fastest 3D software for linux

Linux 3D
interactive ray-tracing
[1 introduction] [2 overview] [3 reference] [4 GUI]

Index

 E3dVertexGeometry_VertexAttributeAdd
 E3dVertexGeometry_VertexAttributeDelByIndex
 E3dVertexGeometry_VerticesFree
 E3dVertices_New
 E3dVertices_Add
 E3dVertexAttribute_Add
 E3dMesh_VertexAttributeDel
 E3dMesh_VerticesFree
 E3dMesh_NumOfSelectedVertices
 E3dMesh_FilterVertices
 E3dMesh_VerticesRemap
 E3dMesh_VertexGetConnectedVertices
 E3dMesh_VertexGetEdges
 E3dMesh_GetVertexLinksNew
 E3dEdges_New
 E3dEdges_Sort
 E3dMesh_EdgesNew
 E3dMesh_EdgesAdd
 E3dMesh_EdgesFree
 E3dMesh_EdgesSorted
 E3dMesh_EdgesSort
 E3dMesh_CreateWingedEdgesFromEdges
 E3dMesh_CreateEdgesFromPolygons
 E3dMesh_GetEdgeNormals
 E3dMesh_EdgeGetPolygons
 E3dMesh_NumOfSelectedEdges
 E3dMesh_NumOfVisibleEdges
 E3dMesh_EdgeFlagsUpdate
 E3dMesh_PolyGroupsEdgesFromMeshEdges
 E3dMesh_AppendPolyGroup
 E3dMesh_PolyGroupAdd
 E3dMesh_PolyGroupDel
 E3dMesh_ChangePolygonFlags
 E3dMesh_PolyGroupAddTriangleStrip
 E3dMesh_PolyGroupAddTriangleStrips
 E3dMesh_RecomputePolygonNormals
 E3dMesh_RecomputeNormals
 E3dMesh_EdgesAndPolyGroupsRemapVertexIndices
 E3dMesh_NumOfSelectedPolygons
 E3dMesh_GetBoundingBox
 E3dMesh_GetTransformedBoundingBox
 E3dMesh_FreeCaches
 E3dMesh_FromBBox

E3dVertexGeometry_VertexAttributeAdd

Add a new attribute to the VertexNodes of a PolyGroup's primitives

Syntax
int E3dVertexGeometry_VertexAttributeAdd(E3dVertexGeometry* PVertexGeometry, const char* PSemantic, const char* PName, const uint16_t PType, const EIndex PCount, EResource** PAttrRet)

Arguments
PMesh Pointer to the Mesh PSemantic The semantic (meaning) string of the new attribute PName The name of this attribute (there may be multiple attributes with the same semantic, but a different name) PType The type of the values. E.g. EResFLOAT32 PCount Number of values in this attribute. E.g. 4 float values (PType = EResFLOAT32 and PCount = 4) PAttrRet If not NULL, return a pointer to the new attribute here
Description
Adds a vertex attribute, such as normals, or texture coordinates, to a PolyGroup.
PIndex = -1 means: do not check whether this component already exists.
PSemantic is a string, such as E3dVtxAttribute_Normal, E3dVtxAttribute_Color, E3dVtxAttribute_ST etc.

Return value
E_SUCCESS if all went well, or an error code

See also
E3dVertexAttribute_Add, E3dMes_VertexAttributeDel, Return, value, E_SUCCESS, if, all, went, well, or, an, error, code

E3dVertexGeometry_VertexAttributeDelByIndex

Remove a component from the Vertices of a Mesh's Vertices

Syntax
int E3dVertexGeometry_VertexAttributeDelByIndex(E3dVertexGeometry* PVertexGeometry, const EIndex PIndex)

Arguments
PMesh Pointer to the Mesh PIndex Index of the attribute
Description
Removes a vertex attribute from a Mesh.


Return value
E_SUCCESS if all went well, or an error code

See also
E3dVertexGeometry_VertexAttributeAdd, Return, value, E_SUCCESS, if, all, went, well, or, an, error, code

E3dVertexGeometry_VerticesFree

Free Vertices of a VertexGeometry

Syntax
void E3dVertexGeometry_VerticesFree(E3dVertexGeometry* PVertexGeometry)

