Creates a new Gizmo object.
The camera component.
The render layer. This can be provided by the user or will be created and added to the scene and camera if not provided. Successive gizmos will share the same layer and will be removed from the camera and scene when the last gizmo is destroyed. const gizmo = new pc.Gizmo(camera, 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_layerInternal reference to layer to render the gizmo..
Protected_scaleInternal version of the gizmo scale. Defaults to 1.
The intersection shapes for the gizmo.
The graph nodes attached to the gizmo.
The root gizmo entity.
Gets the gizmo coordinate space.
Sets the gizmo coordinate space. Can be:
Defaults to GIZMOSPACE_WORLD.
ProtectedfacingProtectedSets the gizmo render layer.
Gets the gizmo size.
Sets the gizmo size. Defaults to 1.
Protected_updateProtectedProtected_updateProtectedProtected_updateProtectedFire an event, all additional arguments are passed on to the event listener.
Name of event to fire.
Optionalarg1: anyFirst argument that is passed to the event handler.
Optionalarg2: anySecond argument that is passed to the event handler.
Optionalarg3: anyThird argument that is passed to the event handler.
Optionalarg4: anyFourth argument that is passed to the event handler.
Optionalarg5: anyFifth argument that is passed to the event handler.
Optionalarg6: anySixth argument that is passed to the event handler.
Optionalarg7: anySeventh argument that is passed to the event handler.
Optionalarg8: 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.
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.
Optionalname: stringName of the event to unbind.
Optionalcallback: HandleEventCallbackFunction to be unbound.
Optionalscope: anyScope 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.
Optionalscope: 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.
Optionalscope: any = ...Object to use as 'this' when the event is fired, defaults to current this.
StaticcreateStaticEVENT_Fired when graph nodes are attached.
StaticEVENT_Fired when graph nodes are detached.
StaticEVENT_Fired when the pointer is down on the gizmo.
StaticEVENT_Fired when the pointer is moving over the gizmo.
StaticEVENT_Fired when the pointer is up off the gizmo.
StaticEVENT_Fired when the gizmo's position is updated.
StaticEVENT_Fired when when the gizmo render has updated.
StaticEVENT_Fired when the gizmo's rotation is updated.
StaticEVENT_Fired when the gizmo's scale is updated.
The base class for all gizmos.