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

Method _initAnimation

Engine/source/T3D/guiObjectView.cpp:621–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619//------------------------------------------------------------------------------
620
621void GuiObjectView::_initAnimation()
622{
623 AssertFatal( mModel, "GuiObjectView::_initAnimation - No model loaded!" );
624
625 if( mAnimationSeqName.isEmpty() && mAnimationSeq == -1 )
626 return;
627
628 // Look up sequence by name.
629
630 if( !mAnimationSeqName.isEmpty() )
631 {
632 mAnimationSeq = mModel->getShape()->findSequence( mAnimationSeqName );
633
634 if( mAnimationSeq == -1 )
635 {
636 Con::errorf( "GuiObjectView::_initAnimation - Cannot find animation sequence '%s' on '%s'",
637 mAnimationSeqName.c_str(),
638 mModelName
639 );
640
641 return;
642 }
643 }
644
645 // Start sequence.
646
647 if( mAnimationSeq != -1 )
648 {
649 if( mAnimationSeq >= mModel->getShape()->sequences.size() )
650 {
651 Con::errorf( "GuiObjectView::_initAnimation - Sequence '%i' out of range for model '%s'",
652 mAnimationSeq,
653 mModelName
654 );
655
656 mAnimationSeq = -1;
657 return;
658 }
659
660 if( !mRunThread )
661 mRunThread = mModel->addThread();
662
663 mModel->setSequence( mRunThread, mAnimationSeq, 0.f );
664 }
665
666 mLastRenderTime = Platform::getVirtualMilliseconds();
667}
668
669//------------------------------------------------------------------------------
670

Callers

nothing calls this directly

Calls 8

errorfFunction · 0.50
isEmptyMethod · 0.45
findSequenceMethod · 0.45
getShapeMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
addThreadMethod · 0.45
setSequenceMethod · 0.45

Tested by

no test coverage detected