Assets/Deps/emotitron/Network/NST/NetworkSyncTransform.cs
/// <summary>
/// Move object LOCALLY to pos/rot without lerping or interpolation. Clears all buffers and snapshots. 
/// HardTeleport will clear the buffer, soft teleport just disables the RB to avoid lerping.
/// </summary>
Move object LOCALLY to pos/rot without lerping or interpolation. Clears all buffers and snapshots.
HardTeleport will clear the buffer, soft teleport just disables the RB to avoid lerping.
Move object LOCALLY to pos / rot without lerping or interpolation . Clears all buffers and snapshots . HardTeleport will clear the buffer soft teleport just disables the RB to avoid lerping .
public void ApplyTeleportLocally(Vector3 pos, bool hardTeleport = true)
		{
			bool wasKinematic = false;
			DebugX.Log(Time.time + " <color=red><b>Teleport</b></color> hard:" + hardTeleport + " + Distance: " + Vector3.Distance(pos, transform.position));
			if (rb != null)
			{
				rb.Sleep();
				wasKinematic = rb.isKinematic;
				rb.isKinematic = true;
			}
			if (hardTeleport)
			{
				buffer.validFrameMask = 0;
				CurrentFrame.pos = pos;
				CurrentFrame.compPos = pos.CompressPos();
				lastSentPos = pos;
				lastSentCompPos = pos.CompressPos();
			}
			posSnapshot = pos;
			gameObject.SetPosition(pos, includeXYZ); 
			if (rb != null)
				rb.isKinematic = wasKinematic;
		}
public void ApplyTeleportLocally ( Vector3 pos , bool hardTeleport = true ) { bool wasKinematic = false ; DebugX . Log ( Time . time + " " + hardTeleport + " " + Vector3 . Distance ( pos , transform . position ) ) ; if ( rb != null ) { rb . Sleep ( ) ; wasKinematic = rb . isKinematic ; rb . isKinematic = true ; } if ( hardTeleport ) { buffer . validFrameMask = 0 ; CurrentFrame . pos = pos ; CurrentFrame . compPos = pos . CompressPos ( ) ; lastSentPos = pos ; lastSentCompPos = pos . CompressPos ( ) ; } posSnapshot = pos ; gameObject . SetPosition ( pos , includeXYZ ) ; if ( rb != null ) rb . isKinematic = wasKinematic ; }
Move object LOCALLY to pos/rot without lerping or interpolation.
Move object LOCALLY to pos / rot without lerping or interpolation .
// Clear ALL old frame buffer items to stop warping. They are all invalid now anyway. //frameQueue.Clear(); //transform.position = pos;
pos
Vector3
hardTeleport
bool