Exemple #1
0
 /// <summary>
 /// Расставляет все объекты по снимку, применяет ввод к сущности игрока и вызывает тик.
 /// </summary>
 /// <returns></returns>
 public Snapshot Predict(Snapshot snapshot, ushort playerEntityId, InputMessageModel inputMessageModel,
                         float physicsSimulationDuration)
 {
     //откатить физическую сцену к состоянию
     physicsRollbackManager.Rollback(snapshot);
     Predict(playerEntityId, inputMessageModel, physicsSimulationDuration);
     log.Debug("Пересимуляция physicsSimulationDuration = " + physicsSimulationDuration);
     return(snapshotFactory.Create());
 }
        public void Cleanup()
        {
            Snapshot          snapshot          = snapshotFactory.Create();
            DateTime          now               = DateTime.UtcNow;
            uint              lastInputId       = lastInputIdStorage.GetLastInputId();
            float             deltaTimeSec      = Time.deltaTime;
            PredictedSnapshot predictedSnapshot = new PredictedSnapshot(now, lastInputId, deltaTimeSec);

            predictedSnapshot.Modify(snapshot);
            predictedSnapshotsStorage.PutPredicted(predictedSnapshot);
        }