Public Member Functions

FBMesh Class Reference

This reference page is linked to from the following overview topics: MotionBuilder 2014, Scene Elements, FBModel - Transformation Data and the Scene Graph, FBGeometry - Meshes and Surfaces, Updated Objects.


Search for all occurrences

Detailed Description

Mesh class.

Definition at line 651 of file fbgeometry.h.

#include <fbgeometry.h>

Inheritance diagram for FBMesh:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FBMesh (const char *pName, HIObject pObject=NULL)
 Constructor.
bool TriangleListAdd (int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
 Add Triangle List, Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.
bool TriangleStripAdd (int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
 Add Triangle Strip Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.
bool PolygonListAdd (int pPolygonSize, int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
 Add Polygon List Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.
int PolygonBegin (int pMaterialId=0)
 Begin Polygon definition.
bool PolygonVertexAdd (int pVertex)
 Add a vertex.
int PolygonEnd ()
 End Polygon definition.
int PolygonVertexCount (int pPolygonIndex) const
 Get Polygon vertex count.
int PolygonVertexIndex (int pPolygonIndex, int pVertexPolygonIndex) const
 Get global (for the mesh) index of a vertex from a polygon.
int PolygonCount () const
 Get number of polygons in mesh.
const int * PolygonVertexArrayGet (int &pArraySize) const
 Get the array of polygon vertex (i.e.
bool IsTriangleMesh () const
 Determines if the mesh is composed entirely of triangles.
int PolygonMaterialIdGet (int pIndex=-1) const
 Get a Material ID for the given Polygon index.
void ComputeVertexNormals (bool pCW=false)
 Compute Mesh Vertex Normal.
void InverseNormal ()
 Inverse Normal.

Constructor & Destructor Documentation

FBMesh ( const char *  pName,
HIObject  pObject = NULL 
)

Constructor.

Parameters:
pNameName of Mesh.
pObjectFor internal use only(default=NULL).

Member Function Documentation

bool TriangleListAdd ( int  pIndexArraySize,
int *  pIndexArray,
int  pMaterialId = 0 
)

Add Triangle List, Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.

Parameters:
pIndexArraySizeSize of pIndexArray, Added triangle count is floor(max(pIndexArraySize, 0) / 3)
pIndexArrayIndex array of triangle list.
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Note:
The indexes' value in input pIndexArray won't be validated, and the behavior is undefined if out of range.
bool TriangleStripAdd ( int  pIndexArraySize,
int *  pIndexArray,
int  pMaterialId = 0 
)

Add Triangle Strip Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.

Parameters:
pIndexArraySizeSize of pIndexArray, Added triangle count is max(pIndexArraySize - 2, 0)
pIndexArrayIndex array of triangle strip.
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Note:
The indexes' value in input pIndexArray won't be validated, and the behavior is undefined if out of range.
bool PolygonListAdd ( int  pPolygonSize,
int  pIndexArraySize,
int *  pIndexArray,
int  pMaterialId = 0 
)

Add Polygon List Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's responsibility to make sure to input valid index values, otherwise afterwards behavior will be undefined.

Parameters:
pPolygonSizeSize of polygon, 3 mean triangle, 4 for quadrilateral, and so on. minimum input value is 3.
pIndexArraySizeSize of pIndexArray, Added polygon count is floor(max(pIndexArraySize, 0) / pPolygonSize)
pIndexArrayIndex array of triangle strip.
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Note:
The indexes' value in input pIndexArray won't be validated, and the behavior is undefined if out of range.
int PolygonBegin ( int  pMaterialId = 0)

Begin Polygon definition.

Parameters:
pMaterialIdIndex of material for this polygon. Only effective when MaterialMappingMode is kFBGeometryMapping_BY_POLYGON mode.
Returns:
Number of existing polygons in Mesh
bool PolygonVertexAdd ( int  pVertex)

Add a vertex.

Parameters:
pVertexIndex in mesh of vertex to add to polygon, must be in range of [0, ControlPointCount)
Returns:
true if successful.
int PolygonEnd ( )

End Polygon definition.

Clean up and associate vertices internally.

Returns:
Current number of polygons.
Note:
MoBu expect each polygon to contain at least 3 vertices, the behavior is undefined if user add less than 3 vertices polygon.
int PolygonVertexCount ( int  pPolygonIndex) const

Get Polygon vertex count.

Parameters:
pPolygonIndexIndex of polygon to get vertex count from.
Returns:
Number of vertices in polygon at pPolygonIndex.
int PolygonVertexIndex ( int  pPolygonIndex,
int  pVertexPolygonIndex 
) const

Get global (for the mesh) index of a vertex from a polygon.

Parameters:
pPolygonIndexIndex of polygon in question.
pVertexPolygonIndexPolygon vertex index.
Returns:
Index in mesh of vertex.
int PolygonCount ( ) const

Get number of polygons in mesh.

Returns:
Number of polygons in mesh.
const int* PolygonVertexArrayGet ( int &  pArraySize) const

Get the array of polygon vertex (i.e.

index to control points). This array is a concatenation of the list of polygon vertices of all the polygons. Example: a mesh made of 2 triangles [1,2,3] and [2,3,4] results in [1,2,3,2,3,4]. The first polygon starts at position 0 and the second at position 3.

Parameters:
pArraySizePolygon vertex array size.
Returns:
Readonly polygon vertex array.
bool IsTriangleMesh ( ) const

Determines if the mesh is composed entirely of triangles.

Returns:
true if all polygons are triangles, false otherwise
int PolygonMaterialIdGet ( int  pIndex = -1) const

Get a Material ID for the given Polygon index.

Parameters:
pIndexPolygon's index to get material ID at (default=-1).
Returns:
ID of material of vertex at pIndex.
void ComputeVertexNormals ( bool  pCW = false)

Compute Mesh Vertex Normal.

Parameters:
pCWTrue for clock wise normal, otherwise for counter-clock wise
void InverseNormal ( )

The documentation for this class was generated from the following file:

FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh
FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh FBMesh