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

Method updateAnimation

Engine/source/T3D/player.cpp:4617–4658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4615//----------------------------------------------------------------------------
4616
4617void Player::updateAnimation(F32 dt)
4618{
4619 // If dead then remove any image animations
4620 if ((mDamageState == Disabled || mDamageState == Destroyed) && mImageStateThread)
4621 {
4622 // Remove the image state animation
4623 mShapeInstance->destroyThread(mImageStateThread);
4624 mImageStateThread = 0;
4625 }
4626
4627 if ((isGhost() || mActionAnimation.animateOnServer) && mActionAnimation.thread)
4628 mShapeInstance->advanceTime(dt,mActionAnimation.thread);
4629 if (mRecoilThread)
4630 mShapeInstance->advanceTime(dt,mRecoilThread);
4631 if (mImageStateThread)
4632 mShapeInstance->advanceTime(dt,mImageStateThread);
4633
4634 // update any active blend clips
4635 if (isGhost())
4636 for (S32 i = 0; i < blend_clips.size(); i++)
4637 mShapeInstance->advanceTime(dt, blend_clips[i].thread);
4638 // If we are the client's player on this machine, then we need
4639 // to make sure the transforms are up to date as they are used
4640 // to setup the camera.
4641 if (isGhost())
4642 {
4643 if (getControllingClient())
4644 {
4645 updateAnimationTree(isFirstPerson());
4646 mShapeInstance->animate();
4647 }
4648 else
4649 {
4650 updateAnimationTree(false);
4651 // This addition forces recently visible players to animate their
4652 // skeleton now rather than in pre-render so that constrained effects
4653 // get up-to-date node transforms.
4654 if (didRenderLastRender())
4655 mShapeInstance->animate();
4656 }
4657 }
4658}
4659
4660void Player::updateAnimationTree(bool firstPerson)
4661{

Callers

nothing calls this directly

Calls 4

destroyThreadMethod · 0.45
advanceTimeMethod · 0.45
sizeMethod · 0.45
animateMethod · 0.45

Tested by

no test coverage detected