From abeab118759a9147c6b62db7ef33eac7ddc771be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Fri, 27 Feb 2015 12:56:02 +0100 Subject: [PATCH] Solved jittering by moving physics update in the level update. --- level.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/level.cc b/level.cc index fef60ca..03d0e5c 100644 --- a/level.cc +++ b/level.cc @@ -57,6 +57,8 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass, } void Level::update(float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed) { + physics.takeUpdateStep(runTime); + // Ignore first two mouse updates, because they are incorrect // DON'T try to move this functionallity elsewhere static int i = 0; @@ -89,8 +91,6 @@ void Level::update(float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPre if(lPressed) camera.setIsPhysicsCamera(false); - physics.takeUpdateStep(runTime); - cameraCenter->setPosition(physics.getPos(0)); cameraCenter->setRotation(physics.getRotation(0));