コード例 #1
0
ファイル: Player.cs プロジェクト: shadowpt/hs
        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);
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: shadowpt/hs
 public void ReadInputFromClient(PacketReader packetReader, GameTime gameTime)
 {
     PositionInput = packetReader.ReadVector2();
     RotationInput = packetReader.ReadVector4();
 }