示例#1
0
文件: Client.cs 项目: Adevien/Netcode
        void SimulateTick(ref SimulationStep step)
        {
            m_GetPlayer.HandlePlayer(step.input);
            m_ClientSimulation.Simulate(Constants.SNAPSHOT_INTERVAL);
            step.state.Set(m_GetPlayer.transform.position, m_GetPlayer.transform.rotation, m_GetPlayer.Yaw, m_GetPlayer.Pitch);

            _previous = _current;
            _current  = new PredictedState(m_GetPlayer.transform.position, m_GetPlayer.transform.rotation, m_GetPlayer.Yaw, m_GetPlayer.Pitch);

            //todo rebuild a simulation with a simple controller + camera to try the code
        }
示例#2
0
 public SimulationStep(PredictedState state, InputData input)
 {
     this.state = state;
     this.input = input;
 }