Argument
PVertexGeometry Pointer to the VertexGeometry
Description
Frees the Vertex array of a VertexGeometry.

Return value
None.

E3dVertices_New

Allocate memory for an array of Vertices

Syntax
E3dVertex* E3dVertices_New(const E3dVertexSize PVertexSize, const EIndex PNVertices, const EBool PInitialize)

Arguments
PNumOfVertices Number of Vertices to allocate PVertexSize The size of a Vertex in bytes PInitialize If TRUE, initialize the Vertex Flags via E3dM_VertexInit
Description
Allocates memory for the specified number of Vertices.

Return value
A pointer to the allocated array, or NULL in case of an error.

See also
E3dMesh_VerticesFree, E3dVertices_Free

E3dVertices_Add

Add Vertices to an array

Syntax
E3dVertex* E3dVertices_Add(E3dVertex* PVertices, const E3dVertexSize PVertexSize, const EIndex POldNumOfVertices, EIndex PNumOfNewVertices, const EBool PInitialize)

Arguments
PVertices Pointer to the array POldNumOfVertices Number of Vertices already in the array PNumOfNewVertices Number of Vertices to add PInitialize Initialize the Vertex array
Description
Allocates memory for the specified number of Vertices.

Return value
A pointer to the allocated array, or NULL in case of an error.

See also
E3dMesh_VerticesFree

E3dVertexAttribute_Add

Add a Vertex attribute to a list

Syntax
int E3dVertexAttribute_Add(EResourceList* PList, const char* PSemantic, const char* PName, const uint16_t PType, const EIndex PCount, EResource** PVARet)

Arguments
PList Pointer to the list PSemantic The semantic (meaning) string of the new attribute PName The name of this attribute (there may be multiple attributes with the same semantic, but a different name) PType The type of the values. E.g. EResFLOAT32 PCount Number of values in this attribute. E.g. 4 float values (PType = EResFLOAT32 and PCount = 4) PVARet Pointer to return the new attribute
Description
Adds a vertex attribute, such as deformer weight. The most common use is adding a vertex attribute to a Mesh. For example: E3dVertexAttribute_Add(&LMesh->VertexAttributes, _WeightSemanticString, EResFLOAT32, "CustomDeformerWeight"); PSemantic is not copied (to allow for pointing to constant strings), so caller should not free it. PName is copied.

Return value
E_SUCCESS if successful, E_NOTHING_TO_DO if the VertexAttribute already exists

See also
E3dVertexGeometry_VertexAttributeAdd

E3dMesh_VertexAttributeDel

Remove a component from the Vertices of a Mesh's Vertices

Syntax
int E3dMesh_VertexAttributeDel(E3dMesh* PMesh, const char* PSemantic, const EIndex PIndex)

Arguments
PMesh Pointer to the Mesh PSemantic The semantic string of the new attribute PIndex Index of the new attribute. Only applies to texture coordinates (ST 0, 1 ...)
Description
Removes a vertex attribute, such as deformer weights, from a Mesh.


Return value
E_SUCCESS if all went well, or an error code

See also
E3dVertexGeometry_VertexAttributeAdd, Return, value, E_SUCCESS, if, all, went, well, or, an, error, code

E3dMesh_VerticesFree

Free Vertices of a Mesh

Syntax
void E3dMesh_VerticesFree(E3dMesh* PMesh)

Argument
PMesh Pointer to the Mesh
Description
Frees the Vertex array of a Mesh.

Return value
None.

E3dMesh_NumOfSelectedVertices

Count selected Vertices on a Mesh

Syntax
EIndex E3dMesh_NumOfSelectedVertices(const E3dMesh* PMesh, const float PSoftSelectionThreshold, EIndex* PNSoftSelectedVertices)

Arguments
PMesh The Mesh PNSoftSelectedVertices Number of soft-selected Vertices return pointer
Description
Returns the number of selected Vertices in a Mesh. If PNSoftSelectedVertices is not NULL, the number of soft-selected Vertices (E3dVtxAttribute_SoftSelection value > 0.005) will be returned there.

Return value
Total number of selected Vertices (hard + soft)

E3dMesh_FilterVertices

Mark Vertices of a Mesh that pass the given filter criteria

Syntax
EIndex E3dMesh_FilterVertices(const E3dMesh* PMesh, const unsigned int PWhatToInclude)

