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

Method resetAnimation

Engine/source/afx/ce/afxModel.cpp:731–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

729}
730
731void afxModel::resetAnimation(U32 tag)
732{
733 // check if this is a blended clip
734 if ((tag & 0x80000000) != 0)
735 {
736 for (S32 i = 0; i < blend_clips.size(); i++)
737 {
738 if (blend_clips[i].tag == tag)
739 {
740 if (blend_clips[i].thread)
741 {
742 //Con::printf("DESTROY THREAD %d of %d tag=%d" , i, blend_clips.size(), tag & 0x7fffffff);
743 shape_inst->destroyThread(blend_clips[i].thread);
744 }
745 blend_clips.erase_fast(i);
746 break;
747 }
748 }
749 return;
750 }
751
752 if (tag != 0 && tag == last_anim_tag)
753 {
754 // restore original non-animated state
755 if (main_seq_id == -1)
756 {
757 shape_inst->destroyThread(main_seq_thread);
758 main_seq_thread = 0;
759 }
760 // restore original sequence
761 else
762 {
763 shape_inst->setTimeScale(main_seq_thread, seq_rate_factor*mDataBlock->seq_rate);
764 shape_inst->transitionToSequence(main_seq_thread, main_seq_id , 0.0f, 0.25f, true);
765 }
766 last_anim_tag = 0;
767 }
768}
769
770F32 afxModel::getAnimClipDuration(const char* clip)
771{

Callers

nothing calls this directly

Calls 5

erase_fastMethod · 0.80
transitionToSequenceMethod · 0.80
sizeMethod · 0.45
destroyThreadMethod · 0.45
setTimeScaleMethod · 0.45

Tested by

no test coverage detected