beastapi/beastmesh.h File Reference

#include "beastapitypes.h"

File Description

The api for specifying meshes in beast.

Functions

ILBStatus ILBAddColorData (ILBMeshHandle mesh, const ILBLinearRGBA *colorData, int32 vertexCount)
 
ILBStatus ILBAddTangentData (ILBMeshHandle mesh, const ILBVec3 *tangentData, const ILBVec3 *bitangentData, int32 vertexCount)
 
ILBStatus ILBAddTriangleData (ILBMeshHandle mesh, const int32 *indexData, int32 indexCount)
 
ILBStatus ILBAddUVData (ILBMeshHandle mesh, const ILBVec2 *uvData, int32 vertexCount)
 
ILBStatus ILBAddVertexData (ILBMeshHandle mesh, const ILBVec3 *positionData, const ILBVec3 *normalData, int32 vertexCount)
 
ILBStatus ILBBeginColorLayer (ILBMeshHandle mesh, ILBConstString layerName)
 
ILBStatus ILBBeginMaterialGroup (ILBMeshHandle mesh, ILBConstString materialName)
 
ILBStatus ILBBeginMesh (ILBManagerHandle beastManager, ILBConstString uniqueName, ILBMeshHandle *targetMesh)
 
ILBStatus ILBBeginTangents (ILBMeshHandle mesh)
 
ILBStatus ILBBeginUVLayer (ILBMeshHandle mesh, ILBConstString layerName)
 
ILBStatus ILBEndColorLayer (ILBMeshHandle mesh)
 
ILBStatus ILBEndMaterialGroup (ILBMeshHandle mesh)
 
ILBStatus ILBEndMesh (ILBMeshHandle mesh)
 
ILBStatus ILBEndTangents (ILBMeshHandle mesh)
 
ILBStatus ILBEndUVLayer (ILBMeshHandle mesh)
 
ILBStatus ILBFindMesh (ILBManagerHandle beastManager, ILBConstString uniqueName, ILBMeshHandle *target)
 

Function Documentation

ILBStatus ILBAddColorData ( ILBMeshHandle  mesh,
const ILBLinearRGBA colorData,
int32  vertexCount 
)

Add color data to the active color set.

Parameters
meshthe mesh to add color data to.
colorDataa pointer to an array of color data.
vertexCountthe number of colors in the array
Returns
The result of the operation.
+ Examples:
ILBStatus ILBAddTangentData ( ILBMeshHandle  mesh,
const ILBVec3 tangentData,
const ILBVec3 bitangentData,
int32  vertexCount 
)

Adds a batch of tangents and bitangents (binormals) to a mesh.

It may be called multiple times, but the total number of added tangents/bitangents may never be more than there are vertices in the mesh.

Parameters
meshthe mesh to add tangent data on.
tangentDataan array of tangents to add.
bitangentDataan array of bitangents to add.
vertexCountthe number of tangents/bitangents to add.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBAddTriangleData ( ILBMeshHandle  mesh,
const int32 *  indexData,
int32  indexCount 
)

Add triangles to a material group.

The indices refers to the vertices added with AddVertexData. The triangles should be defined so the objects outside sees it as counter clock wise to make sure the outside is visible if rendering them single sided.

Parameters
meshthe mesh on which to add the triangles to
indexDatathe indices of the triangles to add
indexCountthe total index count. Must be a multiply of 3 (i.e each batch must end in a complete triangle)
Returns
The result of the operation.
+ Examples:
ILBStatus ILBAddUVData ( ILBMeshHandle  mesh,
const ILBVec2 uvData,
int32  vertexCount 
)

Adds a batch of UV coordinates to a mesh.

It may be called multiple times, but the total number of add UV's may never be more than there are vertices in the mesh.

