private void SetActiveSnapshot(int index) { var snapShot = Snapshots[index]; // Set the current position/rotation of each hitbox to be back in time. for (int hitboxIndex = 0; hitboxIndex < _transforms.Length; hitboxIndex++) { _transforms[hitboxIndex].SetPositionAndRotation( MatrixUtils.ExtractTranslationFromMatrix(ref snapShot.LocalToWorld[hitboxIndex]), MatrixUtils.ExtractRotationFromMatrix(ref snapShot.LocalToWorld[hitboxIndex])); } }
private void RestoreSnapshot() { if (!_isRewound) { return; } for (int i = 0; i < _transforms.Length; i++) { _transforms[i].SetPositionAndRotation( MatrixUtils.ExtractTranslationFromMatrix(ref _restoreSnapshot.LocalToWorld[i]), MatrixUtils.ExtractRotationFromMatrix(ref _restoreSnapshot.LocalToWorld[i])); } }