Creates a new TranslateGizmo object.
The camera component.
The render layer.
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 GIZMOSPACE_WORLD.
Protected
_deviceInternal reference to the graphics device of the app.
Protected
_draggingInternal state for if the gizmo is being dragged.
Protected
_guideInternal version of the guide line color.
Protected
_layerInternal reference to layer to render the gizmo..
Protected
_meshInternal color for meshes.
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 angle in world space.
Protected
_selectionInternal selection starting coordinates in world space.
Protected
_shadingInternal state of if shading is enabled. Defaults to true.
Protected
_shapesInternal object containing the gizmo shapes to render.
The intersection data object.
The graph nodes attached to the gizmo.
The root gizmo entity.
Gets the arrow length.
Sets the arrow length.
Gets the arrow thickness.
Sets the arrow thickness.
Gets the axis center size.
Sets the axis center size.
Gets the axis center tolerance.
Sets the axis center tolerance.
Gets the axis gap.
Sets the axis gap.
Gets the axis line length.
Sets the axis line length.
Gets the axis line thickness.
Sets the axis line thickness.
Gets the axis line tolerance.
Sets the axis line tolerance.
Gets the plane gap.
Sets the plane gap.
Gets the plane size.
Sets the plane size.
Gets the color alpha for all axes.
Sets the color alpha for all axes.
Gets the gizmo coordinate space.
Sets the gizmo coordinate space. Can be:
Defaults to GIZMOSPACE_WORLD.
Gets whether shading are enabled. Defaults to true.
Sets whether shading are enabled. Defaults to true.
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.
Protected
_createProtected
_createProtected
_createProtected
_projectProtected
The point to project.
The axis to project to.
Protected
_screenProtected
_updateProtected
_updateProtected
_updateFire 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.
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: objectScope that was used as the this when the event is fired.
Self for chaining.
const handler = function () {
};
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: object = ...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: object = ...Object to use as 'this' when the event is fired, defaults to current this.
Static
createCreates a new gizmo layer and adds it to the scene.
The app.
Optional
layerName: string = LAYER_NAMEThe layer name. Defaults to 'Gizmo'.
Optional
layerIndex: numberThe 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.
Translation gizmo.