The problem persists even after setting the inertia to 0.
I made another attempt, this time I did the following:
- Set sphereOrigin as parent of sphereCollision
- Set sphereCollision as parent of camera
- Add code to control the sphereOrigin rotation with the mouse/pointer
- Detatch the camera controls from the canvas
- Use the ray hit distance to change the z position of sphereCollision (to simulate the camera radius)
The issue still remains (moving the pointer too fast will result in sphereCollision hitting the ground)
I have also tried to save the rotation of sphereOrigin while sphereCollision is not intersecting with the ground. When sphereCollision intersects with the ground, sphereOrigin rotation is changed with the previously saved position.
Despite all this, sphereCollision still hits the ground.
Here’s the PG:
https://www.babylonjs-playground.com/#1VITHH#21