Argument
PMesh Pointer to the Mesh structure PWhatToInclude The filter criteria (OR-ed together bits)
Description
Examines the given Mesh and marks the Vertices that pass z given filter criteria, by setting their E3dVtxMARK0 flag. PWhatToInclude flags: E3dBB_SELECTED_GEOMETRY E3dBB_SHADOW_CASTERS E3dBB_SHADOW_RECEIVERS E3dBB_ALL

Example
E3dMesh_FilterVertices(PMesh, E3dBB_SELECTED_POLYGROUPS);
This will mark the Vertices PASSED, that are referenced from the selected PolyGroups of the Mesh. For improved efficiency, if all the Vertices pass, no Vertex flags are set, but the returned value will be equal to PMesh->Vertices.Count. Return value
The number of Vertices that passed the test.

See also
E3dMesh_GetBoundingBox

E3dMesh_VerticesRemap

Add / remove or reorder Mesh Vertices

Syntax
void E3dMesh_VerticesRemap(E3dMesh* PMesh, const EIndex* PNewToOldVertexTable, const EIndex PNumOfVertices)

Arguments
PMesh Pointer to the Mesh PNewToOldVertexTable Indices to the original Vertex for each new Vertex PNumOfVertices The new number of Vertices
Description
Copies the Vertex list of a Mesh to a new one, based on a remapping table (potentially doing one-to-many mapping).
This function should be used to add or remove Vertices from a Mesh, so those changes are propagated to the Mesh's runtime-typed components.
PNewToOldVertexTable should have PNumOfVertices entries. One for each Vertex in the new Vertex list.
The values should be indices to the original Vertex to be copied to a given new Vertex.
PNumOfVertices may be less than PMesh->Vertices.Count (removing Vertices), greater (adding / duplicating Vertices) or equal (reordering).
More than one new Vertex may be derived from each original Vertex.
An index value of -1 means that no original Vertex will be copied to the corresponding new Vertex.
It is the caller's responsibility to properly initialize such new Vertices.

Return value
None.

See also
E3dMesh_EdgesAndPolyGroupsRemapVertexIndices

E3dMesh_VertexGetConnectedVertices

Collect Vertices that a Vertex is connected to via Edges

Syntax
EIndex E3dMesh_VertexGetConnectedVertices(const E3dMesh* PMesh, const EIndex PVertexIndex, EIndex** PVertexIndicesP)

Arguments
PMesh Pointer to the Mesh PVertexIndex Index of the Vertex in question PVertexIndicesP The list of Vertex indices will be returned here
Description
Collects a list of Edges in a Mesh that share a given Vertex.

Return value
The number of Edges that share the given Vertex

E3dMesh_VertexGetEdges

Collect Edges that share a Vertex

Syntax
EIndex E3dMesh_VertexGetEdges(const E3dMesh* PMesh, const EIndex PVertexIndex, E3dEdge*** PEdgesPtr)

Arguments
PMesh Pointer to the Mesh PVertexIndex Index of the Vertex in question PEdgesPtr The list of Edges will be returned here
Description
Collects a list of Edges in a Mesh that share a given Vertex.

Return value
The number of Edges that share the given Vertex

E3dMesh_GetVertexLinksNew

Collect information on which Polygon VertexNodes use each Vertex of the given Mesh.

Syntax
E3dVertexLinkNew* E3dMesh_GetVertexLinksNew(E3dMesh* PMesh, const uint16_t PFlags)

Arguments
PMesh Pointer to the Mesh PFlags E3dVertexLinksEDGES, E3dVertexLinksPOLYGONS, E3dVertexLinksPOLYGROUPS PGetPolyGroups Fill in PolyGroups fields PGetEdges Fill in EdgeEnds fields
Description
Builds array of E3dVertexLinksNew structs for PMesh (one entry per Mesh Vertex). Each entry will show: - Which Polygon VertexNodes use that Vertex. If PGetPolyGroups is TRUE, it will also show which PolyGroups those Polygons belong to. - The other end (Vertex) of each Edge that connects to this Vertex. See the definition of E3dVertexLinksNew and E3dVertexLinkPolys for more details.

Return value
Pointer to the array, or NULL, in case of an error.

