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

Defines a basic hierachial structure of transformation spaces. More...

#include <CCSkeleton3D.h>

Inheritance diagram for Bone3D:
Ref

Classes

struct  BoneBlendState
 

Public Member Functions

const Mat4getInverseBindPose ()
 Returns the inverse bind pose matrix for this joint. More...
 
void updateWorldMat ()
 update own world matrix and children's More...
 
const Mat4getWorldMat ()
 get wrod matrix More...
 
const std::string & getName () const
 get bone name More...
 
void setAnimationValue (float *trans, float *rot, float *scale, void *tag=nullptr, float weight=1.0f)
 set animation value More...
 
void clearBoneBlendState ()
 clear bone blend states More...
 
void setInverseBindPose (const Mat4 &m)
 Sets the inverse bind pose matrix. More...
 
void setOriPose (const Mat4 &m)
 Sets the bone's original pose. More...
 
void resetPose ()
 reset pose to origin More...
 
void updateJointMatrix (Vec4 *matrixPalette)
 Updates the joint matrix. More...
 
Bone3DgetParentBone ()
 bone tree, we do not inherit from Node, Node has too many properties that we do not need. More...
 
ssize_t getChildBoneCount () const
 get child bone count More...
 
Bone3DgetChildBoneByIndex (int index) const
 get child bone by index More...
 
void addChildBone (Bone3D *bone)
 add child bone More...
 
void removeChildBoneByIndex (int index)
 remove child bone by index More...
 
void removeChildBone (Bone3D *bone)
 remove child bone More...
 
void removeAllChildBone ()
 remove all child bone 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 Bone3Dcreate (const std::string &id)
 Creates C3DBone. More...
 

Protected Member Functions

 Bone3D (const std::string &id)
 Constructor. More...
 
virtual ~Bone3D ()
 Destructor. More...
 
void updateLocalMat ()
 Update local matrix. More...
 
void setWorldMatDirty (bool dirty=true)
 set world matrix dirty flag More...
 
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 

Protected Attributes

std::string _name
 
Mat4 _invBindPose
 The Mat4 representation of the Joint's bind pose. More...
 
Mat4 _oriPose
 
Bone3D_parent
 
Vector< Bone3D * > _children
 
bool _worldDirty
 
Mat4 _world
 
Mat4 _local
 
std::vector< BoneBlendState_blendStates
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Friends

class Skeleton3D
 
class MeshSkin
 

Detailed Description

Defines a basic hierachial structure of transformation spaces.

Constructor & Destructor Documentation

Bone3D ( const std::string &  id)
protected

Constructor.

virtual ~Bone3D ( )
protectedvirtual

Destructor.

Member Function Documentation

void addChildBone ( Bone3D bone)

add child bone

void clearBoneBlendState ( )

clear bone blend states

static Bone3D* create ( const std::string &  id)
static

Creates C3DBone.

Bone3D* getChildBoneByIndex ( int  index) const

get child bone by index

ssize_t getChildBoneCount ( ) const

get child bone count

const Mat4& getInverseBindPose ( )

Returns the inverse bind pose matrix for this joint.

Returns
Inverse bind pose matrix.
const std::string& getName ( ) const
inline

get bone name

Bone3D* getParentBone ( )

bone tree, we do not inherit from Node, Node has too many properties that we do not need.

A clean Node is needed.

const Mat4& getWorldMat ( )

get wrod matrix

void removeAllChildBone ( )

remove all child bone

void removeChildBone ( Bone3D bone)

remove child bone

void removeChildBoneByIndex ( int  index)

remove child bone by index

void resetPose ( )

reset pose to origin

void setAnimationValue ( float *  trans,
float *  rot,
float *  scale,
void *  tag = nullptr,
float  weight = 1.0f 
)

set animation value

Parameters
transtranslate vec3
rotrotation quaternion
scalescale vec3
tag,uniquetag, only blend animation between different tags
weight,blendweight
void setInverseBindPose ( const Mat4 m)

Sets the inverse bind pose matrix.

Parameters
mMat4 representing the inverse bind pose for this Bone.
void setOriPose ( const Mat4 m)

Sets the bone's original pose.

Parameters
mMat4 representing the original pose for this Bone.
void setWorldMatDirty ( bool  dirty = true)
protected

set world matrix dirty flag

void updateJointMatrix ( Vec4 matrixPalette)

Updates the joint matrix.

Parameters
matrixPaletteThe matrix palette to update.
void updateLocalMat ( )
protected

Update local matrix.

void updateWorldMat ( )

update own world matrix and children's

Friends And Related Function Documentation

friend class MeshSkin
friend
friend class Skeleton3D
friend

Member Data Documentation

std::vector<BoneBlendState> _blendStates
protected
Vector<Bone3D*> _children
protected
Mat4 _invBindPose
protected

The Mat4 representation of the Joint's bind pose.

Mat4 _local
protected
std::string _name
protected
Mat4 _oriPose
protected
Bone3D* _parent
protected
Mat4 _world
protected
bool _worldDirty
protected

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