Method GetVertexAndIndexCount
GetVertexAndIndexCount(int, int, bool, bool, Vector2, out int, out int)
Calculate the vertex and index count required for an extruded mesh. Use this method to allocate attribute and index buffers for use with Extrude.
Declaration
public static void GetVertexAndIndexCount(int sides, int segments, bool capped, bool closed, Vector2 range, out int vertexCount, out int indexCount)
Parameters
Type | Name | Description |
---|---|---|
int | sides | How many sides make up the radius of the mesh. |
int | segments | How many sections compose the length of the mesh. |
bool | capped | Whether the start and end of the mesh is filled. This setting is ignored when spline is closed. |
bool | closed | Whether the extruded mesh is closed or open. This can be separate from the Spline.Closed value. |
Vector2 | range | The section of the Spline to extrude. This value expects a normalized interpolation start and end. I.e., [0,1] is the entire Spline, whereas [.5, 1] is the last half of the Spline. |
int | vertexCount | The number of vertices required for an extruded mesh using the provided settings. |
int | indexCount | The number of indices required for an extruded mesh using the provided settings. |