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

Function xEntMPGetNext

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

Source from the content-addressed store, hash-verified

363}
364
365void xEntMPGetNext(xEntMotion* motion, xMovePoint* prev, xScene* sc)
366{
367 xEntMPData* mp = &motion->mp;
368 xVec3 tempdir;
369 xMat3x3 mat;
370
371 mp->spl = NULL;
372 mp->curdist = 0.0f;
373 mp->dist = xMovePointGetNext(mp->src, prev, &mp->dest, &tempdir);
374
375 if (mp->dest == mp->src)
376 {
377 xEntMotionStop(motion);
378 }
379 else if (mp->dest == 0)
380 {
381 xEntMotionStop(motion);
382 }
383 else
384 {
385 if (motion->asset->flags & 1)
386 {
387 xQuatFromMat(&mp->aquat, (xMat3x3*)(motion->owner->model->Mat));
388 xVec3Inv(&tempdir, &tempdir);
389 xMat3x3LookVec(&mat, &tempdir);
390 xQuatFromMat(&mp->bquat, &mat);
391 }
392 if (mp->dest->spl != 0)
393 {
394 mp->spl = mp->dest->spl;
395 while (mp->dest->asset->bezIndex != 0)
396 {
397 mp->dest = mp->dest->nodes[0];
398 }
399 mp->dist = xSpline3_ArcTotal(mp->spl);
400 }
401 }
402}
403
404U32 xQuatEquals(const xQuat* a, const xQuat* b); // Should be linked weakly
405

Callers 2

xEntMotionResetFunction · 0.70
xEntMPMoveFunction · 0.70

Calls 6

xEntMotionStopFunction · 0.85
xVec3InvFunction · 0.85
xSpline3_ArcTotalFunction · 0.85
xMovePointGetNextFunction · 0.70
xQuatFromMatFunction · 0.70
xMat3x3LookVecFunction · 0.70

Tested by

no test coverage detected