reckfellENGINE

EditorEntity3DGizmo

An instance of editor helper geometry for one Entity3D.

On this page
class EditorEntity3DGizmoReckfellSharpEditorInherits Entity3DGizmo

Contains lines, picking data and handles bound to an Entity3D. Usually created by EditorEntity3DGizmoPlugin; derive a separate class for per-object state or logic.

Clear old data during redraw and add geometry in local coordinates. A gizmo does not create a game mesh or physics collider.

Complete C# example.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

EditorEntity3DGizmoConstructor
# EditorEntity3DGizmo
C#
public EditorEntity3DGizmo();

Methods29

AddCollisionSegments2 overloads
# AddCollisionSegments · 1/2
C#
public void AddCollisionSegments(Vector3[] segments);

Add local segments for editor gizmo picking. This is picking geometry, not a game physics collider. Call during redraw.

Parameters
NameTypeDefault
segmentsVector3[]—
segments

Pairs of local segment endpoints.

# AddCollisionSegments · 2/2
C#
public void AddCollisionSegments(ReadOnlySpan<Vector3> segments);

Add local segments for editor gizmo picking. This is picking geometry, not a game physics collider. Call during redraw.

Parameters
NameTypeDefault
segmentsReadOnlySpan<Vector3>—
segments

Pairs of local segment endpoints.

AddCollisionTrianglesvoid
# AddCollisionTriangles
C#
public void AddCollisionTriangles(TriangleMesh triangles);

Adds collision triangles to the gizmo for picking. A TriangleMesh can be generated from a regular Mesh too. Call this method during EditorEntity3DGizmo._Redraw.

Parameters
NameTypeDefault
trianglesTriangleMesh—
AddHandles2 overloads
# AddHandles · 1/2
C#
public void AddHandles(Vector3[] handles, Material material, int[] ids, bool billboard = false, bool secondary = false);

Add interactive points only for a selected, editable gizmo. Implement update/commit callbacks to change properties; points alone do not change data.

Parameters
NameTypeDefault
handlesVector3[]—
materialMaterial—
idsint[]—
billboardboolfalse
secondaryboolfalse
handles

Handle positions in Entity3D local coordinates.

material

The material created by CreateHandleMaterial().

ids

Each handle ID: a nonempty array must match handles in length. An empty array uses indices.

billboard

The handle billboard setting.

secondary

Assign to the secondary set; callbacks receive the same flag.

# AddHandles · 2/2
C#
public void AddHandles(ReadOnlySpan<Vector3> handles, Material material, ReadOnlySpan<int> ids, bool billboard, bool secondary);

Add interactive points only for a selected, editable gizmo. Implement update/commit callbacks to change properties; points alone do not change data.

Parameters
NameTypeDefault
handlesReadOnlySpan<Vector3>—
materialMaterial—
idsReadOnlySpan<int>—
billboardbool—
secondarybool—
handles

Handle positions in Entity3D local coordinates.

material

The material created by CreateHandleMaterial().

ids

Each handle ID: a nonempty array must match handles in length. An empty array uses indices.

billboard

The handle billboard setting.

secondary

Assign to the secondary set; callbacks receive the same flag.

AddLines2 overloads
# AddLines · 1/2
C#
public void AddLines(Vector3[] lines, Material material, bool billboard = false, Color? modulate = default);

Add lines as pairs of local points. Call after Clear() during redraw. Lines alone do not create handles or physics collisions.

Parameters
NameTypeDefault
linesVector3[]—
materialMaterial—
billboardboolfalse
modulateColor?default
lines

Pairs of segment endpoints in Entity3D local coordinates.

material

The line material, usually from GetMaterial(name, gizmo).

billboard

Face lines toward the camera.

modulate

An additional color multiplier; white by default.

# AddLines · 2/2
C#
public void AddLines(ReadOnlySpan<Vector3> lines, Material material, bool billboard, Color? modulate);

Add lines as pairs of local points. Call after Clear() during redraw. Lines alone do not create handles or physics collisions.

Parameters
NameTypeDefault
linesReadOnlySpan<Vector3>—
materialMaterial—
billboardbool—
modulateColor?—
lines

Pairs of segment endpoints in Entity3D local coordinates.

material

The line material, usually from GetMaterial(name, gizmo).

billboard

Face lines toward the camera.

modulate

An additional color multiplier; white by default.

AddMeshvoid
# AddMesh
C#
public void AddMesh(Mesh mesh, Material material = null, Transform3D? transform = default, SkinReference skeleton = null);

Adds a mesh to the gizmo with the specified material, local transform and skeleton. Call this method during EditorEntity3DGizmo._Redraw.

Parameters
NameTypeDefault
meshMesh—
materialMaterialnull
transformTransform3D?default
skeletonSkinReferencenull
transform

If the parameter is null, then the default value is Transform3D.Identity.

AddUnscaledBillboardvoid
# AddUnscaledBillboard
C#
public void AddUnscaledBillboard(Material material, float defaultScale = 1f, Color? modulate = default);

Adds an unscaled billboard for visualization and selection. Call this method during EditorEntity3DGizmo._Redraw.

Parameters
NameTypeDefault
materialMaterial—
defaultScalefloat1f
modulateColor?default
modulate

If the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).

Clearvoid
# Clear
C#
public void Clear();

Clear accumulated gizmo geometry and picking data. Call at the beginning of redraw before adding lines and handles again. This does not delete the Entity.

GetEntity3DEntity3D
# GetEntity3D
C#
public Entity3D GetEntity3D();

Return the Entity3D bound to this gizmo instance. Added geometry uses its local coordinates.

Returns Entity3D

The associated Entity3D.

GetPluginEditorEntity3DGizmoPlugin
# GetPlugin
C#
public EditorEntity3DGizmoPlugin GetPlugin();

Return the serving handler. Use it to retrieve materials; do not dispose it while registered or in use.

Returns EditorEntity3DGizmoPlugin

This gizmo's handler; an unbound instance can return null.

GetSubgizmoSelectionint[]
# GetSubgizmoSelection
C#
public int[] GetSubgizmoSelection();

Returns a list of the currently selected subgizmos. Can be used to highlight selected elements during EditorEntity3DGizmo._Redraw.

Returns int[]
IsSelectedbool
# IsSelected
C#
public bool IsSelected();

Read editor gizmo selection state. This is neither Entity visibility nor a physics query.

Returns bool

true for a selected gizmo.

IsSubgizmoSelectedbool
# IsSubgizmoSelected
C#
public bool IsSubgizmoSelected(int id);

Returns true if the given subgizmo is currently selected. Can be used to highlight selected elements during EditorEntity3DGizmo._Redraw.

Parameters
NameTypeDefault
idint—
Returns bool
SetEntity3Dvoid
# SetEntity3D
C#
public void SetEntity3D(Entity node);

Sets the reference Entity3D node for the gizmo. node must inherit from Entity3D.

Parameters
NameTypeDefault
nodeEntity—
SetHiddenvoid
# SetHidden
C#
public void SetHidden(bool hidden);

Sets the gizmo's hidden state. If true, the gizmo will be hidden. If false, it will be shown.

Parameters
NameTypeDefault
hiddenbool—
_BeginHandleActionvoid
# _BeginHandleAction
C#
public virtual void _BeginHandleAction(int id, bool secondary);
Parameters
NameTypeDefault
idint—
secondarybool—
_CommitHandlevoid
# _CommitHandle
C#
public virtual void _CommitHandle(int id, bool secondary, Variant restore, bool cancel);

Override this method to commit a handle being edited (handles must have been previously added by EditorEntity3DGizmo.AddHandles). This usually means creating an UndoRedo action for the change, using the current handle value as "do" and the restore argument as "undo". If the cancel argument is true, the restore value should be directly set, without any UndoRedo action. The secondary argument is true when the committed handle is secondary (see EditorEntity3DGizmo.AddHandles for more information).

Parameters
NameTypeDefault
idint—
secondarybool—
restoreVariant—
cancelbool—
_CommitSubgizmosvoid
# _CommitSubgizmos
C#
public virtual void _CommitSubgizmos(int[] ids, Reckfell.Collections.Array<Transform3D> restores, bool cancel);

Override this method to commit a group of subgizmos being edited (see EditorEntity3DGizmo._SubgizmosIntersectRay and EditorEntity3DGizmo._SubgizmosIntersectFrustum). This usually means creating an UndoRedo action for the change, using the current transforms as "do" and the restores transforms as "undo". If the cancel argument is true, the restores transforms should be directly set, without any UndoRedo action.

Parameters
NameTypeDefault
idsint[]—
restoresReckfell.Collections.Array<Transform3D>—
cancelbool—
_GetHandleNamestring
# _GetHandleName
C#
public virtual string _GetHandleName(int id, bool secondary);

Override this method to return the name of an edited handle (handles must have been previously added by EditorEntity3DGizmo.AddHandles). Handles can be named for reference to the user when editing. The secondary argument is true when the requested handle is secondary (see EditorEntity3DGizmo.AddHandles for more information).

Parameters
NameTypeDefault
idint—
secondarybool—
Returns string
_GetHandleValueVariant
# _GetHandleValue
C#
public virtual Variant _GetHandleValue(int id, bool secondary);

Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the restore argument in EditorEntity3DGizmo._CommitHandle. The secondary argument is true when the requested handle is secondary (see EditorEntity3DGizmo.AddHandles for more information).

Parameters
NameTypeDefault
idint—
secondarybool—
Returns Variant
_GetSubgizmoTransformTransform3D
# _GetSubgizmoTransform
C#
public virtual Transform3D _GetSubgizmoTransform(int id);

Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the restore argument in EditorEntity3DGizmo._CommitSubgizmos.

Parameters
NameTypeDefault
idint—
Returns Transform3D
_IsHandleHighlightedbool
# _IsHandleHighlighted
C#
public virtual bool _IsHandleHighlighted(int id, bool secondary);

Override this method to return true whenever the given handle should be highlighted in the editor. The secondary argument is true when the requested handle is secondary (see EditorEntity3DGizmo.AddHandles for more information).

Parameters
NameTypeDefault
idint—
secondarybool—
Returns bool
_Redrawvoid
# _Redraw
C#
public virtual void _Redraw();

Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call EditorEntity3DGizmo.Clear at the beginning of this method and then add visual elements depending on the node's properties.

_SetHandlevoid
# _SetHandle
C#
public virtual void _SetHandle(int id, bool secondary, Camera3D camera, Vector2 point);

Override this method to update the node properties when the user drags a gizmo handle (previously added with EditorEntity3DGizmo.AddHandles). The provided point is the mouse position in screen coordinates and the camera can be used to convert it to raycasts. The secondary argument is true when the edited handle is secondary (see EditorEntity3DGizmo.AddHandles for more information).

Parameters
NameTypeDefault
idint—
secondarybool—
cameraCamera3D—
pointVector2—
_SetSubgizmoTransformvoid
# _SetSubgizmoTransform
C#
public virtual void _SetSubgizmoTransform(int id, Transform3D transform);

Override this method to update the node properties during subgizmo editing (see EditorEntity3DGizmo._SubgizmosIntersectRay and EditorEntity3DGizmo._SubgizmosIntersectFrustum). The transform is given in the Entity3D's local coordinate system.

Parameters
NameTypeDefault
idint—
transformTransform3D—
_SubgizmosIntersectFrustumint[]
# _SubgizmosIntersectFrustum
C#
public virtual int[] _SubgizmosIntersectFrustum(Camera3D camera, Reckfell.Collections.Array<Plane> frustum);

Override this method to allow selecting subgizmos using mouse drag box selection. Given a camera and a frustum, this method should return which subgizmos are contained within the frustum. The frustum argument consists of an array with all the Planes that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like EditorEntity3DGizmo._GetSubgizmoTransform or EditorEntity3DGizmo._CommitSubgizmos.

Parameters
NameTypeDefault
cameraCamera3D—
frustumReckfell.Collections.Array<Plane>—
Returns int[]
_SubgizmosIntersectRayint
# _SubgizmosIntersectRay
C#
public virtual int _SubgizmosIntersectRay(Camera3D camera, Vector2 point);

Override this method to allow selecting subgizmos using mouse clicks. Given a camera and a point in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like EditorEntity3DGizmo._GetSubgizmoTransform or EditorEntity3DGizmo._CommitSubgizmos.

Parameters
NameTypeDefault
cameraCamera3D—
pointVector2—
Returns int
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.