E3dEdges_New

Allocate array of independent Edges (line segments)

Syntax
E3dEdge* E3dEdges_New(const EIndex PEdgeNum)

Argument
PEdgeNum Number of Edges to allocate
Description
Allocates memory for an array of Edges and initializes all the Edges.

Return value
Pointer to the array of Edges or NULL in case of an error.

E3dEdges_Sort

Sort a list of Edges

Syntax
int E3dEdges_Sort(E3dEdge* PEdges, const EIndex PCount)

Argument
PEdges The array of Edges PCount Number of Edges in the array
Description
Ensures that the "Start" field of each Edge is lower than the "End" field, then sorts the Edges in ascending order, by their "Start" field. This allows for much more efficient Edge manipulation, faster lookups etc.

Return value
E_SUCCESS if successful, E_NO_DATA if the array is empty and E_CORRUPT_DATA, if one or more of the Edges have Start == End

E3dMesh_EdgesNew

Allocate array of independent Edges (line segments)

Syntax
E3dEdge* E3dMesh_EdgesNew(E3dMesh* PMesh, const EIndex PCount, const EBool PInitialize)

Argument
PMesh Pointer to the Mesh Count Number of Edges to allocate
Description
Reallocates the Edge array of PMesh and initializes all the Edges.

Return value
Pointer to the array of Edges or NULL in case of an error.

E3dMesh_EdgesAdd

Add Edges to a Mesh

Syntax
E3dEdge* E3dMesh_EdgesAdd(E3dMesh* PMesh, const EIndex PCount, const EBool PInitialize)

Arguments
PMesh Pointer to the Mesh PCount The number of Edges to add PInitialize If TRUE, initialize the new Edges
Description
Adds the given number of Edges to PMesh.

Return value
Pointer to the first newly added Edge.

E3dMesh_EdgesFree

Free Edges of a Mesh

Syntax
void E3dMesh_EdgesFree(E3dMesh* PMesh)

Argument
PMesh Pointer to the Mesh
Description
Frees the VertexLinks, WingedEdges, PolyGroup Edge index lists, and finally the Edge array of a Mesh.

Return value
None.

E3dMesh_EdgesSorted

Check if the Edges of a Mesh are sorted

Syntax
int E3dMesh_EdgesSorted(E3dMesh* PMesh)

Argument
PMesh The Mesh
Description
Check if the Edges of a Mesh are sorted by Start and End Vertex index.

Return value
E_YES if the Edges are sorted. E_NO, if the Edges are not sorted. E_CORRUPT_DATA if one or more Edges have Start > End. E_NO_DATA if the Mesh has no Edges.

E3dMesh_EdgesSort

Sort Edges of a Mesh

Syntax
int E3dMesh_EdgesSort(E3dMesh* PMesh, const EBool PCheckIfSorted)

Argument
PMesh The Mesh PCheckIfSorted If TRUE, check if the Edges are already properly sorted
Description
- For each Edge, ensures that the Start Vertex index is < End. - Sorts Edges by Start first, then by End. If PMesh has more than one PolyGroup, this function must be called before calling E3dMesh_PolyGroupsEdgesFromMeshEdges(). Otherwise the PolyGroup Edge indices will be wrong!

Return value
E_SUCCESS if the operation was successful. E_NO_DATA if the Mesh has no Edges E_NOTHING_TO_DO if PCheckIfSorted was TRUE and the Edges are already sorted.

E3dMesh_CreateWingedEdgesFromEdges

Create WingedEdge list and VertexLinks for the given Mesh from its Edge list

Syntax
void E3dMesh_CreateWingedEdgesFromEdges(E3dMesh* PMesh, const EBool PKeepVertexLinks, const EBool PRepair)

Arguments
PMesh Pointer to the Mesh PKeepVertexLinks Keep Mesh->VertexLinks data PRepair Add missing Edges, if any
Description
Builds WidgedEdges data for a Mesh, from the Edges array. Unlike E3dMesh_CreateEdgesFromPolygons, this function leaves the Mesh's Edges intact, so Edge selection etc. information will be preserved. This function is also responsible for adding Edge index information to Polygon VertexNodes in the PolyGroups of the Mesh, so you need to call it, if you need that info.

Return value
None.

