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

Function xParCmdFollow_Update

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

Source from the content-addressed store, hash-verified

132}
133
134void xParCmdFollow_Update(xParCmd* c, xParGroup* ps, F32 dt)
135{
136 xPar* p = ps->m_root;
137 xParCmdFollow* cmd = (xParCmdFollow*)c->tasset;
138 F32 mdt = cmd->gravity * dt;
139
140 while (p && p->m_next)
141 {
142 xVec3 var_38;
143
144 xVec3Sub(&var_38, &p->m_next->m_pos, &p->m_pos);
145
146 F32 f31 = xVec3Length2(&var_38);
147 F32 f1 = xVec3LengthFast(var_38.x, var_38.y, var_38.z);
148
149 F32 force = mdt / (f1 * (f31 + cmd->epsilon));
150
151 p->m_vel.x += var_38.x * force;
152 p->m_vel.y += var_38.y * force;
153 p->m_vel.z += var_38.z * force;
154
155 p = p->m_next;
156 }
157}
158
159void xParCmdOrbitPoint_Update(xParCmd* c, xParGroup* ps, F32 dt)
160{

Callers

nothing calls this directly

Calls 3

xVec3SubFunction · 0.85
xVec3Length2Function · 0.85
xVec3LengthFastFunction · 0.85

Tested by

no test coverage detected