API ReferenceSandbox
public class Sandbox.VertexBuffer
Constructors
Showing 1 constructors
public VertexBuffer()
No results match this filter.
Methods
Showing 7 methods
public void Add(Sandbox.Vertex v)
Add a vertex
public void AddIndex(int i)
Add an index. This is relative to the top of the vertex buffer. So 0 is Vertex.Count., 1 is Vertex.Count -1
Exceptions
| Exception | Condition |
|---|---|
InvalidOperationException | Thrown when `Sandbox.VertexBuffer.Indexed` is false. |
public void AddRawIndex(int i)
Add an index. This is NOT relative to the top of the vertex buffer.
Exceptions
| Exception | Condition |
|---|---|
InvalidOperationException | Thrown when `Sandbox.VertexBuffer.Indexed` is false. |
public void AddTriangleIndex(int a, int b, int c)
Add a triangle by indices. This is relative to the top of the vertex buffer. So 0 is Vertex.Count.
Exceptions
| Exception | Condition |
|---|---|
InvalidOperationException | Thrown when `Sandbox.VertexBuffer.Indexed` is false. |
public virtual void Clear()
Clear all vertices and indices, and resets `Sandbox.VertexBuffer.Default`.
public void Draw(Sandbox.Material material, Sandbox.RenderAttributes attributes = null)
Draw this mesh using Material
Parameters
attributes: Default: null
public virtual void Init(bool useIndexBuffer)
Clear the buffer and set whether it will have indices.
Parameters
useIndexBuffer: Whether this buffer will have indices. Affects `Sandbox.VertexBuffer.Indexed`.
No results match this filter.
Properties
Showing 1 properties
public bool Sandbox.VertexBuffer.Indexed { get; set; }
Whether this vertex buffer has any indexes. This is set by `Sandbox.VertexBuffer.Init(System.Boolean)`.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.VertexBuffer |