IGameSkin Class Reference

IGameSkin Class Referenceabstract

#include <IGameModifier.h>

Class Description

A skin wrapper Class.

This class provides an unified interface to the various skin options present in 3ds Max. This includes Physique and Skin. All the data from skin and physique are stored in the same way, but options exist to find out what skinning option was used. The vertex indexes used here are the same as those for the actual mesh, so this provides a one to one corelation.
The version of the Character Studio that is used for IGame is 3.2.1 - Anything earlier is unsupported
The bones need to be parsed by IGame before this interface can be used.

See also
IGameModifier
+ Inheritance diagram for IGameSkin:

Public Types

enum  SkinType { IGAME_PHYSIQUE, IGAME_SKIN }
 Skinning Modifier Types. More...
 
enum  VertexType { IGAME_RIGID, IGAME_RIGID_BLENDED, IGAME_UNKNOWN }
 Vertex types. More...
 
- Public Types inherited from IGameModifier
enum  ModType { IGAME_SKINNING, IGAME_MORPHER, IGAME_GENERAL }
 IGame modifier types. More...
 

Public Member Functions

virtual int GetNumOfSkinnedVerts ()=0
 Get the numbers of vertices effected by this instance of the modifier. More...
 
virtual int GetNumberOfBones (int vertexIndex)=0
 Get the numbers of bones effecting the vertex. More...
 
virtual float GetWeight (int vertexIndex, int boneIndex)=0
 Get the weight for the bone and vertex index passed in. More...
 
virtual INodeGetBone (int vertexIndex, int boneIndex)=0
 Get the 3ds Max bone effecting the vertex. More...
 
virtual IGameNodeGetIGameBone (int vertexIndex, int boneIndex)=0
 Get the IGameNode equivalent of the bone effecting the vertex. More...
 
virtual int GetBoneID (int vertexIndex, int boneIndex)=0
 Get the IGameNode ID equivalent of the bone effecting the vertex. More...
 
virtual VertexType GetVertexType (int vertexIndex)=0
 Get Vertex Type. More...
 
virtual SkinType GetSkinType ()=0
 Get the Skinning type. More...
 
virtual bool GetInitBoneTM (IGameNode *boneNode, GMatrix &intMat)=0
 Get the bone TM when skin was added. More...
 
virtual bool GetInitBoneTM (INode *boneNode, GMatrix &intMat)=0
 Get the bone TM when skin was added. More...
 
virtual void GetInitSkinTM (GMatrix &intMat)=0
 Get the original TM for the node with skin. More...
 
virtual int GetTotalBoneCount ()=0
 Get the number of bones used by the skinning modifiers. More...
 
virtual int GetTotalSkinBoneCount ()=0
 Receive the total number of bones used by the skinning system - this will include bones that are not assigned to any vertex. More...
 
virtual IGameMeshGetInitialPose ()=0
 Returns the mesh before the skin modifier was added. More...
 
virtual int GetBoneIndex (IGameNode *boneNode, bool usedList=false)=0
 use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex More...
 
virtual int GetBoneIndex (INode *boneNode, bool usedList=false)=0
 use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex More...
 
virtual IGameNodeGetIGameBone (int index, bool usedList=false)=0
 use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex More...
 
virtual INodeGetBone (int index, bool usedList=false)=0
 use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex More...
 
 IGameSkin (Modifier *mod, INode *node)
 The IGameSkin constructor. More...
 
- Public Member Functions inherited from IGameModifier
 IGameModifier (Modifier *mod, INode *node)
 The IGameModifier constructor. More...
 
virtual ModType GetModifierType ()=0
 Get IGameModifier type. More...
 
virtual const MCHARGetUIName ()
 Get the modifier Name. More...
 
virtual const MCHARGetInternalName ()
 Get the modifier Name. More...
 
virtual ModifierGetMaxModifier ()
 Access to the 3ds Max modifier. More...
 
virtual void EffectedNodes (Tab< INode * > &nodeList)
 Access to the nodes this modifier is applied to. More...
 
virtual bool IsSkin ()
 Check whether the modifier is a skinning modifier. More...
 
virtual bool IsMorpher ()
 Check whether the modifier is the morpher modifier. More...
 
virtual ~IGameModifier ()
 
- Public Member Functions inherited from IExportEntity
virtual ~IExportEntity ()
 Destructor. More...
 
virtual IPropertyContainerGetIPropertyContainer ()
 Retrieve the Property Container. More...
 
virtual bool IsEntitySupported ()
 Is the Entity directly supported. More...
 
virtual const MCHARGetClassName ()=0
 Retrieves the name of the entity class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Member Enumeration Documentation

enum SkinType

Skinning Modifier Types.

These are the Skin modifiers known to IGame

Enumerator
IGAME_PHYSIQUE 

A Physique Modifier.

IGAME_SKIN 

A 3ds Max Skin Modifier.

128  {
130  IGAME_SKIN,
131  };
A 3ds Max Skin Modifier.
Definition: IGameModifier.h:130
A Physique Modifier.
Definition: IGameModifier.h:129
enum VertexType

Vertex types.

