MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xRayHitsGrid

Function xRayHitsGrid

src/SB/Core/x/xScene.cpp:180–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void xRayHitsGrid(xGrid* grid, xScene* sc, xRay3* r, xRayEntCallback rentcb, xQCData* qcr,
181 void* data)
182{
183 xLine3 ln;
184 xGridIterator it;
185
186 r->flags |= (XRAY3_USE_MIN | XRAY3_USE_MAX);
187 if (r->flags & XRAY3_USE_MIN)
188 {
189 xVec3 delta;
190 delta.x = r->dir.x * r->min_t;
191 delta.y = r->dir.y * r->min_t;
192 delta.z = r->dir.z * r->min_t;
193 ln.p1.x = r->origin.x + delta.x;
194 ln.p1.y = r->origin.y + delta.y;
195 ln.p1.z = r->origin.z + delta.z;
196 }
197 else
198 {
199 ln.p1.x = r->origin.x;
200 ln.p1.y = r->origin.y;
201 ln.p1.z = r->origin.z;
202 }
203 if (r->flags & XRAY3_USE_MAX)
204 {
205 F32 len;
206 if (r->flags & XRAY3_USE_MIN)
207 {
208 len = r->max_t - r->min_t;
209 }
210 else
211 {
212 len = r->max_t;
213 }
214 ln.p2.x = r->dir.x * len;
215 ln.p2.y = r->dir.y * len;
216 ln.p2.z = r->dir.z * len;
217 }
218 else
219 {
220 ln.p2.x = r->dir.x;
221 ln.p2.y = r->dir.y;
222 ln.p2.z = r->dir.z;
223 }
224
225 ln.p2.x = ln.p1.x + ln.p2.x;
226 ln.p2.y = ln.p1.y + ln.p2.y;
227 ln.p2.z = ln.p1.z + ln.p2.z;
228
229 S32 sclgx, sclgz;
230 S32 eclgx, eclgz;
231 F32 sclcx, sclcz;
232 F32 eclcx, eclcz;
233 F32 halfclx, halfclz;
234 F32 quatrclx, quatrclz;
235 S32 sz, ez;
236 S32 x, z;
237

Callers 7

_xCameraUpdateFunction · 0.70
xSweptSphereToSceneFunction · 0.70
xSweptSphereToStatDynFunction · 0.70
xSweptSphereToNPCFunction · 0.70
xSweptSphereToNonMovingFunction · 0.70
xRayHitsSceneFunction · 0.70

Calls 4

xGridIterNextCellFunction · 0.85
xGridGetCellFunction · 0.70
xGridIterFirstCellFunction · 0.70
xQuickCullIsectsFunction · 0.70

Tested by

no test coverage detected