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

Function xEntOrbitMove

src/SB/Core/x/xEntMotion.cpp:339–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339static void xEntOrbitMove(xEntMotion* motion, xScene* sc, F32 dt, xEntFrame* frame)
340{
341 F32 rem = dt * 0.5f;
342 F32 u = motion->orb.w * (motion->t + rem);
343 F32 th = isin(motion->orb.w * rem);
344 F32 newt = motion->t - motion->orb.p;
345
346 if (newt > 0.0f)
347 {
348 motion->t = newt;
349 }
350
351 if ((-newt < dt) && (-newt > 0.0f))
352 {
353 xVec3Sub(&frame->dpos, &motion->orb.orig, &frame->mat.pos);
354 }
355 else
356 {
357 frame->dpos.x = (2.0f * th) * motion->orb.a * isin(u);
358 frame->dpos.y = 0.0f;
359 frame->dpos.z = (-2.0f * th) * motion->orb.b * icos(u);
360 }
361
362 frame->mode = 2;
363}
364
365void xEntMPGetNext(xEntMotion* motion, xMovePoint* prev, xScene* sc)
366{

Callers 1

xEntMotionMoveFunction · 0.70

Calls 3

isinFunction · 0.85
xVec3SubFunction · 0.85
icosFunction · 0.85

Tested by

no test coverage detected