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 (syncPosition) writer.WriteVector3(snapshot.position);
|
||||||
if (syncRotation)
|
if (syncRotation)
|
||||||
{
|
{
|
||||||
// (optional) smallest three compression for now. no delta.
|
// if smallest-three quaternion compression is enabled,
|
||||||
if (compressRotation)
|
// then we don't need baseline rotation since delta always
|
||||||
writer.WriteUInt(Compression.CompressQuaternion(snapshot.rotation));
|
// sends an absolute value.
|
||||||
else
|
if (!compressRotation)
|
||||||
writer.WriteQuaternion(snapshot.rotation);
|
writer.WriteQuaternion(snapshot.rotation);
|
||||||
}
|
}
|
||||||
if (syncScale) writer.WriteVector3(snapshot.scale);
|
if (syncScale) writer.WriteVector3(snapshot.scale);
|
||||||
@ -271,10 +271,10 @@ public override void OnDeserialize(NetworkReader reader, bool initialState)
|
|||||||
}
|
}
|
||||||
if (syncRotation)
|
if (syncRotation)
|
||||||
{
|
{
|
||||||
// (optional) smallest three compression for now. no delta.
|
// if smallest-three quaternion compression is enabled,
|
||||||
if (compressRotation)
|
// then we don't need baseline rotation since delta always
|
||||||
rotation = Compression.DecompressQuaternion(reader.ReadUInt());
|
// sends an absolute value.
|
||||||
else
|
if (!compressRotation)
|
||||||
rotation = reader.ReadQuaternion();
|
rotation = reader.ReadQuaternion();
|
||||||
}
|
}
|
||||||
if (syncScale) scale = reader.ReadVector3();
|
if (syncScale) scale = reader.ReadVector3();
|
||||||
|
Loading…
Reference in New Issue
Block a user