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

Method _initAnimation

Engine/source/T3D/guiObjectView.cpp:620–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

errorfFunction · 0.85
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