Class GizmoManager
Implements
Constructors
constructor
-
new GizmoManager(
_scene: Scene,
thickness?: number,
utilityLayer?: UtilityLayerRenderer,
keepDepthUtilityLayer?: UtilityLayerRenderer,
): GizmoManagerInstantiates a gizmo manager
Parameters
- _scene: Scene
the scene to overlay the gizmos on top of
- thickness: number = 1
display gizmo axis thickness
- utilityLayer: UtilityLayerRenderer = UtilityLayerRenderer.DefaultUtilityLayer
the layer where gizmos are rendered
- keepDepthUtilityLayer: UtilityLayerRenderer = UtilityLayerRenderer.DefaultKeepDepthUtilityLayer
the layer where occluded gizmos are rendered
Returns GizmoManager
- _scene: Scene
Properties
attachable Meshes
Array of meshes which will have the gizmo attached when a pointer selected them. If null, all meshes are attachable. (Default: null)
attachable Nodes
Array of nodes which will have the gizmo attached when a pointer selected them. If null, all nodes are attachable. (Default: null)
bounding Box Drag Behavior
When bounding box gizmo is enabled, this can be used to track drag/end events
clear Gizmo On Empty Pointer Event
When true, the gizmo will be detached from the current object when a pointer down occurs with an empty picked mesh
enable Auto Picking
When true (default), picking to attach a new mesh is enabled. This works in sync with inspector autopicking.
gizmos
boundingBoxGizmo: Nullable<IBoundingBoxGizmo>;
positionGizmo: Nullable<IPositionGizmo>;
rotationGizmo: Nullable<IRotationGizmo>;
scaleGizmo: Nullable<IScaleGizmo>;
}
Gizmos created by the gizmo manager, gizmo will be null until gizmo has been enabled for the first time
on Attached To Mesh Observable
Fires an event when the manager is attached to a mesh
on Attached To Node Observable
Fires an event when the manager is attached to a node
use Pointer To Attach Gizmos
If pointer events should perform attaching/detaching a gizmo, if false this can be done manually via attachToMesh/attachToNode. (Default: true)
Accessors
additional Transform Node
-
Additional transform node that will be used to transform all the gizmos
Returns TransformNode | undefined
-
Sets the additional transform applied to all the gizmos.
Parameters
- node: TransformNode | undefined
Returns void
attached Mesh
-
The mesh the gizmo's is attached to
Returns Nullable<AbstractMesh>
attached Node
bounding Box Gizmo Enabled
-
get boundingBoxGizmoEnabled(): boolean
Returns boolean
-
set boundingBoxGizmoEnabled(value: boolean): void
If the boundingBox gizmo is enabled
Parameters
- value: boolean
Returns void
coordinates Mode
-
Returns GizmoCoordinatesMode
-
Set the coordinate system to use. By default it's local. But it's possible for a user to tweak so its local for translation and world for rotation. In that case, setting the coordinate system will change
updateGizmoRotationToMatchAttachedMeshandupdateGizmoPositionToMatchAttachedMeshParameters
- coordinatesMode: GizmoCoordinatesMode
Returns void
is Dragging
-
get isDragging(): boolean
True when the mouse pointer is dragging a gizmo mesh
Returns boolean
is Hovered
-
get isHovered(): boolean
True when the mouse pointer is hovering a gizmo mesh
Returns boolean
keep Depth Utility Layer
-
Utility layer that the bounding box gizmo belongs to
Returns UtilityLayerRenderer
position Gizmo Enabled
-
get positionGizmoEnabled(): boolean
Returns boolean
-
set positionGizmoEnabled(value: boolean): void
If the position gizmo is enabled
Parameters
- value: boolean
Returns void
rotation Gizmo Enabled
-
get rotationGizmoEnabled(): boolean
Returns boolean
-
set rotationGizmoEnabled(value: boolean): void
If the rotation gizmo is enabled
Parameters
- value: boolean
Returns void
scale Gizmo Enabled
-
get scaleGizmoEnabled(): boolean
Returns boolean
-
set scaleGizmoEnabled(value: boolean): void
If the scale gizmo is enabled
Parameters
- value: boolean
Returns void
scale Ratio
-
get scaleRatio(): number
Returns number
-
set scaleRatio(value: number): void
Ratio for the scale of the gizmo (Default: 1)
Parameters
- value: number
Returns void
utility Layer
-
Utility layer that all gizmos besides bounding box belong to
Returns UtilityLayerRenderer
Methods
add To Axis Cache
-
Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
Parameters
- gizmoAxisCache: Map<Mesh, GizmoAxisCache>
Gizmo axis definition used for reactive gizmo UI
Returns void
- gizmoAxisCache: Map<Mesh, GizmoAxisCache>
attach To Mesh
-
Attaches a set of gizmos to the specified mesh
Parameters
- mesh: Nullable<AbstractMesh>
The mesh the gizmo's should be attached to
Returns void
- mesh: Nullable<AbstractMesh>
attach To Node
dispose
-
Disposes of the gizmo manager
Returns void
release Drag
-
Force release the drag action by code
Returns void
Helps set up gizmos in the scene to rotate/scale/position nodes