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

Method processTick

Engine/source/T3D/item.cpp:551–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549//----------------------------------------------------------------------------
550
551void Item::processTick(const Move* move)
552{
553 Parent::processTick(move);
554
555 if ( isMounted() )
556 return;
557
558 //
559 if (mCollisionObject && !--mCollisionTimeout)
560 mCollisionObject = 0;
561
562 // Warp to catch up to server
563 if (mDelta.warpTicks > 0)
564 {
565 mDelta.warpTicks--;
566
567 // Set new pos.
568 MatrixF mat = mObjToWorld;
569 mat.getColumn(3,&mDelta.pos);
570 mDelta.pos += mDelta.warpOffset;
571 mat.setColumn(3, mDelta.pos);
572 Parent::setTransform(mat);
573
574 // Backstepping
575 mDelta.posVec.x = -mDelta.warpOffset.x;
576 mDelta.posVec.y = -mDelta.warpOffset.y;
577 mDelta.posVec.z = -mDelta.warpOffset.z;
578 }
579 else
580 {
581 if (isServerObject() && mAtRest && (mStatic == false && mDataBlock->sticky == false))
582 {
583 if (++mAtRestCounter > csmAtRestTimer)
584 {
585 mAtRest = false;
586 mAtRestCounter = 0;
587 setMaskBits(PositionMask);
588 }
589 }
590
591 if (!mStatic && !mAtRest && isHidden() == false)
592 {
593 updateVelocity(TickSec);
594 updateWorkingCollisionSet(isGhost() ? sClientCollisionMask : sServerCollisionMask, TickSec);
595 updatePos(isGhost() ? sClientCollisionMask : sServerCollisionMask, TickSec);
596 }
597 else
598 {
599 // Need to clear out last updatePos or warp interpolation
600 mDelta.posVec.set(0,0,0);
601 }
602 }
603}
604
605void Item::interpolateTick(F32 dt)
606{

Callers

nothing calls this directly

Calls 4

isHiddenFunction · 0.85
getColumnMethod · 0.80
setColumnMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected