Table of Contents

Class AxialGizmoBase

Namespace
Stride.CommunityToolkit.Rendering.Gizmos
Assembly
Stride.CommunityToolkit.dll

Represents a base class for creating an Axial Gizmo, which visually represents 3D axes in the scene. The Gizmo consists of three axes (X, Y, Z), each represented by a different color (Red, Green, Blue). This class provides the foundational functionality for rendering and configuring the visual aspects of the Gizmo.

public abstract class AxialGizmoBase
Inheritance
AxialGizmoBase
Derived

Constructors

AxialGizmoBase(GraphicsDevice, Color?, Color?, Color?)

Initializes a new instance of the AxialGizmoBase class with optional custom axis colors.

protected AxialGizmoBase(GraphicsDevice graphicsDevice, Color? redColor = null, Color? greenColor = null, Color? blueColor = null)

Parameters

graphicsDevice GraphicsDevice

The graphics device used to render the Gizmo.

redColor Color?

Optional custom color for the X-axis (Red). If null, a default red color is used.

greenColor Color?

Optional custom color for the Y-axis (Green). If null, a default green color is used.

blueColor Color?

Optional custom color for the Z-axis (Blue). If null, a default blue color is used.

Properties

BlueUniformMaterial

Gets the material for the Z-axis (Blue) of the Gizmo.

protected Material? BlueUniformMaterial { get; }

Property Value

Material

DefaultOriginMaterial

Gets the default material for the Gizmo's origin, typically represented in white.

protected Material? DefaultOriginMaterial { get; }

Property Value

Material

GraphicsDevice

Gets the graphics device used for rendering the Gizmo.

protected GraphicsDevice GraphicsDevice { get; }

Property Value

GraphicsDevice

GreenUniformMaterial

Gets the material for the Y-axis (Green) of the Gizmo.

protected Material? GreenUniformMaterial { get; }

Property Value

Material

RedUniformMaterial

Gets the material for the X-axis (Red) of the Gizmo.

protected Material? RedUniformMaterial { get; }

Property Value

Material

RenderGroup

Gets or sets the render group of the Gizmo. This determines which render group the Gizmo will belong to.

public RenderGroup RenderGroup { get; protected set; }

Property Value

RenderGroup

Methods

CreateEmissiveColorMaterial(Color)

Creates a material with an emissive color to visually represent the Gizmo's axes.

protected Material CreateEmissiveColorMaterial(Color color)

Parameters

color Color

The color of the material.

Returns

Material

A Material instance with the specified emissive color.

CreateMaterials()

Creates the origin and axis materials. A derived gizmo calls this before it builds its entities.

protected void CreateMaterials()

Exceptions

InvalidOperationException

Thrown if the GraphicsDevice is not initialized.

GetBlueColor()

Retrieves the color for the Z-axis (Blue). Returns the default blue color if none is specified.

protected Color GetBlueColor()

Returns

Color

The color for the Z-axis.

GetGreenColor()

Retrieves the color for the Y-axis (Green). Returns the default green color if none is specified.

protected Color GetGreenColor()

Returns

Color

The color for the Y-axis.

GetRedColor()

Retrieves the color for the X-axis (Red). Returns the default red color if none is specified.

protected Color GetRedColor()

Returns

Color

The color for the X-axis.