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")); } }
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")); } }
public void Apply() { if (crusher != null) { crusher.Apply(this); } }
/// 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); }
public void Apply() { crusher.Apply(this); }