view VectorTypes.h @ 1445:6de9c1316852

Слияние
author Ritor1
date Sat, 03 Aug 2013 00:00:31 +0600
parents 0dbf6c4dd029
children ff1867836af5
line wrap: on
line source

#pragma once
#include <array>

typedef unsigned __int32 uint;

#pragma pack(push, 1)
struct Vec2_short_
{
  __int16 x;
  __int16 y;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct Vec3_float_
{
  void Normalize();

  
//----- (0049B32D) --------------------------------------------------------
static Vec3_float_ *Vec3_float_::Cross(Vec3_float_ *v1, Vec3_float_ *pOut, float x, float y, float z)
{
  pOut->x = z * v1->y - y * v1->z;
  pOut->y = x * v1->z - z * v1->x;
  pOut->z = y * v1->x - x * v1->y;
  return pOut;
}

  //----- (0049B02E) --------------------------------------------------------
  inline static float NegDot(Vec3_float_ *a1, Vec3_float_ *a2, float *a3)
  {
    return *a3 = -(a1->z * a2->z + a1->y * a2->y + a1->x * a2->x);
  }

  float x;
  float y;
  float z;
};
#pragma pack(pop)


#pragma pack(push, 1)
struct Vec2_int_
{
  int x;
  int y;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct Vec2_float_
{
  float x;
  float y;
};
#pragma pack(pop)


#pragma pack(push, 1)
struct Vec3_short_
{
  __int16 x;
  __int16 y;
  __int16 z;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct Vec3_int_
{
  inline Vec3_int_():
    x(0), y(0), z(0)
  {}
  inline Vec3_int_(int a, int b = 0, int c = 0):
    x(a), y(b), z(c)
  {}

  void Normalize_float();

  static void __fastcall Rotate(int sDepth, int sRotY, int sRotX, Vec3_int_ v, int *outx, int *outy, int *outz);
  static void Normalize(int *x, int *y, int *z);

  int x;
  int y;
  int z;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct Vec4_int_
{
  int x;
  int y;
  int z;
  int w;
};
#pragma pack(pop)






/*   82 */
#pragma pack(push, 1)
struct Plane_int_
{
  Vec3_int_ vNormal;
  int dist;
};
#pragma pack(pop)


#pragma pack(push, 1)
struct BBox_short_
{
  __int16 x1;
  __int16 x2;
  __int16 y1;
  __int16 y2;
  __int16 z1;
  __int16 z2;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct BBox_int_
{
  int x1;
  int x2;
  int y1;
  int y2;
  int z1;
  int z2;
};
#pragma pack(pop)

#pragma pack(push, 1)
struct Plane_float_
{
  struct Vec3_float_ vNormal;
  float dist;
};
#pragma pack(pop)




/*  196 */
#pragma pack(push, 1)
struct Matrix3x3_float_
{
  union
  {
    struct
    {
      float _11; float _12; float _13;
      float _21; float _22; float _23;
      float _31; float _32; float _33;
    };
    float v[3][3];
  };
};
#pragma pack(pop)