osgearth
osgearth copied to clipboard
Terrain avoidance doesn't work with middle mouse button pressed in earth manipulator
Playing with the osgearth_manip.exe example, I noticed that enabling terrain avoidance (via ToggleCollisionHandler) doesn't have any effect when using the middle mouse button (hold down and moving the mouse up and down) to move the viewpoint close to the ground.
This can be seen by using the osgearth_manip.exe with an earth file pointing to terrain data:
- zooming in to an area where terrain is present
- pressing the middle mouse button down while moving the mouse vertical until the viewpoint is under the terrain.
If terrain avoidance is enabled, the camera should clamp to the minimum distance defined and not go through the terrain surface.
I count not repro it your way, but I could repro by positioning the camera above a mountain, and then pitching up so that the camera went down into the ground underneath.
Okay. That is what I was trying to describe. Perhaps a screen capture would be helpful...
I first position my camera as so...
While holding down the middle mouse button and moving the mouse cursor up on the screen, I get this...
Toggling the collision using the 'k' key had no effect. I was still able to go under the terrain
At any rate, I'm glad you were able to repro the problem.
I have a fix for this, but it till have to wait until after the 3.3 release (because of breaking APIs).