Class ImmediateDebugPrimitives
- Namespace
- Stride.CommunityToolkit.DebugShapes
- Assembly
- Stride.CommunityToolkit.DebugShapes.dll
Provides methods for generating geometric primitives for debug visualization.
public static class ImmediateDebugPrimitives
- Inheritance
-
ImmediateDebugPrimitives
Remarks
This type is the public entry point; the heavier mesh generation lives in Stride.CommunityToolkit.DebugShapes.CircularDebugPrimitives (circle, cylinder, cone) and Stride.CommunityToolkit.DebugShapes.SphericalDebugPrimitives (sphere, capsule), with the shared wireframe uv constants in Stride.CommunityToolkit.DebugShapes.DebugPrimitiveUv.
Methods
CopyFromGeometricPrimitive(GeometricMeshData<VertexPositionNormalTexture>, ref VertexPositionTexture[], ref int[])
Copies vertex positions and texture coordinates from a geometric primitive to arrays for rendering.
public static void CopyFromGeometricPrimitive(GeometricMeshData<VertexPositionNormalTexture> primitiveData, ref VertexPositionTexture[] vertices, ref int[] indices)
Parameters
primitiveDataGeometricMeshData<VertexPositionNormalTexture>The source geometric mesh data.
verticesVertexPositionTexture[]The destination vertex array.
indicesint[]The destination index array.
GenerateCapsule(float, float, int, int)
Generates a capsule mesh with optional UV splits.
public static (VertexPositionTexture[] Vertices, int[] Indices) GenerateCapsule(float length, float radius, int tessellations, int uvSplits = 4)
Parameters
lengthfloatThe length of the capsule (distance between hemispheres).
radiusfloatThe radius of the capsule.
tessellationsintThe number of segments used to approximate the capsule.
uvSplitsintThe number of UV splits for wireframe rendering.
Returns
- (VertexPositionTexture[] Vertices, int[] Indices)
Arrays of vertices and indices representing the capsule.
GenerateCircle(float, int, int, float, bool, int)
Generates a circle mesh with optional UV splits and offset.
public static (VertexPositionTexture[] Vertices, int[] Indices) GenerateCircle(float radius = 0.5, int tessellations = 16, int uvSplits = 0, float yOffset = 0, bool isFlipped = false, int uvOffset = 0)
Parameters
radiusfloatThe radius of the circle.
tessellationsintThe number of segments used to approximate the circle.
uvSplitsintThe number of UV splits for wireframe rendering.
yOffsetfloatVertical offset for the circle.
isFlippedboolWhether to flip the winding order.
uvOffsetintOffset for UV splits.
Returns
- (VertexPositionTexture[] Vertices, int[] Indices)
Arrays of vertices and indices representing the circle.
GenerateCone(float, float, int, int, int)
Generates a cone mesh with optional UV splits for the top and bottom.
public static (VertexPositionTexture[] Vertices, int[] Indices) GenerateCone(float height, float radius, int tessellations, int uvSplits = 4, int uvSplitsBottom = 0)
Parameters
heightfloatThe height of the cone.
radiusfloatThe radius of the base of the cone.
tessellationsintThe number of segments used to approximate the cone.
uvSplitsintThe number of UV splits for wireframe rendering (top).
uvSplitsBottomintThe number of UV splits for wireframe rendering (bottom).
Returns
- (VertexPositionTexture[] Vertices, int[] Indices)
Arrays of vertices and indices representing the cone.
GenerateCube(float)
Generates a cube mesh with the specified size.
public static (VertexPositionTexture[] Vertices, int[] Indices) GenerateCube(float size = 1)
Parameters
sizefloatThe size of the cube.
Returns
- (VertexPositionTexture[] Vertices, int[] Indices)
Arrays of vertices and indices representing the cube.
GenerateCylinder(float, float, int, int, int?)
Generates a cylinder mesh with optional UV splits and circle side splits.
public static (VertexPositionTexture[] Vertices, int[] Indices) GenerateCylinder(float height = 1, float radius = 0.5, int tessellations = 16, int uvSplits = 4, int? uvSidesForCircle = null)
Parameters
heightfloatThe height of the cylinder.
radiusfloatThe radius of the cylinder.
tessellationsintThe number of segments used to approximate the cylinder.
uvSplitsintThe number of UV splits for wireframe rendering.
uvSidesForCircleint?Number of sides for the circle caps (optional).
Returns
- (VertexPositionTexture[] Vertices, int[] Indices)
Arrays of vertices and indices representing the cylinder.
GenerateQuad(float, float)
Generates a quad (rectangle) mesh with the specified width and height.
public static (VertexPositionTexture[] Vertices, int[] Indices) GenerateQuad(float width, float height)
Parameters
Returns
- (VertexPositionTexture[] Vertices, int[] Indices)
Arrays of vertices and indices representing the quad.
GenerateSphere(float, int, int, int)
Generates a sphere mesh with optional UV splits and vertical offset.
public static (VertexPositionTexture[] Vertices, int[] Indices) GenerateSphere(float radius = 0.5, int tessellations = 16, int uvSplits = 4, int uvSplitOffsetVertical = 0)
Parameters
radiusfloatThe radius of the sphere.
tessellationsintThe number of segments used to approximate the sphere.
uvSplitsintThe number of UV splits for wireframe rendering.
uvSplitOffsetVerticalintVertical offset for UV splits.
Returns
- (VertexPositionTexture[] Vertices, int[] Indices)
Arrays of vertices and indices representing the sphere.
GetCircleVector(int, int)
Calculates a vector on the circumference of a circle in the XZ plane.
public static Vector3 GetCircleVector(int i, int tessellation)