API ReferenceSandbox
VertexBufferclass
object→VertexBuffer
Constructors1
Showing 1 constructors
public VertexBuffer()
No results match this filter.
Methods7
Showing 7 methods
public void Add(Sandbox.Vertex v)
Add a vertex
| Parameter | Type | Description |
|---|---|---|
| v | Vertex | — |
Returns:
void—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
| Parameter | Type | Description |
|---|---|---|
| i | int | — |
Returns:
void—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.
| Parameter | Type | Description |
|---|---|---|
| i | int | — |
Returns:
void—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.
| Parameter | Type | Description |
|---|---|---|
| a | int | — |
| b | int | — |
| c | int | — |
Returns:
void—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`.
Returns:
void—public void Draw(Sandbox.Material material, Sandbox.RenderAttributes attributes = null)
Draw this mesh using Material
| Parameter | Type | Description |
|---|---|---|
| material | Material | — |
| attributes = null | RenderAttributes | — |
Returns:
void—public virtual void Init(bool useIndexBuffer)
Clear the buffer and set whether it will have indices.
| Parameter | Type | Description |
|---|---|---|
| useIndexBuffer | bool | Whether this buffer will have indices. Affects `Sandbox.VertexBuffer.Indexed`. |
Returns:
void—No results match this filter.
Properties1
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)`.
Returns:
bool—No results match this filter.