Cocos2d-x  v3.17
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Bone3D Class Reference

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

Inherits Ref.

Public Member Functions

const Mat4getInverseBindPose ()
 Returns the inverse bind pose matrix for this joint. More...
 
var getInverseBindPose ()
 Returns the inverse bind pose matrix for this joint. More...
 
void updateWorldMat ()
 update own world matrix and children's
 
var updateWorldMat ()
 update own world matrix and children's
 
const Mat4getWorldMat ()
 get world matrix
 
var getWorldMat ()
 get world matrix
 
const std::string & getName () const
 get bone name
 
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...
 
void clearBoneBlendState ()
 clear bone blend states
 
var clearBoneBlendState ()
 clear bone blend states
 
void setInverseBindPose (const Mat4 &m)
 Sets the inverse bind pose matrix. More...
 
var setInverseBindPose ( var 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
 
var resetPose ()
 reset pose to origin
 
void updateJointMatrix (Vec4 *matrixPalette)
 Updates the joint matrix. More...
 
var updateJointMatrix ( var 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
 
Bone3DgetChildBoneByIndex (int index) const
 get child bone by index
 
var getChildBoneByIndex ( var index)
 get child bone by index
 
void addChildBone (Bone3D *bone)
 add child bone
 
void removeChildBoneByIndex (int index)
 remove child bone by index
 
var removeChildBoneByIndex ( var index)
 remove child bone by index
 
void removeChildBone (Bone3D *bone)
 remove child bone
 
void removeAllChildBone ()
 remove all child bone
 
var removeAllChildBone ()
 remove all child bone
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
local 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. More...
 

Static Public Member Functions

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

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.
 

Detailed Description

Defines a basic hierarchical structure of transformation spaces.

Member Function Documentation

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.
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
tagunique tag, only blend animation between different tags
weightblend weight
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
tagunique tag, only blend animation between different tags
weightblend weight
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.
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.
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.
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.


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