Constraining a chaseCam


I have a small camera problem that I can’t fathom. I have a chase camera which always points downward, fixed on my player object.

This player object bounces up and down, and I want the chase cam to match its movements but with some springiness to the vertical axis (ie, the player gets closer and farther as they bounce, with the camera altitude slowly matching the players altitude.).

Here’s what I have so far:

[java] chaseCam = new ChaseCamera( cam, objectManager.GetObject(0).GetGeometry() );



final float h = (float)Math.PI * 0.5f;

final float v = (float)Math.PI * 0.0f;

chaseCam.setDefaultHorizontalRotation( h );

chaseCam.setDefaultVerticalRotation( v );

chaseCam.setMaxVerticalRotation( v );

chaseCam.setMaxVerticalRotation( v );

chaseCam.setUpVector( new Vector3f( 0.0f, 1.0f, 0.0f ) );[/java]

If I uncomment the smoothMotion, it nearly produces the required results but the rotation drifts so eventually the camera is below the target. I want the rotation to stay locked.

Is there a way to do this with the existing chaseCam or should I just roll my own?



try chaseCam.setTrailingEnabled(false);

1 Like


I thought I had tried every permutation. Thanks for the clarity.

hehe yeah there are a lot of parameters to tweak on this chaseCam…maybe a bit too much :stuck_out_tongue: