Ok so I've perfected the movement system for my game, but it uses 8 directions for player rotations (A* paths) and my camera seems to be EXTREMELY twitchy / jerky because of that..
My question is how can I smooth the camera system? Here's the code I'm using to make the camera follow the player.
I've tried timers for camera updating but they only cut down on the amount of twitchy/jerky camera movements. How can I make something smoother?
My question is how can I smooth the camera system? Here's the code I'm using to make the camera follow the player.
Code Select
public void update() {
// I think the following 3 lines is what makes the camera seem to jerk or twitch, since the player rotates in 1 of 8 directions.. and the camera snaps to the player
camera.setPositionToCenter(abstractHuman.getModel());
camera.align(abstractHuman.getModel()); // align the camera with the player
camera.rotateY(cameraRotation);
camera.rotateCameraX((float) Math.toRadians(30)); // angle
camera.moveCamera(Camera.CAMERA_MOVEOUT, 90); // zoom
}
I've tried timers for camera updating but they only cut down on the amount of twitchy/jerky camera movements. How can I make something smoother?