annotate stru10.cpp @ 1610:fa0e700bcc80

m
author Ritor1
date Sat, 14 Sep 2013 10:28:13 +0600
parents c4ab816fcc5e
children afc1c3514dd5
rev   line source
0
Ritor1
parents:
diff changeset
1 #include "stru10.h"
Ritor1
parents:
diff changeset
2 #include "Render.h"
Ritor1
parents:
diff changeset
3 #include "Indoor.h"
Ritor1
parents:
diff changeset
4 #include "Game.h"
Ritor1
parents:
diff changeset
5 #include "Party.h"
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1507
diff changeset
6 #include "ErrorHandling.h"
0
Ritor1
parents:
diff changeset
7
Ritor1
parents:
diff changeset
8 #include "mm7_data.h"
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10
Ritor1
parents:
diff changeset
11
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
12 int _49CE9E_sub0_x(RenderVertexSoft *pVertices, unsigned int uNumVertices, float test_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
13 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
14 float max_val = FLT_MAX;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
15 int idx = -1;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
16
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
17 float temp_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
18 for (uint i = 0; i < uNumVertices; ++i)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
19 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
20 if (pVertices[i].vWorldPosition.x <= test_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
21 temp_val = test_val - pVertices[i].vWorldPosition.x;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
22 else
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
23 temp_val = pVertices[i].vWorldPosition.x - test_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
24
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
25 if (temp_val < max_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
26 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
27 max_val = temp_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
28 idx = i;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
29 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
30 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
31 return idx;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
32 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
33
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
34
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
35 int _49CE9E_sub0_y(RenderVertexSoft *pVertices, unsigned int uNumVertices, float test_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
36 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
37 float max_val = FLT_MAX;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
38 int idx = -1;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
39
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
40 float temp_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
41 for (uint i = 0; i < uNumVertices; ++i)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
42 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
43 if (pVertices[i].vWorldPosition.y <= test_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
44 temp_val = test_val - pVertices[i].vWorldPosition.y;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
45 else
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
46 temp_val = pVertices[i].vWorldPosition.y - test_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
47
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
48 if (temp_val < max_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
49 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
50 max_val = temp_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
51 idx = i;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
52 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
53 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
54 return idx;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
55 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
56
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
57
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
58 int _49CE9E_sub0_z(RenderVertexSoft *pVertices, unsigned int uNumVertices, float test_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
59 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
60 float max_val = FLT_MAX;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
61 int idx = -1;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
62
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
63 float temp_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
64 for (uint i = 0; i < uNumVertices; ++i)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
65 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
66 if (pVertices[i].vWorldPosition.z <= test_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
67 temp_val = test_val - pVertices[i].vWorldPosition.z;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
68 else
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
69 temp_val = pVertices[i].vWorldPosition.z - test_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
70
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
71 if (temp_val < max_val)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
72 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
73 max_val = temp_val;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
74 idx = i;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
75 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
76 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
77 return idx;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
78 }
0
Ritor1
parents:
diff changeset
79
Ritor1
parents:
diff changeset
80 //----- (0049CE9E) --------------------------------------------------------
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
81 void stru10::_49CE9E(BLVFace *pFace, RenderVertexSoft *pVertices, unsigned int uNumVertices, RenderVertexSoft *pOutLimits)
0
Ritor1
parents:
diff changeset
82 {
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1507
diff changeset
83 Assert(sizeof(RenderVertexSoft) == 0x30);
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
84
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
85 RenderVertexSoft pLimits[64];
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
86 stru10::CalcPolygonLimits(pFace, pLimits);
0
Ritor1
parents:
diff changeset
87
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
88 if (pFace->uAttributes & FACE_XY_PLANE)
0
Ritor1
parents:
diff changeset
89 {
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
90 memcpy(&pOutLimits[0], &pVertices[_49CE9E_sub0_x(pVertices, uNumVertices, pLimits[0].vWorldPosition.x)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
91 memcpy(&pOutLimits[2], &pVertices[_49CE9E_sub0_x(pVertices, uNumVertices, pLimits[2].vWorldPosition.x)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
92 memcpy(&pOutLimits[1], &pVertices[_49CE9E_sub0_y(pVertices, uNumVertices, pLimits[1].vWorldPosition.y)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
93 memcpy(&pOutLimits[3], &pVertices[_49CE9E_sub0_y(pVertices, uNumVertices, pLimits[3].vWorldPosition.y)], 0x30);
0
Ritor1
parents:
diff changeset
94 }
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
95 else if (pFace->uAttributes & FACE_XZ_PLANE)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
96 {
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
97 memcpy(&pOutLimits[0], &pVertices[_49CE9E_sub0_x(pVertices, uNumVertices, pLimits[0].vWorldPosition.x)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
98 memcpy(&pOutLimits[2], &pVertices[_49CE9E_sub0_x(pVertices, uNumVertices, pLimits[2].vWorldPosition.x)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
99 memcpy(&pOutLimits[1], &pVertices[_49CE9E_sub0_z(pVertices, uNumVertices, pLimits[1].vWorldPosition.z)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
100 memcpy(&pOutLimits[3], &pVertices[_49CE9E_sub0_z(pVertices, uNumVertices, pLimits[3].vWorldPosition.z)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
101 }
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
102 else if (pFace->uAttributes & FACE_YZ_PLANE)
0
Ritor1
parents:
diff changeset
103 {
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
104 memcpy(&pOutLimits[0], &pVertices[_49CE9E_sub0_y(pVertices, uNumVertices, pLimits[0].vWorldPosition.y)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
105 memcpy(&pOutLimits[2], &pVertices[_49CE9E_sub0_y(pVertices, uNumVertices, pLimits[2].vWorldPosition.y)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
106 memcpy(&pOutLimits[1], &pVertices[_49CE9E_sub0_z(pVertices, uNumVertices, pLimits[1].vWorldPosition.z)], 0x30);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
107 memcpy(&pOutLimits[3], &pVertices[_49CE9E_sub0_z(pVertices, uNumVertices, pLimits[3].vWorldPosition.z)], 0x30);
0
Ritor1
parents:
diff changeset
108 }
Ritor1
parents:
diff changeset
109 }
Ritor1
parents:
diff changeset
110
Ritor1
parents:
diff changeset
111 //----- (0049D379) --------------------------------------------------------
794
Nomad
parents: 686
diff changeset
112 void stru10::CalcPolygonLimits(BLVFace *pFace, RenderVertexSoft *pOutVertices)
0
Ritor1
parents:
diff changeset
113 {
Ritor1
parents:
diff changeset
114 struct
Ritor1
parents:
diff changeset
115 {
Ritor1
parents:
diff changeset
116 float x;
Ritor1
parents:
diff changeset
117 float y;
Ritor1
parents:
diff changeset
118 int c;
Ritor1
parents:
diff changeset
119 } v46[40]; //[sp+0C];
Ritor1
parents:
diff changeset
120
Ritor1
parents:
diff changeset
121 if (pFace->uAttributes & 0x0100)
Ritor1
parents:
diff changeset
122 {
Ritor1
parents:
diff changeset
123 for (uint i = 0; i < pFace->uNumVertices; ++i)
Ritor1
parents:
diff changeset
124 {
Ritor1
parents:
diff changeset
125 v46[i].x = pIndoor->pVertices[pFace->pVertexIDs[i]].x + pFace->pXInterceptDisplacements[i];
Ritor1
parents:
diff changeset
126 v46[i].y = pIndoor->pVertices[pFace->pVertexIDs[i]].y + pFace->pYInterceptDisplacements[i];
Ritor1
parents:
diff changeset
127 v46[i].c = i;
Ritor1
parents:
diff changeset
128 }
Ritor1
parents:
diff changeset
129 }
Ritor1
parents:
diff changeset
130 if (pFace->uAttributes & 0x0200)
Ritor1
parents:
diff changeset
131 {
Ritor1
parents:
diff changeset
132 for (uint i = 0; i < pFace->uNumVertices; ++i)
Ritor1
parents:
diff changeset
133 {
Ritor1
parents:
diff changeset
134 v46[i].x = pIndoor->pVertices[pFace->pVertexIDs[i]].x + pFace->pXInterceptDisplacements[i];
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
135 v46[i].y = pIndoor->pVertices[pFace->pVertexIDs[i]].z + pFace->pZInterceptDisplacements[i];
0
Ritor1
parents:
diff changeset
136 v46[i].c = i;
Ritor1
parents:
diff changeset
137 }
Ritor1
parents:
diff changeset
138 }
Ritor1
parents:
diff changeset
139 if (pFace->uAttributes & 0x0400)
Ritor1
parents:
diff changeset
140 {
Ritor1
parents:
diff changeset
141 for (uint i = 0; i < pFace->uNumVertices; ++i)
Ritor1
parents:
diff changeset
142 {
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
143 v46[i].x = pIndoor->pVertices[pFace->pVertexIDs[i]].y + pFace->pYInterceptDisplacements[i];
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
144 v46[i].y = pIndoor->pVertices[pFace->pVertexIDs[i]].z + pFace->pZInterceptDisplacements[i];
0
Ritor1
parents:
diff changeset
145 v46[i].c = i;
Ritor1
parents:
diff changeset
146 }
Ritor1
parents:
diff changeset
147 }
Ritor1
parents:
diff changeset
148
1302
0aa57a8d4804 current portal loop
Ritor1
parents: 1113
diff changeset
149 float x_min = v46[0].x;
0
Ritor1
parents:
diff changeset
150 uint x_min_idx = 0;
Ritor1
parents:
diff changeset
151
1302
0aa57a8d4804 current portal loop
Ritor1
parents: 1113
diff changeset
152 float x_max = v46[0].x;
0
Ritor1
parents:
diff changeset
153 uint x_max_idx = 0;
Ritor1
parents:
diff changeset
154
1302
0aa57a8d4804 current portal loop
Ritor1
parents: 1113
diff changeset
155 float y_min = v46[0].y;
0
Ritor1
parents:
diff changeset
156 uint y_min_idx = 0;
Ritor1
parents:
diff changeset
157
1302
0aa57a8d4804 current portal loop
Ritor1
parents: 1113
diff changeset
158 float y_max = v46[0].y;
0
Ritor1
parents:
diff changeset
159 uint y_max_idx = 0;
Ritor1
parents:
diff changeset
160
Ritor1
parents:
diff changeset
161 for (uint i = 0; i < pFace->uNumVertices; ++i)
Ritor1
parents:
diff changeset
162 {
Ritor1
parents:
diff changeset
163 if (v46[i].x < x_min)
Ritor1
parents:
diff changeset
164 {
Ritor1
parents:
diff changeset
165 x_min = v46[i].x;
Ritor1
parents:
diff changeset
166 x_min_idx = v46[i].c;
Ritor1
parents:
diff changeset
167 }
Ritor1
parents:
diff changeset
168 if (v46[i].x > x_max)
Ritor1
parents:
diff changeset
169 {
Ritor1
parents:
diff changeset
170 x_max = v46[i].x;
Ritor1
parents:
diff changeset
171 x_max_idx = v46[i].c;
Ritor1
parents:
diff changeset
172 }
Ritor1
parents:
diff changeset
173
Ritor1
parents:
diff changeset
174 if (v46[i].y < y_min)
Ritor1
parents:
diff changeset
175 {
Ritor1
parents:
diff changeset
176 y_min = v46[i].y;
Ritor1
parents:
diff changeset
177 y_min_idx = v46[i].c;
Ritor1
parents:
diff changeset
178 }
Ritor1
parents:
diff changeset
179 if (v46[i].y > y_max)
Ritor1
parents:
diff changeset
180 {
Ritor1
parents:
diff changeset
181 y_max = v46[i].y;
Ritor1
parents:
diff changeset
182 y_max_idx = v46[i].c;
Ritor1
parents:
diff changeset
183 }
Ritor1
parents:
diff changeset
184 }
Ritor1
parents:
diff changeset
185
1319
Ritor1
parents: 1317
diff changeset
186 RenderVertexSoft v1; // [sp+30Ch] [bp-54h]@24
Ritor1
parents: 1317
diff changeset
187 v1.vWorldPosition.x = (float)pIndoor->pVertices[pFace->pVertexIDs[x_min_idx]].x;
Ritor1
parents: 1317
diff changeset
188 v1.vWorldPosition.y = (float)pIndoor->pVertices[pFace->pVertexIDs[x_min_idx]].y;
Ritor1
parents: 1317
diff changeset
189 v1.vWorldPosition.z = (float)pIndoor->pVertices[pFace->pVertexIDs[x_min_idx]].z;
Ritor1
parents: 1317
diff changeset
190 memcpy(&pOutVertices[0], &v1, sizeof(RenderVertexSoft));
0
Ritor1
parents:
diff changeset
191
Ritor1
parents:
diff changeset
192 RenderVertexSoft v2; // [sp+30Ch] [bp-54h]@24
1319
Ritor1
parents: 1317
diff changeset
193 v2.vWorldPosition.x = (float)pIndoor->pVertices[pFace->pVertexIDs[y_min_idx]].x;
Ritor1
parents: 1317
diff changeset
194 v2.vWorldPosition.y = (float)pIndoor->pVertices[pFace->pVertexIDs[y_min_idx]].y;
Ritor1
parents: 1317
diff changeset
195 v2.vWorldPosition.z = (float)pIndoor->pVertices[pFace->pVertexIDs[y_min_idx]].z;
Ritor1
parents: 1317
diff changeset
196 memcpy(&pOutVertices[1], &v2, sizeof(RenderVertexSoft));
0
Ritor1
parents:
diff changeset
197
Ritor1
parents:
diff changeset
198 RenderVertexSoft v3; // [sp+30Ch] [bp-54h]@24
1319
Ritor1
parents: 1317
diff changeset
199 v3.vWorldPosition.x = (float)pIndoor->pVertices[pFace->pVertexIDs[x_max_idx]].x;
Ritor1
parents: 1317
diff changeset
200 v3.vWorldPosition.y = (float)pIndoor->pVertices[pFace->pVertexIDs[x_max_idx]].y;
Ritor1
parents: 1317
diff changeset
201 v3.vWorldPosition.z = (float)pIndoor->pVertices[pFace->pVertexIDs[x_max_idx]].z;
Ritor1
parents: 1317
diff changeset
202 memcpy(&pOutVertices[2], &v3, sizeof(RenderVertexSoft));
0
Ritor1
parents:
diff changeset
203
Ritor1
parents:
diff changeset
204 RenderVertexSoft v4; // [sp+30Ch] [bp-54h]@24
1319
Ritor1
parents: 1317
diff changeset
205 v4.vWorldPosition.x = (double)pIndoor->pVertices[pFace->pVertexIDs[y_max_idx]].x;
Ritor1
parents: 1317
diff changeset
206 v4.vWorldPosition.y = (double)pIndoor->pVertices[pFace->pVertexIDs[y_max_idx]].y;
Ritor1
parents: 1317
diff changeset
207 v4.vWorldPosition.z = (double)pIndoor->pVertices[pFace->pVertexIDs[y_max_idx]].z;
Ritor1
parents: 1317
diff changeset
208 memcpy(&pOutVertices[3], &v4, sizeof(RenderVertexSoft));
0
Ritor1
parents:
diff changeset
209 }
Ritor1
parents:
diff changeset
210
Ritor1
parents:
diff changeset
211
Ritor1
parents:
diff changeset
212 //----- (0049C9E3) --------------------------------------------------------
794
Nomad
parents: 686
diff changeset
213 bool stru10::CalcFaceBounding(BLVFace *pFace, RenderVertexSoft *pFaceLimits, unsigned int uNumVertices, RenderVertexSoft *pOutBounding)
0
Ritor1
parents:
diff changeset
214 {
Ritor1
parents:
diff changeset
215 //IndoorCameraD3D *v6; // edi@1
Ritor1
parents:
diff changeset
216 //PolygonType v7; // al@1
Ritor1
parents:
diff changeset
217 //unsigned int v8; // edx@7
Ritor1
parents:
diff changeset
218 //char v10; // zf@10
Ritor1
parents:
diff changeset
219 //float v13; // ST14_4@20
Ritor1
parents:
diff changeset
220 //stru10 *v15; // ecx@21
Ritor1
parents:
diff changeset
221 //RenderVertexSoft *v16; // ST0C_4@21
Ritor1
parents:
diff changeset
222 //bool result; // eax@21
Ritor1
parents:
diff changeset
223 //float v18; // ST14_4@24
Ritor1
parents:
diff changeset
224 //stru10 *v19; // edi@29
Ritor1
parents:
diff changeset
225 //float v20; // ST14_4@30
Ritor1
parents:
diff changeset
226 //float v21; // ST14_4@30
Ritor1
parents:
diff changeset
227 //float v22; // ST14_4@30
Ritor1
parents:
diff changeset
228 //float v23; // ST14_4@30
Ritor1
parents:
diff changeset
229 //float v24; // ST14_4@31
Ritor1
parents:
diff changeset
230 //RenderVertexSoft v25; // [sp+10h] [bp-90h]@24
Ritor1
parents:
diff changeset
231 //RenderVertexSoft v26; // [sp+40h] [bp-60h]@20
Ritor1
parents:
diff changeset
232 //IndoorCameraD3D *thisa; // [sp+70h] [bp-30h]@1
Ritor1
parents:
diff changeset
233 //stru10 *v31; // [sp+84h] [bp-1Ch]@1
794
Nomad
parents: 686
diff changeset
234 //float v32; // [sp+88h] [bp-18h]@8
0
Ritor1
parents:
diff changeset
235 Vec3_float_ a1; // [sp+8Ch] [bp-14h]@1
794
Nomad
parents: 686
diff changeset
236 //float v35; // [sp+9Ch] [bp-4h]@8
0
Ritor1
parents:
diff changeset
237
Ritor1
parents:
diff changeset
238 //auto a3 = pFace;
Ritor1
parents:
diff changeset
239 //auto arg4 = pFaceBounding;
Ritor1
parents:
diff changeset
240
Ritor1
parents:
diff changeset
241 //_ESI = a3;
Ritor1
parents:
diff changeset
242 //v31 = this;
Ritor1
parents:
diff changeset
243 //v6 = pGame->pIndoorCameraD3D;
Ritor1
parents:
diff changeset
244 //v7 = a3->uPolygonType;
Ritor1
parents:
diff changeset
245
Ritor1
parents:
diff changeset
246 a1.x = 0.0f;
Ritor1
parents:
diff changeset
247 a1.y = 0.0f;
Ritor1
parents:
diff changeset
248 a1.z = 0.0f;
Ritor1
parents:
diff changeset
249
Ritor1
parents:
diff changeset
250 float var_28;
Ritor1
parents:
diff changeset
251 float var_24;
794
Nomad
parents: 686
diff changeset
252 switch (pFace->uPolygonType)
0
Ritor1
parents:
diff changeset
253 {
794
Nomad
parents: 686
diff changeset
254 case POLYGON_VerticalWall:
1319
Ritor1
parents: 1317
diff changeset
255 a1.x = -pFace->pFacePlane.vNormal.y;// направление полигона
794
Nomad
parents: 686
diff changeset
256 a1.y = pFace->pFacePlane.vNormal.x;
Nomad
parents: 686
diff changeset
257 a1.z = 0.0f;
Nomad
parents: 686
diff changeset
258 a1.Normalize();
Nomad
parents: 686
diff changeset
259
Nomad
parents: 686
diff changeset
260 var_28 = 0;
Nomad
parents: 686
diff changeset
261 var_24 = 1;
Nomad
parents: 686
diff changeset
262 break;
0
Ritor1
parents:
diff changeset
263
794
Nomad
parents: 686
diff changeset
264 case POLYGON_Floor:
Nomad
parents: 686
diff changeset
265 case POLYGON_Ceiling:
Nomad
parents: 686
diff changeset
266 a1.x = 1;
Nomad
parents: 686
diff changeset
267 a1.y = 0;
Nomad
parents: 686
diff changeset
268 a1.z = 0.0f;
Nomad
parents: 686
diff changeset
269
Nomad
parents: 686
diff changeset
270 var_28 = 1;
Nomad
parents: 686
diff changeset
271 var_24 = 0;
Nomad
parents: 686
diff changeset
272 break;
Nomad
parents: 686
diff changeset
273
Nomad
parents: 686
diff changeset
274 default:
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1507
diff changeset
275 Error("Invalid polygon type (%u)", pFace->uPolygonType);
0
Ritor1
parents:
diff changeset
276 }
Ritor1
parents:
diff changeset
277
Ritor1
parents:
diff changeset
278
794
Nomad
parents: 686
diff changeset
279 float face_center_x;
Nomad
parents: 686
diff changeset
280 float face_center_y;
Nomad
parents: 686
diff changeset
281 float face_center_z;
0
Ritor1
parents:
diff changeset
282 float a3;
Ritor1
parents:
diff changeset
283 float var_8;
794
Nomad
parents: 686
diff changeset
284
0
Ritor1
parents:
diff changeset
285 if (pFace->uAttributes & 0x0100)
Ritor1
parents:
diff changeset
286 {
794
Nomad
parents: 686
diff changeset
287 face_center_x = (pFaceLimits[0].vWorldPosition.x + pFaceLimits[2].vWorldPosition.x) / 2;
Nomad
parents: 686
diff changeset
288 face_center_y = (pFaceLimits[3].vWorldPosition.y + pFaceLimits[1].vWorldPosition.y) / 2;
Nomad
parents: 686
diff changeset
289 face_center_z = (pFaceLimits[0].vWorldPosition.z + pFaceLimits[2].vWorldPosition.z) / 2;
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
290
794
Nomad
parents: 686
diff changeset
291 a3 = face_center_x - pFaceLimits[0].vWorldPosition.x;
Nomad
parents: 686
diff changeset
292 var_8 = face_center_y - pFaceLimits[1].vWorldPosition.y;
0
Ritor1
parents:
diff changeset
293 }
Ritor1
parents:
diff changeset
294 if (pFace->uAttributes & 0x0200)
Ritor1
parents:
diff changeset
295 {
1319
Ritor1
parents: 1317
diff changeset
296 face_center_x = (pFaceLimits[0].vWorldPosition.x + pFaceLimits[2].vWorldPosition.x) / 2;// центр полигона
794
Nomad
parents: 686
diff changeset
297 face_center_y = (pFaceLimits[0].vWorldPosition.y + pFaceLimits[2].vWorldPosition.y) / 2;
Nomad
parents: 686
diff changeset
298 face_center_z = (pFaceLimits[1].vWorldPosition.z + pFaceLimits[3].vWorldPosition.z) / 2;
0
Ritor1
parents:
diff changeset
299
1319
Ritor1
parents: 1317
diff changeset
300 a3 = face_center_x - pFaceLimits[0].vWorldPosition.x;//от центра до верхнего края
Ritor1
parents: 1317
diff changeset
301 var_8 = face_center_z - pFaceLimits[1].vWorldPosition.z;// высота от центра
0
Ritor1
parents:
diff changeset
302
Ritor1
parents:
diff changeset
303 if (pFace->uPolygonType == POLYGON_VerticalWall)
Ritor1
parents:
diff changeset
304 a3 /= a1.x;
Ritor1
parents:
diff changeset
305 }
Ritor1
parents:
diff changeset
306 if (pFace->uAttributes & 0x0400)
Ritor1
parents:
diff changeset
307 {
794
Nomad
parents: 686
diff changeset
308 face_center_x = (pFaceLimits[0].vWorldPosition.x + pFaceLimits[2].vWorldPosition.x) / 2;
Nomad
parents: 686
diff changeset
309 face_center_y = (pFaceLimits[0].vWorldPosition.y + pFaceLimits[2].vWorldPosition.y) / 2;
Nomad
parents: 686
diff changeset
310 face_center_z = (pFaceLimits[1].vWorldPosition.z + pFaceLimits[3].vWorldPosition.z) / 2;
0
Ritor1
parents:
diff changeset
311
794
Nomad
parents: 686
diff changeset
312 a3 = face_center_y - pFaceLimits[0].vWorldPosition.y;
Nomad
parents: 686
diff changeset
313 var_8 = face_center_z - pFaceLimits[1].vWorldPosition.z;
0
Ritor1
parents:
diff changeset
314 // [0.5]
Ritor1
parents:
diff changeset
315 if (pFace->uPolygonType == POLYGON_VerticalWall)
Ritor1
parents:
diff changeset
316 {
Ritor1
parents:
diff changeset
317 if (a1.x != 1.0f)
Ritor1
parents:
diff changeset
318 a3 /= a1.y;
Ritor1
parents:
diff changeset
319 }
Ritor1
parents:
diff changeset
320 }
Ritor1
parents:
diff changeset
321
Ritor1
parents:
diff changeset
322
Ritor1
parents:
diff changeset
323
Ritor1
parents:
diff changeset
324
Ritor1
parents:
diff changeset
325 //_EBX = arg0;
Ritor1
parents:
diff changeset
326 //v15 = v31;
Ritor1
parents:
diff changeset
327 //v16 = arg0;
678
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
328 //float var_20 = var_8 * var_24;
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
329 //var_8 = a3 * a1.z;
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
330 //float arg_0 = var_8 + var_4;
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
331
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
332 /*
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
333
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
334
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
335
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
336 .text:0049CBB3 fld [ebp+var_8] 0 var8
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
337 .text:0049CBB6 1 fmul ds:flt_4D84E8 0 var8 * flt_4D84E8
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
338
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
339 .text:0049CBBC 1 fld [ebp+var_8] 0 var8
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
340 1 var8 * flt_4D84E8
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
341
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
342 .text:0049CBBF 2 fmul [ebp+var_28] 0 var8 * var28
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
343 1 var8 * flt_4D84E8
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
344
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
345 .text:0049CBC2 2 fld [ebp+var_8] 0 var8
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
346 1 var8 * var28
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
347 2 var8 * flt_4D84E8
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
348
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
349 .text:0049CBC5 3 fmul [ebp+var_24] 0 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
350 1 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
351 2 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
352
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
353 .text:0049CBD5 3 fst [ebp+var_20] 0 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
354 1 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
355 2 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
356 [var20] var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
357
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
358 .text:0049CBD8 3 fld [ebp+a3] 0 a3 -1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
359 1 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
360 2 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
361 3 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
362
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
363 .text:0049CBDB 4 fmul [ebp+a1.x] 0 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
364 1 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
365 2 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
366 3 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
367
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
368 .text:0049CBDE 4 fld [ebp+a3] 0 a3
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
369 1 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
370 2 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
371 3 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
372 4 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
373
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
374 .text:0049CBE1 5 fmul [ebp+a1.y] 0 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
375 1 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
376 2 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
377 3 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
378 4 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
379 .text:0049CBE4 5 fld [ebp+a3]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
380 .text:0049CBE7 6 fmul [ebp+a1.z] 0 a3 * a1.z 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
381 1 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
382 2 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
383 3 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
384 4 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
385 5 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
386
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
387 .text:0049CBEC 6 fstp [ebp+var_8]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
388 var8 <- a3 * a1.z 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
389
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
390 .text:0049CBEF 5 fld [ebp+arg4] 0 arg4 -1700
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
391 1 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
392 2 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
393 3 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
394 4 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
395 5 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
396
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
397 .text:0049CBF2 6 fsub st, st(2) 0 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
398 1 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
399 2 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
400 3 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
401 4 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
402 5 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
403
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
404 .text:0049CBF4 6 fld st 0 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
405 1 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
406 2 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
407 3 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
408 4 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
409 5 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
410 6 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
411
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
412 .text:0049CBF6 7 fadd st, st(6) 0 arg4 - a3 * a1.x + var8 * flt_4D84E8 -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
413 1 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
414 2 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
415 3 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
416 4 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
417 5 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
418 6 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
419 .text:0049CBF8 7 fstp dword ptr [ebx]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
420 [0].x <- arg4 - a3 * a1.x + var8 * flt_4D84E8 -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
421
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
422 .text:0049CBFA 6 fld [ebp+var_18] 0 var18 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
423 1 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
424 2 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
425 3 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
426 4 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
427 5 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
428 6 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
429
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
430 .text:0049CBFD 7 fsub st, st(2) 0 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
431 1 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
432 2 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
433 3 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
434 4 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
435 5 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
436 6 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
437
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
438 .text:0049CBFF 7 fld st 0 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
439 1 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
440 2 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
441 3 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
442 4 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
443 5 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
444 6 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
445 7 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
446
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
447 .text:0049CC01 8 fadd st, st(6) 0 var18 - a3 * a1.y + var8 * var28 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
448 1 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
449 2 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
450 3 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
451 4 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
452 5 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
453 6 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
454 7 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
455
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
456 .text:0049CC03 8 fstp dword ptr [ebx+4]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
457 [0].y <- var18 - a3 * a1.y + var8 * var28 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
458
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
459 .text:0049CC06 7 fld [ebp+var_4]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
460 .text:0049CC09 8 fsub [ebp+var_8] 0 var4 - a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
461 1 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
462 2 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
463 3 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
464 4 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
465 5 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
466 6 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
467 7 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
468 .text:0049CC0C 8 fst [ebp+a3]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
469 a3 <- var4 - a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
470
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
471 .text:0049CC0F 8 fadd st, st(5)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
472 .text:0049CC11 8 fstp dword ptr [ebx+8]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
473 [0].z <- var4 - a3 * a1.z + var8 * var24 1536
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
474
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
475 0 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
476 1 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
477 2 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
478 3 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
479 4 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
480 5 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
481 6 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
482
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
483
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
484
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
485
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
486 [var20] var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
487 [var8] a3 * a1.z
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
488 [a3] var4 - a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
489
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
490
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
491 .text:0049CC14 7 fld st(1)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
492 .text:0049CC16 8 fsub st, st(7) 0 arg4 - a3 * a1.x - var8 * flt_4D84E8 -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
493 1 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
494 2 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
495 3 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
496 4 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
497 5 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
498 6 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
499 7 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
500 .text:0049CC18 8 fstp dword ptr [ebx+30h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
501 [1].x <- arg4 - a3 * a1.x - var8 * flt_4D84E8 -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
502
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
503 0 var18 - a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
504 1 arg4 - a3 * a1.x -3684
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
505 2 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
506 3 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
507 4 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
508 5 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
509 6 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
510 .text:0049CC1B 7 fsub st, st(5)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
511 .text:0049CC1D 7 fstp dword ptr [ebx+34h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
512 [1].y <- var18 - a3 * a1.y - var8 * var28 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
513 .text:0049CC20 6 fstp st
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
514 0 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
515 1 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
516 2 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
517 3 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
518 4 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
519
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
520
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
521 [var20] var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
522 [var8] a3 * a1.z
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
523 [a3] var4 - a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
524
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
525 .text:0049CC22 5 fld [ebp+a3] 0 var4 - a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
526 1 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
527 2 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
528 3 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
529 4 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
530 5 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
531 .text:0049CC25 6 fsub st, st(3)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
532 .text:0049CC27 6 fstp dword ptr [ebx+38h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
533 [1].z <- var4 - a3 * a1.z - var8 * var24 768 - 768 = 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
534
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
535 0 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
536 1 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
537 2 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
538 3 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
539 4 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
540
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
541
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
542 .text:0049CC2A fld st(1)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
543 .text:0049CC2C 6 fadd [ebp+arg4] 0 arg4 + a3 * a1.x 284
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
544 1 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
545 2 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
546 3 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
547 4 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
548 5 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
549 .text:0049CC2F 6 fst [ebp+a3]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
550
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
551 [var20] var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
552 [var8] a3 * a1.z
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
553 [a3] arg4 + a3 * a1.x 284
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
554 .text:0049CC32 6 fsub st, st(5)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
555 .text:0049CC34 6 fstp dword ptr [ebx+60h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
556 [2].x <- arg4 + a3 * a1.x - var8 * flt_4D84E8 284
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
557
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
558 0 a3 * a1.y 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
559 1 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
560 2 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
561 3 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
562 4 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
563
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
564 .text:0049CC37 5 fadd [ebp+var_18] 0 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
565 1 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
566 2 var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
567 3 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
568 4 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
569
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
570 .text:0049CC3A 5 fstp st(2) 0 a3 * a1.x 1984
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
571 1 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
572 2 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
573 3 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
574
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
575 .text:0049CC3C 4 fstp st 0 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
576 1 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
577 2 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
578
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
579 .text:0049CC3E 3 fld st 0 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
580 1 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
581 2 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
582 3 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
583 .text:0049CC40 4 fsub st, st(2)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
584 .text:0049CC42 4 fstp dword ptr [ebx+64h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
585 [2].y <- var18 + a3 * a1.y - var8 * var28 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
586
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
587 0 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
588 1 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
589 2 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
590
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
591 [var20] var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
592 [var8] a3 * a1.z
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
593 [a3] arg4 + a3 * a1.x 284
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
594 .text:0049CC45 3 fld [ebp+var_8]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
595 .text:0049CC48 4 fadd [ebp+var_4] 0 var4 + a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
596 1 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
597 2 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
598 3 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
599
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
600 .text:0049CC4B 4 fst [ebp+arg0]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
601 [var20] var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
602 [arg0] var4 + a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
603 [var8] a3 * a1.z 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
604 [a3] arg4 + a3 * a1.x 284
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
605
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
606 .text:0049CC4E 4 fsub [ebp+var_20]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
607 .text:0049CC51 4 fstp dword ptr [ebx+68h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
608 [2].z <- var4 + a3 * a1.z - var8 * var24 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
609
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
610
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
611
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
612 [var20] var8 * var24 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
613 [arg0] var4 + a3 * a1.z 768
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
614 [var8] a3 * a1.z 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
615 [a3] arg4 + a3 * a1.x 284
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
616
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
617
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
618 0 var18 + a3 * a1.y 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
619 1 var8 * var28 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
620 2 var8 * flt_4D84E8 0
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
621
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
622 .text:0049CC54 3 fld [ebp+a3]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
623 .text:0049CC57 4 fadd st, st(3)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
624 .text:0049CC59 4 fstp dword ptr [ebx+90h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
625 [3].x <- arg4 + a3 * a1.x + var8 * flt_4D84E8 284
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
626
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
627 .text:0049CC5F 3 fadd st, st(1)
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
628 .text:0049CC61 3 fstp dword ptr [ebx+94h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
629 [3].y <- var18 + a3 * a1.y + var8 * var28 1480
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
630
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
631 .text:0049CC67 2 fstp st
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
632 .text:0049CC69 1 fstp st
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
633 0 empty
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
634 .text:0049CC6B 0 fld [ebp+arg0]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
635 .text:0049CC6E 1 fadd [ebp+var_20]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
636 .text:0049CC71 1 fstp dword ptr [ebx+98h]
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
637 [3].z <- var4 + a3 * a1.z + var8 * var24 1536
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
638
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
639 0 empty
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
640 */
0
Ritor1
parents:
diff changeset
641
794
Nomad
parents: 686
diff changeset
642 pOutBounding[0].vWorldPosition.x = face_center_x - a3 * a1.x + var_8 * flt_4D84E8;
Nomad
parents: 686
diff changeset
643 pOutBounding[0].vWorldPosition.y = face_center_y - a3 * a1.y + var_8 * var_28;
Nomad
parents: 686
diff changeset
644 pOutBounding[0].vWorldPosition.z = face_center_z - a3 * a1.z + var_8 * var_24;
678
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
645
794
Nomad
parents: 686
diff changeset
646 pOutBounding[1].vWorldPosition.x = face_center_x - a3 * a1.x - var_8 * flt_4D84E8;
Nomad
parents: 686
diff changeset
647 pOutBounding[1].vWorldPosition.y = face_center_y - a3 * a1.y - var_8 * var_28;
Nomad
parents: 686
diff changeset
648 pOutBounding[1].vWorldPosition.z = face_center_z - a3 * a1.z - var_8 * var_24;
0
Ritor1
parents:
diff changeset
649
794
Nomad
parents: 686
diff changeset
650 pOutBounding[2].vWorldPosition.x = face_center_x + a3 * a1.x - var_8 * flt_4D84E8;
Nomad
parents: 686
diff changeset
651 pOutBounding[2].vWorldPosition.y = face_center_y + a3 * a1.y - var_8 * var_28;
Nomad
parents: 686
diff changeset
652 pOutBounding[2].vWorldPosition.z = face_center_z + a3 * a1.z - var_8 * var_24;
678
35a97ce58790 fixed stru10::49C9E3 (cause for attempting to get cross product on zero vectors)
Nomad
parents: 676
diff changeset
653
794
Nomad
parents: 686
diff changeset
654 pOutBounding[3].vWorldPosition.x = face_center_x + a3 * a1.x + var_8 * flt_4D84E8;
Nomad
parents: 686
diff changeset
655 pOutBounding[3].vWorldPosition.y = face_center_y + a3 * a1.y + var_8 * var_28;
Nomad
parents: 686
diff changeset
656 pOutBounding[3].vWorldPosition.z = face_center_z + a3 * a1.z + var_8 * var_24;
0
Ritor1
parents:
diff changeset
657
Ritor1
parents:
diff changeset
658 a1.x = 0.0f;
Ritor1
parents:
diff changeset
659 a1.y = 0.0f;
Ritor1
parents:
diff changeset
660 a1.z = 0.0f;
794
Nomad
parents: 686
diff changeset
661 a3 = face_center_x + a3 * a1.x;
0
Ritor1
parents:
diff changeset
662
794
Nomad
parents: 686
diff changeset
663 if (!FindFacePlane(pOutBounding, &a1, &a3))
0
Ritor1
parents:
diff changeset
664 return false;
Ritor1
parents:
diff changeset
665
Ritor1
parents:
diff changeset
666
Ritor1
parents:
diff changeset
667
Ritor1
parents:
diff changeset
668 RenderVertexSoft v25; // [sp+10h] [bp-90h]@20
794
Nomad
parents: 686
diff changeset
669 memcpy(&v25, pOutBounding, sizeof(RenderVertexSoft));
0
Ritor1
parents:
diff changeset
670
Ritor1
parents:
diff changeset
671 float _dp = (v25.vWorldPosition.x - pBLVRenderParams->vPartyPos.x) * a1.x +
Ritor1
parents:
diff changeset
672 (v25.vWorldPosition.y - pBLVRenderParams->vPartyPos.y) * a1.y +
Ritor1
parents:
diff changeset
673 (v25.vWorldPosition.z - pBLVRenderParams->vPartyPos.z) * a1.z;
Ritor1
parents:
diff changeset
674 if (fabs(_dp) < 1e-6f)
Ritor1
parents:
diff changeset
675 {
1317
Ritor1
parents: 1314
diff changeset
676 memcpy(&v25, &pOutBounding[1], sizeof(RenderVertexSoft));
Ritor1
parents: 1314
diff changeset
677 memcpy(&pOutBounding[1], &pOutBounding[3], sizeof(RenderVertexSoft));
Ritor1
parents: 1314
diff changeset
678 memcpy(&pOutBounding[3], &v25, sizeof(RenderVertexSoft));
0
Ritor1
parents:
diff changeset
679 }
Ritor1
parents:
diff changeset
680
794
Nomad
parents: 686
diff changeset
681 //if ( byte_4D864C && pGame->uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
Nomad
parents: 686
diff changeset
682 //{
0
Ritor1
parents:
diff changeset
683 RenderVertexSoft v26; // [sp+40h] [bp-60h]@20
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
684 extern bool draw_debug_line;
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
685 if ( draw_debug_line )
0
Ritor1
parents:
diff changeset
686 {
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
687 if (!bDoNotDrawPortalFrustum)
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
688 {
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
689 v26.vWorldPosition.x = pParty->vPosition.x;
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
690 v26.vWorldPosition.y = pParty->vPosition.y;
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
691 v26.vWorldPosition.z = pParty->vPosition.z + pParty->sEyelevel; // frustum
794
Nomad
parents: 686
diff changeset
692
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
693 pGame->pIndoorCameraD3D->do_draw_debug_line_sw(&v26, 0xFF0000u, &pOutBounding[0], 0xFF0000u, 0, 0);
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
694 pGame->pIndoorCameraD3D->do_draw_debug_line_sw(&v26, 0xFF00u, &pOutBounding[1], 0xFF00u, 0, 0);
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
695 pGame->pIndoorCameraD3D->do_draw_debug_line_sw(&v26, 0xFFu, &pOutBounding[2], 0xFFu, 0, 0);
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
696 pGame->pIndoorCameraD3D->do_draw_debug_line_sw(&v26, 0xFFFFFFu, &pOutBounding[3], 0xFFFFFFu, 0, 0);
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
697 bDoNotDrawPortalFrustum = true;
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
698 }
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
699 pGame->pIndoorCameraD3D->debug_outline_sw(pOutBounding, uNumVertices, 0x1EFF1Eu, 0.00019999999); // bounding
794
Nomad
parents: 686
diff changeset
700 }
Nomad
parents: 686
diff changeset
701 //}
Nomad
parents: 686
diff changeset
702
Nomad
parents: 686
diff changeset
703 //pGame->pIndoorCameraD3D->debug_outline_sw(pFaceLimits, 4, 0xFFF14040, 0.000099999997); // limits
Nomad
parents: 686
diff changeset
704
Nomad
parents: 686
diff changeset
705 /*if ( byte_4D864C && pGame->uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
Nomad
parents: 686
diff changeset
706 {
Nomad
parents: 686
diff changeset
707 RenderVertexSoft v26; // [sp+40h] [bp-60h]@20
Nomad
parents: 686
diff changeset
708 v26.vWorldPosition.x = face_center_x; // corner to center
Nomad
parents: 686
diff changeset
709 v26.vWorldPosition.y = face_center_y;
Nomad
parents: 686
diff changeset
710 v26.vWorldPosition.z = face_center_z;
0
Ritor1
parents:
diff changeset
711
794
Nomad
parents: 686
diff changeset
712 pGame->pIndoorCameraD3D->do_draw_debug_line_sw(pFaceLimits, 0xFF00u, &v26, 0xFF0000u, 0, 0);
Nomad
parents: 686
diff changeset
713 }*/
Nomad
parents: 686
diff changeset
714
Nomad
parents: 686
diff changeset
715
Nomad
parents: 686
diff changeset
716 /*if ( byte_4D864C )
Nomad
parents: 686
diff changeset
717 {
Nomad
parents: 686
diff changeset
718 if ( pGame->uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)*/
Nomad
parents: 686
diff changeset
719 {
Nomad
parents: 686
diff changeset
720 RenderVertexSoft v25; // [sp+10h] [bp-90h]@20
Nomad
parents: 686
diff changeset
721 RenderVertexSoft v26; // [sp+40h] [bp-60h]@20
Nomad
parents: 686
diff changeset
722
Nomad
parents: 686
diff changeset
723 v25.vWorldPosition.x = face_center_x; // portal normal
Nomad
parents: 686
diff changeset
724 v25.vWorldPosition.y = face_center_y;
Nomad
parents: 686
diff changeset
725 v25.vWorldPosition.z = face_center_z;
Nomad
parents: 686
diff changeset
726
Nomad
parents: 686
diff changeset
727 v26.vWorldPosition.x = face_center_x + a1.x * 400.0f;
Nomad
parents: 686
diff changeset
728 v26.vWorldPosition.y = face_center_y + a1.y * 400.0f;
Nomad
parents: 686
diff changeset
729 v26.vWorldPosition.z = face_center_z + a1.z * 400.0f;
Nomad
parents: 686
diff changeset
730
1507
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
731 extern bool draw_debug_line;
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
732 if ( draw_debug_line )
a109bb203e28 UIGame.cpp cleaning(continue) GameUI_DrawMinimap
Ritor1
parents: 1319
diff changeset
733 pGame->pIndoorCameraD3D->do_draw_debug_line_sw(&v25, 0xFFFFFFFFu, &v26, 0xFFFF00u, 0, 0);
0
Ritor1
parents:
diff changeset
734 }
794
Nomad
parents: 686
diff changeset
735 //}
Nomad
parents: 686
diff changeset
736
0
Ritor1
parents:
diff changeset
737 return true;
Ritor1
parents:
diff changeset
738 }
Ritor1
parents:
diff changeset
739
Ritor1
parents:
diff changeset
740
Ritor1
parents:
diff changeset
741
Ritor1
parents:
diff changeset
742 //----- (0049C5B0) --------------------------------------------------------
Ritor1
parents:
diff changeset
743 stru10::stru10()
Ritor1
parents:
diff changeset
744 {
794
Nomad
parents: 686
diff changeset
745 this->bDoNotDrawPortalFrustum = false;
0
Ritor1
parents:
diff changeset
746 }
Ritor1
parents:
diff changeset
747
Ritor1
parents:
diff changeset
748 //----- (0049C5BD) --------------------------------------------------------
Ritor1
parents:
diff changeset
749 stru10::~stru10()
Ritor1
parents:
diff changeset
750 {
Ritor1
parents:
diff changeset
751 }
Ritor1
parents:
diff changeset
752
Ritor1
parents:
diff changeset
753 //----- (0049C5DA) --------------------------------------------------------
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
754 char stru10::_49C5DA(BLVFace *pFace, RenderVertexSoft *pVertices, unsigned int *pNumVertices, IndoorCameraD3D_Vec4 *a5, RenderVertexSoft *pOutBounding)
0
Ritor1
parents:
diff changeset
755 {
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
756 RenderVertexSoft pLimits[4]; // [sp+Ch] [bp-C0h]@1
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
757
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
758 _49CE9E(pFace, pVertices, *pNumVertices, pLimits);
0
Ritor1
parents:
diff changeset
759
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
760 //if ( byte_4D864C && pGame->uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
761 // pGame->pIndoorCameraD3D->debug_outline_sw(a4a, 4u, 0xFF1E1Eu, 0.000099999997);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
762 if (CalcFaceBounding(pFace, pLimits, 4, pOutBounding))
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
763 return _49C720(pOutBounding, a5);
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
764 return false;
0
Ritor1
parents:
diff changeset
765 }
Ritor1
parents:
diff changeset
766 // 4D864C: using guessed type char byte_4D864C;
Ritor1
parents:
diff changeset
767
Ritor1
parents:
diff changeset
768 //----- (0049C681) --------------------------------------------------------
1317
Ritor1
parents: 1314
diff changeset
769 bool stru10::CalcPortalShape(BLVFace *pFace, IndoorCameraD3D_Vec4 *pPortalDataFrustum, RenderVertexSoft *pOutBounding)
0
Ritor1
parents:
diff changeset
770 {
794
Nomad
parents: 686
diff changeset
771 RenderVertexSoft pLimits[4]; // [sp+Ch] [bp-C0h]@1
0
Ritor1
parents:
diff changeset
772
1319
Ritor1
parents: 1317
diff changeset
773 CalcPolygonLimits(pFace, pLimits);//определение границ портала
794
Nomad
parents: 686
diff changeset
774 //if ( byte_4D864C && pGame->uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS)
Nomad
parents: 686
diff changeset
775 // pGame->pIndoorCameraD3D->debug_outline_sw(pLimits, 4, 0xFF1E1E, 0.000099999997);
Nomad
parents: 686
diff changeset
776 if (CalcFaceBounding(pFace, pLimits, 4, pOutBounding))
1317
Ritor1
parents: 1314
diff changeset
777 return _49C720(pOutBounding, pPortalDataFrustum) != 0;
0
Ritor1
parents:
diff changeset
778 return false;
Ritor1
parents:
diff changeset
779 }
1314
Ritor1
parents: 1302
diff changeset
780
0
Ritor1
parents:
diff changeset
781 // 4D864C: using guessed type char byte_4D864C;
Ritor1
parents:
diff changeset
782
Ritor1
parents:
diff changeset
783 //----- (0049C720) --------------------------------------------------------
1317
Ritor1
parents: 1314
diff changeset
784 char stru10::_49C720(RenderVertexSoft *pFaceBounding, IndoorCameraD3D_Vec4 *pPortalDataFrustum)
0
Ritor1
parents:
diff changeset
785 {
1317
Ritor1
parents: 1314
diff changeset
786 Vec3_float_ pRayStart; // [sp+4h] [bp-34h]@1
Ritor1
parents: 1314
diff changeset
787 pRayStart.x = (double)pBLVRenderParams->vPartyPos.x;
Ritor1
parents: 1314
diff changeset
788 pRayStart.y = (double)pBLVRenderParams->vPartyPos.y;
Ritor1
parents: 1314
diff changeset
789 pRayStart.z = (double)pBLVRenderParams->vPartyPos.z;
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
790
1317
Ritor1
parents: 1314
diff changeset
791 if (FindFaceNormal(&pFaceBounding[0], &pFaceBounding[1], &pRayStart, &pPortalDataFrustum[0]) &&
Ritor1
parents: 1314
diff changeset
792 FindFaceNormal(&pFaceBounding[1], &pFaceBounding[2], &pRayStart, &pPortalDataFrustum[1]) &&
Ritor1
parents: 1314
diff changeset
793 FindFaceNormal(&pFaceBounding[2], &pFaceBounding[3], &pRayStart, &pPortalDataFrustum[2]) &&
Ritor1
parents: 1314
diff changeset
794 FindFaceNormal(&pFaceBounding[3], &pFaceBounding[0], &pRayStart, &pPortalDataFrustum[3]))
795
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
795 return true;
472ca68386d4 more stru10 & stru9
Nomad
parents: 794
diff changeset
796 return false;
0
Ritor1
parents:
diff changeset
797 }
Ritor1
parents:
diff changeset
798
Ritor1
parents:
diff changeset
799 //----- (0049C7C5) --------------------------------------------------------
1317
Ritor1
parents: 1314
diff changeset
800 bool stru10::FindFaceNormal(RenderVertexSoft *pFaceBounding1, RenderVertexSoft *pFaceBounding2, Vec3_float_ *pRayStart, IndoorCameraD3D_Vec4 *pPortalDataFrustum)
0
Ritor1
parents:
diff changeset
801 {
1317
Ritor1
parents: 1314
diff changeset
802 Vec3_float_ ray_dir; // [sp+4h] [bp-48h]@1
Ritor1
parents: 1314
diff changeset
803 Vec3_float_ pRay2; // [sp+10h] [bp-3Ch]@1
794
Nomad
parents: 686
diff changeset
804
1317
Ritor1
parents: 1314
diff changeset
805 ray_dir.x = pFaceBounding1->vWorldPosition.x - pRayStart->x;//get ray for cmera to bounding1
Ritor1
parents: 1314
diff changeset
806 ray_dir.y = pFaceBounding1->vWorldPosition.y - pRayStart->y;
Ritor1
parents: 1314
diff changeset
807 ray_dir.z = pFaceBounding1->vWorldPosition.z - pRayStart->z;
Ritor1
parents: 1314
diff changeset
808 Vec3_float_::Cross(&ray_dir, &pRay2, pFaceBounding2->vWorldPosition.x - pFaceBounding1->vWorldPosition.x,
Ritor1
parents: 1314
diff changeset
809 pFaceBounding2->vWorldPosition.y - pFaceBounding1->vWorldPosition.y,
Ritor1
parents: 1314
diff changeset
810 pFaceBounding2->vWorldPosition.z - pFaceBounding1->vWorldPosition.z);
0
Ritor1
parents:
diff changeset
811
1317
Ritor1
parents: 1314
diff changeset
812 float sqr_mag = pRay2.x * pRay2.x + pRay2.y * pRay2.y + pRay2.z * pRay2.z;
794
Nomad
parents: 686
diff changeset
813 if (fabsf(sqr_mag) > 1e-6f)
0
Ritor1
parents:
diff changeset
814 {
794
Nomad
parents: 686
diff changeset
815 float inv_mag = 1.0f / sqrtf(sqr_mag);
1317
Ritor1
parents: 1314
diff changeset
816 pRay2.x *= inv_mag;
Ritor1
parents: 1314
diff changeset
817 pRay2.y *= inv_mag;
Ritor1
parents: 1314
diff changeset
818 pRay2.z *= inv_mag;
Ritor1
parents: 1314
diff changeset
819 pRay2.Normalize();
794
Nomad
parents: 686
diff changeset
820
1317
Ritor1
parents: 1314
diff changeset
821 pPortalDataFrustum->x = pRay2.x;
Ritor1
parents: 1314
diff changeset
822 pPortalDataFrustum->y = pRay2.y;
Ritor1
parents: 1314
diff changeset
823 pPortalDataFrustum->z = pRay2.z;
Ritor1
parents: 1314
diff changeset
824 pPortalDataFrustum->dot = pRayStart->z * pRay2.z + pRayStart->y * pRay2.y + pRayStart->x * pRay2.x;
794
Nomad
parents: 686
diff changeset
825 return true;
0
Ritor1
parents:
diff changeset
826 }
794
Nomad
parents: 686
diff changeset
827 return false;
0
Ritor1
parents:
diff changeset
828 }
Ritor1
parents:
diff changeset
829
Ritor1
parents:
diff changeset
830 //----- (0049C8DC) --------------------------------------------------------
794
Nomad
parents: 686
diff changeset
831 bool stru10::FindFacePlane(RenderVertexSoft *arg0, Vec3_float_ *a2, float *a3)
0
Ritor1
parents:
diff changeset
832 {
Ritor1
parents:
diff changeset
833 Vec3_float_ v1; // [sp+8h] [bp-3Ch]@1
Ritor1
parents:
diff changeset
834 Vec3_float_ v2; // [sp+14h] [bp-30h]@1
Ritor1
parents:
diff changeset
835
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
836 v1.x = arg0[1].vWorldPosition.x - arg0[0].vWorldPosition.x;
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
837 v1.y = arg0[1].vWorldPosition.y - arg0[0].vWorldPosition.y;
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
838 v1.z = arg0[1].vWorldPosition.z - arg0[0].vWorldPosition.z;
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
839
794
Nomad
parents: 686
diff changeset
840 Vec3_float_::Cross(&v1, &v2, arg0[2].vWorldPosition.x - arg0[1].vWorldPosition.x,
Nomad
parents: 686
diff changeset
841 arg0[2].vWorldPosition.y - arg0[1].vWorldPosition.y,
Nomad
parents: 686
diff changeset
842 arg0[2].vWorldPosition.z - arg0[1].vWorldPosition.z);
676
ecfb1b3c9a39 BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents: 0
diff changeset
843
794
Nomad
parents: 686
diff changeset
844 float sqr_mag = v2.x * v2.x + v2.y * v2.y + v2.z * v2.z;
Nomad
parents: 686
diff changeset
845 if (fabsf(sqr_mag) > 1e-6f)
0
Ritor1
parents:
diff changeset
846 {
794
Nomad
parents: 686
diff changeset
847 //v2.Normalize();
Nomad
parents: 686
diff changeset
848 float inv_mag = 1.0f / sqrtf(sqr_mag);
Nomad
parents: 686
diff changeset
849 v2.x *= inv_mag;
Nomad
parents: 686
diff changeset
850 v2.y *= inv_mag;
Nomad
parents: 686
diff changeset
851 v2.z *= inv_mag;
Nomad
parents: 686
diff changeset
852
Nomad
parents: 686
diff changeset
853 a2->x = v2.x;
Nomad
parents: 686
diff changeset
854 a2->y = v2.y;
Nomad
parents: 686
diff changeset
855 a2->z = v2.z;
Nomad
parents: 686
diff changeset
856 *a3 = -(arg0[0].vWorldPosition.z * v2.z + arg0[0].vWorldPosition.y * v2.y + arg0[0].vWorldPosition.x * v2.x);
0
Ritor1
parents:
diff changeset
857 return true;
Ritor1
parents:
diff changeset
858 }
Ritor1
parents:
diff changeset
859 return false;
Ritor1
parents:
diff changeset
860 }