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

Method ExtractAimDir

src/SB/Game/zNPCGoalAmbient.cpp:148–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void zNPCGoalJellyBumped::ExtractAimDir(xVec3* dir_aim)
149{
150 zNPCJelly* npc = (zNPCJelly*)psyche->clt_owner;
151 F32 length;
152
153 if (flg_info & 0x10)
154 {
155 npc->XZVecToPos(dir_aim, (const xVec3*)&pos_bumper, NULL);
156 }
157 else
158 {
159 npc->XZVecToPlayer(dir_aim, NULL);
160 }
161
162 flg_info = 0x0;
163
164 xVec3Inv(dir_aim, dir_aim);
165
166 dir_aim->y = 0.0f;
167
168 length = dir_aim->length();
169 if (length < 1e-5f)
170 {
171 *dir_aim = *NPCC_faceDir(&globals.player.ent);
172 }
173 else
174 {
175 *dir_aim /= length;
176 }
177}
178
179F32 zNPCGoalJellyBumped::CalcEndPoint(xVec3* pos_end, const xVec3* dir_aim)
180{

Callers

nothing calls this directly

Calls 4

xVec3InvFunction · 0.85
NPCC_faceDirFunction · 0.85
XZVecToPlayerMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected