cocos2d-x  3.4
 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...
 
local getInverseBindPose ()
 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...
 
var getWorldMat ()
 get wrod matrix More...
 
local getWorldMat ()
 get wrod matrix More...
 
const std::string & getName () const
 get bone name More...
 
local getName ()
 get bone name More...
 
void setAnimationValue (float *trans, float *rot, float *scale, void *tag=nullptr, float weight=1.0f)
 set animation value More...
 
var setAnimationValue ( var trans, var rot, var scale, var nullptr, var 0f)
 set animation value More...
 
local setAnimationValue ( local trans, local rot, local scale, local nullptr, local 0f)
 set animation value More...
 
void clearBoneBlendState ()
 clear bone blend states More...
 
var clearBoneBlendState ()
 clear bone blend states More...
 
local clearBoneBlendState ()
 clear bone blend states More...
 
void setInverseBindPose (const Mat4 &m)
 Sets the inverse bind pose matrix. More...
 
var setInverseBindPose ( var m)
 Sets the inverse bind pose matrix. More...
 
local setInverseBindPose ( local m)
 Sets the inverse bind pose matrix. More...
 
void setOriPose (const Mat4 &m)
 Sets the bone's original pose. More...
 
var setOriPose ( var m)
 Sets the bone's original pose. More...
 
local setOriPose ( local m)
 Sets the bone's original pose. More...
 
void resetPose ()
 reset pose to origin More...
 
var resetPose ()
 reset pose to origin More...
 
local resetPose ()
 reset pose to origin More...
 
void updateJointMatrix (Vec4 *matrixPalette)
 Updates the joint matrix. More...
 
var updateJointMatrix ( var matrixPalette)
 Updates the joint matrix. More...
 
local updateJointMatrix ( local 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...
 
local getChildBoneByIndex ( local index)
 get child bone by index More...
 
void addChildBone (Bone3D *bone)
 add child bone More...
 
var addChildBone ( var bone)
 add child bone More...
 
local addChildBone ( local bone)
 add child bone More...
 
void removeChildBoneByIndex (int index)
 remove child bone by index More...
 
void removeChildBone (Bone3D *bone)
 remove child bone More...
 
var removeChildBone ( var bone)
 remove child bone More...
 
local removeChildBone ( local bone)
 remove child bone More...
 
void removeAllChildBone ()
 remove all child bone More...
 
var removeAllChildBone ()
 remove all child bone More...
 
local 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 ()

Static Public Member Functions

static Bone3Dcreate (const std::string &id)
 Creates C3DBone. More...
 
local create ( local id)
 Creates C3DBone. More...
 

Protected Member Functions

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

Protected Attributes

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

var Bone3D ( var  id)
protected

Constructor.

local Bone3D ( local  id)
protected

Constructor.

virtual ~Bone3D ( )
protectedvirtual

Destructor.

var ~Bone3D ( )
protectedvirtual

Destructor.

local ~Bone3D ( )
protectedvirtual

Destructor.

Member Function Documentation

void addChildBone ( Bone3D bone)

add child bone

var addChildBone ( var  bone)

add child bone

local addChildBone ( local  bone)

add child bone

void clearBoneBlendState ( )

clear bone blend states

var clearBoneBlendState ( )

clear bone blend states

local clearBoneBlendState ( )

clear bone blend states

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

Creates C3DBone.

var create ( var  id)
static

Creates C3DBone.

local create ( local  id)
static

Creates C3DBone.

Bone3D* getChildBoneByIndex ( int  index) const

get child bone by index

var getChildBoneByIndex ( var  index)

get child bone by index

local getChildBoneByIndex ( local  index)

get child bone by index

ssize_t getChildBoneCount ( ) const

get child bone count

var getChildBoneCount ( )

get child bone count

local getChildBoneCount ( )

get child bone count

const Mat4& getInverseBindPose ( )

Returns the inverse bind pose matrix for this joint.

Returns
Inverse bind pose matrix.
var getInverseBindPose ( )

Returns the inverse bind pose matrix for this joint.

Returns
Inverse bind pose matrix.
local getInverseBindPose ( )

Returns the inverse bind pose matrix for this joint.

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

get bone name

var getName ( )
inline

get bone name

local getName ( )
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.

var getParentBone ( )

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

A clean Node is needed.

local 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

var getWorldMat ( )

get wrod matrix

local getWorldMat ( )

get wrod matrix

void removeAllChildBone ( )

remove all child bone

var removeAllChildBone ( )

remove all child bone

local removeAllChildBone ( )

remove all child bone

void removeChildBone ( Bone3D bone)

remove child bone

var removeChildBone ( var  bone)

remove child bone

local removeChildBone ( local  bone)

remove child bone

void removeChildBoneByIndex ( int  index)

remove child bone by index

var removeChildBoneByIndex ( var  index)

remove child bone by index

local removeChildBoneByIndex ( local  index)

remove child bone by index

void resetPose ( )

reset pose to origin

var resetPose ( )

reset pose to origin

local 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
var setAnimationValue ( var  trans,
var  rot,
var  scale,
var  tag = nullptr,
var  weight = 1.0f 
)

set animation value

Parameters
transtranslate vec3
rotrotation quaternion
scalescale vec3
tag,uniquetag, only blend animation between different tags
weight,blendweight
local setAnimationValue ( local  trans,
local  rot,
local  scale,
local  tag = nullptr,
local  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.
var setInverseBindPose ( var  m)

Sets the inverse bind pose matrix.

Parameters
mMat4 representing the inverse bind pose for this Bone.
local setInverseBindPose ( local  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.
var setOriPose ( var  m)

Sets the bone's original pose.

Parameters
mMat4 representing the original pose for this Bone.
local setOriPose ( local  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

var setWorldMatDirty ( var  dirty = true)
protected

set world matrix dirty flag

local setWorldMatDirty ( local  dirty = true)
protected

set world matrix dirty flag

void updateJointMatrix ( Vec4 matrixPalette)

Updates the joint matrix.

Parameters
matrixPaletteThe matrix palette to update.
var updateJointMatrix ( var  matrixPalette)

Updates the joint matrix.

Parameters
matrixPaletteThe matrix palette to update.
local updateJointMatrix ( local  matrixPalette)

Updates the joint matrix.

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

Update local matrix.

var updateLocalMat ( )
protected

Update local matrix.

local updateLocalMat ( )
protected

Update local matrix.

void updateWorldMat ( )

update own world matrix and children's

var updateWorldMat ( )

update own world matrix and children's

local updateWorldMat ( )

update own world matrix and children's

Friends And Related Function Documentation

friend class MeshSkin
friend
var MeshSkin
friend
local MeshSkin
friend
friend class Skeleton3D
friend
var Skeleton3D
friend
local Skeleton3D
friend

Member Data Documentation

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

The Mat4 representation of the Joint's bind pose.

var _invBindPose
protected

The Mat4 representation of the Joint's bind pose.

local _invBindPose
protected

The Mat4 representation of the Joint's bind pose.

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

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