Class CameraGizmo
Hierarchy (View Summary)
- Gizmo
- CameraGizmo
Implements
Constructors
constructor
-
new CameraGizmo(
gizmoLayer?: UtilityLayerRenderer,
gizmoColor?: Color3,
frustumLinesColor?: Color3,
): CameraGizmoCreates a CameraGizmo
Parameters
- gizmoLayer: UtilityLayerRenderer = UtilityLayerRenderer.DefaultUtilityLayer
The utility layer the gizmo will be added to
OptionalgizmoColor: Color3Camera mesh color. Default is Gray
OptionalfrustumLinesColor: Color3Frustum lines color. Default is White
Returns CameraGizmo
- gizmoLayer: UtilityLayerRenderer = UtilityLayerRenderer.DefaultUtilityLayer
Properties
_ root Mesh
The root mesh of the gizmo
gizmo Layer
[Object] The utility layer the gizmo will be added to
on Clicked Observable
Event that fires each time the gizmo is clicked
StaticPreserve Scaling
When enabled, any gizmo operation will preserve scaling sign. Default is off. Only valid for TransformNode derived classes (Mesh, AbstractMesh, ...)
StaticUse Absolute Scaling
There are 2 ways to preserve scaling: using mesh scaling or absolute scaling. Depending of hierarchy, non uniform scaling and LH or RH coordinates. One is preferable than the other. If the scaling to be preserved is the local scaling, then set this value to false. Default is true which means scaling to be preserved is absolute one (with hierarchy applied)
Accessors
additional Transform Node
-
Additional transform applied to the gizmo. It's useful when the gizmo is attached to a bone: if the bone is part of a skeleton attached to a mesh, you should define the mesh as additionalTransformNode if you want the gizmo to be displayed at the bone's correct location. Otherwise, as the gizmo is relative to the skeleton root, the mesh transformation will not be taken into account.
Returns TransformNode | undefined
-
Additional transform applied to the gizmo. It's useful when the gizmo is attached to a bone: if the bone is part of a skeleton attached to a mesh, you should define the mesh as additionalTransformNode if you want the gizmo to be displayed at the bone's correct location. Otherwise, as the gizmo is relative to the skeleton root, the mesh transformation will not be taken into account.
Parameters
- value: TransformNode | undefined
Returns void
anchor Point
-
Defines where the gizmo will be positioned if
updateGizmoPositionToMatchAttachedMeshis enabled. (Default: GizmoAnchorPoint.Origin)Returns GizmoAnchorPoint
-
Defines where the gizmo will be positioned if
updateGizmoPositionToMatchAttachedMeshis enabled. (Default: GizmoAnchorPoint.Origin)Parameters
- value: GizmoAnchorPoint
Returns void
attached Mesh
-
Mesh that the gizmo will be attached to. (eg. on a drag gizmo the mesh that will be dragged)
- When set, interactions will be enabled
Returns Nullable<AbstractMesh>
-
Mesh that the gizmo will be attached to. (eg. on a drag gizmo the mesh that will be dragged)
- When set, interactions will be enabled
Parameters
- value: Nullable<AbstractMesh>
Returns void
attached Node
camera
coordinates Mode
-
Set the coordinate mode to use. By default it's local.
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
custom Rotation Quaternion
-
Orientation that the gizmo will be displayed with. When set null, default value will be used (Quaternion(0, 0, 0, 1))
Returns Nullable<Quaternion>
-
Orientation that the gizmo will be displayed with. When set null, default value will be used (Quaternion(0, 0, 0, 1))
Parameters
- customRotationQuaternion: Nullable<Quaternion>
Returns void
display Frustum
-
get displayFrustum(): boolean
Gets or sets a boolean indicating if frustum lines must be rendered (true by default)
Returns boolean
-
set displayFrustum(value: boolean): void
A boolean indicating if frustum lines must be rendered
Parameters
- value: boolean
Returns void
is Hovered
-
get isHovered(): boolean
True when the mouse pointer is hovered a gizmo mesh
Returns boolean
material
-
Gets the material used to render the camera gizmo
Returns StandardMaterial
scale Ratio
-
get scaleRatio(): number
Ratio for the scale of the gizmo
Returns number
-
set scaleRatio(value: number): void
Ratio for the scale of the gizmo (Default: 1)
Parameters
- value: number
Returns void
update Gizmo Position To Match Attached Mesh
-
get updateGizmoPositionToMatchAttachedMesh(): boolean
If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
Returns boolean
-
set updateGizmoPositionToMatchAttachedMesh(value: boolean): void
If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
Parameters
- value: boolean
Returns void
update Gizmo Rotation To Match Attached Mesh
-
get updateGizmoRotationToMatchAttachedMesh(): boolean
If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
Returns boolean
-
set updateGizmoRotationToMatchAttachedMesh(value: boolean): void
If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true) NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation
Parameters
- value: boolean
Returns void
update Scale
-
get updateScale(): boolean
When set, the gizmo will always appear the same size no matter where the camera is (default: true)
Returns boolean
-
set updateScale(value: boolean): void
When set, the gizmo will always appear the same size no matter where the camera is (default: true)
Parameters
- value: boolean
Returns void
Methods
dispose
-
Disposes of the camera gizmo
Returns void
set Custom Mesh
-
Disposes and replaces the current camera mesh in the gizmo with the specified mesh
Parameters
- mesh: Mesh
The mesh to replace the default mesh of the camera gizmo
Returns void
- mesh: Mesh
StaticGizmo Axis Pointer Observer
-
GizmoAxisPointerObserver(
gizmoLayer: UtilityLayerRenderer,
gizmoAxisCache: Map<Mesh, GizmoAxisCache>,
): Observer<PointerInfo>Subscribes to pointer up, down, and hover events. Used for responsive gizmos.
Parameters
- gizmoLayer: UtilityLayerRenderer
The utility layer the gizmo will be added to
- gizmoAxisCache: Map<Mesh, GizmoAxisCache>
Gizmo axis definition used for reactive gizmo UI
Returns Observer<PointerInfo>
pointerObserver
- gizmoLayer: UtilityLayerRenderer
Gizmo that enables viewing a camera