Пример #1
0
 // Token: 0x06005983 RID: 22915 RVA: 0x001F1748 File Offset: 0x001EFB48
 private void LateUpdate()
 {
     if (VRC.Network.IsSadAndAlone && (this.LastPosition == null || (double)Time.time - this.LastPosition.Time > VRC.Network.SendInterval))
     {
         this.DiscontinuityHint = false;
         TweenFunctions.RecordValue <SyncPhysics.PositionEvent>(this.positionHistory, this.MakeCurrentPositionEvent((double)Time.time));
     }
     if (base.isMine)
     {
         if (this.hasRigidbody)
         {
             if (!this.isHeld)
             {
                 this.rigidbody.interpolation = RigidbodyInterpolation.Extrapolate;
             }
             else
             {
                 this.rigidbody.interpolation = RigidbodyInterpolation.None;
             }
             if (!this.rigidbody.IsSleeping() && !this.ShouldSleep())
             {
                 this.LastUnsettledTime = Time.time;
             }
         }
         this.UpdateFlags();
     }
     else if (this.hasRigidbody)
     {
         this.rigidbody.interpolation = RigidbodyInterpolation.None;
     }
 }
Пример #2
0
 // Token: 0x0600598B RID: 22923 RVA: 0x001F1F1C File Offset: 0x001F031C
 public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
 {
     if (stream.isWriting)
     {
         SyncPhysics.PositionEvent positionEvent = this.MakeCurrentPositionEvent((double)Time.time);
         positionEvent.OwnerID = info.photonView.ownerId;
         bool flag = false;
         this.RecentOwnershipChange = flag;
         this.RecentCollision       = flag;
         this.SerializePositionEvent(positionEvent, stream, info);
         this.DiscontinuityHint = false;
         TweenFunctions.RecordValue <SyncPhysics.PositionEvent>(this.positionHistory, positionEvent);
     }
     else
     {
         SyncPhysics.PositionEvent positionEvent = this.DeserializePositionEvent(stream, info);
         positionEvent.OwnerID = info.sender.ID;
         if (this.positionHistory.Full && this.positionHistory[0].Time > (double)Time.time - 2.0 * VRC.Network.SimulationDelay(base.Owner))
         {
             this.positionHistory.Capacity *= 2;
         }
         if (positionEvent.Discontinuity)
         {
             this.positionHistory.Clear();
         }
         TweenFunctions.RecordValue <SyncPhysics.PositionEvent>(this.positionHistory, positionEvent);
         this.LastUnsettledTime = Time.time;
     }
 }
