CrystalSpace

Public API Reference

CS::Mesh::AnimatedMeshTools Class Reference

Helper class to generate new CS::Mesh::iAnimatedMesh's. More...

#include <cstool/animeshtools.h>

List of all members.

Static Public Member Functions

static csPtr
< iAnimatedMeshFactory
ImportGeneralMesh (iObjectRegistry *object_reg, iGeneralFactoryState *genmesh, bool deleteMesh=true)
 Create a new animesh from a genmesh.
static bool ImportMorphMesh (iObjectRegistry *object_reg, iAnimatedMeshFactory *baseMesh, iAnimatedMeshFactory *morphMesh, const char *morphName, bool deleteMesh=true)
 Create a new morph target in an animesh by importing the vertices from another animesh.
static csPtr
< iAnimatedMeshFactory
ImportSplitMorphMesh (iObjectRegistry *object_reg, const char *path, const char *baseMesh, const char *factoryName, const char *meshMask="")
 Import a mesh with its morph targets split in several different model files.
static void PopulateSkeletonBoundingBoxes (CS::Mesh::iAnimatedMeshFactory *animeshFactory, csBitArray *boneMask=nullptr)
 Populate an animesh factory with bone bounding boxes that are based only on the topology of the skeleton of the animesh.

Detailed Description

Helper class to generate new CS::Mesh::iAnimatedMesh's.

Definition at line 45 of file animeshtools.h.


Member Function Documentation

static csPtr<iAnimatedMeshFactory> CS::Mesh::AnimatedMeshTools::ImportGeneralMesh ( iObjectRegistry object_reg,
iGeneralFactoryState genmesh,
bool  deleteMesh = true 
) [static]

Create a new animesh from a genmesh.

It imports only the mesh part of the genmesh (ie vertices, indices, etc), not the animations.

Parameters:
object_reg The object registry
genmesh The genmesh to be imported
deleteMesh Whether or not the genmesh will be deleted after the call to this method. If true, then it allows to reuse the render buffers of this mesh, this is therefore more optimal.
static bool CS::Mesh::AnimatedMeshTools::ImportMorphMesh ( iObjectRegistry object_reg,
iAnimatedMeshFactory baseMesh,
iAnimatedMeshFactory morphMesh,
const char *  morphName,
bool  deleteMesh = true 
) [static]

Create a new morph target in an animesh by importing the vertices from another animesh.

Warning:
You must still call iAnimatedMeshFactory::Invalidate() on baseMesh after the call to this method (eg after the creation of all morph targets).
Parameters:
object_reg The object registry
baseMesh The base animesh where the morph target will be imported.
morphMesh The animesh to import into the other as a new morph target.
morphName The name of the new morph target
deleteMesh Whether or not the animesh morphMesh will be deleted after the call to this method. If true, then it allows to reuse the render buffers of this mesh, this is therefore more optimal.
Warning:
The two animeshes must have the same vertices in the same order.
static csPtr<iAnimatedMeshFactory> CS::Mesh::AnimatedMeshTools::ImportSplitMorphMesh ( iObjectRegistry object_reg,
const char *  path,
const char *  baseMesh,
const char *  factoryName,
const char *  meshMask = "" 
) [static]

Import a mesh with its morph targets split in several different model files.

This is useful eg to load directly models from the FaceGen software.

The system will scan the provided directory, and load all animesh model files matching the given mask. All these animeshes will be imported in the base animesh as a new morph target instead of a new animesh.

Parameters:
object_reg The object registry
path A VFS path to the directory containing all the data files
baseMesh The name of the file defining the base animesh where all morph targets will be imported.
factoryName Name to be given to the newly created animesh factory.
meshMask A regular expression to determine which files should be imported as a new morph target. Use for example ".*[.]3[dD][sS]" if you want all files terminating by ".3ds" or ".3DS". If you provide an empty mask, then a new one will be built based on baseMesh.
Note:
The animesh models with a different number of vertices than the base animesh won't be imported. These models are also supposed to have the same vertices in the same order.
static void CS::Mesh::AnimatedMeshTools::PopulateSkeletonBoundingBoxes ( CS::Mesh::iAnimatedMeshFactory animeshFactory,
csBitArray boneMask = nullptr 
) [static]

Populate an animesh factory with bone bounding boxes that are based only on the topology of the skeleton of the animesh.

The behavior of this method is different from the default computing of the bone bounding boxes that is integrated in the animesh. The default behavior is based on the vertices of the animesh and their bone influences, while this method will compute the bone bounding boxes only based on the topology of the skeleton, not on the envelope of the mesh.

Parameters:
animeshFactory The animesh to manipulate.
boneMask An optional bone mask specifying the bones for which a bounding box has to be defined. All the bones that are not present in the mask will have their bounding box untouched.

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

Generated for Crystal Space 2.1 by doxygen 1.6.1