Name | Description |
Cleanup | Completely reset the Geometry destroying all structures, buffers and settings. |
Declaration
|
BuildVertexData | Creates a linear vertex array based on the VertexConfig and vertex_array ready to be sent on the GPU. |
Declaration bool BuildVertexData( void ) Return Value
true if the Geometry vertex_array have been initialized and if the vertex_config is valid; else return false .
|
CalculateNormals | Calculate the vertex normals of the Geometry. |
Declaration bool CalculateNormals( const bool fast ) Parameters
fast : Choose between fast or accurate method.
Return Value
true if the Geometry vertex_array and if the base LOD elementdata of the Geometry are presents; else return false .
|
CalculateTangents | Calculate the vertex tangents of the Geometry. |
Declaration bool CalculateTangents( const bool fast )
fast : Choose between fast or accurate method.
Return Value
true if the Geometry vertex_array and if the base LOD elementdata of the Geometry are presents; else return false .
|
RestoreVertexArray | Reload back the Geometry vertex_array from cache. |
Declaration bool RestoreVertexArray( void ) Return Value
true if a valid VertexConfig exists; else return false .
|
GetVertexAt | Return a specific Vertex using its index as key. |
Declaration Vertex GetVertexAt( unsigned int index ) Parameters
index : The index of the Vertex to retrieve.
Return Value
A Vertex structure filled with data; else an empty Vertex structure if the vertex index is inexistent.
|
GetElementAt | Return the element value at a specific index location. |
Declaration int GetElementAt( unsigned int index ) Parameters
index : Index of the element to retrieve.
Return Value
The element index; else return -1 if the element index is inexistent.
|
GetPrimitive | Retrieve an existing PrimitiveData using its index as key. |
Declaration PrimitiveData GetPrimitive( unsigned short index ) Parameters
index : Index of the primitive to retrieve.
Return Value
A PrimitiveData filled with the values located by index ; else an empty PrimitiveData structure.
|
BuildReductionData | Generate an octree optimized for quick mesh simplification. |
Declaration int BuildReductionData( void ) Return Value
-1 if the reduction data already exists, -2 if the goemetry does not contain any vertex normals, 1 on success 0 in the case of an internal failure.
|
BuildReductionData | Destroy the reduction data from memory and optinonally on disk. |
Declaration void DestroyReductionData( bool external_data );
|
GenerateLODs | Generate level of details for the active Geometry. |
Declaration int GenerateLODs( Geometry *geometry, const unsigned char lod_count ); Parameters
lod_count : Number of level of details to generate.
Return Value
The actual amount of level of details generated (which may vary from the lod_count parameter if an LOD does not contain any triangles or if the tri. count is the same as the previous level).
|
GetLOD | Retrieve a specific LOD index based on the parameters received by the function. |
Declaration int GetLOD( Geometry *geometry, const mat4 model_matrix, const mat4 view_projection_matrix, const float lod_details ) Parameters
model_matrix : Current model transformation matrix of the object.
view_projection_matrix : The camera view projection matrix.
modelview_matrix : Camera modelview matrix.
lod_details : The details ratio to use to decide which LOD should be selected.
Return Value
The LOD index evaluated from the parameters received by the function; -1 if no LOD is available.
|
GetTriCount | Return the amount of a triangles used by a specific LOD. |
Declaration unsigned int GetTriCount( unsigned char lod_index ) Parameters
lod_index : Index of the LOD to retrieve the triangle count.
Return Value
The amount of triangles a certain level of details is using; 0 if the lod_index provided is out of range.
|
RemoveLOD | Remove a specific level of detail by index. |
Declaration bool RemoveLOD( unsigned short lod_index ) Parameters
lod_index : The index of the LOD detail to remove.
Return Value
true if the function successfully remove the LOD; false if the LOD at the index location doesn't exist.
|
Clear | Clear the vertex and element data of the active Geometry. |
Declaration
|
ClearLODs | Clear all LODs below the level pointed by index. |
Declaration bool ClearLODs( unsigned short lod_index ) Parameters
lod_index : The base LOD index to remove.
Return Value
true if the base index was valid and the lower level were deleted successfully; false if the index was invalid.
|
CalculateLocalBounds | Calculate and update the local bounds of the active Geometry. |
Declaration bool CalculateLocalBounds( void ) Return Value
true if updated successfully; false if no vertex data buffer or stride was previously set (see VertexConfig).
|
TransformPivot | Transform the Geometry pivot point. |
Declaration bool TransformPivot( const mat4 m, bool vertex_array ) Parameters
m : 4x4 matrix representing the transformation that have to be applied to the pivot.
vertex_array : Optionally also transform the Geometry vertex array so it revolves around the new pivot.
Return Value
true if updated successfully else return false if no vertex data buffer exists or no stride have been specified (see VertexConfig).
|
UpdateVertexConfig | Apply the changes made on the Geometry VertexConfig (vertex_config ). |
Declaration void UpdateVertexConfig( void ) - Warning
- To avoid unwanted behaviors (or even crashes) always apply the changes made on the Geometry
vertex_config right away before saving your project.
|
Raycast | Test the Geometry triangles against a ray. |
Declaration GeometryRay Raycast( unsigned short lod_index, const mat4 world_matrix, const vec3 ray_from, const vec3 ray_to, bool cull_face ) Parameters
lod_index : The LOD index to test against the ray.
world_matrix : The current transformation applied to the Geometry.
ray_from : The starting point of the ray.
ray_to : The ending point of the ray.
cull_face : Enable/disable back face culling.
Return Value
A GeometryRay structure containing the hit information (check the hit boolean variable to check if the ray actually hit the Geometry).
|
AllocVertexArray | Allocate a new vertex array. |
Declaration bool AllocVertexArray( unsigned short vertex_count, bool weights, bool point_sizes, bool normals, unsigned char uv_layer, bool tangents, unsigned char color_layer ) Parameters
vertex_count : The number of vertex the vertex array should contain.
weight : Specify that each vertex will have a weight associated to it.
point_sizes : Specify that the vertex array will contain point sizes for each vertex.
normals : Specify that each vertex require a normal.
uv_layer : The total amount of texture coordinate per vertex.
tangents : Specify that a space for the tangents should be allocated.
color_layer : Amount of color per vertex.
Return Value
true if allocated successfully; false if no vertex_count is provided or if an existing vertex_array is currently allocated.
|
AllocWeights | Manually allocate an array of vertex weights. |
Declaration bool AllocWeights( unsigned int weight_count ) Parameters
weight_count : The amount of weights that should be created.
Return Value
false if no weight_count is provided or if an existing weight_array is already allocated; else return true .
|
AllocVertexArray | Manually allocate an array of primitives. |
Declaration bool AllocPrimitives( unsigned short primitive_count, unsigned int element_count ) Parameters
primitive_count : The number of primitives.
element_count : Total amount of indices that primitive(s) should store.
Return Value
true if allocated successfully; false if no primitive_count is provided or if an existing primitive_array is already allocated.
|
SetPrimitive | Update an existing PrimitiveData using its index as key. |
Declaration bool SetPrimitive( unsigned short primitive_index, const char *name, const BeginMode mode, unsigned int indice_count ) Parameters
primitive_index : The primitive index to update.
name : A name to identify the primitive.
mode : The type of BeginMode to use for the active primitive.
indice_count : Number of indices the primitive should use to draw.
Return Value
true if the primitive_index is correct; else false .
|
Lock | Prevent the Geometry to be updated by another thread. |
Declaration
|
Unlock | Unlock a previously locked Geometry. |
Declaration
|
ApplyTransform | Apply a specific transformation to all Geometry vertex data. |
Declaration bool ApplyTransform( const mat4 m ) Parameters
|
BuildSubVertexData | Build a subset of the vertex data ready to be uploaded on the GPU. |
Declaration bool BuildSubVertexData( const unsigned int min_index, const unsigned int max_index ); Parameters
min_index : The index of the vertex to start the update.
max_index : The index of the vertex to identify the end of the update.
Return Value
false if Geometry vertex array is uninitialized or if the min_index or max_index if out of range; else return true .
|
The precision qualifier used throughout the API.
Vertex properties.
Weight properties.
A primitive is a set specific set of element indices that are delimited by a single Material within the Geometry. The following data structure represents the properties that can be set for each primitive.