mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-18 13:23:05 +00:00
encode position when changing reference
This commit is contained in:
parent
5ccbc49603
commit
764fb59ffb
@ -171,9 +171,14 @@ namespace QSB.Syncs.RigidbodySync
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"{GetType().Name} set reference transform to {transform.name}");
|
||||
ReferenceTransform = transform;
|
||||
_intermediaryTransform.SetReferenceTransform(transform);
|
||||
|
||||
if (HasAuthority || NetIdentity.ClientAuthorityOwner == null)
|
||||
{
|
||||
_intermediaryTransform.EncodePosition(AttachedObject.transform.position);
|
||||
_intermediaryTransform.EncodeRotation(AttachedObject.transform.rotation);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO : optimize by using sqrMagnitude
|
||||
|
@ -183,7 +183,6 @@ namespace QSB.Syncs.TransformSync
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"{_logName} set reference transform to {transform.name}");
|
||||
ReferenceTransform = transform;
|
||||
_intermediaryTransform.SetReferenceTransform(transform);
|
||||
if (AttachedObject == null)
|
||||
@ -199,6 +198,12 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
ReparentAttachedObject(transform);
|
||||
}
|
||||
|
||||
if (HasAuthority || NetIdentity.ClientAuthorityOwner == null)
|
||||
{
|
||||
_intermediaryTransform.EncodePosition(AttachedObject.transform.position);
|
||||
_intermediaryTransform.EncodeRotation(AttachedObject.transform.rotation);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReparentAttachedObject(Transform newParent)
|
||||
|
@ -121,7 +121,6 @@ namespace QSB.Syncs.TransformSync
|
||||
|
||||
public void SetReferenceSector(QSBSector sector)
|
||||
{
|
||||
DebugLog.DebugWrite($"{Player.PlayerId}.{GetType().Name} set reference sector to {sector.Name}");
|
||||
ReferenceSector = sector;
|
||||
SetReferenceTransform(sector?.Transform);
|
||||
}
|
||||
|
@ -125,9 +125,14 @@ namespace QSB.Syncs.TransformSync
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"{PlayerId}.{GetType().Name} set reference transform to {transform.name}");
|
||||
ReferenceTransform = transform;
|
||||
_intermediaryTransform.SetReferenceTransform(transform);
|
||||
|
||||
if (HasAuthority || NetIdentity.ClientAuthorityOwner == null)
|
||||
{
|
||||
_intermediaryTransform.EncodePosition(AttachedObject.transform.position);
|
||||
_intermediaryTransform.EncodeRotation(AttachedObject.transform.rotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user