I am currently developing a scene editor (much like the Babylonjs Editor) and the heart of my project are basically Gizmos, to translate, scale and rotate meshes.
I like the Babylonjs gizmos, but there are a few quirks with them when it comes to doing stuff like snapping, scaling, dragging the gizmo, etc. which is why I would love to get these bugs fixed and feature requests added.
First of all some bugs:
PG: https://playground.babylonjs.com/#851PUZ#13
Using snapping with the ScaleGizmo (and also BoundingBoxGizmo) and scaling down a mesh causes mesh to disappear, not being able to scale it back up.
(this behaviour is even worse with the boundingBoxGizmo, sometimes the pos and scale values even become NaN)
I’ve tried fixing this by adding checks to the dragObservable like so, but this didn’t really fix the underlying issue:
if (mesh.scaling.x < 1 || isNaN(mesh.scaling.x)) {
mesh.scaling.x = 1;
}
/-------/
Bug 2:
Not being able to smoothly drag a gizmo when very far away from it (dragging gizmo suddenly stops)
PG: https://playground.babylonjs.com/#851PUZ#12
(try rapidly dragging the gizmo back and forth, you will see that it stops at times)
I’m working with larger scenes, which is why this bug is quite annoying.
Now onto the feature requests:
Dragging the ScaleGizmo or the BoundingBoxGizmo to scale a mesh a significant size is very hard to do sometimes, especially when the mesh is “thin”. (You can see what I mean in the first video, ~11s in).
I would love to have an option to drag the gizmo to exactly wherever the mouse pointer is at, like seen in this video:
I’ve tried messing around with the sensitivity and scaleDragSpeed settings, but none really achieved what I was looking for.
/—/
And finally, Incremental snapping as described here.
Would be making my life much easier.
Everything other than these few bugs and quirks, the Babylonjs gizmos are amazing.
Tagging @Cedric