E3dMesh_CreateEdgesFromPolygons

Create Edge list for the given Mesh from its Polygon and Triangle strip data

Syntax
void E3dMesh_CreateEdgesFromPolygons(E3dMesh* PMesh, E3dPolyGroup* PJustThisPolyGroup, const EBool PUpdateWingedEdges, const EBool PKeepVertexLinks)

Arguments
PMesh Pointer to the Mesh PJustThisPolyGroup If not NULL, only consider the Polygons of this PolyGroup PUpdateWingedEdges Build WingedEdges as well PKeepVertexLinks Keep VertexUsage information after completion
Description
Generates Mesh and PolyGroup Edge information from the Polygon data on a Mesh.

Return value
None.

See also
E3dMesh_PolyGroupsEdgesFromMeshEdges

E3dMesh_GetEdgeNormals

Generate normals for the Edges of a Mesh

Syntax
E3dCoord3Sum* E3dMesh_GetEdgeNormals(const E3dMesh* PMesh)

Argument
PMesh Pointer to the Mesh
Description
Generates normal vectors for the Edges of a Mesh. The Mesh must have up-to-date WingedEdges.

Return value
Pointer to the normal vectors (one for each Edge), as an array of E3dCoord3Sum structs, or NULL, in case of an error.

See also
E3dMesh_CreateWingedEdgesFromEdges

E3dMesh_EdgeGetPolygons

Collect Polygons that share an Edge

Syntax
EIndex E3dMesh_EdgeGetPolygons(const E3dMesh* PMesh, const E3dEdge* PEdge, E3dEdgePolygonInfo** PDescriptorsP, unsigned int* PDescriptionP)

Arguments
PMesh Pointer to the Mesh PEdge The Edge to be tested PDescriptorsP Results pointer PDescriptionP Flags, providing some details
Description
Description Collects the Polygons that share an Edge within a Mesh. If successful, it will return an array of E3dEdgePolygonInfo structs. If PEdge is part of a Polygon's hole contour, the flag E3dPolyEDGE_IS_IN_HOLE_CONTOUR will be set in PDescriptionP.

Return value
The number of Polygons that share PEdge

E3dMesh_NumOfSelectedEdges

Count selected Edges in a Mesh

Syntax
EIndex E3dMesh_NumOfSelectedEdges(const E3dMesh* PMesh)

Argument
PMesh Pointer to the E3dMesh structure
Description
Returns the number of selected Edges in the given Mesh.

Return value
The number of selected Edges.

E3dMesh_NumOfVisibleEdges

Count visible Edges in a Mesh

Syntax
EIndex E3dMesh_NumOfVisibleEdges(const E3dMesh* PMesh)

Argument
PMesh Pointer to the E3dMesh structure
Description
Returns the number of visible Edges in the given Mesh.

Return value
The number of visible Edges.

E3dMesh_EdgeFlagsUpdate

Update a Mesh after Edge parameters change

Syntax
void E3dMesh_EdgeFlagsUpdate(E3dMesh* PMesh)

Argument
PMesh Pointer to the Mesh
Description
This function must be called after changing the E3dSELECTED_EDGES, E3dACTIVE_EDGES and E3dHARD_EDGES flags, or the Hardness value of a Mesh's Edges. Otherwise, the changes will not be visible. This is because of performance optimiziations. If a Mesh has none of those flags set and all its Edge Hardness values are 0.0: - its wireframe can be drawn much faster, in a single OpenGL call - the Edge flags don't need to be saved, potentially resulting in significan file size reduction, with large Meshes

Return value
None.

E3dMesh_PolyGroupsEdgesFromMeshEdges

Create PolyGroup Edges for PMesh's PolyGroups (if there's more than 1 PolyGroup)

Syntax
int E3dMesh_PolyGroupsEdgesFromMeshEdges(E3dMesh* PMesh, const EBool PKeepEdgeCaches, const EBool PRepair)

Arguments
PMesh Pointer to the Mesh PKeepEdgeCaches If TRUE, WingedEdges and VertexLinks won't be freed PRepair Add missing Edges, if any
Description
If PMesh has more than 1 PolyGroup, it creates PolyGroup Edge lists from the Edge list of the Mesh.

Return value
None.

E3dMesh_AppendPolyGroup