Parameters
meshthe mesh to add UV data on.
uvDataan array of UV coordinates to add to the UV layer
vertexCountthe number of UV coordinates in the uvData array.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBAddVertexData ( ILBMeshHandle  mesh,
const ILBVec3 positionData,
const ILBVec3 normalData,
int32  vertexCount 
)

Adds a chunk of vertex data to a mesh.

This can be called multiple times to keep temporary buffer bounded.

Parameters
meshthe mesh to add vertices to.
positionDataa pointer to an array of vertex positions
normalDataa pointer to an array of vertex normals
vertexCountthe number of positions/normals specified in this call. Behavior is undefined if positionData or normalsData contains less than vertexCount positions/normals
Returns
The result of the operation.
+ Examples:
ILBStatus ILBBeginColorLayer ( ILBMeshHandle  mesh,
ILBConstString  layerName 
)

Creates a new color layer.


Parameters
meshthe mesh to add the color layer to
layerNamethe name of the layer, must be unique.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBBeginMaterialGroup ( ILBMeshHandle  mesh,
ILBConstString  materialName 
)

Begins a material group.

Parameters
meshthe mesh to add a material group to
materialNamename of the default material on this group
Returns
The result of the operation.
+ Examples:
ILBStatus ILBBeginMesh ( ILBManagerHandle  beastManager,
ILBConstString  uniqueName,
ILBMeshHandle targetMesh 
)

Begins creation of a mesh.

Parameters
beastManagerthe beast manager this mesh will be associated with
uniqueNamea name that must be unique within the scene. Used to look it up in the cache.
targetMesha pointer to a Beast mesh object that will receive the created object
Returns
The result of the operation.
+ Examples:
ILBStatus ILBBeginTangents ( ILBMeshHandle  mesh)

Begins adding tangents and bitangents to the mesh.


Use ILBAddTangentData to add tangent and bitangent data.

Parameters
meshthe mesh to add tangent data to. Must not be finalized yet.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBBeginUVLayer ( ILBMeshHandle  mesh,
ILBConstString  layerName 
)

Creates a new UV layer.


Use AddUVData to add UV coordinates.

Parameters
meshthe mesh to add the UV layer to. Must not be finalized yet.
layerNamethe UV layer name. Must be unique within the mesh
Returns
The result of the operation.
+ Examples:
ILBStatus ILBEndColorLayer ( ILBMeshHandle  mesh)

Finalizes a color layer.

The total number of added colors must be the same as the vertex count in the mesh.

Parameters
meshthe mesh to finalize the color layer on.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBEndMaterialGroup ( ILBMeshHandle  mesh)

End a material group.

Parameters
meshthe mesh to end the material group on
Returns
The result of the operation.
+ Examples:
ILBStatus ILBEndMesh ( ILBMeshHandle  mesh)

Finalizes a mesh.


After this call, it's possible to create instances from the mesh.
Will fail if any material group, uvLayer or colorLayer is unfinished

Parameters
meshthe mesh to finalize
Returns
The result of the operation.
+ Examples:
ILBStatus ILBEndTangents ( ILBMeshHandle  mesh)

Ends adding tangent data to the mesh.


Will fail if not the current number of tangents is the same as the number of vertices in the mesh.

Parameters
meshthe mesh to finalize the tangent data on.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBEndUVLayer ( ILBMeshHandle  mesh)

Ends the UV layer currently being created.


Will fail if not the current number of UV's is the same as the number of vertices in the mesh.

Parameters
meshthe mesh to finalize the UV layer on.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBFindMesh ( ILBManagerHandle  beastManager,
ILBConstString  uniqueName,
ILBMeshHandle target 
)

Finds a cached mesh.

Parameters
beastManagerthe beast manager to check whether the mesh is available in
uniqueNamethe unique name for mesh.
targetthe mesh handle to store the mesh in
Returns
The result of the operation.
ILB_ST_SUCCESS if the mesh is available ILB_ST_UNKNOWN_OBJECT if the mesh is not in the cache
+ Examples:

Go to the source code of this file.