ChaseCamera do not get mouse AXIS_X input sometimes

Hi everybody,

I have following code:

[java]

flyCam.setEnabled(false);

chaseCam = new ChaseCamera(cam,my_model, inputManager);

chaseCam.setToggleRotationTrigger(new MouseAxisTrigger(MouseInput.AXIS_X,true),new MouseAxisTrigger(MouseInput.AXIS_Y,true));

chaseCam.setInvertVerticalAxis(true);

chaseCam.setSmoothMotion(true);

[/java]

when I run Project, camera do not follow to mouse input. What do I wrong?

Thanks

this is messy :

chaseCam.setToggleRotationTrigger(new MouseAxisTrigger(MouseInput.AXIS_X,true),new MouseAxisTrigger(MouseInput.AXIS_Y,true));



this will lead to unexpected behavior of the ChaseCam. This setting is supposed to setup what button press will toggle the rotation mode of the cam, not what does actually rotates the cam.

use new MouseButtonTrigger(MouseInput.BUTTON_LEFT) and new MouseButtonTrigger(MouseInput.BUTTON_RIGHT) as stated in the javadoc.

1 Like

How can I create 3rd person camera which rotates by mouse AXIS input?

nehon said:
this is messy :
chaseCam.setToggleRotationTrigger(new MouseAxisTrigger(MouseInput.AXIS_X,true),new MouseAxisTrigger(MouseInput.AXIS_Y,true));

this will lead to unexpected behavior of the ChaseCam. This setting is supposed to setup what button press will toggle the rotation mode of the cam, not what does actually rotates the cam.
use new MouseButtonTrigger(MouseInput.BUTTON_LEFT) and new MouseButtonTrigger(MouseInput.BUTTON_RIGHT) as stated in the javadoc.


How can I create 3rd person camera which rotates by mouse AXIS input?

try chaseCam.setDragToRotate(false);

nehon said:
try chaseCam.setDragToRotate(false);


I tried, but for rotation I need to press Left mouse first (((. I need camera which rotates by mouse AXIS input without pressing any button.

I can’t reproduce your issue, when I use chaseCam.setDragToRotate(false); the cam rotates when I move the mouse without any button pressed.

try just that



flyCam.setEnabled(false);

chaseCam = new ChaseCamera(cam,my_model, inputManager);

chaseCam.setDragToRotate(false);

chaseCam.setInvertVerticalAxis(true);

chaseCam.setSmoothMotion(true);

2 Likes

It works!!! Great. My mistake was, I have set chaseCam.setDragToRotate(true). Thanks a lot nehon.

nehon said:

I can’t reproduce your issue, when I use chaseCam.setDragToRotate(false); the cam rotates when I move the mouse without any button pressed.

try just that

<br /> flyCam.setEnabled(false);<br /> chaseCam = new ChaseCamera(cam,my_model, inputManager);<br /> chaseCam.setDragToRotate(false);<br /> chaseCam.setInvertVerticalAxis(true);<br /> chaseCam.setSmoothMotion(true);<br />



It works!!! Great. My mistake was, I have set chaseCam.setDragToRotate(true). Thanks a lot nehon.