ChaseCam follows a Spatial moving block by block smoothly

I have a Box Spatial and a ChaseCam following the Spatial. But my problem is the Spatial is moving block by block (it is supposed to do it) and because it is moving block by block The CahseCam is glitching as I suppose.

My question is, is there a handy way to make the camera follow the Spatial smoothly, while the Spatial moves block by block?

My CamInit:
public class CamInit {

private final InputManager inputManager;
private final Camera cam;
public static ChaseCamera chaseCam;
private final FlyByCamera flyCam;

public CamInit(AppSettings settings, InputManager inputManager, Camera cam, FlyByCamera flyCam) {
	assert (inputManager != null);
	this.inputManager = inputManager;
	assert (cam != null); = cam;
	assert (flyCam != null);
	this.flyCam = flyCam;
	this.chaseCam = new ChaseCamera(, SnakeInit.snake[0], this.inputManager);
	//, (settings.getWidth() / settings.getHeight()), 1.0f, 2000.0f);		
	chaseCam.setDefaultVerticalRotation(40 * FastMath.DEG_TO_RAD);


Video of the glitching ChaseCam:

Try to do something along the lines of making the cam move half way the distance from its current location to the desired location of the cam and multiply that by the time per frame(tpf).This should give the desired effect and then you can multiply the tpf with a float to polish the feel of the motion.

Well, when using setSmoothMotion(true) the ChaseCamera should interpolate towards the new position and not just jump. However I think that setting really high values on chasingSensitivity and trailingSenstivity might cause really fast movement of the camera making it look like it’s jumping from position A to B really fast. Have you tried using the default values?

Just wondering couldn’t you just move the camera without the control? this seems like it is a basic enough camera?

float camDistance = 10f;
float camHeight = 8f;
float camMoveSpeed = 2f;

Vector3f camLocation = cam.getLocation();
Vector3f newCamLocation = target.subtract(camLocation);
camLocation.interpolate(newCamLocation, camMoveSpeed * tpf);
cam.lookAt(target, Vector3f.UNIT_Y);

I’ve tried it, but it didn’t made a difference! It was just the same

I’m using the ChaseCamera, I don’t set the Camera position anywhere it just follow’s the cube at the front as I declared it!

I thought using a ChaseCamera is more simple than having to write a camera which position you have to set every tick.

But if there is definitly no other way to to this, I’ll follow your idea.

I am not saying there is no other way just this is an option and it is simple enough to implement. you could even wrap the code I posted in a custom control.

Now don’t take this word for word just as an example, I am missing some getters and setters, but wrapping this up might be faster and easer.

public class MyCameraControl extends AbstractControl {
	private float cameraDistance = 10f;
	private float cameraHeight = 8f;
	private float cameraMoveSpeed = 2f;
	private Camera camera;
	private Vector3f cameraLocation;
	private Vector3f newCameraLocation;
	public MyCameraControl() {
		cameraLocation = new Vector3f();
		newCameraLocation = new Vector3f();
	public MyCameraControl(Camera camera) { = camera;
		cameraLocation = new Vector3f();
		newCameraLocation = new Vector3f();
	public Camera getCamera() {
		return camera;
	public void setCamera(Camera camera) { = camera;
	public void setSpatial(Spatial spatial) {
	protected void controlUpdate(float tpf) {
		if(spatial != null && camera != null) {
			Vector3f spatialLocation = spatial.getWorldTranslation();
			camLocation.interpolate(newCamLocation, cameraMoveSpeed * tpf);
			camera.lookAt(spatialLocation, Vector3f.UNIT_Y);
	protected void controlRender(RenderManager renderManager, ViewPort viewPort) {

and your code to use it would look like this.

SnakeInit.snake[0].addControl(new MyCameraControl(cam));