Mouse picking and the ChaseCamera

So I’m using an input system with a ChaseCamera that players can use to rotate around a scene (EVE-like camera), and mouse picking (click an object to select it). Obviously, mouse events will be detected when all the player wants to do is rotate the view; so I want picking to take place only if the mouse event is a release, not a press, and if the mouse was not moved between press and release. I see how to check for a button release (&& !keyPressed), but how do I check how much the mouse was moved? Is the tpf variable what I need?

You have to use an analogListener. It has an onAnalog method with a value parameter that is, in the case of a mouse move, the distance covered by the mouse during the frame.
Look at the chaseCam or flyCam code to see how to register and analogListener to the mouse axis. There must be a tutorial on that matter in the tutorial section too.

1 Like

Awesome, got it working. Thanks!