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