void TSShapeInstance::animate(S32 dl) { PROFILE_SCOPE( TSShapeInstance_animate ); if (dl==-1) // nothing to do return; S32 ss = mShape->details[dl].subShapeNum; // this is a billboard detail... if (ss<0) return; U32 dirtyFlags = mDirtyFlags[ss]; if (dirtyFlags & ThreadDirty) sortThreads(); // animate nodes? if (dirtyFlags & TransformDirty) animateNodes(ss); // animate objects? if (dirtyFlags & VisDirty) animateVisibility(ss); if (dirtyFlags & FrameDirty) animateFrame(ss); if (dirtyFlags & MatFrameDirty) animateMatFrame(ss); mDirtyFlags[ss] = 0; }
void TSShapeInstance::transitionToSequence(TSThread * thread, S32 seq, F32 pos, F32 duration, bool continuePlay) { // make sure all transforms on all detail levels are accurate sortThreads(); animateNodeSubtrees(); thread->transitionToSequence(seq,pos,duration,continuePlay); setDirty(AllDirtyMask); mGroundThread = NULL; if (mScaleCurrentlyAnimated && !thread->getSequence()->animatesScale()) checkScaleCurrentlyAnimated(); else if (!mScaleCurrentlyAnimated && thread->getSequence()->animatesScale()) mScaleCurrentlyAnimated=true; mTransitionRotationNodes.overlap(thread->transitionData.oldRotationNodes); mTransitionRotationNodes.overlap(thread->getSequence()->rotationMatters); mTransitionTranslationNodes.overlap(thread->transitionData.oldTranslationNodes); mTransitionTranslationNodes.overlap(thread->getSequence()->translationMatters); mTransitionScaleNodes.overlap(thread->transitionData.oldScaleNodes); mTransitionScaleNodes.overlap(thread->getSequence()->scaleMatters); // if we aren't already in the list of transition threads, add us now S32 i; for (i=0; i<mTransitionThreads.size(); i++) if (mTransitionThreads[i]==thread) break; if (i==mTransitionThreads.size()) mTransitionThreads.push_back(thread); updateTransitions(); }
void TSShapeInstance::setSequence(TSThread * thread, S32 seq, F32 pos) { if ( (thread->transitionData.inTransition && mTransitionThreads.size()>1) || mTransitionThreads.size()>0) { // if we have transitions, make sure transforms are up to date... sortThreads(); animateNodeSubtrees(); } thread->setSequence(seq,pos); setDirty(AllDirtyMask); mGroundThread = NULL; if (mScaleCurrentlyAnimated && !thread->getSequence()->animatesScale()) checkScaleCurrentlyAnimated(); else if (!mScaleCurrentlyAnimated && thread->getSequence()->animatesScale()) mScaleCurrentlyAnimated=true; updateTransitions(); }