mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
don't include rotation in baseline if smallest-three compression
This commit is contained in:
parent
2de68feb5e
commit
1bfb469821
@ -207,10 +207,10 @@ public override void OnSerialize(NetworkWriter writer, bool initialState)
|
||||
if (syncPosition) writer.WriteVector3(snapshot.position);
|
||||
if (syncRotation)
|
||||
{
|
||||
// (optional) smallest three compression for now. no delta.
|
||||
if (compressRotation)
|
||||
writer.WriteUInt(Compression.CompressQuaternion(snapshot.rotation));
|
||||
else
|
||||
// if smallest-three quaternion compression is enabled,
|
||||
// then we don't need baseline rotation since delta always
|
||||
// sends an absolute value.
|
||||
if (!compressRotation)
|
||||
writer.WriteQuaternion(snapshot.rotation);
|
||||
}
|
||||
if (syncScale) writer.WriteVector3(snapshot.scale);
|
||||
@ -271,10 +271,10 @@ public override void OnDeserialize(NetworkReader reader, bool initialState)
|
||||
}
|
||||
if (syncRotation)
|
||||
{
|
||||
// (optional) smallest three compression for now. no delta.
|
||||
if (compressRotation)
|
||||
rotation = Compression.DecompressQuaternion(reader.ReadUInt());
|
||||
else
|
||||
// if smallest-three quaternion compression is enabled,
|
||||
// then we don't need baseline rotation since delta always
|
||||
// sends an absolute value.
|
||||
if (!compressRotation)
|
||||
rotation = reader.ReadQuaternion();
|
||||
}
|
||||
if (syncScale) scale = reader.ReadVector3();
|
||||
|
Loading…
Reference in New Issue
Block a user