IFXMesh |
Render performance is achieved by partitioning 3-D meshes into smaller face sets (or simply meshes) with same material and texture properties. This is done to minimize video card state changes during rendering. IFXMesh is the interface to a single material mesh (a triangle mesh where all the faces have the same material and thus all vertices have same format). To specify an entire model, meshes are grouped together inside a MeshGroup which also specifies a material for each mesh.
Note:The interface is not specific to a particular data layout. This allows the layout to be changed to improve performance while minimizing changes to the rest of the code base. Rendering code uses the token returned by GetRenderCode() and GetInterface() to obtain, in a safe manner, a pointer to the class implementation. The IFXMesh implementations include methods for directly accessing the mesh data for rendering purposes.
|
Interface Methods |
Description |
|
Gets the number of faces in mesh |
|
|
Sets the number of faces in mesh |
|
|
Gets the number of vertices in mesh |
|
|
Sets the number of vertices in mesh |
|
|
Get the maximum (allocated) number of vertices |
|
|
Get the maximum (allocated) number of faces |
|
|
Gets mesh attributes |
|
|
Accesses the faces of the mesh |
|
|
Accesses the vertex attributes of the mesh |
|
|
Accesses the position attribute of vertices |
|
|
Accesses the normal attribute of vertices |
|
|
Accesses the color attribute of vertices |
|
|
Accesses the texture coordinate attribute of vertices |
|
|
Sets a pointer to the mesh factory that created the mesh |
|
|
Gets a pointer to the mesh factory that created the mesh |
|
|
Specifies the mesh attributes and allocates memory for the vertex and face data |
|
|
Creates a new mesh of larger dimensions and copies the old mesh data into it |
|
|
Adds or removes attributes, vertices, and faces |
|
|
Adds or removes attributes, vertices, and faces |
|
|
Class destructor |
|
|
Obtains the class implementation in a runtime type-safe manner |
|
|
Obtains render code |
|
|
Indicates whether the diffuse color channel is BGR or RGB |
|
|
Indicates whether the specular color channel is BGR or RGB |
|
|
Switches the diffuse color channel from BGR to RGB and vice versa |
|
|
Switches the specular color channel from BGR to RGB and vice versa |
This method gets the number of faces in the mesh.
Parameters:
None
Return Values:
U32
This method sets the number of faces in the mesh.
Parameters:
|
numFaces |
Number of faces |
Return Values:
U32
This method gets the number of vertices in the mesh.
Parameters:
None
Return Values:
U32
This method sets the number of vertices in the mesh.
Parameters:
None
Return Values:
U32
This method gets the maximum (allocated) number of vertices.
Parameters:
None
Return Values:
U32
This method gets the maximum (allocated) number of faces.
Parameters:
None
Return Values:
U32
This method gets the mesh attributes.
Parameters:
None
Return Values:
IFXVertexAttributes
This method initializes a face iterator for accessing faces in this mesh. Creates a new IFXFaceIter and passes its pointer into this method to be initialized.
Parameters:
|
pFaceIter |
Pointer to a face iterator |
This method initializes a vertex iterator for accessing the attribute
information for vertices in the mesh.
Note: If you need to access only
one or two vertex attributes, use a more specific iterator. See GetPositionIter(),
GetNormalIter(), GetColorIter(),
and GetTexCoordIter().
This may result in a performance gain.
Parameters:
|
pVertexIter |
Pointer to a vertex iterator |
This method initializes a vector iterator for accessing the position attribute of vertices in the mesh.
Parameters:
|
pPositionIter |
Pointer to a vector iterator |
This method initializes a vector iterator for accessing the normal attribute of vertices in this mesh.
Parameters:
|
pNormalIter |
Pointer to a vector iterator |
This method initializes a U32 iterator for accessing the diffuse color attribute of vertices in this mesh.
Parameters:
|
pColorIter |
Pointer to a color iterator |
This method initializes a vector iterator for accessing the texture coordinate attribute of vertices in this mesh. Specifies the texture layer using the "layer" argument.
Parameters:
|
pTextureIter |
Pointer to a vector iterator |
|
layer |
Layer number |
This method stores the pointer to the mesh factory that created this instance.
Parameters:
|
pMeshFactory |
Pointer to the IFXMeshFactory |
Return Values:
None
This method obtains a pointer to the mesh factory that created the mesh.The mesh factory can be used to create a new (empty) mesh with the same class implementation (vertex data layout) and same attributes.
Note: A high-performance copy can be achieved using the Copy() method on two meshes with the same class implementation and attributes.
Parameters:
None
Return Values:
Pointer to IFXMeshFactory
This method creates a new mesh of larger dimensions (uNumFaces, uNumVerts), copies the old mesh data into it, and then deletes the previously existing mesh. A successful call to Allocate() must occur before calling this method.
Parameters:
|
uNumFaces |
Number of faces |
|
uNumVerts |
Number of vertices |
This method specifies the mesh attributes and allocates memory for the vertex and face data. The mesh data is not initialized to known values. Use the iterators to set the mesh data. Call Allocate() only once per mesh. Allocate() should be called before any other methods, except Copy() and SetMeshFactory().
Parameters:
|
attributeFlags |
Returns the IFXVertexAttributes |
|
maxNumVertices |
Maximum number of vertices |
|
maxNumFaces |
Maximum number of faces |
This method can be called on the destination the mesh before or after Allocate() is called. If PartialCopy() is called before Allocate(), the destination mesh will have the exact same attributes as the source mesh. If PartialCopy() is called after Allocate(), the copy will expand the destination mesh enough for the copy to complete. uEndVert and uEndFace are included in the copy.
Parameters:
|
pSourceMesh |
Pointer to the IFXMesh |
|
uStartVert |
Starting number of vertices |
|
uEndVert |
Ending number of vertices |
|
uStartFace |
Starting number of faces |
|
uEndFace |
Ending number of faces |
This method allows the adding or removing of attributes, vertices, and faces. Allocate() must be called on pSourceMesh before it can be used as a source mesh for copying. Copy() can be called on the destination (this) mesh before or after Allocate() is called. If Copy() is called before Allocate(), the destination mesh will have the exact same number of vertices, faces, and attributes as the source mesh. If Allocate() is called first, the copy will fill in common information as much as possible.
Parameters:
|
pSourceMesh |
Pointer to the IFXMesh |
Class destructor.
Parameters:
None
Return Values:
None
This method obtains the class implementation in a runtime type-safe manner. For example:
IFXMeshInterleaved* pMeshInterleaved;
res = GetInterface(IID_IFXMeshInterleaved, (void**)(&pMeshInterleaved));
if (result == IFX_OK)
This method also allows for runtime discovery of extended interfaces.
Parameters:
|
interfaceIdentifier |
ID number of interface |
|
interfaceIdentifier |
Pointer to the interface identifier |
Interface for rendering system. Each class implementation of IFXMesh has a unique render code associated with it. This render code is used in conjuction with GetInterface() to obtain methods that directly access the mesh data for rendering.
Parameters:
None
Return Values:
IFXRenderCode
This method indicates whether or not the diffuse color channel is BGR.
Parameters:
None
Return Values:
BOOL
This method indicates whether or not the specular color channel is BGR.
Parameters:
None
Return Values:
BOOL
This method switches the diffuse color channel from BGR to RGB and vice versa.
Parameters:
None
This method switches the specular color channel from BGR to RGB and vice versa.
Parameters:
None
§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.