Main Physique Export API Elements
The following is a list of primary classes and functions in the physique export interface contained in the file PhyExp
.h.
Rigid Vertex Interface
A rigid vertex is represented by an instance of IPhyRigidVertex
.
IPhyRigidVertex::GetNode()
- Returns a pointer to theINode
to which the given vertex is assigned (controlled).IPhyRigidVertex::GetOffsetVector()
- Returns aPoint3
offset vector in the local coordinate space of the nthINode
.
Blended Rigid Vertex Interface
A blended rigid vertex is represented by an instance of IPhyBlendedRigidVertex
.
IPhyBlendedRigidVertex::GetNumberNodes()
- Return an int value which specifies how many nodes (Physique Links) this vertex is assigned to. The deformation of this vertex will be a blended (weighted average).IPhyBlendedRigidVertex::GetNode()
- Return a pointer to the nthINode
to which the given vertex is assigned (controlled).IPhyBlendedRigidVertex::GetOffsetVector()
- Return a Point3 offset vector in the local coordinate space of the nthINode
.IPhyBlendedRigidVertex::GetWeight()
- Return a floating point weight for the nthINode
.
Physique Export Interface
The physique export interface is represented by an instance of IPhysiqueExport
. It is accessed from a physique modifier using a call to Animatable::GetInterface()
with the class ID I_PHYINTERFACE
.
IPhysiqueExport::GetContextInterface()
- Returns a ModContext Export Interface for the ModContext associated with the given INode.IPhysiqueExport::ReleaseContextInterface()
- Must be called to free the context interface from memory.IPhysiqueExport::GetInitNodeTM()
- Returns the node transformation matrix in the initial position given a node pointer. Passing a node pointer for the deformable object itself will return the object offset matrix at the initial position, instead of the node transformation matrix. The return values are one of the following:MATRIX_RETURNED
NODE_NOT_FOUND
NO_MATRIX_SAVED
INVALID_MOD_POINTER
MATRIX_RETURNED
NODE_NOT_FOUND
NO_MATRIX_SAVED
INVALID_MOD_POINTER
IPhysiqueExport::Version()
- Returns the version of the export interface. For physique 2.2 the return value is 22.IPhysiqueExport::SetInitialPose()
- Puts the model in/out the initial position. Passing TRUE puts the model in the initial pose, Passing FALSE allows the model to deform normally.
Physique Context Export Interface
The physique context export interface is represented by an instance of IPhysiqueContextExport
. A pointer to IPhysiqueContextExport
can be retrieved using the method IPhysiqueExport::GetContextInterface()
. The context Interface is associated with a physique modifier associated with a node.
IPhysiqueContextExport::GetNumberVertices()
- Returns the number of vertices for the given physique object.IPhysiqueContextExport::ConvertToRigid()
- When called with the value TRUE as an argument, all vertices accessed byIPhysiqueContextExport::GetVertexInterface()
will be converted to rigid vertices. If passed the value FALSE as an argument, then any deformable vertices will return NULL when retrieved usingIPhysiqueContextExport::GetVertexInterface()
.IPhysiqueContextExport::GetVertexInterface()
- Returns anIPhyExport
pointer for the nth vertex.- Rigid non-blended vertices (assigned rigid to a single Node) will return an object that derives from
IPhyRigidVertex
. - Rigid Blended vertices (assigned rigid to more than one Node) will return an object that derives from
IPhyBlendedRigidVertex
. - All other vertices will return NULL, unless
ConvertToRigid()
has been called with the argument TRUE, in which case all vertices return eitherIPhyRigidVertex
orIPhyBlendedRigidVertex
.
- Rigid non-blended vertices (assigned rigid to a single Node) will return an object that derives from
- Rigid non-blended vertices (assigned rigid to a single Node) will return an object that derives from
IPhyRigidVertex
. - Rigid Blended vertices (assigned rigid to more than one Node) will return an object that derives from
IPhyBlendedRigidVertex
. - All other vertices will return NULL, unless
ConvertToRigid()
has been called with the argument TRUE, in which case all vertices return eitherIPhyRigidVertex
orIPhyBlendedRigidVertex
. IPhysiqueContextExport::ReleaseVertexInterface()
- You must call this method to free the vertex interface from memory.
Vertex Export Interface
The vertex export interface is an instance of IPhyVertexExport
and can is retrieved by calling IPhyContextExport::GetVertexInterface()
. This is the base class for all vertex export interface classes.
IPhyVertexExport::GetVertexType()
- Returns an integer representing the defined vertex type for the a vertex interface. We suggest usingdynamic_cast
<T*> and comparing againstNULL
instead to query the interface type.
Rigid Vertex Export Interface
The interface IPhyRigidVertex
derives from IPhyVertexExport
and is the base class for all non-blended rigid vertex assignments.
IPhyRigidVertex::GetNode()
- Returns anINode
pointer for the node (bone/link) to which the vertex is assigned.IPhyRigidVertex::GetOffsetVector()
- Returns the coordinates of the vertex in the local coordinates of the associatedINode
.
Blended Rigid Vertex Export Interface
The interface IPhyBlendedRigidVertex
derives from IPhyVertexExport
and is the base class for all blended rigid vertex assignments.
IPhyBlendedRigidVertex::GetNumberNodes()
- Returns the number of nodes to which this vertices is assigned with blending.IPhyBlendedRigidVertex::GetNode()
- Returns anINode
pointer for the nth node (bone/link) to which the vertex is assigned with blending.IPhyBlendedRigidVertex::GetOffsetVector()
- Returns the coordinates of the vertex in the local coordinates of the nthINode
pointer.IPhyBlendedRigidVertex::GetWeight()
- Returns the weight of the vertex assigned to the nthINode
pointer.