mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-27 03:35:20 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugLog.DebugWrite($"{GetType().Name} set reference transform to {transform.name}");
|
|
||||||
ReferenceTransform = transform;
|
ReferenceTransform = transform;
|
||||||
_intermediaryTransform.SetReferenceTransform(transform);
|
_intermediaryTransform.SetReferenceTransform(transform);
|
||||||
|
|
||||||
|
if (HasAuthority || NetIdentity.ClientAuthorityOwner == null)
|
||||||
|
{
|
||||||
|
_intermediaryTransform.EncodePosition(AttachedObject.transform.position);
|
||||||
|
_intermediaryTransform.EncodeRotation(AttachedObject.transform.rotation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO : optimize by using sqrMagnitude
|
// TODO : optimize by using sqrMagnitude
|
||||||
|
@ -183,7 +183,6 @@ namespace QSB.Syncs.TransformSync
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugLog.DebugWrite($"{_logName} set reference transform to {transform.name}");
|
|
||||||
ReferenceTransform = transform;
|
ReferenceTransform = transform;
|
||||||
_intermediaryTransform.SetReferenceTransform(transform);
|
_intermediaryTransform.SetReferenceTransform(transform);
|
||||||
if (AttachedObject == null)
|
if (AttachedObject == null)
|
||||||
@ -199,6 +198,12 @@ namespace QSB.Syncs.TransformSync
|
|||||||
{
|
{
|
||||||
ReparentAttachedObject(transform);
|
ReparentAttachedObject(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HasAuthority || NetIdentity.ClientAuthorityOwner == null)
|
||||||
|
{
|
||||||
|
_intermediaryTransform.EncodePosition(AttachedObject.transform.position);
|
||||||
|
_intermediaryTransform.EncodeRotation(AttachedObject.transform.rotation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReparentAttachedObject(Transform newParent)
|
private void ReparentAttachedObject(Transform newParent)
|
||||||
|
@ -121,7 +121,6 @@ namespace QSB.Syncs.TransformSync
|
|||||||
|
|
||||||
public void SetReferenceSector(QSBSector sector)
|
public void SetReferenceSector(QSBSector sector)
|
||||||
{
|
{
|
||||||
DebugLog.DebugWrite($"{Player.PlayerId}.{GetType().Name} set reference sector to {sector.Name}");
|
|
||||||
ReferenceSector = sector;
|
ReferenceSector = sector;
|
||||||
SetReferenceTransform(sector?.Transform);
|
SetReferenceTransform(sector?.Transform);
|
||||||
}
|
}
|
||||||
|
@ -125,9 +125,14 @@ namespace QSB.Syncs.TransformSync
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugLog.DebugWrite($"{PlayerId}.{GetType().Name} set reference transform to {transform.name}");
|
|
||||||
ReferenceTransform = transform;
|
ReferenceTransform = transform;
|
||||||
_intermediaryTransform.SetReferenceTransform(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