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

Method updateThread

Engine/source/T3D/shapeBase.cpp:2352–2399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2350}
2351
2352void ShapeBase::updateThread(Thread& st)
2353{
2354 switch (st.state)
2355 {
2356 case Thread::Stop:
2357 {
2358 mShapeInstance->setTimeScale( st.thread, 1.f );
2359 mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f );
2360 } // Drop through to pause state
2361
2362 case Thread::Pause:
2363 {
2364 mShapeInstance->setTimeScale( st.thread, 0.f );
2365 } break;
2366
2367 case Thread::Play:
2368 {
2369 if (st.atEnd)
2370 {
2371 mShapeInstance->setTimeScale(st.thread,1);
2372 mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f );
2373 mShapeInstance->setTimeScale(st.thread,0);
2374 st.state = Thread::Stop;
2375 }
2376 else
2377 {
2378 if ( st.position != -1.f )
2379 {
2380 mShapeInstance->setTimeScale( st.thread, 1.f );
2381 mShapeInstance->setPos( st.thread, st.position );
2382 }
2383
2384 mShapeInstance->setTimeScale(st.thread, st.timescale );
2385 }
2386 } break;
2387
2388 case Thread::Destroy:
2389 {
2390 st.atEnd = true;
2391 st.sequence = -1;
2392 if(st.thread)
2393 {
2394 mShapeInstance->destroyThread(st.thread);
2395 st.thread = 0;
2396 }
2397 } break;
2398 }
2399}
2400
2401bool ShapeBase::stopThread(U32 slot)
2402{

Callers

nothing calls this directly

Calls 3

setPosMethod · 0.80
setTimeScaleMethod · 0.45
destroyThreadMethod · 0.45

Tested by

no test coverage detected