How to force the chaseCam to keep a given upVector?

I like to chase my little guys around with a camera. But I would like it to observe a given direction as ‘up’. Currently it rotates in all directions and the guys are more often then not upside down:



This is the code I used to follow one of the guys around:

        camTarget=guyToFollow;
        
        chaseCam = new ChaseCamera(cam, camTarget.mesh, app.getInputManager());
        chaseCam.setSmoothMotion(true);
        chaseCam.setUpVector(camTarget.upVector);

A complicating factor may be that the guys live on a rotating sphere, to tackle that I even tried to update the up-vector every frame:

chaseCam.setUpVector(camTarget.upVector);

Where do you update the up-vector: in a control, an app state, or in simpleUpdate()?

What happens if you update the up-vector once per second instead of on every frame?

I poll the up-vector every simpleUpdate and set it directly to the camera.

1 Like