ChaseCam on drugs

Hello

I am using the ChaseCam to follow my excavator around in my sandbox and it works perfect for my purpose. I have different AbstracAppStates that control different parts of my WorldAppState handles the World and calls ExcavatorAppState that build and control my excavator. After the excavator is build, the method initFollowCam is called:

[java]
chaseCam = new ChaseCamera(cam, nodeExcavator, inputManager);
chaseCam.setSmoothMotion(true);
chaseCam.setTrailingEnabled(true);
[/java]

So far so good! Then I change the world from WorldAppState that renders a new world and attaches a new ExcavatorAppState, however now the ChaseCam went picking bad mushrooms and cant quite figure out how to level with the world.

The gif image beneath shows the initial load “first loaded” and how I think its intended to work. Then I remove the world and load a new one (for this purpose, I re-created the same level to show the difference) and its quite tilted and it cant seem to manage to “walk straight”.

From inspecting the ChaseCam I tryed to remove the control attached to the spatial and I tried to call cam.clearViewportChanged(); from ExcavatorAppState with no results. Any one encountered this and propose a solution?

Much appreciated

You may need to call setUpVector(Vector3f).

Works like a charm!

Thank you so much

1 Like