Creates a new RotateGizmo object. Use Gizmo.createLayer to create the layer required to display the gizmo.
The camera component.
The layer responsible for rendering the gizmo.
Protected
_appInternal reference to the app containing the gizmo.
Protected
_cameraInternal reference to camera component to view the gizmo.
Protected
_coordInternal version of coordinate space. Defaults to 'world'.
Protected
_deviceInternal reference to the graphics device of the app.
Protected
_handlesInternal list of app event handles for the gizmo.
Protected
_layerInternal reference to layer to render the gizmo..
Protected
_rootInternal gizmo starting rotation in world space.
Protected
_rootInternal gizmo starting rotation in world space.
Protected
_scaleInternal version of the gizmo scale. Defaults to 1.
Protected
_selectedInternal currently selected axis.
Protected
_selectedInternal state of if currently selected shape is a plane.
Protected
_selectionInternal selection starting coordinates in world space.
Protected
_shapesInternal object containing the gizmo shapes to render.
Protected
_themeInternal theme.
Whether to hide the shapes when dragging. Defaults to 'selected'.
The intersection shapes for the gizmo.
The graph nodes attached to the gizmo.
This forces the rotation to always be calculated based on the mouse position around the gizmo.
The root gizmo entity.
Protected
_draggingProtected
Gets the angle guide line thickness.
Sets the angle guide line thickness.
Gets the camera component to view the gizmo.
Protected
cameraProtected
Gets the gizmo coordinate space.
Gets the gizmo enabled state.
Sets the gizmo enabled state.
Gets the face ring radius.
Sets the face ring radius.
Gets the face tube radius.
Sets the face tube radius.
Protected
facingProtected
Gets the gizmo render layer.
Gets the ring tolerance.
Sets the ring tolerance.
Gets the gizmo size.
Sets the gizmo size. Defaults to 1.
Gets whether snapping is enabled. Defaults to false.
Sets whether snapping is enabled. Defaults to false.
Gets the current theme for the gizmo.
Gets the XYZ ring radius.
Sets the XYZ ring radius.
Gets the XYZ tube radius.
Sets the XYZ tube radius.
Protected
_calculateProtected
The point.
The x coordinate.
The y coordinate.
The angle.
Protected
_createProtected
The axis to create the plane for.
Whether the axis is facing the camera.
Whether the axis is a line.
Protected
_createProtected
_createProtected
Protected
_dirProtected
_drawProtected
_drawProtected
_projectProtected
The point to project.
The axis to project to.
Protected
_screenProtected
The x coordinate.
The y coordinate.
The point (space is TransformGizmo#coordSpace).
Protected
_updateProtected
Protected
_updateProtected
Protected
_updateProtected
Set the shape to be enabled or disabled.
The shape axis.
The enabled state of shape.
Fire an event, all additional arguments are passed on to the event listener.
Name of event to fire.
Optional
arg1: anyFirst argument that is passed to the event handler.
Optional
arg2: anySecond argument that is passed to the event handler.
Optional
arg3: anyThird argument that is passed to the event handler.
Optional
arg4: anyFourth argument that is passed to the event handler.
Optional
arg5: anyFifth argument that is passed to the event handler.
Optional
arg6: anySixth argument that is passed to the event handler.
Optional
arg7: anySeventh argument that is passed to the event handler.
Optional
arg8: anyEighth argument that is passed to the event handler.
Self for chaining.
Test if there are any handlers bound to an event name.
The name of the event to test.
True if the object has handlers bound to the specified event name.
Get the enabled state of the shape.
The shape axis. Can be:
Detach an event handler from an event. If callback is not provided then all callbacks are unbound from the event, if scope is not provided then all events with the callback will be unbound.
Optional
name: stringName of the event to unbind.
Optional
callback: HandleEventCallbackFunction to be unbound.
Optional
scope: anyScope that was used as the this when the event is fired.
Self for chaining.
const handler = () => {};
obj.on('test', handler);
obj.off(); // Removes all events
obj.off('test'); // Removes all events called 'test'
obj.off('test', handler); // Removes all handler functions, called 'test'
obj.off('test', handler, this); // Removes all handler functions, called 'test' with scope this
Attach an event handler to an event.
Name of the event to bind the callback to.
Function that is called when event is fired. Note the callback is limited to 8 arguments.
Optional
scope: any = ...Object to use as 'this' when the event is fired, defaults to current this.
Can be used for removing event in the future.
Attach an event handler to an event. This handler will be removed after being fired once.
Name of the event to bind the callback to.
Function that is called when event is fired. Note the callback is limited to 8 arguments.
Optional
scope: any = ...Object to use as 'this' when the event is fired, defaults to current this.
Sets the theme or partial theme for the gizmo.
The partial theme to set.
Optional
disabled?: Partial<Color>The disabled color.
Optional
guideBase?: Partial<{ f: Color; x: Color; y: Color; z: Color }>The guide line colors.
Optional
guideOcclusion?: numberThe guide occlusion value. Defaults to 0.8.
Optional
shapeBase?: Partial<{ f: Color; x: Color; xyz: Color; y: Color; z: Color }>The axis colors.
Optional
shapeHover?: Partial<{ f: Color; x: Color; xyz: Color; y: Color; z: Color }>The hover colors.
Static
createCreates a new gizmo layer and adds it to the scene.
The app.
Optional
layerName: string = 'Gizmo'The layer name. Defaults to 'Gizmo'.
Optional
layerIndex: number = app.scene.layers.layerList.lengthThe layer index. Defaults to the end of the layer list.
The new layer.
Static
EVENT_Fired when graph nodes are attached.
Static
EVENT_Fired when graph nodes are detached.
Static
EVENT_Fired when the pointer is down on the gizmo.
Static
EVENT_Fired when the pointer is moving over the gizmo.
Static
EVENT_Fired when the pointer is up off the gizmo.
Static
EVENT_Fired when the gizmo's position is updated.
Static
EVENT_Fired when when the gizmo render has updated.
Static
EVENT_Fired when the gizmo's rotation is updated.
Static
EVENT_Fired when the gizmo's scale is updated.
Static
EVENT_Fired when when the transformation has ended.
Static
EVENT_Fired during the transformation.
Static
EVENT_Fired when when the transformation has started.
The RotateGizmo provides interactive 3D manipulation handles for rotating/reorienting Entitys in a Scene. It creates a visual widget with a draggable ring for each axis of rotation, plus a fourth ring for rotation in the camera's view plane, allowing precise control over object orientation through direct manipulation. The gizmo's visual appearance can be customized away from the defaults as required.
Note that the gizmo can be driven by both mouse+keyboard and touch input.
Relevant Engine API examples: