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

Method advanceThreads

Engine/source/T3D/shapeBase.cpp:2346–2370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2344}
2345
2346void ShapeBase::advanceThreads(F32 dt)
2347{
2348 for (U32 i = 0; i < MaxScriptThreads; i++) {
2349 Thread& st = mScriptThread[i];
2350 if (st.thread) {
2351 if (!mShapeInstance->getShape()->sequences[st.sequence].isCyclic() && !st.atEnd &&
2352 ( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0:
2353 mShapeInstance->getPos(st.thread) <= 0)) {
2354 st.atEnd = true;
2355 updateThread(st);
2356 if (!isGhost()) {
2357 mDataBlock->onEndSequence_callback(this, i, this->getThreadSequenceName(i));
2358 }
2359 }
2360
2361 // Make sure the thread is still valid after the call to onEndSequence_callback().
2362 // Someone could have called destroyThread() while in there.
2363 if(st.thread)
2364 {
2365 mShapeInstance->advanceTime(dt,st.thread);
2366 st.position = mShapeInstance->getPos(st.thread);
2367 }
2368 }
2369 }
2370}
2371
2372//----------------------------------------------------------------------------
2373

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected