I have recently started working on a gizmo system that allows you to use transform gizmos (much like the ones that you have access to inside the Unity Editor) at runtime.
I have put up a short video with what I’ve done so far (only the translation and rotation gizmos have been implemented):
Here are a few screen shots that show the current properties which can be modified for the gizmos:
a)Translation gizmo
b) Rotation Gizmo
The system currently supports basic object selection functionality (left click to select object, CTRL/COMMAND adds to selection). The finished version will allow you to select objects using standard object selection functionality which also includes a selection rectangle for multiple object selection.
I am currently working on the scaling gizmo and I am also planning on putting together an Undo/Redo system. Also, there is a feature which is currently missing for the rotation gizmo and that is angle snap which I am also planning to include in the final version.
Thanks! Indeed, vertex snapping would be a cool feature! However, currently I am planning on implementing the snapping functionality by letting the user specify a step value (probably for each axis) and then, when they move the mouse, the gizmo moves in increments of the step value. I am still not sure if this is particularly useful, but I am planning on implementing it and playing around with it a little bit to see how it feels.
With regards to vertex snapping, there are some optimization issues which need to be carefully considered before implementing it. I currently have no idea, but probably some form of spatial partitioning will be required at the mesh level to speed up vertex queries. It will probably not make it in the first release, but I hope to get it down some time in the future.
I know it’s been a while, but I have managed to make some progress with the Runtime Gizmo system and I would like to share it with you. I have created a presentation video which gives you an overview of what has been done so far:
These are the features that have been added since the last time:
scale gizmo - the scale gizmo has been added to the mix. This is almost the same as the one which is available in the Unity Editor, with the exception that it allows you to scale objects along 2 axes at once; pressing the SHIFT key, will activate a square centered around the gizmo position which allows you to scale along all 3 axes at once;
for the translation gizmo, you can now press SHIFT to activate a square which allows you to translate along the view right and up axes.
The ‘Controls.txt’ file contains a list with all the controls which allow you to interact with the system (keyboard shortcuts and mouse buttons etc).
The package will be made available on the Unity Asset Store pretty soon, but there are a few more things that I would like to implement for the final release:
snapping for all gizmo types (including vertex snapping for the translation gizmo);
Undo/Redo system
Please feel free to drop a comment if you have any questions or suggestions.