Mercurial > mm7
annotate VectorTypes.h @ 1504:ff1867836af5
Cleanup of VectorTypes.
author | yoctozepto |
---|---|
date | Mon, 02 Sep 2013 12:46:32 +0200 |
parents | 0dbf6c4dd029 |
children | af57b3b76fe4 |
rev | line source |
---|---|
0 | 1 #pragma once |
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1025
diff
changeset
|
2 |
0 | 3 typedef unsigned __int32 uint; |
4 | |
5 #pragma pack(push, 1) | |
6 struct Vec2_short_ | |
7 { | |
8 __int16 x; | |
9 __int16 y; | |
10 }; | |
11 #pragma pack(pop) | |
12 | |
13 #pragma pack(push, 1) | |
14 struct Vec3_float_ | |
15 { | |
16 void Normalize(); | |
17 | |
18 | |
1025 | 19 //----- (0049B32D) -------------------------------------------------------- |
20 static Vec3_float_ *Vec3_float_::Cross(Vec3_float_ *v1, Vec3_float_ *pOut, float x, float y, float z) | |
21 { | |
22 pOut->x = z * v1->y - y * v1->z; | |
23 pOut->y = x * v1->z - z * v1->x; | |
24 pOut->z = y * v1->x - x * v1->y; | |
25 return pOut; | |
26 } | |
0 | 27 |
28 //----- (0049B02E) -------------------------------------------------------- | |
29 inline static float NegDot(Vec3_float_ *a1, Vec3_float_ *a2, float *a3) | |
30 { | |
31 return *a3 = -(a1->z * a2->z + a1->y * a2->y + a1->x * a2->x); | |
32 } | |
33 | |
34 float x; | |
35 float y; | |
36 float z; | |
37 }; | |
38 #pragma pack(pop) | |
39 | |
40 | |
41 #pragma pack(push, 1) | |
42 struct Vec2_int_ | |
43 { | |
44 int x; | |
45 int y; | |
46 }; | |
47 #pragma pack(pop) | |
48 | |
49 #pragma pack(push, 1) | |
50 struct Vec2_float_ | |
51 { | |
52 float x; | |
53 float y; | |
54 }; | |
55 #pragma pack(pop) | |
56 | |
57 | |
58 #pragma pack(push, 1) | |
59 struct Vec3_short_ | |
60 { | |
61 __int16 x; | |
62 __int16 y; | |
63 __int16 z; | |
64 }; | |
65 #pragma pack(pop) | |
66 | |
67 #pragma pack(push, 1) | |
68 struct Vec3_int_ | |
69 { | |
70 inline Vec3_int_(): | |
71 x(0), y(0), z(0) | |
72 {} | |
73 inline Vec3_int_(int a, int b = 0, int c = 0): | |
74 x(a), y(b), z(c) | |
75 {} | |
76 | |
77 void Normalize_float(); | |
78 | |
79 static void __fastcall Rotate(int sDepth, int sRotY, int sRotX, Vec3_int_ v, int *outx, int *outy, int *outz); | |
80 static void Normalize(int *x, int *y, int *z); | |
81 | |
82 int x; | |
83 int y; | |
84 int z; | |
85 }; | |
86 #pragma pack(pop) | |
87 | |
88 #pragma pack(push, 1) | |
89 struct Vec4_int_ | |
90 { | |
91 int x; | |
92 int y; | |
93 int z; | |
94 int w; | |
95 }; | |
96 #pragma pack(pop) | |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | |
103 /* 82 */ | |
104 #pragma pack(push, 1) | |
105 struct Plane_int_ | |
106 { | |
107 Vec3_int_ vNormal; | |
108 int dist; | |
109 }; | |
110 #pragma pack(pop) | |
111 | |
112 | |
113 #pragma pack(push, 1) | |
114 struct BBox_short_ | |
115 { | |
116 __int16 x1; | |
117 __int16 x2; | |
118 __int16 y1; | |
119 __int16 y2; | |
120 __int16 z1; | |
121 __int16 z2; | |
122 }; | |
123 #pragma pack(pop) | |
124 | |
125 #pragma pack(push, 1) | |
126 struct BBox_int_ | |
127 { | |
128 int x1; | |
129 int x2; | |
130 int y1; | |
131 int y2; | |
132 int z1; | |
133 int z2; | |
134 }; | |
135 #pragma pack(pop) | |
136 | |
137 #pragma pack(push, 1) | |
138 struct Plane_float_ | |
139 { | |
140 struct Vec3_float_ vNormal; | |
141 float dist; | |
142 }; | |
143 #pragma pack(pop) | |
144 | |
145 | |
146 | |
147 | |
148 /* 196 */ | |
149 #pragma pack(push, 1) | |
150 struct Matrix3x3_float_ | |
151 { | |
152 union | |
153 { | |
154 struct | |
155 { | |
156 float _11; float _12; float _13; | |
157 float _21; float _22; float _23; | |
158 float _31; float _32; float _33; | |
159 }; | |
160 float v[3][3]; | |
161 }; | |
162 }; | |
163 #pragma pack(pop) | |
164 |