VertexBufferclass
Constructors1
Showing 1 constructors
public VertexBuffer()
No results match this filter.
Methods15
Showing 15 methods
public void AddCube(Vector3 center, Vector3 size, Rotation rot, Color32 color = null)
Add a cube to the vertex buffer. Will include indices if they're enabled.
| Parameter | Type | Description |
|---|---|---|
| center | Vector3 | — |
| size | Vector3 | — |
| rot | Rotation | — |
| color = null | Color32 | — |
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 | — |
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 | — |
void—Exceptions
| Exception | Condition |
|---|---|
InvalidOperationException | Thrown when `Sandbox.VertexBuffer.Indexed` is false. |
public void AddTriangle(Sandbox.Vertex a, Sandbox.Vertex b, Sandbox.Vertex c)
Add a triangle to the vertex buffer. Will include indices if they're enabled.
| Parameter | Type | Description |
|---|---|---|
| a | Vertex | — |
| b | Vertex | — |
| c | Vertex | — |
void—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 | — |
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`.
void—public void Draw(Sandbox.Material material, Sandbox.RenderAttributes attributes = null)
Draw this mesh using Material
| Parameter | Type | Description |
|---|---|---|
| material | Material | — |
| attributes = null | RenderAttributes | — |
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`. |
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)`.
bool—No results match this filter.