Cocos2d-x  v3.11
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
MeshSkin Class Reference

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

Inherits Ref.

Public Member Functions

ssize_t getBoneCount () const
 Get total bone count. More...
 
Bone3DgetBoneByIndex (unsigned int index) const
 Get the specified bone by index. More...
 
Bone3DgetBoneByName (const std::string &id) const
 Get the specified bone by name. More...
 
int getBoneIndex (Bone3D *bone) const
 Get the specified bone index. More...
 
Vec4getMatrixPalette ()
 Compute matrix palette used by gpu skin. More...
 
ssize_t getMatrixPaletteSize () const
 Get the MatrixPalette size. More...
 
Bone3DgetRootBone () const
 Get the root bone of the skin. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

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)
 Create a new meshskin if do not want to share meshskin The specified skeleton. More...
 

Protected Member Functions

void removeAllBones ()
 Remove all bones.
 
void addSkinBone (Bone3D *bone)
 Add the specified skin bone The Bone3D object.
 
const Mat4getInvBindPose (const Bone3D *bone)
 Get inverse bind pose by the specified Bone3D object. More...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

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

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

Member Function Documentation

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.

Parameters
skeletonThe specified skeleton.
static MeshSkin* create ( Skeleton3D skeleton,
const std::vector< std::string > &  boneNames,
const std::vector< Mat4 > &  invBindPose 
)
static

Create a new meshskin if do not want to share meshskin The specified skeleton.

The bones names list. The bones' inverse binding pose. The meshSkin object.

ssize_t getBoneCount ( ) const

Get total bone count.

(skin bone + node bone) The bone count.

Bone3D* getBoneByIndex ( unsigned int  index) const

Get the specified bone by index.

The index. The Bone3D object.

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

Get the specified bone by name.

The name. The Bone3D object.

int getBoneIndex ( Bone3D bone) const

Get the specified bone index.

The specified Bone3D object. The index.

Vec4* getMatrixPalette ( )

Compute matrix palette used by gpu skin.

The matrix palette is array of matrix which contatin The matrix palette.

ssize_t getMatrixPaletteSize ( ) const

Get the MatrixPalette size.

The size. Equal to the getSkinBoneCount() * 3

Bone3D* getRootBone ( ) const

Get the root bone of the skin.

The Bone3D object.

const Mat4& getInvBindPose ( const Bone3D bone)
protected

Get inverse bind pose by the specified Bone3D object.

The Bone3d object. The inverse bind pose matrix.


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