MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getGroundInfo

Method getGroundInfo

Engine/source/T3D/player.cpp:651–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651void PlayerData::getGroundInfo(TSShapeInstance* si, TSThread* thread,ActionAnimation *dp)
652{
653 dp->death = !dStrnicmp(dp->name, "death", 5);
654 if (dp->death)
655 {
656 // Death animations use roll frame-to-frame changes in ground transform into position
657 dp->speed = 0.0f;
658 dp->dir.set(0.0f, 0.0f, 0.0f);
659
660 // Death animations MUST define ground transforms, so add dummy ones if required
661 if (si->getShape()->sequences[dp->sequence].numGroundFrames == 0)
662 si->getShape()->setSequenceGroundSpeed(dp->name, Point3F(0, 0, 0), Point3F(0, 0, 0));
663 }
664 else
665 {
666 VectorF save = dp->dir;
667 si->setSequence(thread,dp->sequence,0);
668 si->animate();
669 si->advanceTime(1);
670 si->animateGround();
671 si->getGroundTransform().getColumn(3,&dp->dir);
672 if ((dp->speed = dp->dir.len()) < 0.01f)
673 {
674 // No ground displacement... In this case we'll use the
675 // default table entry, if there is one.
676 if (save.len() > 0.01f)
677 {
678 dp->dir = save;
679 dp->speed = 1.0f;
680 dp->velocityScale = false;
681 }
682 else
683 dp->speed = 0.0f;
684 }
685 else
686 dp->dir *= 1.0f / dp->speed;
687 }
688}
689
690bool PlayerData::isTableSequence(S32 seq)
691{

Callers

nothing calls this directly

Calls 11

dStrnicmpFunction · 0.85
animateGroundMethod · 0.80
getColumnMethod · 0.80
Point3FClass · 0.50
setMethod · 0.45
getShapeMethod · 0.45
setSequenceMethod · 0.45
animateMethod · 0.45
advanceTimeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected