diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 56ec0e4d5..f963b171e 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -2154,13 +2154,13 @@ bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset) if (reset) { st.state = Thread::Play; st.atEnd = false; - st.timescale = 1.f; - st.position = 0.f; + st.timescale = 1.f; + st.position = 0.f; } if (mShapeInstance) { if (!st.thread) st.thread = mShapeInstance->addThread(); - mShapeInstance->setSequence(st.thread,seq,0); + mShapeInstance->setSequence(st.thread,seq,st.position); updateThread(st); } return true; @@ -2175,17 +2175,11 @@ void ShapeBase::updateThread(Thread& st) case Thread::Stop: { mShapeInstance->setTimeScale( st.thread, 1.f ); - mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 0.0f : 1.0f ); + mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f ); } // Drop through to pause state case Thread::Pause: { - if ( st.position != -1.f ) - { - mShapeInstance->setTimeScale( st.thread, 1.f ); - mShapeInstance->setPos( st.thread, st.position ); - } - mShapeInstance->setTimeScale( st.thread, 0.f ); } break; @@ -2339,6 +2333,7 @@ void ShapeBase::advanceThreads(F32 dt) if(st.thread) { mShapeInstance->advanceTime(dt,st.thread); + st.position = mShapeInstance->getPos(st.thread); } } } @@ -3039,9 +3034,9 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream) if (stream->readFlag()) { Thread& st = mScriptThread[i]; U32 seq = stream->readInt(ThreadSequenceBits); - st.state = stream->readInt(2); - stream->read( &st.timescale ); - stream->read( &st.position ); + st.state = Thread::State(stream->readInt(2)); + stream->read( &st.timescale ); + stream->read( &st.position ); st.atEnd = stream->readFlag(); if (st.sequence != seq && st.state != Thread::Destroy) setThreadSequence(i,seq,false); diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index 22e25810d..de22114a9 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -729,9 +729,7 @@ protected: Play, Stop, Pause, Destroy }; TSThread* thread; ///< Pointer to 3space data. - U32 state; ///< State of the thread - /// - /// @see Thread::State + State state; ///< State of the thread S32 sequence; ///< The animation sequence which is running in this thread. F32 timescale; ///< Timescale bool atEnd; ///< Are we at the end of this thread?