How to constraint pointer inputs?

Hi there !

I’m using Pep to handle touch control with babylonJS on mobile devices, but I would like to disable panning and zooming (and thus having only the rotation feature enabled) on my ArcRotateCamera, but I can’t put my finger on the way to do it.

Any ideas ?

Hey!

There are a few properties on ArcRotateCamera that you can set to enable, disable or limit the movement of the camera.

camera.minZ = 0.01 // how close does the camera clip
camera.panningAxis = new Vector3(1, 0, 1) // make the pan move along the ground
camera.panningSensibility = 0 // how fast can you move 0 = no panning
camera.panningDistanceLimit = 20 // don't allow panning to far away
camera.wheelPrecision = 20 // how fast do we zoom
camera.allowUpsideDown = false // don't allow inversing camera
camera.lowerRadiusLimit = 1 // how far in can you zoom
camera.upperRadiusLimit = 15 // how far out can you zoom
camera.lowerBetaLimit = 0.5 // how for up can you move the camera
camera.upperBetaLimit = Math.PI / 2.2 // how low down can you move the camera

You can find all the settings available in the source code to the camera

I hope that gives you something to play with :smile:

2 Likes