Was writing a help-wanted post and figured out a solution to this problem and thought I’d post it to save someone the hours I spent on it.
To make it clear, I wanted no camera movement (rotation or “panning” which really should be called trucking or translation) whilst interacting with objects in the scene (picking or dragging).
I used this beforeRender set camera.alpha and beta code from this playground by @nasimiasl as my starting point - Babylon.js Playground
And just made it conditional based on onPointerDown and Up and locked panning via .panningSensibility=0. But the scene kept jumping around at the end of the pointerUp call and it was much more noticeable on mobile.
Then I realised you needed to wipe off the inertia from the camera during the click. I’d also suggest tuning the inertia to your needs as my scene was spinning at some crazy speed with the default when all I need is 1~2 rotations from center of the screen.
Final playground - https://playground.babylonjs.com/#55XXJ3#11
By the way to people who know more about the docs that I do as I’ve only been here since Friday:
I tried to use the “Customizing Camera Inputs” guide but that doesn’t have the same default setup in it’s code as a recent version of Babylon.JS (like there is no mouse attached by default in my scenes) and detaching the pointer doesn’t do anything for me yet I take it that would have also disabled zoom which you need to get far enough out to get some background to click on to move the camera.
Also I really struggled to understand what panningSensibility actually means. The docs don’t really help there (either in explaining it as limiting translation or what sensibility means).
I do wish more problem/solution code was in the docs so you weren’t relying on the forum posts so much (and I really don’t have the energy to be setting up whole repo’s and making pull requests to make suggestions).