Solved jittering by moving physics update in the level update.

This commit is contained in:
Steffen Fündgens 2015-02-27 12:56:02 +01:00
parent 2d65071887
commit abeab11875

View File

@ -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));