bool StdClientProcessList::advanceTime( SimTime timeDelta ) { PROFILE_SCOPE( StdClientProcessList_AdvanceTime ); if ( doBacklogged( timeDelta ) ) return false; bool ret = Parent::advanceTime( timeDelta ); ProcessObject *obj = NULL; AssertFatal( mLastDelta >= 0.0f && mLastDelta <= 1.0f, "mLastDelta is not zero to one."); obj = mHead.mProcessLink.next; while ( obj != &mHead ) { if ( obj->isTicking() ) obj->interpolateTick( mLastDelta ); obj = obj->mProcessLink.next; } for (U32 i = 0; i < UpdateInterface::all.size(); i++) { Component *comp = dynamic_cast<Component*>(UpdateInterface::all[i]); if (!comp->isClientObject() || !comp->isActive()) continue; UpdateInterface::all[i]->interpolateTick(mLastDelta); } // Inform objects of total elapsed delta so they can advance // client side animations. F32 dt = F32(timeDelta) / 1000; // Update camera FX. gCamFXMgr.update( dt ); obj = mHead.mProcessLink.next; while ( obj != &mHead ) { obj->advanceTime( dt ); obj = obj->mProcessLink.next; } for (U32 i = 0; i < UpdateInterface::all.size(); i++) { Component *comp = dynamic_cast<Component*>(UpdateInterface::all[i]); if (comp) { if (!comp->isClientObject() || !comp->isActive()) continue; } UpdateInterface::all[i]->advanceTime(dt); } return ret; }
bool HifiClientProcessList::advanceTime( SimTime timeDelta ) { PROFILE_SCOPE( AdvanceClientTime ); if ( mSkipAdvanceObjectsMs && timeDelta > mSkipAdvanceObjectsMs ) { timeDelta -= mSkipAdvanceObjectsMs; advanceTime( mSkipAdvanceObjectsMs ); AssertFatal( !mSkipAdvanceObjectsMs, "mSkipAdvanceObjectsMs must always be positive." ); } if ( doBacklogged( timeDelta ) ) return false; // remember interpolation value because we might need to set it back F32 oldLastDelta = mLastDelta; bool ret = Parent::advanceTime( timeDelta ); if ( !mSkipAdvanceObjectsMs ) { AssertFatal( mLastDelta >= 0.0f && mLastDelta <= 1.0f, "mLastDelta must always be zero to one." ); for ( ProcessObject *pobj = mHead.mProcessLink.next; pobj != &mHead; pobj = pobj->mProcessLink.next ) { if ( pobj->isTicking() ) pobj->interpolateTick( mLastDelta ); } // Inform objects of total elapsed delta so they can advance // client side animations. F32 dt = F32( timeDelta ) / 1000; for ( ProcessObject *pobj = mHead.mProcessLink.next; pobj != &mHead; pobj = pobj->mProcessLink.next) { pobj->advanceTime( dt ); } } else { mSkipAdvanceObjectsMs -= timeDelta; mLastDelta = oldLastDelta; } return ret; }
bool ExtendedClientProcessList::advanceTime( SimTime timeDelta ) { PROFILE_SCOPE( ExtendedClientProcessList_AdvanceTime ); if ( doBacklogged( timeDelta ) ) return false; bool ret = Parent::advanceTime( timeDelta ); ProcessObject *obj = NULL; AssertFatal( mLastDelta >= 0.0f && mLastDelta <= 1.0f, "mLastDelta is not zero to one."); obj = mHead.mProcessLink.next; while ( obj != &mHead ) { if ( obj->isTicking() ) obj->interpolateTick( mLastDelta ); obj = obj->mProcessLink.next; } // Inform objects of total elapsed delta so they can advance // client side animations. F32 dt = F32(timeDelta) / 1000; // Update camera FX. gCamFXMgr.update( dt ); obj = mHead.mProcessLink.next; while ( obj != &mHead ) { obj->advanceTime( dt ); obj = obj->mProcessLink.next; } return ret; }