static class Gizmo

book_4_sparkGenerated
code_blocksInput

Description

The Gizmo class in the Sandbox namespace provides a set of static methods and properties for manipulating and interacting with 3D objects in a scene. It is designed to facilitate the creation and manipulation of gizmos, which are visual tools used in 3D environments to perform transformations such as translation, rotation, and scaling.

Members

Static Methods

Member NameSummary
EndInstanceEnds the current gizmo instance.
SelectAllows selection of gizmos with options for unselecting and multi-selecting.
ScopeCreates a scoped gizmo instance with various overloads for different transformations.
ObjectScopeCreates a scoped gizmo instance for a specific object and transform.
GetPositionOnPlaneCalculates the position on a plane given a ray and plane normal.
GetMouseDeltaGets the mouse movement delta in relation to a plane.
GetMouseDragCalculates the drag vector of the mouse on a plane.
GetMouseDistanceCalculates the distance of the mouse from a plane.
GetMouseDistanceDeltaCalculates the change in distance of the mouse from a plane.
SnapSnaps a vector or angle to a grid or increment.
NudgeNudges a vector in a specified direction based on rotation.

Static Properties

Member NameSummary
ControlHolds fully realized controls to manipulate some value.
DrawDraws a shape using the gizmo library.
WorldRepresents the scene world associated with the gizmo.
PreviousRayThe ray from the previous frame.
CurrentRayThe current ray being used by the gizmo.
RayDepthThe depth of the ray in the scene.
ControlModeThe current control mode of the gizmo.
TransformThe transform associated with the gizmo.
PathThe path associated with the gizmo.
ObjectThe object currently being manipulated by the gizmo.
CameraThe camera associated with the gizmo.
IsHoveredIndicates if the gizmo is currently hovered over.
IsSelectedIndicates if the gizmo is currently selected.
IsChildSelectedIndicates if a child of the gizmo is selected.
WasClickedIndicates if the gizmo was clicked.
HasSelectedIndicates if the gizmo has any selected elements.
HasHoveredIndicates if the gizmo has any hovered elements.
HasClickedIndicates if the gizmo has been clicked.
HasMouseFocusIndicates if the gizmo has mouse focus.
CursorPositionThe current cursor position, in screen space.
CursorMoveDeltaThe delta of cursor movement between this frame and last, in screen space.
CursorDragDeltaThe delta of cursor movement between last press and now, in screen space. If left mouse isn't down, will return CursorMoveDelta.
KeyboardModifiersThe current keyboard modifiers.
IsCtrlPressedIndicates if the Ctrl key is pressed.
IsShiftPressedIndicates if the Shift key is pressed.
IsAltPressedIndicates if the Alt key is pressed.
WasLeftMouseReleasedIndicates if the left mouse button was released.
IsLeftMouseDownIndicates if the left mouse button is down.
WasLeftMousePressedIndicates if the left mouse button was pressed.
WasRightMouseReleasedIndicates if the right mouse button was released.
IsRightMouseDownIndicates if the right mouse button is down.
WasRightMousePressedIndicates if the right mouse button was pressed.
IsDoubleClickedIndicates if the gizmo was double-clicked.
CameraTransformThe camera's transform in world space.
LocalCameraTransformThe camera's transform in local space.
IsPressedIndicates if the gizmo is pressed. Obsolete: Use Gizmo.Pressed.This
HasPressedIndicates if the gizmo has been pressed. Obsolete: Use Gizmo.Pressed.Any
PressRayThe ray used when the gizmo is pressed. Obsolete: Use Gizmo.Pressed.Ray
SettingsSettings related to the gizmo's scene.
HitboxAllows creating a gizmo hitbox which will be interactable using the mouse or VR controller.