public class Sandbox.Mesh
A mesh is a basic version of a `Sandbox.Model`, containing a set of vertices and indices which make up faces that make up a shape. A set of meshes can be used to create a `Sandbox.Model` via the `Sandbox.ModelBuilder` class.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 3 constructors
No results match this filter.
Methods
Showing 25 methods
public void CreateBuffers(Sandbox.VertexBuffer vb, bool calculateBounds = True)
Create vertex and index buffers.
Parameters
vb: Input vertex buffer. If it is indexed (`Sandbox.VertexBuffer.Indexed`), then index buffer will also be created.calculateBounds: Whether to recalculate bounds from the vertex buffer. Default: True
protected virtual override void Finalize()
public void SetIndexBufferSize(int elementCount)
Resize the index buffer.
public void SetIndexRange(int start, int count)
Set how many indices this mesh draws
public void SetVertexBufferSize(int elementCount)
Resize the vertex buffer
public void SetVertexRange(int start, int count)
Set how many vertices this mesh draws (if there's no index buffer)
public static System.Span`1<int> TriangulatePolygon(System.Span`1<Vector3> vertices)
No results match this filter.
Properties
Showing 9 properties
public bool Sandbox.Mesh.HasIndexBuffer { get; set; }
Whether this mesh has an index buffer.
public bool Sandbox.Mesh.HasVertexBuffer { get; set; }
Whether this mesh has a vertex buffer.
public int Sandbox.Mesh.IndexCount { get; set; }
Number of indices this mesh has.
public virtual sealed bool Sandbox.Mesh.IsValid { get; set; }
public Sandbox.MeshPrimitiveType Sandbox.Mesh.PrimitiveType { get; set; }
Sets the primitive type for this mesh.
public float Sandbox.Mesh.UvDensity { get; set; }
Used to calculate texture size for texture streaming.
public int Sandbox.Mesh.VertexCount { get; set; }
Number of vertices this mesh has.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Mesh |