Constructor
new TransformGizmo(webglContext, targetObject, optionsopt)
Creates a new TransformGizmo instance.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
webglContext |
WebGL2RenderingContext | WebGL2 rendering context. | |
targetObject |
Object3D | Target object to attach the gizmo to. | |
options |
Object |
<optional> |
Optional settings (reserved for future use). |
- Source:
Throws:
-
When inputs are invalid.
- Type
- TypeError
Classes
Methods
clearState() → {void}
Clears hovered/active state and restores the default visuals.
- Source:
Returns:
- Type
- void
getActiveAxis() → {string|null}
Returns the currently active axis (if set).
- Source:
Returns:
- The currently active axis id (x, y, z) or null, if no axis is active.
- Type
- string | null
getAxisForMesh(mesh) → {string|null}
Returns the axis identifier for a pick mesh.
Parameters:
| Name | Type | Description |
|---|---|---|
mesh |
Mesh | Pick the mesh instance. |
- Source:
Throws:
-
When the mesh input is invalid.
- Type
- TypeError
Returns:
- The axis id (x, y, z) for the provided pick mesh or null, if the mesh is not mapped to an axis.
- Type
- string | null
isVisible() → {boolean}
Returns current visibility state.
- Source:
Returns:
- The current visibility state of the gizmo.
- Type
- boolean
setActiveAxis(axis) → {void}
Sets the active axis identifier.
Parameters:
| Name | Type | Description |
|---|---|---|
axis |
string | null | Axis id (x, y, z) or null. |
- Source:
Throws:
-
When the axis value is invalid.
- Type
- TypeError
Returns:
- Type
- void
setHoveredAxis(axis) → {void}
Sets the hovered axis identifier.
Parameters:
| Name | Type | Description |
|---|---|---|
axis |
string | null | Axis id (x, y, z) or null. |
- Source:
Throws:
-
When the axis value is invalid.
- Type
- TypeError
Returns:
- Type
- void
setTarget(targetObject) → {void}
Updates the gizmo target and reparents this object.
Parameters:
| Name | Type | Description |
|---|---|---|
targetObject |
Object3D | Target object to attach the gizmo to. |
- Source:
Throws:
-
When the target object is invalid.
- Type
- TypeError
Returns:
- Type
- void
setVisible(visible) → {void}
Sets gizmo visibility.
Parameters:
| Name | Type | Description |
|---|---|---|
visible |
boolean | Whether the gizmo should be visible. |
- Source:
Throws:
-
When the visibility flag is invalid.
- Type
- TypeError
Returns:
- Type
- void