void Item::processTick(const Move* move) { Parent::processTick(move); // if (mCollisionObject && !--mCollisionTimeout) mCollisionObject = 0; // Warp to catch up to server if (delta.warpTicks > 0) { delta.warpTicks--; // Set new pos. MatrixF mat = mObjToWorld; mat.getColumn(3,&delta.pos); delta.pos += delta.warpOffset; mat.setColumn(3,delta.pos); Parent::setTransform(mat); // Backstepping delta.posVec.x = -delta.warpOffset.x; delta.posVec.y = -delta.warpOffset.y; delta.posVec.z = -delta.warpOffset.z; } else { if (isServerObject() && mAtRest && (mStatic == false && mDataBlock->sticky == false)) { if (++mAtRestCounter > csmAtRestTimer) { mAtRest = false; mAtRestCounter = 0; setMaskBits(PositionMask); } } if (!mStatic && !mAtRest && isHidden() == false) { updateVelocity(TickSec); updateWorkingCollisionSet(isGhost() ? sClientCollisionMask : sServerCollisionMask, TickSec); updatePos(isGhost() ? sClientCollisionMask : sServerCollisionMask, TickSec); } else { // Need to clear out last updatePos or warp interpolation delta.posVec.set(0,0,0); } } }
//----------------------------------------------------------------------------- // // VActorPhysicsController::integrateTickUpdate( pDelta, pMove ); // // ... // //----------------------------------------------------------------------------- void VActorPhysicsController::integrateTickUpdate( const F32 &pDelta, const Move *pMove ) { // Update Collision Set. updateWorkingCollisionSet(); // Ground Ground Status. updateGroundStatus(); // Execute Physics Table. VActorPhysicsState *physState = dynamic_cast<VActorPhysicsState*>( mPhysicsStateTable.execute() ); // Assert. AssertFatal( physState, "VActorPhysicsController::update() - Invalid Physics State in the Table." ); // Process the State. physState->processTick( mObject, pDelta, pMove ); // Process Collisions. processCollisions(); }