Say, I have a ‘3D space’ within an Axis Aligned Bounding Box that should not be exceeded. I’m using a Gizmo Manager to move my mesh, but I don’t want my mesh to go outside that bound.
I managed to do that by checking if the mesh is inside the bounding box each time its world matrix is changed (by calling registerAfterWorldMatrixUpdate), but it would mess up the gizmo drag behavior if the camera angle is not placed right. And I don’t quite like the ‘hacky’ way it is to get this working.
Try to play with the z-axis gizmo (the blue one), it will start screwing up if you drag your pointer too far from the sphere.
Also, is there a way to control the gizmo manager so that I can decide whether or not the ‘drag’ is valid (like a predicate, but for dragging after evaluating its to-be position)? Or, is it faster to just implement a drag behavior manually? If so, how?
Thanks in advance!