Mercurial > might-and-magic-trilogy
view VectorTypes.h @ 123:05b2d9653abc
15.11.12
author | Ritor1 |
---|---|
date | Thu, 15 Nov 2012 16:36:30 +0600 |
parents | 8b8875f5b359 |
children |
line wrap: on
line source
#pragma once 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) { double v6; // st7@1 double v7; // st6@1 v6 = x * v1->z - z * v1->x; v7 = y * v1->x - x * v1->y; pOut->x = z * v1->y - y * v1->z; pOut->y = v6; pOut->z = v7; 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)