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

Function xParCmdOrbitPoint_Update

src/SB/Core/x/xParCmd.cpp:159–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void xParCmdOrbitPoint_Update(xParCmd* c, xParGroup* ps, F32 dt)
160{
161 xPar* p = ps->m_root;
162 xParCmdOrbitPoint* cmd = (xParCmdOrbitPoint*)c->tasset;
163 F32 mdt = cmd->gravity * dt;
164
165 while (p)
166 {
167 xVec3 var_38;
168
169 xVec3Sub(&var_38, &cmd->center, &p->m_pos);
170
171 F32 f31 = xVec3Length2(&var_38);
172
173 if (f31 < cmd->maxRadiusSqr)
174 {
175 F32 f1 = xVec3LengthFast(var_38.x, var_38.y, var_38.z);
176
177 F32 force = mdt / (f1 + (f31 + cmd->epsilon));
178
179 p->m_vel.x += var_38.x * force;
180 p->m_vel.y += var_38.y * force;
181 p->m_vel.z += var_38.z * force;
182 }
183
184 p = p->m_next;
185 }
186}
187
188void xParCmdOrbitLine_Update(xParCmd* c, xParGroup* ps, F32 dt)
189{

Callers

nothing calls this directly

Calls 3

xVec3SubFunction · 0.85
xVec3Length2Function · 0.85
xVec3LengthFastFunction · 0.85

Tested by

no test coverage detected