These are the types used by the modifiers

Enumerator
IGAME_RIGID 

A RIGID vertex.

IGAME_RIGID_BLENDED 

A BLENED vertex.

IGAME_UNKNOWN 

Error or unsupported vertex.

135  {
136  IGAME_RIGID,
139  };
Error or unsupported vertex.
Definition: IGameModifier.h:138
A RIGID vertex.
Definition: IGameModifier.h:136
A BLENED vertex.
Definition: IGameModifier.h:137

Constructor & Destructor Documentation

IGameSkin ( Modifier mod,
INode node 
)
inline

The IGameSkin constructor.

Parameters
*modThe 3ds Max modifier to initialise
*nodeThe 3ds Max node to initialise
259 :IGameModifier(mod, node){};
IGameModifier(Modifier *mod, INode *node)
The IGameModifier constructor.

Member Function Documentation

virtual int GetNumOfSkinnedVerts ( )
pure virtual

Get the numbers of vertices effected by this instance of the modifier.

If the modifier is attached to more than one node, then this will be the count of vertices on the current node

Returns
The number of vertices
virtual int GetNumberOfBones ( int  vertexIndex)
pure virtual

Get the numbers of bones effecting the vertex.

Parameters
vertexIndexThe index of the vertex
Returns
The number of bones
virtual float GetWeight ( int  vertexIndex,
int  boneIndex 
)
pure virtual

Get the weight for the bone and vertex index passed in.

Parameters
vertexIndexThe index of the vertex
boneIndexThe bone index
Returns
The weight
virtual INode* GetBone ( int  vertexIndex,
int  boneIndex 
)
pure virtual

Get the 3ds Max bone effecting the vertex.

Parameters
vertexIndexThe index of the vertex
boneIndexThe bone index
Returns
A pointer to a 3ds Max INode for the bone
virtual IGameNode* GetIGameBone ( int  vertexIndex,
int  boneIndex 
)
pure virtual

Get the IGameNode equivalent of the bone effecting the vertex.

Parameters
vertexIndexThe index of the vertex
boneIndexThe bone index
Returns
A pointer to a IGameNode for the bone
virtual int GetBoneID ( int  vertexIndex,
int  boneIndex 
)
pure virtual

Get the IGameNode ID equivalent of the bone effecting the vertex.

The IGameNode ID can be used if the nodes pass out first and use this value as an index when upon import

Parameters
vertexIndexThe index of the vertex
boneIndexThe bone index
Returns
A Node ID
virtual VertexType GetVertexType ( int  vertexIndex)
pure virtual

Get Vertex Type.

Specifies whether the Vertex is either Rigid or blended

Parameters
vertexIndexThe vertex to query
Returns
The vertex type. It can be one of the following
IGAME_RIGID
IGAME_RIGID_BLENDED
See also
IGameSkin::VertexType
virtual SkinType GetSkinType ( )
pure virtual

Get the Skinning type.

This can be used to find out whether 3ds Max's Skin or Physique was used

Returns
The skinning type. It can be one of the following
IGAME_PHYSIQUE
IGAME_SKIN
See also
IGameSkin::SkinType
virtual bool GetInitBoneTM ( IGameNode boneNode,
GMatrix intMat 
)
pure virtual

Get the bone TM when skin was added.

This provides access to the intial Bone TM when the skin modifier was applied.

Parameters
boneNodeTHe IGameNode bone whose matrix is needed
&intMatTHe matrix to receive the intial TM
Returns
True if the bone was found
virtual bool GetInitBoneTM ( INode boneNode,
GMatrix intMat 
)
pure virtual

Get the bone TM when skin was added.

This provides access to the intial Bone TM when the skin modifier was applied.

Parameters
boneNodeThe Max INode bone whose matrix is needed
&intMatThe matrix to receive the intial TM
Returns
True if the bone was found
virtual void GetInitSkinTM ( GMatrix intMat)
pure virtual

Get the original TM for the node with skin.

This provides access to the intial node TM when the skin modifier was applied.

Parameters
&intMatThe matrix to receive the intial TM
virtual int GetTotalBoneCount ( )
pure virtual

Get the number of bones used by the skinning modifiers.

This provides the toal number of bones used by the modifiers. This shouldn't be confused with IGameSkin::GetNumberOfBones, which returns the numbers of bones associated with a vertex.

Returns
The total number of bones in the system
virtual int GetTotalSkinBoneCount ( )
pure virtual

Receive the total number of bones used by the skinning system - this will include bones that are not assigned to any vertex.

virtual IGameMesh* GetInitialPose ( )
pure virtual

Returns the mesh before the skin modifier was added.

virtual int GetBoneIndex ( IGameNode boneNode,
bool  usedList = false 
)
pure virtual

use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex

virtual int GetBoneIndex ( INode boneNode,
bool  usedList = false 
)
pure virtual

use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex

virtual IGameNode* GetIGameBone ( int  index,
bool  usedList = false 
)
pure virtual

use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex

virtual INode* GetBone ( int  index,
bool  usedList = false 
)
pure virtual

use the usedList to define if you want to the search all the bones or just the bones actually effecting a vertex