mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
pos to mSeqPos to resolve a method entry vs class entry
This commit is contained in:
parent
76602509e3
commit
a5ab4acd01
2 changed files with 32 additions and 32 deletions
|
|
@ -727,7 +727,7 @@ class TSThread
|
||||||
TSShapeInstance * mShapeInstance; ///< Instance of the shape that this thread animates
|
TSShapeInstance * mShapeInstance; ///< Instance of the shape that this thread animates
|
||||||
|
|
||||||
S32 sequence; ///< Sequence this thread will perform
|
S32 sequence; ///< Sequence this thread will perform
|
||||||
F32 pos;
|
F32 mSeqPos;
|
||||||
|
|
||||||
F32 timeScale; ///< How fast to play through the sequence
|
F32 timeScale; ///< How fast to play through the sequence
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,17 +170,17 @@ void TSThread::setSequence(S32 seq, F32 toPos)
|
||||||
|
|
||||||
sequence = seq;
|
sequence = seq;
|
||||||
priority = getSequence()->priority;
|
priority = getSequence()->priority;
|
||||||
pos = toPos;
|
mSeqPos = toPos;
|
||||||
makePath = getSequence()->makePath();
|
makePath = getSequence()->makePath();
|
||||||
path.start = path.end = 0;
|
path.start = path.end = 0;
|
||||||
path.loop = 0;
|
path.loop = 0;
|
||||||
|
|
||||||
// 1.0f doesn't exist on cyclic sequences
|
// 1.0f doesn't exist on cyclic sequences
|
||||||
if (pos>0.9999f && getSequence()->isCyclic())
|
if (mSeqPos>0.9999f && getSequence()->isCyclic())
|
||||||
pos = 0.9999f;
|
mSeqPos = 0.9999f;
|
||||||
|
|
||||||
// select keyframes
|
// select keyframes
|
||||||
selectKeyframes(pos,getSequence(),&keyNum1,&keyNum2,&keyPos);
|
selectKeyframes(mSeqPos,getSequence(),&keyNum1,&keyNum2,&keyPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool continuePlay)
|
void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool continuePlay)
|
||||||
|
|
@ -207,7 +207,7 @@ void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool conti
|
||||||
|
|
||||||
// set time characteristics of transition
|
// set time characteristics of transition
|
||||||
transitionData.oldSequence = sequence;
|
transitionData.oldSequence = sequence;
|
||||||
transitionData.oldPos = pos;
|
transitionData.oldPos = mSeqPos;
|
||||||
transitionData.duration = duration;
|
transitionData.duration = duration;
|
||||||
transitionData.pos = 0.0f;
|
transitionData.pos = 0.0f;
|
||||||
transitionData.direction = timeScale>0.0f ? 1.0f : -1.0f;
|
transitionData.direction = timeScale>0.0f ? 1.0f : -1.0f;
|
||||||
|
|
@ -219,17 +219,17 @@ void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool conti
|
||||||
// set target sequence data
|
// set target sequence data
|
||||||
sequence = seq;
|
sequence = seq;
|
||||||
priority = getSequence()->priority;
|
priority = getSequence()->priority;
|
||||||
pos = toPos;
|
mSeqPos = toPos;
|
||||||
makePath = getSequence()->makePath();
|
makePath = getSequence()->makePath();
|
||||||
path.start = path.end = 0;
|
path.start = path.end = 0;
|
||||||
path.loop = 0;
|
path.loop = 0;
|
||||||
|
|
||||||
// 1.0f doesn't exist on cyclic sequences
|
// 1.0f doesn't exist on cyclic sequences
|
||||||
if (pos>0.9999f && getSequence()->isCyclic())
|
if (mSeqPos>0.9999f && getSequence()->isCyclic())
|
||||||
pos = 0.9999f;
|
mSeqPos = 0.9999f;
|
||||||
|
|
||||||
// select keyframes
|
// select keyframes
|
||||||
selectKeyframes(pos,getSequence(),&keyNum1,&keyNum2,&keyPos);
|
selectKeyframes(mSeqPos,getSequence(),&keyNum1,&keyNum2,&keyPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TSThread::isInTransition()
|
bool TSThread::isInTransition()
|
||||||
|
|
@ -322,12 +322,12 @@ void TSThread::activateTriggers(F32 a, F32 b)
|
||||||
|
|
||||||
F32 TSThread::getPos()
|
F32 TSThread::getPos()
|
||||||
{
|
{
|
||||||
return transitionData.inTransition ? transitionData.pos : pos;
|
return transitionData.inTransition ? transitionData.pos : mSeqPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 TSThread::getTime()
|
F32 TSThread::getTime()
|
||||||
{
|
{
|
||||||
return transitionData.inTransition ? transitionData.pos * transitionData.duration : pos * getSequence()->duration;
|
return transitionData.inTransition ? transitionData.pos * transitionData.duration : mSeqPos * getSequence()->duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 TSThread::getDuration()
|
F32 TSThread::getDuration()
|
||||||
|
|
@ -378,48 +378,48 @@ void TSThread::advancePos(F32 delta)
|
||||||
|
|
||||||
if (makePath)
|
if (makePath)
|
||||||
{
|
{
|
||||||
path.start = pos;
|
path.start = mSeqPos;
|
||||||
pos += delta;
|
mSeqPos += delta;
|
||||||
if (!getSequence()->isCyclic())
|
if (!getSequence()->isCyclic())
|
||||||
{
|
{
|
||||||
pos = mClampF(pos , 0.0f, 1.0f);
|
mSeqPos = mClampF(mSeqPos, 0.0f, 1.0f);
|
||||||
path.loop = 0;
|
path.loop = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path.loop = (S32)pos;
|
path.loop = (S32)mSeqPos;
|
||||||
if (pos < 0.0f)
|
if (mSeqPos < 0.0f)
|
||||||
path.loop--;
|
path.loop--;
|
||||||
pos -= path.loop;
|
mSeqPos -= path.loop;
|
||||||
// following necessary because of floating point roundoff errors
|
// following necessary because of floating point roundoff errors
|
||||||
if (pos < 0.0f) pos += 1.0f;
|
if (mSeqPos < 0.0f) mSeqPos += 1.0f;
|
||||||
if (pos >= 1.0f) pos -= 1.0f;
|
if (mSeqPos >= 1.0f) mSeqPos -= 1.0f;
|
||||||
}
|
}
|
||||||
path.end = pos;
|
path.end = mSeqPos;
|
||||||
|
|
||||||
animateTriggers(); // do this automatically...no need for user to call it
|
animateTriggers(); // do this automatically...no need for user to call it
|
||||||
|
|
||||||
AssertFatal(pos>=0.0f && pos<=1.0f,"TSThread::advancePos (1)");
|
AssertFatal(mSeqPos >=0.0f && mSeqPos <=1.0f,"TSThread::advancePos (1)");
|
||||||
AssertFatal(!getSequence()->isCyclic() || pos<1.0f,"TSThread::advancePos (2)");
|
AssertFatal(!getSequence()->isCyclic() || mSeqPos<1.0f,"TSThread::advancePos (2)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos += delta;
|
mSeqPos += delta;
|
||||||
if (!getSequence()->isCyclic())
|
if (!getSequence()->isCyclic())
|
||||||
pos = mClampF(pos, 0.0f, 1.0f);
|
mSeqPos = mClampF(mSeqPos, 0.0f, 1.0f);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos -= S32(pos);
|
mSeqPos -= S32(mSeqPos);
|
||||||
// following necessary because of floating point roundoff errors
|
// following necessary because of floating point roundoff errors
|
||||||
if (pos < 0.0f) pos += 1.0f;
|
if (mSeqPos < 0.0f) mSeqPos += 1.0f;
|
||||||
if (pos >= 1.0f) pos -= 1.0f;
|
if (mSeqPos >= 1.0f) mSeqPos -= 1.0f;
|
||||||
}
|
}
|
||||||
AssertFatal(pos>=0.0f && pos<=1.0f,"TSThread::advancePos (3)");
|
AssertFatal(mSeqPos >=0.0f && mSeqPos <=1.0f,"TSThread::advancePos (3)");
|
||||||
AssertFatal(!getSequence()->isCyclic() || pos<1.0f,"TSThread::advancePos (4)");
|
AssertFatal(!getSequence()->isCyclic() || mSeqPos<1.0f,"TSThread::advancePos (4)");
|
||||||
}
|
}
|
||||||
|
|
||||||
// select keyframes
|
// select keyframes
|
||||||
selectKeyframes(pos,getSequence(),&keyNum1,&keyNum2,&keyPos);
|
selectKeyframes(mSeqPos,getSequence(),&keyNum1,&keyNum2,&keyPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSThread::advanceTime(F32 delta)
|
void TSThread::advanceTime(F32 delta)
|
||||||
|
|
@ -459,7 +459,7 @@ void TSThread::setKeyframeNumber(S32 kf)
|
||||||
|
|
||||||
keyNum1 = keyNum2 = kf;
|
keyNum1 = keyNum2 = kf;
|
||||||
keyPos = 0;
|
keyPos = 0;
|
||||||
pos = 0;
|
mSeqPos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TSThread::TSThread(TSShapeInstance * _shapeInst)
|
TSThread::TSThread(TSShapeInstance * _shapeInst)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue