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

Method setThreadSequence

Engine/source/T3D/shapeBase.cpp:2322–2350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2320}
2321
2322bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset)
2323{
2324 Thread& st = mScriptThread[slot];
2325 if (st.thread && st.sequence == seq && st.state == Thread::Play)
2326 return true;
2327
2328 // Handle a -1 sequence, as this may be set when a thread has been destroyed.
2329 if(seq == -1)
2330 return true;
2331
2332 if (seq < MaxSequenceIndex) {
2333 setMaskBits(ThreadMaskN << slot);
2334 st.sequence = seq;
2335 if (reset) {
2336 st.state = Thread::Play;
2337 st.atEnd = false;
2338 st.timescale = 1.f;
2339 st.position = 0.f;
2340 }
2341 if (mShapeInstance) {
2342 if (!st.thread)
2343 st.thread = mShapeInstance->addThread();
2344 mShapeInstance->setSequence(st.thread,seq,st.position);
2345 updateThread(st);
2346 }
2347 return true;
2348 }
2349 return false;
2350}
2351
2352void ShapeBase::updateThread(Thread& st)
2353{

Callers 3

playAnimationMethod · 0.45
playAnimationMethod · 0.45
shapeBase.cppFile · 0.45

Calls 2

addThreadMethod · 0.45
setSequenceMethod · 0.45

Tested by

no test coverage detected