public void SetGlobalFrameSynchedOverTime(ref MatrixFrame frame, float duration, bool isClient = false)
 {
     if (!(this.GameEntity.GetGlobalFrame() != frame) && !duration.ApproximatelyEqualsTo(0.0f))
     {
         return;
     }
     this._firstFrame       = this.GameEntity.GetFrame();
     this._lastSynchedFrame = (NativeObject)this.GameEntity.Parent != (NativeObject)null ? this.GameEntity.Parent.GetGlobalFrame().TransformToLocalNonOrthogonal(ref frame) : frame;
     this.SetSynchState(SynchedMissionObject.SynchState.SynchronizeFrameOverTime);
     this._duration = duration.ApproximatelyEqualsTo(0.0f) ? 0.1f : duration;
     this._timer    = 0.0f;
     if (GameNetwork.IsServerOrRecorder)
     {
         GameNetwork.BeginBroadcastModuleEvent();
         GameNetwork.WriteMessage((GameNetworkMessage) new SetMissionObjectGlobalFrameOverTime((MissionObject)this, ref frame, duration));
         GameNetwork.EndBroadcastModuleEvent(GameNetwork.EventBroadcastFlags.AddToMissionRecord);
     }
     this._initialSynchFlags |= SynchedMissionObject.SynchFlags.SynchTransform;
 }
Esempio n. 2
0
 private static float RedoneCompareValue(this float value)
 {
     return(value.ApproximatelyEqualsTo(0.0f, 1E-05f) ? 0.0f : value);
 }