Index

 E3d_ModelGetBoundingBox
 E3d_ModelGetTransformedBoundingBox
 E3d_ModelResetTransforms
 E3d_NodeAllocate
 E3d_ModelAllocate
 E3d_NodeTransformGeometries
 E3d_ModelAppendGeometry
 E3d_ModelAddGeometry
 E3d_ModelRemoveGeometry
 E3d_ModelRemoveGeometries
 E3d_NodeFree
 E3d_ModelRefreshMatrixNoScaling


E3d_ModelGetBoundingBox

Compute the bounding box of a Model in its local coordinate system

Syntax
 EBool E3d_ModelGetBoundingBox(E3dModel* LModel, E3d3DPosition* LBBMin, E3d3DPosition* LBBMax, unsigned int LWhatToInclude)
Arguments
 E3dModel*      LModel           Pointer to the Model structure
 E3d3DPosition* LBBMin           First corner of bounding box
 E3d3DPosition* LBBMax           Opposite corner of bounding box
 unsigned int   LWhatToInclude   OR-ed flags of what components to consider for the BBox
Description
Computes the local-relative bounding box of a Model and returns it in LBBMin and LBBMax.

Return value
TRUE if there is a valid bounding box, FALSE if there isn't one (e.g. the Model has no Geometry attached to it).

E3d_ModelGetTransformedBoundingBox

Compute the bounding box of a Model in a given coordinate system

Syntax
 EBool E3d_ModelGetTransformedBoundingBox(E3dModel* LModel, E3dMatrix LMatrix, E3d3DPosition* LBBMin, E3d3DPosition* LBBMax, unsigned int LWhatToInclude)
Arguments
 E3dModel*      LModel           Pointer to the Model structure
 E3dMatrix      LMatrix          Matrix to transform the Geometry with
 E3d3DPosition* LBBMin           First corner of bounding box
 E3d3DPosition* LBBMax           Opposite corner of bounding box
 unsigned int   LWhatToInclude   OR-ed flags of what components to consider for the BBox
Description
Computes the bounding box of a Model in a coordinate system defined by a Matrix and returns it in LBBMin and LBBMax.

Return value
TRUE if there is a valid bounding box, FALSE if there isn't one (e.g. the Model has no geometry attached to it).

E3d_ModelResetTransforms

Reset transformation values of a Model

Syntax
 void E3d_ModelResetTransforms(E3dModel* LModel)
Argument
 E3dModel* LModel       Pointer to the Model structure
Description
Resets the transformations of the Model node in the following manner: - Scaling[XYZ] = 1,1,1 - Rotation[XYZ] = 0,0,0 - Translation[XYZ] = 0,0,0 Also loads an identity Matrix into LocalToWorldMatrix

Return value
None.

E3d_NodeAllocate

Allocate memory for a new Node of the given type

Syntax
 E3dNode* E3d_NodeAllocate(int LType)
Argument
 LName        The name of the new Model
Description
This function allocates and initializes an E3dModel structure.

Return value
Pointer to the allocated E3dModel structure or NULL in case of an error.

See also
E3d_NodeFree

E3d_ModelAllocate

Allocate memory for a Model-Node

Syntax
 E3dModel* E3d_ModelAllocate(void)
Argument
 LName        The name of the new Model
Description
This function allocates and initializes an E3dModel structure.

Return value
Pointer to the allocated E3dModel structure or NULL in case of an error.

See also
E3d_NodeFree

E3d_NodeTransformGeometries

Perform transformation on the Geometries of a Node

Syntax
 void E3d_NodeTransformGeometries(E3dNode* LNode, E3dMatrix LMatrix)
Arguments
 E3dNode*  LNode        Pointer to the Node
 E3dMatrix LMatrix      The Matrix, defining the transformation
Description
This function performs the transformation, described by LMatrix, on the given Node, by transforming the actual Vertices (of a Mesh), CVs (of a Spline, Face etc.) etc..
This operation is sometimes referred to as "Freezing the transformation" of an object, or more colloquially: "baking the transformation into an object".

Return value
None.

E3d_ModelAppendGeometry

Append a Geometry to a Model node

Syntax
 E3dGeometry* E3d_ModelAppendGeometry(E3dModel* LModel, E3dGeometry* LGeometry)
Arguments
 E3dModel*    LModel         Pointer to the Model node
 E3dGeometry* LGeometry      Geometry to append
Description
This function adds the given Geometry to the list of Geometries on the given Model.

Return value
LGeometry if all went well, NULL in case of an error.

See also
E3d_ModelAddGeometry

E3d_ModelAddGeometry

Allocate a Geometry of the given type and add it to a Model

Syntax
 E3dGeometry* E3d_ModelAddGeometry(E3dModel* LModel, int LGeoType)
Arguments
 E3dModel* LModel       Pointer to the Model node
 int       LGeoType     The type of the new Geometry
 LGeoName     The name of the new Geometry
Description
This function allocates, initializes a Geometry of the given type and adds it to the list of Geometries on the given Model.

Return value
Pointer to thenew Geometry if all went well, NULL in case of an error.

See also
E3d_ModelAddGeometry

E3d_ModelRemoveGeometry

Remove a Geometry from a Model

Syntax
 void E3d_ModelRemoveGeometry(E3dModel* LModel, E3dGeometry* LGeometry)
Arguments
 E3dModel*    LModel         Pointer to the Model
 E3dGeometry* LGeometry      Pointer to the Geometry
Description
Removes LGeometry from the given Model's dynamically allocated Geometry list.

Return value
None.

E3d_ModelRemoveGeometries

Free all Geometries of a Model

Syntax
 void E3d_ModelRemoveGeometries(E3dModel* LModel)
Argument
 E3dModel* LModel     Pointer to the E3dModel structure
Description
Frees all the Geometries of LModel.

Return value
None.

See also
E3d_ModelAppendGeometry, E3d_ModelAddGeometry, E3d_ModelRemoveGeometry

E3d_NodeFree

Free a Model

Syntax
 void E3d_NodeFree(E3dNode* LNode)
Arguments
 LModel     Pointer to the E3dModel structure to free
Description
This function first decrements the reference count (RefCnt) of the given Model structure (if it's not already zero). After that, if RefCnt is still greater than zero, it means that something other than the function calling E3d_NodeFree() is still referring to this Model, so E3d_NodeFree() will simply return. If RefCnt is zero, E3d_NodeFree() will free all the Geometries and other dynamically allocated structures of the Model and the Model structure itself.

Return value
None.

See also
E3d_ModelAllocate

E3d_ModelRefreshMatrixNoScaling

Update the LocalToWorld Matrix of a Model

Syntax
 void E3d_ModelRefreshMatrixNoScaling(E3dModel* LModel)
Arguments
 E3dModel* LModel       Pointer to the Model
Description
This function refreshes the local-to-world matrix field (LocalToWorldMatrix) of the Model node. E3d_HrcUpdateConnections() should be called on a hierarchy after a change in local transformation values (Scaling, Rotation, Translation) on the Model nodes.

Return value
None.

See also
E3d_NodeHrcRefreshMatrices, E3d_NodeHrcRefreshMatricesNoScaling, E3d_HrcUpdateConnections