IFXMeshGroup

The IFXMeshGroup class groups multiple IFXMeshes and associates a material with each mesh. Typically a MeshGroup represents a single object that was partitioned into multiple IFXMeshes according to material ID.

The MeshGroup stores only pointers to meshes and materials, so a single mesh or material may be shared by many different MeshGroups.

When to Use

Shockwave 3D§ uses IFXMeshGroup to group IFXMeshes for high performance rendering of model geometry.

Interface Methods

Description

IFXMeshGroup

Constructor

~IFXMeshGroup

Destructor

Allocate

Allocates a mesh group for specified number of meshes.

GetNumMeshes

Returns number of meshes

GetMesh

Returns a specified mesh in the mesh group

SetMesh

Sets a specified mesh in the mesh group

SetMeshND

Sets a specified mesh in the mesh group and old mesh is not deleted

GetParentMeshName

Gets the name of a specified mesh

SetParentMeshName

Sets the name of a specified mesh

GetMeshName

Gets mesh name

SetMeshName

Sets mesh name

GetNeighborMesh

Gets a pointer to the neighbor mesh

SetNeighborMesh

Sets internal point to neighbor mesh


IFXMeshGroup::IFXMeshGroup()

This is the default constructor for IFXMeshGroup. It sets default values but does not allocate memory for meshes.

Parameters:

None


IFXMeshGroup::~IFXMeshGroup()

This is the default destructor for IFXMeshGroup. All allocated memory is deallocated.

Parameters:

None


IFXMeshGroup::Allocate(U32 numMeshes)

This method allocates a group for numMeshes IFXMeshes. This method must be called prior to use of any of the other methods on IFXMeshGroup.

Parameters:

numMeshes

This is the number of meshes in this mesh group

Return Values


IFXMeshGroup::GetNumMeshes()

This method returns the number of meshes in the IFXMeshGroup object.

Parameters:

None

Return Values:

U32 - the number of meshes in the mesh group.


IFXMeshGroup::GetMesh(U32 index)

This method returns a pointer to a specified mesh within the mesh group. GetMesh() may return NULL if SetMesh() has not been called previously with a valid pointer.

Parameters:

index

 ID of the desired mesh

Return Values:

IFXMesh* - a pointer to the mesh


IFXMeshGroup::SetMesh(U32 index, IFXMesh* pMesh)

This method sets a specified mesh pointer within the mesh group.

Parameters:

index

Index of the mesh pointer to be set

pMesh

Pointer to an IFXMesh

Return Values:

IFXMesh * - If successful, returns the same pointer as pMesh. Returns NULL if not successful or if index is greater than the value passed when IFXMeshGroup::Allocate() was called.


IFXMeshGroup::SetMeshND(U32 index, IFXMesh* pMesh)

This method sets a specified mesh pointer within the mesh group. Does not delete old mesh.

Parameters:

index

Index of the mesh pointer to be set

pMesh

Pointer to an IFXMesh

Return Values:

IFXMesh * - If successful, returns the same pointer as pMesh. Returns NULL if not successful or if index is greater than the value passed when IFXMeshGroup::Allocate() was called.


IFXMeshGroup::GetParentMeshName(U32 index)

This method returns the parent mesh name at the specified index.

Parameters:

index

ID of the desired mesh

Return Values:

IFXString - a string containing the mesh name.


IFXMeshGroup::SetParentMeshName(U32 index, IFXString parentmeshName)

This method sets the parent mesh name at the specified index.

Parameters:

index

Index of the mesh pointer to be set

parentmeshName

A String containing the mesh name

Return Values:

None


IFXMeshGroup::GetMeshName(U32 index)

This method returns the mesh name at the specified index.

Parameters:

index

ID of the desired mesh

Return Values:

IFXString - a string containing the mesh name.


IFXMeshGroup::SetMeshName(U32 index, IFXString meshName)

This method sets the name of the mesh in the mesh group at the specified index.

Parameters:

index

Index of the mesh pointer to be set

meshName

A String containing the mesh name

Return Values:

None


IFXMeshGroup::GetNeighborMesh()

This method gets a pointer to the NeighborMesh associated with this mesh group. The neighbor mesh is a way of providing a topologically continuous view of all of the meshes within the mesh group, as they were authored. Such a view is useful for doing face neighbor transitions that may span across different IFXMeshes within a given IFXMeshGroup.

Parameters:

None

Return Values:

IFXNeighborMesh* - A pointer to an IFXNeighborMesh. Returns NULL if no neighbor mesh has been set.


IFXMeshGroup::SetNeighborMesh(IFXNeighborMesh* pNeighborMesh)

This method sets the internal pointer to the neighbor mesh for an IFXMeshGroup object. Note: one should call SetNeighborMesh(NULL) if a neighbor mesh object has been deleted for an IFXMeshGroup object that is still active.

Parameters:

pNeighborMesh

Pointer to a neighbor mesh object

Return Values:

None

§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.