Class AxialGizmoBase
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
graphicsDeviceGraphicsDeviceThe graphics device used to render the Gizmo.
redColorColor?Optional custom color for the X-axis (Red). If null, a default red color is used.
greenColorColor?Optional custom color for the Y-axis (Green). If null, a default green color is used.
blueColorColor?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
DefaultOriginMaterial
Gets the default material for the Gizmo's origin, typically represented in white.
protected Material? DefaultOriginMaterial { get; }
Property Value
GraphicsDevice
Gets the graphics device used for rendering the Gizmo.
protected GraphicsDevice GraphicsDevice { get; }
Property Value
GreenUniformMaterial
Gets the material for the Y-axis (Green) of the Gizmo.
protected Material? GreenUniformMaterial { get; }
Property Value
RedUniformMaterial
Gets the material for the X-axis (Red) of the Gizmo.
protected Material? RedUniformMaterial { get; }
Property Value
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
Methods
CreateEmissiveColorMaterial(Color)
Creates a material with an emissive color to visually represent the Gizmo's axes.
protected Material CreateEmissiveColorMaterial(Color color)
Parameters
colorColorThe color of the material.
Returns
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.