Changes in ChaseCamera class

Hey monkeys,

Since a lot of people seem to use the ChaseCamera, I added some requested features to it :

Some people asked to be able to disable rotation on the left or right click button of the mouse.

Others asked to be able to rotate like in Blender with the middle mouse button.

Now you can!

use the setToggleRotationTrigger(Trigger… triggers) method

Example : enabling rotation when pressing the space bar or the middle mouse button

chaseCam.setToggleRotationTrigger(new MouseButtonTrigger(MouseInput.BUTTON_MIDDLE),new KeyTrigger(KeyInput.KEY_SPACE));

Following the same idea I added a setZoomInTrigger and setZoomOutTrigger methods.

There was a invertYAxis to …well… invert the Y axis.

I renamed it invertVerticalAxis and added a invertHorizontalAxis method (guess what it does :wink: )

invertYAxis is now deprecated.

The lookAtOffset did not work properly, it was resulting in weird movements when the cam was close to the target. Now it’s fixed.

Also there is no more variable instantiation on each update. So the cam should use less memory.

I changed the TestChaseCamera a bit and added some comments to explain the different tweakable parameters of the cam.

Waiting for feedback :wink:


Thanks nehon! chaseCam is a nice feature!

looks and “feels” good thanks :slight_smile:

Cheers, I was looking into changing some parts of it mostly because of the strange behaviour using the lookAtOffset =]

Thanks! I’ll post back if I find myself changing parts for my own game purposes :wink: