FBMesh Class Reference


Detailed Description

Inheritance diagram for FBMesh:

List of all members.

Public Member Functions

 __init__ (str pName, object pObject=None)
 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)
 Get Polygon vertex count.
int PolygonVertexIndex (int pPolygonIndex, int pVertexPolygonIndex)
 Get global (for the mesh) index of a vertex from a polygon.
int PolygonCount ()
 Get number of polygons in mesh.
int PolygonVertexArrayGet (int pArraySize)
 Get the array of polygon vertex (i.e.
bool IsTriangleMesh ()
 Determines if the mesh is composed entirely of triangles.
int PolygonMaterialIdGet (int pIndex=-1)
 Get a Material ID for the given Polygon index.
 ComputeVertexNormals (bool pCW=False)
 Compute Mesh Vertex Normal.
 InverseNormal ()
 Inverse Normal.

Member Function Documentation

__init__ ( str  pName,
object  pObject = None 
)

Constructor.

Parameters:
pNameName of Mesh.
pObjectFor internal use only(default=NULL).
Examples
Samples/Geometry/GeometryInstancing.py, Samples/Geometry/VertexArrayManipulation.py, Samples/Geometry/VertexColor.py

Reimplemented from FBGeometry.

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)

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 
)

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 ( )

Get number of polygons in mesh.

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

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 ( )

Determines if the mesh is composed entirely of triangles.

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

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.
ComputeVertexNormals ( bool  pCW = False)

Compute Mesh Vertex Normal.

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

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