Пример #3
0
 // Token: 0x06004F51 RID: 20305 RVA: 0x001AC7FC File Offset: 0x001AABFC
 public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
 {
     PoseRecorder.PoseEvent poseEvent = new PoseRecorder.PoseEvent();
     if (stream.isWriting)
     {
         if (this.ragDoll != null && this.ragDoll.IsRagDolled)
         {
             PoseRecorder.poseContents = 0;
         }
         poseEvent.poseContents    = PoseRecorder.poseContents;
         PoseRecorder.poseContents = 0;
         stream.SendNext((short)poseEvent.poseContents);
         if (poseEvent.Contains(PoseRecorder.PoseContents.RootOffset))
         {
             poseEvent.rootOffset = this.offset.position;
             this.SerializeVector(stream, poseEvent.rootOffset);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.BaseSkeleton))
         {
             for (int i = 0; i < this.bones.Length; i++)
             {
                 poseEvent.boneRotations[i] = ((!(this.bones[i] == null)) ? this.bones[i].rotation : Quaternion.identity);
                 this.SerializeQuaternion(stream, poseEvent.boneRotations[i]);
             }
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HandGesture))
         {
             int num  = 255;
             int num2 = 255;
             if (this.handgest != null)
             {
                 this.handgest.GetRemoteHandGestures(out num, out num2);
             }
             stream.SendNext((byte)num);
             stream.SendNext((byte)num2);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HandEffectorPositionOrientationL))
         {
             if (this.ik != null)
             {
                 this.ik.GetHandEffectorLeft(out poseEvent.leftHandPosition, out poseEvent.leftHandRotation);
             }
             this.SerializeVector(stream, poseEvent.leftHandPosition);
             this.SerializeQuaternion(stream, poseEvent.leftHandRotation);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HandEffectorPositionOrientationR))
         {
             if (this.ik != null)
             {
                 this.ik.GetHandEffectorRight(out poseEvent.rightHandPosition, out poseEvent.rightHandRotation);
             }
             this.SerializeVector(stream, poseEvent.rightHandPosition);
             this.SerializeQuaternion(stream, poseEvent.rightHandRotation);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HeadEffectorPositionOrientation))
         {
             if (this.ik != null)
             {
                 this.ik.GetHeadEffector(out poseEvent.headPosition, out poseEvent.headRotation);
             }
             this.SerializeVector(stream, poseEvent.headPosition);
             this.SerializeQuaternion(stream, poseEvent.headRotation);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HipEffectorPositionOrientation))
         {
             if (this.ik != null)
             {
                 this.ik.GetHipEffector(out poseEvent.hipPosition, out poseEvent.hipRotation);
             }
             this.SerializeVector(stream, poseEvent.hipPosition);
             this.SerializeQuaternion(stream, poseEvent.hipRotation);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.FootEffectorPositionOrientationL))
         {
             if (this.ik != null)
             {
                 this.ik.GetFootEffectorLeft(out poseEvent.leftFootPosition, out poseEvent.leftFootRotation);
             }
             this.SerializeVector(stream, poseEvent.leftFootPosition);
             this.SerializeQuaternion(stream, poseEvent.leftFootRotation);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.FootEffectorPositionOrientationR))
         {
             if (this.ik != null)
             {
                 this.ik.GetFootEffectorRight(out poseEvent.rightFootPosition, out poseEvent.rightFootRotation);
             }
             this.SerializeVector(stream, poseEvent.rightFootPosition);
             this.SerializeQuaternion(stream, poseEvent.rightFootRotation);
         }
     }
     else
     {
         poseEvent.poseContents = (int)((short)stream.ReceiveNext());
         if (poseEvent.Contains(PoseRecorder.PoseContents.RootOffset))
         {
             poseEvent.rootOffset = this.DeserializeVector(stream);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.BaseSkeleton))
         {
             for (int j = 0; j < this.bones.Length; j++)
             {
                 poseEvent.boneRotations[j] = this.DeserializeQuaternion(stream);
             }
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HandGesture))
         {
             poseEvent.handGestureLeft  = (byte)stream.ReceiveNext();
             poseEvent.handGestureRight = (byte)stream.ReceiveNext();
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HandEffectorPositionOrientationL))
         {
             poseEvent.leftHandPosition = this.DeserializeVector(stream);
             poseEvent.leftHandRotation = this.DeserializeQuaternion(stream);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HandEffectorPositionOrientationR))
         {
             poseEvent.rightHandPosition = this.DeserializeVector(stream);
             poseEvent.rightHandRotation = this.DeserializeQuaternion(stream);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HeadEffectorPositionOrientation))
         {
             poseEvent.headPosition = this.DeserializeVector(stream);
             poseEvent.headRotation = this.DeserializeQuaternion(stream);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.HipEffectorPositionOrientation))
         {
             poseEvent.hipPosition = this.DeserializeVector(stream);
             poseEvent.hipRotation = this.DeserializeQuaternion(stream);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.FootEffectorPositionOrientationL))
         {
             poseEvent.leftFootPosition = this.DeserializeVector(stream);
             poseEvent.leftFootRotation = this.DeserializeQuaternion(stream);
         }
         if (poseEvent.Contains(PoseRecorder.PoseContents.FootEffectorPositionOrientationR))
         {
             poseEvent.rightFootPosition = this.DeserializeVector(stream);
             poseEvent.rightFootRotation = this.DeserializeQuaternion(stream);
         }
     }
     poseEvent.timeReceived = (double)Time.time;
     TweenFunctions.RecordValue <PoseRecorder.PoseEvent>(this.eventHistory, poseEvent);
 }