Ejemplo n.º 1
0
        public void OnUpdate()
        {
            FrameDelta         = Clock.GetFrameDelta();
            _frameAccumulator += FrameDelta;
            if (_frameAccumulator >= 1.0f)
            {
                FramesPerSecond = Clock.FrameCount / _frameAccumulator;
                SetInfoText();

                _frameAccumulator = 0.0f;
                Clock.Reset();
            }

            if (_updateReceiver != null)
            {
                _updateReceiver.Update(this);
            }
            HandleKeyboardInput();
            _bodyPicker.Update();

            Clock.StartPhysics();
            int substepsPassed = Simulation.World.StepSimulation(FrameDelta);

            Clock.StopPhysics(substepsPassed);

            if (FreeLook.Update(FrameDelta))
            {
                Graphics.UpdateView();
            }

            Input.ClearKeyCache();
        }
Ejemplo n.º 2
0
        public virtual void OnUpdate()
        {
            _frameDelta       = clock.Update();
            frameAccumulator += _frameDelta;
            ++frameCount;
            if (frameAccumulator >= 1.0f)
            {
                FramesPerSecond = frameCount / frameAccumulator;

                frameAccumulator = 0.0f;
                frameCount       = 0;
            }

            _world.StepSimulation(_frameDelta);

            if (_freelook.Update(_frameDelta))
            {
                _graphics.UpdateView();
            }

            _input.ClearKeyCache();
        }