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

Function xEntBoulder_ApplyForces

src/SB/Core/x/xEntBoulder.cpp:174–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172void xEntBoulder_AddForce(xEntBoulder* ent, xVec3* force);
173
174void xEntBoulder_ApplyForces(xEntCollis* collis)
175{
176 for (S32 i = collis->dyn_sidx; i < collis->dyn_eidx; i++)
177 {
178 xCollis* coll = &collis->colls[i];
179 xBase* obj = (xBase*)(coll->optr);
180 if ((obj != NULL) && (obj->baseType == eBaseTypeBoulder))
181 {
182 xEntBoulder* boul = ((xEntBoulder*)(coll->optr));
183 xVec3 vec;
184 xVec3SMul(&vec, &collis->colls[i].norm, -5.0f);
185 if ((boul == globals.player.drv.odriver) || (boul == globals.player.drv.driver))
186 {
187 if (collis->colls[i].norm.y > 0.5f)
188 {
189 vec.x = -vec.x;
190 vec.z = -vec.z;
191 }
192 }
193 xEntBoulder_AddForce(boul, &vec);
194 if (boul->basset->flags & 2)
195 {
196 zEntPlayer_DamageNPCKnockBack(boul, 1, &boul->bound.sph.center);
197 }
198 }
199 }
200}
201
202void xEntBoulder_AddInstantForce(xEntBoulder* ent, xVec3* force)
203{

Callers

nothing calls this directly

Calls 3

xVec3SMulFunction · 0.85
xEntBoulder_AddForceFunction · 0.85

Tested by

no test coverage detected