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

Method InCylinder

src/SB/Game/zNPCSupport.cpp:324–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324S32 NPCTarget::InCylinder(xVec3* from, F32 rad, F32 hyt, F32 off)
325{
326 S32 inrange = 1;
327
328 xVec3 vec = {};
329 this->PosGet(&vec);
330 xVec3SubFrom(&vec, from);
331
332 F32 upper = hyt + off;
333 F32 lower = upper - hyt;
334
335 if (vec.y > upper)
336 {
337 inrange = 0;
338 }
339 else if (vec.y < lower)
340 {
341 inrange = 0;
342 }
343 else if (xVec3Length2(&vec) > SQ(rad))
344 {
345 inrange = 0;
346 }
347
348 return inrange;
349}
350
351S32 NPCTarget::IsDead()
352{

Callers 1

MonitorCoweringMethod · 0.80

Calls 3

PosGetMethod · 0.95
xVec3SubFromFunction · 0.85
xVec3Length2Function · 0.85

Tested by

no test coverage detected