Solved jittering by moving physics update in the level update.
This commit is contained in:
parent
8e34b56f48
commit
8773ac8f52
4
level.cc
4
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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user