class Mesh

in global :: Sandbox

A mesh is a basic version of a , 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 via the class.


public bool IsValid { get; }

🤡 Doc inheritance is not yet supported.

No summary.

public MeshPrimitiveType PrimitiveType { set; }

Sets the primitive type for this mesh.

public Material Material { set; }

Sets material for this mesh.

public BBox Bounds { set; }

Sets AABB bounds for this mesh.

public float UvDensity { set; }

Used to calculate texture size for texture streaming.

public void SetVertexRange( int start, int count )

Set how many vertices this mesh draws (if there's no index buffer)

public void SetIndexRange( int start, int count )

Set how many indices this mesh draws

public void CreateBuffers( VertexBuffer vb, bool calculateBounds = True )

Create vertex and index buffers.

  • vb Input vertex buffer. If it is indexed (), then index buffer will also be created.
  • calculateBounds Whether to recalculate bounds from the vertex buffer.

public bool HasIndexBuffer { get; }

Whether this mesh has an index buffer.

public int IndexCount { get; }

Number of indices this mesh has.

public void SetIndexBufferSize( int elementCount )

Resize the index buffer.

public void LockIndexBuffer( Mesh.IndexBufferLockHandler handler )

Lock all the memory in this buffer so you can write to it

public void LockIndexBuffer( int elementCount, Mesh.IndexBufferLockHandler handler )

Lock a specific amount of the memory in this buffer so you can write to it

public void LockIndexBuffer( int elementOffset, int elementCount, Mesh.IndexBufferLockHandler handler )

Lock a region of memory in this buffer so you can write to it

public bool HasVertexBuffer { get; }

Whether this mesh has a vertex buffer.

public int VertexCount { get; }

Number of vertices this mesh has.

public void SetVertexBufferSize( int elementCount )

Resize the vertex buffer

public Mesh( Material material, MeshPrimitiveType primType = Triangles )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public void LockVertexBuffer( int elementOffset, int elementCount, Mesh.VertexBufferLockHandler<T> handler )

😔 No documentation found.

public void LockVertexBuffer( int elementCount, Mesh.VertexBufferLockHandler<T> handler )

😔 No documentation found.

public void LockVertexBuffer( Mesh.VertexBufferLockHandler<T> handler )

😔 No documentation found.

public void SetVertexBufferData( Span<T> data, int elementOffset = 0 )

😔 No documentation found.

public void CreateVertexBuffer( int vertexCount, VertexAttribute[] layout, Span<T> data = null )

😔 No documentation found.

public void CreateIndexBuffer( int indexCount, List<int> data )

😔 No documentation found.

public void CreateVertexBuffer( int vertexCount, VertexAttribute[] layout, List<T> data )

😔 No documentation found.

public void CreateVertexBuffer( VertexAttribute[] layout )

😔 No documentation found.

public Mesh( )

😔 No documentation found.

public static Span<int> TriangulatePolygon( Span<Vector3> vertices )

😔 No documentation found.

public void CreateIndexBuffer( )

😔 No documentation found.

public void SetIndexBufferData( Span<int> data, int elementOffset = 0 )

😔 No documentation found.

public void SetIndexBufferData( List<int> data, int elementOffset = 0 )

😔 No documentation found.

public void SetVertexBufferData( List<T> data, int elementOffset = 0 )

😔 No documentation found.

public void CreateIndexBuffer( int indexCount, Span<int> data = null )

😔 No documentation found.