public virtual void OnUpdate() { _frameDelta = clock.Update(); frameAccumulator += _frameDelta; ++frameCount; if (frameAccumulator >= 1.0f) { FramesPerSecond = frameCount / frameAccumulator; frameAccumulator = 0.0f; frameCount = 0; } if (_world != null) { _world.StepSimulation(_frameDelta); } if (Freelook.Update(_frameDelta)) { Graphics.UpdateView(); } Input.ClearKeyCache(); }
protected virtual void OnUpdate() { FrameDelta = clock.GetFrameDelta(); frameAccumulator += FrameDelta; if (frameAccumulator >= 1.0f) { SetInfoText(); frameAccumulator = 0.0f; _interpolatedSteps = 0; clock.Reset(); } if (PhysicsContext.World != null) { clock.StartPhysics(); int steps = PhysicsContext.World.StepSimulation(FrameDelta); clock.StopPhysics(); if (steps == 0) { _interpolatedSteps++; } } if (Freelook.Update(FrameDelta)) { UpdateView(); } Input.ClearKeyCache(); }
public virtual void OnUpdate() { FrameDelta = Clock.GetFrameDelta(); _frameAccumulator += FrameDelta; if (_frameAccumulator >= 1.0f) { FramesPerSecond = Clock.FrameCount / _frameAccumulator; SetInfoText(); _frameAccumulator = 0.0f; Clock.Reset(); } if (World != null) { Clock.StartPhysics(); World.StepSimulation(FrameDelta); Clock.StopPhysics(); } if (Freelook.Update(FrameDelta)) { Graphics.UpdateView(); } Input.ClearKeyCache(); }
public virtual void OnUpdate() { _frameDelta = clock.GetFrameDelta(); frameAccumulator += _frameDelta; if (frameAccumulator >= 1.0f) { FramesPerSecond = clock.FrameCount / frameAccumulator; frameAccumulator = 0.0f; clock.Reset(); } if (_world != null) { clock.StartPhysics(); _world.StepSimulation(_frameDelta); clock.StopPhysics(); } if (Freelook.Update(_frameDelta)) { Graphics.UpdateView(); } Input.ClearKeyCache(); }
protected virtual void OnUpdate() { if (Freelook.Update(_frameDelta)) { SetSceneConstants(); } PhysicsContext.Update(_frameDelta); }
/// <summary> /// Implements logic to update any relevant sample state. /// </summary> protected virtual void OnUpdate() { if (Freelook.Update(FrameDelta)) { Device.SetTransform(TransformState.View, Freelook.View); } PhysicsContext.Update(FrameDelta); }