コード例 #1
0
        public virtual void OnCaptureCurrentState(int frameId, Realm realm)
        {
            //Debug.LogError(" CAP " + ReferenceEquals(transformCrusher.PosCrusher.XCrusher, WorldBoundsSO.single.worldBoundsGroups[0].crusher.XCrusher)
            //	+ " " + transformCrusher.PosCrusher.XCrusher.Resolution + " " + WorldBoundsSO.single.worldBoundsGroups[0].crusher.XCrusher.Resolution);

            Frame frame = frames[frameId];

            frame.hasTeleported = hasTeleported;

            if (hasTeleported)
            {
                //Debug.LogError(frameId + " <color=blue>SST HasTeleported</color> m: " + frame.m.position + " -> tm: " + frame.telem.position + " "
                //	+ (transform.parent ? transform.parent.name : "null"));


                /// We want to use the captured values for the m and cm, as they were captured before possible parent change post teleport.
                frame.cm.CopyFrom(preTeleportCM);
                frame.m.CopyFrom(preTeleportM);
                CaptureCurrent(frame.telem, frame.telecm, Realm.Primary, true);
                transformCrusher.Apply(transform, frame.telem);

                //if (GetComponent<SyncPickup>())
                //	Debug.Log(Time.time + " " + name + " " + frameId + " <b>TELE</b> " + frame.telem.position + " : " + frame.m.position + " " + (transform.parent ? transform.parent.name : "null"));

                hasTeleported = false;
            }
            else
            {
                CaptureCurrent(frame.m, frame.cm, realm);

                //if (GetComponent<SyncPickup>())
                //	Debug.Log(Time.time + " " + name + " " + frameId + " <b>CAP</b> " + frame.telem.position + " : " + frame.m.position + " " + (transform.parent ? transform.parent.name : "null"));
            }
        }
コード例 #2
0
ファイル: SyncTransform.cs プロジェクト: ajinkya2020/FPS-GAME
        public virtual void OnCaptureCurrentState(int frameId)
        {
            Frame frame = frames[frameId];

            frame.hasTeleported = hasTeleported;

            if (hasTeleported)
            {
                //Debug.LogError(frameId + " <color=blue>SST HasTeleported</color> m: " + frame.m.position + " -> tm: " + frame.telem.position + " "
                //	+ (transform.parent ? transform.parent.name : "null"));

                /// We want to use the captured values for the m and cm, as they were captured before possible parent change post teleport.
                frame.cm.CopyFrom(preTeleportCM);
                frame.m.CopyFrom(preTeleportM);
                CaptureCurrent(frame.telem, frame.telecm, true);
                transformCrusher.Apply(transform, frame.telem);

                //if (GetComponent<SyncPickup>())
                //	Debug.Log(Time.time + " " + name + " " + frameId + " <b>TELE</b> " + frame.telem.position + " : " + frame.m.position + " " + (transform.parent ? transform.parent.name : "null"));

                hasTeleported = false;
            }
            else
            {
                CaptureCurrent(frame.m, frame.cm);

                //if (GetComponent<SyncPickup>())
                //	Debug.Log(Time.time + " " + name + " " + frameId + " <b>CAP</b> " + frame.telem.position + " : " + frame.m.position + " " + (transform.parent ? transform.parent.name : "null"));
            }
        }
コード例 #3
0
 public void Apply()
 {
     if (crusher != null)
     {
         crusher.Apply(this);
     }
 }
コード例 #4
0
        /// Apply the incoming compressed transform to the local object
        void ApplyUpdate(ulong frag0, byte frag1)
        {
            // If this transform data originated from this object, exit.
            if (hasAuthority)
            {
                return;
            }

            // The crusher can take the fragments and directly reassemble them into a CompressedMatrix, decode that into a Matrix,
            // and apply it to a transform or rigidbody - as shown here.
            crusher.Apply(transform, frag0, frag1);
        }
コード例 #5
0
ファイル: Matrix.cs プロジェクト: namibia00/VROnlineMulti
 public void Apply()
 {
     crusher.Apply(this);
 }