cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MeshSkin Class Reference

MeshSkin, A class maintain a collection of bones that affect Mesh vertex. More...

#include <CCMeshSkin.h>

Inheritance diagram for MeshSkin:
Ref

Public Member Functions

ssize_t getBoneCount () const
 get total bone count, skin bone + node bone More...
 
Bone3DgetBoneByIndex (unsigned int index) const
 get bone More...
 
Bone3DgetBoneByName (const std::string &id) const
 
int getBoneIndex (Bone3D *bone) const
 get bone index More...
 
Vec4getMatrixPalette ()
 compute matrix palette used by gpu skin More...
 
ssize_t getMatrixPaletteSize () const
 getSkinBoneCount() * 3 More...
 
Bone3DgetRootBone () const
 get root bone of the skin More...
 
 ~MeshSkin ()
 
void removeAllBones ()
 remove all bones More...
 
void addSkinBone (Bone3D *bone)
 add skin bone More...
 
const Mat4getInvBindPose (const Bone3D *bone)
 get inverse bind pose More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 NA NA More...
 

Static Public Member Functions

static MeshSkincreate (Skeleton3D *skeleton, const std::string &filename, const std::string &name)
 create a new meshskin if do not want to share meshskin More...
 
static MeshSkincreate (Skeleton3D *skeleton, const std::vector< std::string > &boneNames, const std::vector< Mat4 > &invBindPose)
 

Public Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: MeshSkin()
 

Protected Attributes

Vector< Bone3D * > _skinBones
 
std::vector< Mat4_invBindPoses
 
Bone3D_rootBone
 
Skeleton3D_skeleton
 
Vec4_matrixPalette
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Friends

class Mesh
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 

Detailed Description

MeshSkin, A class maintain a collection of bones that affect Mesh vertex.

And it is responsible for computing matrix palletes that used by skin mesh rendering.

Constructor & Destructor Documentation

~MeshSkin ( )

Member Function Documentation

void addSkinBone ( Bone3D bone)

add skin bone

static MeshSkin* create ( Skeleton3D skeleton,
const std::string &  filename,
const std::string &  name 
)
static

create a new meshskin if do not want to share meshskin

static MeshSkin* create ( Skeleton3D skeleton,
const std::vector< std::string > &  boneNames,
const std::vector< Mat4 > &  invBindPose 
)
static
Bone3D* getBoneByIndex ( unsigned int  index) const

get bone

Bone3D* getBoneByName ( const std::string &  id) const
ssize_t getBoneCount ( ) const

get total bone count, skin bone + node bone

int getBoneIndex ( Bone3D bone) const

get bone index

const Mat4& getInvBindPose ( const Bone3D bone)

get inverse bind pose

Vec4* getMatrixPalette ( )

compute matrix palette used by gpu skin

ssize_t getMatrixPaletteSize ( ) const

getSkinBoneCount() * 3

Bone3D* getRootBone ( ) const

get root bone of the skin

void removeAllBones ( )

remove all bones

Friends And Related Function Documentation

friend class Mesh
friend

Member Data Documentation

std::vector<Mat4> _invBindPoses
protected
Vec4* _matrixPalette
protected
Bone3D* _rootBone
protected
Skeleton3D* _skeleton
protected
Vector<Bone3D*> _skinBones
protected

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