Table of Contents

Class GridDiagnosticGizmoDrawer

Namespace
GridForge.Utility

Converts GridForge diagnostic geometry into Unity gizmo primitives.

public static class GridDiagnosticGizmoDrawer
Inheritance
GridDiagnosticGizmoDrawer
Inherited Members

Methods

CreatePhysicalCell(GridWorld, VoxelGrid, Voxel)

Creates a physical-cell diagnostic descriptor for a voxel.

public static GridDiagnosticCell CreatePhysicalCell(GridWorld world, VoxelGrid grid, Voxel voxel)

Parameters

world GridWorld

The owning world.

grid VoxelGrid

The owning grid.

voxel Voxel

The voxel to describe.

Returns

GridDiagnosticCell

The physical-cell descriptor.

DrawWireCell(in GridDiagnosticCell, Color)

Draws a diagnostic cell as a Unity wire gizmo.

public static void DrawWireCell(in GridDiagnosticCell cell, Color color)

Parameters

cell GridDiagnosticCell

The diagnostic cell.

color Color

The gizmo color.

GetEdgeCount(in GridDiagnosticCell)

Gets the edge count required to draw a diagnostic cell.

public static int GetEdgeCount(in GridDiagnosticCell cell)

Parameters

cell GridDiagnosticCell

The diagnostic cell.

Returns

int

The required edge count.

GetVertexCount(in GridDiagnosticCell)

Gets the vertex count required to draw a diagnostic cell.

public static int GetVertexCount(in GridDiagnosticCell cell)

Parameters

cell GridDiagnosticCell

The diagnostic cell.

Returns

int

The required vertex count.

WriteUnityVertices(in GridDiagnosticCell, Span<Vector3>)

Writes the diagnostic cell geometry as Unity vertices.

public static int WriteUnityVertices(in GridDiagnosticCell cell, Span<Vector3> vertices)

Parameters

cell GridDiagnosticCell

The diagnostic cell.

vertices Span<Vector3>

The destination span.

Returns

int

The number of vertices written, or zero when the destination is too small.