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

Method CalcEndPoint

src/SB/Game/zNPCGoalAmbient.cpp:179–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179F32 zNPCGoalJellyBumped::CalcEndPoint(xVec3* pos_end, const xVec3* dir_aim)
180{
181 xCollis colrec;
182 S32 rc;
183
184 F32 dst_toEndPnt = 4.0f;
185 zNPCJelly* npc = (zNPCJelly*)psyche->clt_owner;
186 xVec3 vec = *dir_aim * dst_toEndPnt;
187 xVec3 pos = *npc->Pos() + vec;
188
189 memset(&colrec, 0, sizeof(colrec));
190 colrec.flags = 0x1F00;
191
192 rc = npc->HaveLOSToPos(&pos, 4.0f, globals.sceneCur, NULL, &colrec);
193 if (rc)
194 {
195 *pos_end = pos;
196 dst_toEndPnt = 4.0f;
197 }
198 else
199 {
200 dst_toEndPnt = colrec.dist;
201 *pos_end = *npc->Pos() + *dir_aim * dst_toEndPnt;
202 }
203
204 return dst_toEndPnt;
205}
206
207S32 zNPCGoalJellyAttack::Enter(F32 arg0, void* arg1)
208{

Callers

nothing calls this directly

Calls 3

memsetFunction · 0.85
HaveLOSToPosMethod · 0.80
PosMethod · 0.45

Tested by

no test coverage detected