public override void Read(Connection connection, NetworkObj obj, NetworkStorage storage, Packet packet) { obj.RootState.Entity.SetParentInternal(packet.ReadEntity()); if (PositionEnabled) { storage.Values[obj[this] + POSITION].Vector3 = PositionCompression.Read(packet); if (Extrapolation.Enabled) { storage.Values[obj[this] + VELOCITY].Vector3 = PositionCompression.Read(packet); } } if (RotationEnabled) { storage.Values[obj[this] + ROTATION].Quaternion = RotationCompression.Read(packet); } }
public override void Read(Connection connection, NetworkObj obj, NetworkStorage storage, Packet packet) { UE.Vector3 v = Compression.Read(packet); if (Interpolation.Enabled && (obj.Root is NetworkState)) { storage.Values[obj[this] + 1].Vector3 = v; } else { storage.Values[obj[this]].Vector3 = v; } }
public Quaternion Read(Packet stream) { Quaternion q; if (QuaternionMode) { q.x = Quaternion.Read(stream); q.y = Quaternion.Read(stream); q.z = Quaternion.Read(stream); q.w = Quaternion.Read(stream); } else { q = UnityEngine.Quaternion.Euler(Euler.Read(stream)); } return(q); }