Append an existing PolyGroup to a Mesh

Syntax
int E3dMesh_AppendPolyGroup(E3dMesh* PMesh, E3dPolyGroup* PPolyGroup)

Arguments
PMesh Pointer to the Mesh PPolyGroup Pointer to the PolyGroup
Description
Adds an existing PolyGroup to PMesh.

Return value
E_SUCCESS on success, or E_ALREADY_EXISTS, if PPolyGroup is already on PMesh.

E3dMesh_PolyGroupAdd

Allocate a new PolygGroup and add it to a Mesh

Syntax
E3dPolyGroup* E3dMesh_PolyGroupAdd(E3dMesh* PMesh)

Arguments
PMesh Pointer to the Mesh
Description
Creates a new PolyGroup and adds it to PMesh.

Return value
Pointer to the new PolyGroup, or NULL, in case of an error.

E3dMesh_PolyGroupDel

Remove a PolyGroup from a Mesh and free it

Syntax
int E3dMesh_PolyGroupDel(E3dMesh* PMesh, E3dPolyGroup* PPolyGroup)

Arguments
PMesh Pointer to the Mesh PPolyGroup Pointer to the PolyGroup
Description
Removes the given PolyGroup from the given Mesh's dynamically allocated PolyGroups array and frees all memory assiciated with the PolyGroup.

Return value
E_SUCCESS on success, or E_NOT_FOUND, if PPolyGroup is not on PMesh.

E3dMesh_ChangePolygonFlags

Change flags on Polygons of a Mesh

Syntax
void E3dMesh_ChangePolygonFlags(E3dMesh* PMesh, const E3dPolygonFlags PFlags, const int PAction)

Arguments
PMesh Pointer to the Mesh PFlags The flags to change PAction The action to take: E_SET, E_CLEAR or E_COPY
Description
Set, clear, or copy the flags given in PFlags in the Flags field of each Polygon of each PolyGroup in PMesh.

Return value
None.

E3dMesh_PolyGroupAddTriangleStrip

Add a TriangleStrip to a Mesh

Syntax
E3dTriangleStrip* E3dMesh_PolyGroupAddTriangleStrip(E3dMesh* PMesh, E3dPolyGroup* PPolyGroup)

Arguments
PMesh Pointer to the E3dMesh PPolyGroup The PolyGroup to which the strip will be added
Description
Allocates space for and initializes a new TriangleStrip in the given Mesh and PolyGroup.

Return value
A pointer to the new strip or NULL, if unsuccessful.

See also
E3d_TriangleStripsAllocate, E3dMesh_PolyGroupAddTriangleStrips

E3dMesh_PolyGroupAddTriangleStrips

Add TriangleStrips to a Mesh

Syntax
E3dTriangleStrip* E3dMesh_PolyGroupAddTriangleStrips(E3dMesh* PMesh, E3dPolyGroup* PPolyGroup, EIndex PNumOfNewStrips)

Arguments
PMesh Pointer to the Mesh PPolyGroup The PolyGroup to which the strip will be added PNumOfNewStrips Number of triangle strips to add
Description
Allocates space for and initializes the specified number of TriangleStrips in the given Mesh and PolyGroup.

Return value
A pointer to the new strips or NULL, if unsuccessful.

See also
E3d_TriangleStripsAllocate, E3dMesh_PolyGroupAddTriangleStrip

E3dMesh_RecomputePolygonNormals

Recalculate Polygon normals of a Mesh

Syntax
void E3dMesh_RecomputePolygonNormals(E3dMesh* PMesh)

Arguments
PMesh Pointer to the Mesh
Description
Recomputes the normals of the Polygons of all PolyGroups in PMesh.

Return value
None.

E3dMesh_RecomputeNormals

Recompute Polygon and Vertex normals of a Mesh

Syntax
void E3dMesh_RecomputeNormals(E3dMesh* PMesh, const EBool PRefreshPolygonNormals, const EBool PRefreshMeshVertexNormals)

Arguments
PMesh Pointer to the Mesh PRefreshPolygonNormals Recompute Polygon normals PRefreshMeshVertexNormals If the Mesh has Vertex normals, recompute those
Description
Recomputes the vertex normals of the Polygons of all PolyGroups in PMesh. If PRefreshPolygonNormals is TRUE, the Polygon normals will be recomputed first.

