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

Function PickupFallPhysics

src/SB/Game/zEntPickup.cpp:183–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181static zEntPickup* sSpatulaBungeeDeferred = NULL;
182
183static void PickupFallPhysics(zEntPickup* ent, xScene* sc, F32 dt)
184{
185 // non-matching: scheduling, float regalloc
186
187 gPickupFrame.mat = *(xMat4x3*)ent->model->Mat;
188 gPickupFrame.mat.pos.y -= 0.8f;
189 gPickupFrame.oldmat = gPickupFrame.mat;
190
191 gPickupCollis.chk = 0x22;
192 gPickupCollis.pen = 0x22;
193
194 ent->vel.y -= 15.0f * dt;
195
196 if (ent->vel.y < -20.0f)
197 {
198 ent->vel.y = -20.0f;
199 }
200
201 gPickupFrame.mat.pos.x += ent->vel.x * dt;
202 gPickupFrame.mat.pos.y += ent->vel.y * dt;
203 gPickupFrame.mat.pos.z += ent->vel.z * dt;
204
205 if (!(ent->state & 0x80) || ent->vel.y < 0.0f)
206 {
207 ent->frame = &gPickupFrame;
208 ent->collis = &gPickupCollis;
209
210 xEntCollide(ent, sc, dt);
211
212 ent->frame = NULL;
213 ent->collis = NULL;
214 }
215
216 gPickupFrame.mat.pos.y += 0.8f;
217
218 *(xMat4x3*)ent->model->Mat = gPickupFrame.mat;
219
220 if ((gPickupCollis.colls[0].flags & 0x1) && ent->vel.y < 0.0f)
221 {
222 ent->vel.x = 0.0f;
223 ent->vel.y = 0.0f;
224 ent->vel.z = 0.0f;
225 ent->state &= ~0x3f;
226 ent->state |= 0x1;
227 }
228}
229
230U32 isRewardPickup(zEntPickup* ent)
231{

Callers

nothing calls this directly

Calls 1

xEntCollideFunction · 0.50

Tested by

no test coverage detected