Class IndexExtensions
- Namespace
- Stride.Extensions
- Assembly
- Stride.Rendering.dll
public static class IndexExtensions
- Inheritance
-
IndexExtensions
Methods
CompactIndexBuffer(MeshDraw)
Compacts the index buffer from 32 bits to 16 bits per index, if possible.
public static bool CompactIndexBuffer(this MeshDraw meshData)
Parameters
meshData
MeshDrawThe mesh data.
Returns
- bool
Returns true if index buffer was actually compacted.
Exceptions
GenerateIndexBuffer(MeshDraw, VertexDeclaration)
Generates an index buffer for this mesh data.
public static void GenerateIndexBuffer(this MeshDraw meshData, VertexDeclaration declaration)
Parameters
meshData
MeshDrawThe mesh data.
declaration
VertexDeclarationThe final vertex declaration
GenerateIndexBufferAEN(IndexBufferBinding, VertexBufferBinding, CommandList)
public static int[] GenerateIndexBufferAEN(IndexBufferBinding indexBuffer, VertexBufferBinding vertexBuffer, CommandList commandList = null)
Parameters
indexBuffer
IndexBufferBindingvertexBuffer
VertexBufferBindingcommandList
CommandList
Returns
- int[]
GenerateIndexBufferAEN(MeshDraw)
Generates the index buffer with dominant edge and vertex information. Each triangle gets its indices expanded to 12 control points, with 0 to 2 being original triangle, 3 to 8 being dominant edges and 9 to 11 being dominant vertices.
public static void GenerateIndexBufferAEN(this MeshDraw meshData)
Parameters
meshData
MeshDrawThe mesh data.
GenerateIndexMapping(VertexBufferBinding, CommandList, params string[])
Generates an index mapping with the specified vertex elements. If no vertex elements are specified, use the whole vertex.
public static IndexExtensions.IndexMappingResult GenerateIndexMapping(this VertexBufferBinding vertexBufferBinding, CommandList commandList, params string[] usages)
Parameters
vertexBufferBinding
VertexBufferBindingThe vertex buffer binding.
commandList
CommandListusages
string[]The vertex element usages to consider.
Returns
GetReversedWindingOrder(MeshDraw, out byte[])
Reverses the winding order of an index buffer. Assumes it is stored in TriangleList format. Works on both 32 and 16 bit indices.
public static bool GetReversedWindingOrder(this MeshDraw meshData, out byte[] outBytes)
Parameters
meshData
MeshDrawoutBytes
byte[]Output of the operation, the indices matching the reversed winding order
Returns
RemoveIndexBuffer(MeshDraw)
Expand vertices using index buffer (if existing), and remove it.
public static void RemoveIndexBuffer(this MeshDraw meshData)
Parameters
meshData
MeshDrawThe mesh data.
ReverseWindingOrder(MeshDraw)
Reverses the winding order of an index buffer. Assumes it is stored in TriangleList format. Works on both 32 and 16 bit indices.
public static bool ReverseWindingOrder(this MeshDraw meshData)
Parameters
meshData
MeshDraw