Mesh

Types

struct Mesh A 32 bit handle.

struct VertexData A packed 32-byte per vertex format.

typedef struct VertexData{
  float position[3];
  uint8_t color[4]; 
  uint16_t uv[2];
  uint8_t normal[4];
  uint8_t skin_index[4];
  uint8_t skin_weight[4]; 
}VertexData;

Creation & Destruction

Mesh_Create( void ) : Mesh Creates a new empty mesh.

Mesh_Init(
const VertexData* vertices,
uint32_t vertex_count,
const uint16_t* indices,
uint32_t index_count ) : Mesh Creates a new mesh from the vertices and indices specified.

Mesh_Destroy( Mesh mesh ) : void
Destroys the mesh and associated vertex buffers. The buffer memory may not be available for up to 3 frames.

Functions

Mesh_Exists( Mesh mesh ) : bool
Returns true if the Mesh is non-null.

Mesh_VertexCount( Mesh mesh ) : uint32_t
Returns the number of vertices in this mesh. Returns 0 if the mesh is null or there is no data.

Mesh_IndexCount( Mesh mesh ) : uint32_t
Returns the number of indices in this mesh. Returns 0 if the mesh is null or there is no data.

Mesh_Filescale( Mesh mesh ) : float
Returns the filescale of this mesh. Returns 1.0 if the mesh is null.

Methods

Mesh_SetFilescale( Mesh mesh, float val ) : void
Set the filescale of this mesh.