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

Method advanceThreads

Engine/source/T3D/shapeBase.cpp:2497–2521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2495}
2496
2497void ShapeBase::advanceThreads(F32 dt)
2498{
2499 for (U32 i = 0; i < MaxScriptThreads; i++) {
2500 Thread& st = mScriptThread[i];
2501 if (st.thread) {
2502 if (!mShapeInstance->getShape()->sequences[st.sequence].isCyclic() && !st.atEnd &&
2503 ( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0:
2504 mShapeInstance->getPos(st.thread) <= 0)) {
2505 st.atEnd = true;
2506 updateThread(st);
2507 if (!isGhost()) {
2508 mDataBlock->onEndSequence_callback(this, i, this->getThreadSequenceName(i));
2509 }
2510 }
2511
2512 // Make sure the thread is still valid after the call to onEndSequence_callback().
2513 // Someone could have called destroyThread() while in there.
2514 if(st.thread)
2515 {
2516 mShapeInstance->advanceTime(dt,st.thread);
2517 st.position = mShapeInstance->getPos(st.thread);
2518 }
2519 }
2520 }
2521}
2522
2523//----------------------------------------------------------------------------
2524

Callers

nothing calls this directly

Calls 5

getThreadSequenceNameMethod · 0.95
isCyclicMethod · 0.45
getShapeMethod · 0.45
getPosMethod · 0.45
advanceTimeMethod · 0.45

Tested by

no test coverage detected