Return value
None.

E3dMesh_EdgesAndPolyGroupsRemapVertexIndices

Re-map Vertex indices of Edges and Polygons in a Mesh, according to a table

Syntax
void E3dMesh_EdgesAndPolyGroupsRemapVertexIndices(E3dMesh* PMesh, const EIndex* POldToNewVertexTable)

Arguments
PMesh Pointer to the Mesh POldToNewVertexTable Indices to the original Vertex for each new Vertex
Description
Adjusts the Vertex indices of each VertexNode on the PolyGroups of a Mesh, based on a remapping table.
This function is usually used in conjunction with E3dMesh_VerticesRemap.
Note that, as the name indicates, the remapping table for this function is the opposite of the one passed to E3dMesh_VerticesRemap.
POldToNewVertexTable tells, for each original Vertex, which new Vertex it should be replaced with.
This function does not modify the Vertex array of PMesh, so it does not require a number of Vertices argument.

Return value
None.

See also
E3dMesh_VerticesRemap

E3dMesh_NumOfSelectedPolygons

Count selected Polygons in a Mesh

Syntax
EIndex E3dMesh_NumOfSelectedPolygons(const E3dMesh* PMesh)

Argument
Mesh Pointer to the E3dMes structure
Description
Returns the number of selected Polygons in the given Mesh.

Return value
The number of selected Polygons.

E3dMesh_GetBoundingBox

Get the local bounding box of a Mesh

Syntax
EBool E3dMesh_GetBoundingBox(const E3dMesh* PMesh, const uint32_t PWhatToInclude, E3dBBox* PBBox)

Arguments
PMesh Pointer to the Mesh structure PWhatToInclude OR-ed flags of PBBMox Returned bounding box
Description
Returns the bounding box of the given Mesh. Accepted flags in PWhatToInclude: E3dBB_SELECTED_GEOMETRY E3dBB_SHADOW_CASTERS E3dBB_SHADOW_RECEIVERS E3dBB_ALL

Return value
TRUE if successful, FALSE in case of an error, such as the Mesh having no Vertices.

See also
E3dMesh_GetTransformedBoundingBox

E3dMesh_GetTransformedBoundingBox

Get the bounding box of a Mesh aligned to an arbitrary coordinate system

Syntax
EBool E3dMesh_GetTransformedBoundingBox(const E3dMesh* PMesh, const E3dMatrix PMatrix, const uint32_t PWhatToInclude, E3dBBox* PBBox)

Argument
PMesh Pointer to the Mesh structure PMatrix The Matrix that defines the coordinate system PBBox Returned bounding box
Description
This function transforms each Vertex of the given Mesh with the given Matrix and returns the minimum and maximum XYZ values of the resulting bounding box.

Example
E3dMesh_GetTransformedBoundingBox(PMesh, LModel->LocalToWorldMatrix, PBBMin, PBBMax);
This will return the "world-aligned" bounding box of the PMesh (assuming that PMesh is a Geometry of LModel). Return value
TRUE if successful, FALSE in case of an error.

See also
E3dMesh_GetBoundingBox

E3dMesh_FreeCaches

Free VertexUsageList etc. of a Mesh

Syntax
void E3dMesh_FreeCaches(E3dMesh* PMesh)

Argument
PMesh Pointer to the Mesh
Description
Frees the render data, VertexUsageList, VertexLinks, WingedEdges and PolyGroup Edge lists of a Mesh. These caches can greatly accelerate operations on a Mesh, but they use memory and cost time to build, so they are only rebuilt as needed. This function must be called after changes to a Mesh (except when only changing Vertex positions etc.), to ensure that these data caches are valid. Trying to operate on a Mesh with invalid cached data, may cause crashes (e.g. a WidgedEdge may try to access a no longer existing PolyGroup).

Return value
None.

E3dMesh_FromBBox

Create a Mesh from a bounding-box

Syntax
void E3dMesh_FromBBox(E3dMesh* PMesh, const E3dBBox* PBBox)

Arguments
PMesh Pointer to the Mesh BBox Pointer to the bounding box
Description
Used for visualizing bounding boxes/

Return value
None.
© 1996-2024 By Gabor Nagy