public void ReadNetworkPacket(PacketReader packetReader, GameTime gameTime, TimeSpan latency, bool enablePrediction, bool enableSmoothing, float packetSendTime) { if (enableSmoothing) { previousState = displayState; _currentSmoothing = 1; } else _currentSmoothing = 0; //float packetSendTime = packetReader.ReadSingle(); simulationState.Position = packetReader.ReadVector3(); simulationState.Velocity = packetReader.ReadVector2(); simulationState.Rotation = packetReader.ReadSingle(); PositionInput = packetReader.ReadVector2(); RotationInput = packetReader.ReadVector4(); if (enablePrediction) ApplyPrediction(gameTime, latency, packetSendTime); }
public void ReadInputFromClient(PacketReader packetReader, GameTime gameTime) { PositionInput = packetReader.ReadVector2(); RotationInput = packetReader.ReadVector4(); }