public override bool Write(Connection connection, NetworkObj obj, NetworkStorage storage, Packet packet) { if (obj.RootState.Entity.HasParent) { if (connection.entityChannel.ExistsOnRemote(obj.RootState.Entity.Parent)) { packet.WriteEntity(obj.RootState.Entity.Parent); } else { return(false); } } else { packet.WriteEntity(null); } if (PositionEnabled) { PositionCompression.Pack(packet, storage.Values[obj[this] + POSITION].Vector3); if (Extrapolation.Enabled) { PositionCompression.Pack(packet, storage.Values[obj[this] + VELOCITY].Vector3); } } if (RotationEnabled) { RotationCompression.Pack(packet, storage.Values[obj[this] + ROTATION].Quaternion); } return(true); }
public override bool Write(Connection connection, NetworkObj obj, NetworkStorage storage, Packet packet) { Compression.Pack(packet, storage.Values[obj[this]].Quaternion); return(true); }