Class Bone
Hierarchy
- Node
- Bone
Index
Constructors
Properties
Accessors
Methods
- add
Behavior - begin
Animation - clone
- compute
Absolute Transforms - compute
World Matrix - copy
Animation Range - create
Animation Range - delete
Animation Range - dispose
- get
Absolute Position - get
Absolute Position From Local - get
Absolute Position From Local To Ref - get
Absolute Position To Ref - get
Absolute Transform - get
Animation By Name - get
Animation Range - get
Animation Ranges - get
Base Matrix - get
Behavior By Name - get
Bind Pose - get
Child Meshes - get
Children - get
Class Name - get
Descendants - get
Direction - get
Direction To Ref - get
Engine - get
Hierarchy Bounding Vectors - get
Index - get
Inverted Absolute Transform - get
Local Matrix - get
Local Position From Absolute - get
Local Position From Absolute To Ref - get
Parent - get
Position - get
Position To Ref - get
Rest Pose - get
Rotation - get
Rotation Matrix - get
Rotation Matrix To Ref - get
Rotation Quaternion - get
Rotation Quaternion To Ref - get
Rotation To Ref - get
Scale - get
Scale To Ref - get
Scene - get
Skeleton - get
Transform Node - get
World Matrix - is
Descendant Of - is
Disposed - is
Enabled - is
Ready - link
Transform Node - mark
As Dirty - remove
Behavior - return
To Rest - rotate
- scale
- serialize
Animation Ranges - set
Absolute Position - set
Axis Angle - set
Bind Pose - set
Current Pose As Rest - set
Enabled - set
Parent - set
Position - set
Rest Pose - set
Rotation - set
Rotation Matrix - set
Rotation Quaternion - set
Scale - set
Yaw Pitch Roll - translate
- update
Matrix - Add
Node Constructor - Construct
- Parse
Animation Ranges
Constructors
constructor
Create a new bone
Parameters
name: string
defines the bone name
skeleton: Skeleton
defines the parent skeleton
Optional parentBone: Nullable<Bone>
defines the parent (can be null if the bone is the root)
Optional localMatrix: Nullable<Matrix>
defines the local matrix
Optional restPose: Nullable<Matrix>
defines the rest pose matrix
Optional baseMatrix: Nullable<Matrix>
defines the base matrix
Optional index: Nullable<number>
defines index of the bone in the hierarchy
Returns Bone
Properties
animationsSearch playground for animations
Gets the animations associated with this bone
childrenSearch playground for children
Gets the list of child bones
idSearch playground for id
Gets or sets the id of the node
inspectable Custom PropertiesSearch playground for inspectableCustomProperties
List of inspectable custom properties (used by the Inspector)
lengthSearch playground for length
Gets or sets bone length
metadataSearch playground for metadata
Gets or sets an object used to store user defined information for the node
nameSearch playground for name
defines the bone name
on Accessibility Tag Changed ObservableSearch playground for onAccessibilityTagChangedObservable
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the mesh is disposed
on ReadySearch playground for onReady
Callback raised when the node is ready to be used
reserved Data StoreSearch playground for reservedDataStore
For internal use only. Please do not use.
stateSearch playground for state
Gets or sets a string used to store user defined state for the node
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
Accessors
accessibility Tag
Gets or sets the accessibility tag to describe the node for accessibility purpose.
Returns Nullable<IAccessibilityTag>
Gets or sets the accessibility tag to describe the node for accessibility purpose.
Parameters
value: Nullable<IAccessibilityTag>
Returns void
animation Properties Override
Gets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
behaviors
do Not Serialize
Gets or sets a boolean used to define if the node must be serialized
Returns boolean
Gets or sets a boolean used to define if the node must be serialized
Parameters
value: boolean
Returns void
on Cloned Observable
An event triggered when the node is cloned
Returns Observable<Node>
on Dispose
Sets a callback that will be raised when the node will be disposed
Parameters
callback: (() => void)
Returns void
Returns void
on Enabled State Changed Observable
An event triggered when the enabled state of the node changes
Returns Observable<boolean>
parent
position
rotation
rotation Quaternion
Gets or sets current rotation quaternion (in local space)
Returns Quaternion
Gets or sets current rotation quaternion (in local space)
Parameters
newRotation: Quaternion
Returns void
scaling
world Matrix From Cache
Returns directly the latest state of the mesh World matrix. A Matrix is returned.
Returns Matrix
Methods
add BehaviorSearch playground for addBehavior
begin AnimationSearch playground for beginAnimation
Will start the animation sequence
Parameters
name: string
defines the range frames for animation sequence
Optional loop: boolean
defines if the animation should loop (false by default)
Optional speedRatio: number
defines the speed factor in which to run the animation (1 by default)
Optional onAnimationEnd: (() => void)
defines a function to be executed when the animation ended (undefined by default)
Returns void
Returns Nullable<Animatable>
the object created for this animation. If range does not exist, it will return null
cloneSearch playground for clone
compute Absolute TransformsSearch playground for computeAbsoluteTransforms
Compute the absolute transforms of this bone and its children
Returns void
compute World MatrixSearch playground for computeWorldMatrix
Computes the world matrix of the node
Parameters
Optional _force: boolean
defines if the cache version should be invalidated forcing the world matrix to be created from scratch
Returns Matrix
the world matrix
copy Animation RangeSearch playground for copyAnimationRange
Copy an animation range from another bone
Parameters
source: Bone
defines the source bone
rangeName: string
defines the range name to copy
frameOffset: number
defines the frame offset
rescaleAsRequired: boolean
defines if rescaling must be applied if required
skelDimensionsRatio: Nullable<Vector3>
defines the scaling ratio
Returns boolean
true if operation was successful
create Animation RangeSearch playground for createAnimationRange
Creates an animation range for this node
Parameters
name: string
defines the name of the range
from: number
defines the starting key
to: number
defines the end key
Returns void
delete Animation RangeSearch playground for deleteAnimationRange
Delete a specific animation range
Parameters
name: string
defines the name of the range to delete
Optional deleteFrames: boolean
defines if animation frames from the range must be deleted as well
Returns void
disposeSearch playground for dispose
Releases resources associated with this node.
Parameters
Optional doNotRecurse: boolean
Set to true to not recurse into each children (recurse into each children by default)
Optional disposeMaterialAndTextures: boolean
Set to true to also dispose referenced materials and textures (false by default)
Returns void
get Absolute PositionSearch playground for getAbsolutePosition
Get the absolute position of the bone (world space)
Parameters
Optional tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to
Returns Vector3
The absolute position of the bone
get Absolute Position From LocalSearch playground for getAbsolutePositionFromLocal
Get the world position of a point that is in the local space of the bone
Parameters
position: Vector3
The local position
Optional tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to
Returns Vector3
The world position
get Absolute Position From Local To RefSearch playground for getAbsolutePositionFromLocalToRef
Get the world position of a point that is in the local space of the bone and copy it to the result param
Parameters
position: Vector3
The local position
tNode: undefined | Nullable<TransformNode>
The TransformNode that this bone is attached to
result: Vector3
The vector3 that the world position should be copied to
Returns void
get Absolute Position To RefSearch playground for getAbsolutePositionToRef
Copy the absolute position of the bone (world space) to the result param
Parameters
tNode: TransformNode
The TransformNode that this bone is attached to
result: Vector3
The vector3 to copy the absolute position to
Returns void
get Absolute TransformSearch playground for getAbsoluteTransform
Gets the absolute transform matrix (ie base matrix * parent world matrix)
Returns Matrix
a matrix
get Animation By NameSearch playground for getAnimationByName
get Animation RangeSearch playground for getAnimationRange
Get an animation range by name
Parameters
name: string
defines the name of the animation range to look for
Returns Nullable<AnimationRange>
null if not found else the requested animation range
get Animation RangesSearch playground for getAnimationRanges
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Base MatrixSearch playground for getBaseMatrix
Gets the base matrix (initial matrix which remains unchanged)
Returns Matrix
the base matrix (as known as bind pose matrix)
get Behavior By NameSearch playground for getBehaviorByName
get Bind PoseSearch playground for getBindPose
Gets the bind pose matrix
Returns Matrix
the bind pose matrix
get Child MeshesSearch playground for getChildMeshes
Get all child-meshes of this node
Type Parameters
T extends AbstractMesh<T>
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optional predicate: ((node: Node) => node is T)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns node is T
Returns T[]
an array of AbstractMesh
Get all child-meshes of this node
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optional predicate: ((node: Node) => boolean)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns boolean
Returns AbstractMesh[]
an array of AbstractMesh
get ChildrenSearch playground for getChildren
Returns an array containing the root bones
Returns Bone[]
an array containing the root bones
get Class NameSearch playground for getClassName
Gets the current object class name.
Returns string
the class name
get DescendantsSearch playground for getDescendants
Will return all nodes that have this node as ascendant
Type Parameters
T extends Node<T>
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional predicate: ((node: Node) => node is T)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns node is T
Returns T[]
all children nodes of all types
Will return all nodes that have this node as ascendant
Parameters
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional predicate: ((node: Node) => boolean)
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Parameters
node: Node
Returns boolean
Returns Node[]
all children nodes of all types
get DirectionSearch playground for getDirection
Get the world direction from an axis that is in the local space of the bone
Parameters
localAxis: Vector3
The local direction that is used to compute the world direction
Optional tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to
Returns Vector3
The world direction
get Direction To RefSearch playground for getDirectionToRef
Copy the world direction to a vector3 from an axis that is in the local space of the bone
Parameters
localAxis: Vector3
The local direction that is used to compute the world direction
tNode: undefined | Nullable<TransformNode>
The TransformNode that this bone is attached to
result: Vector3
The vector3 that the world direction will be copied to
Returns void
get EngineSearch playground for getEngine
Gets the engine of the node
Returns Engine
a Engine
get Hierarchy Bounding VectorsSearch playground for getHierarchyBoundingVectors
Return the minimum and maximum world vectors of the entire hierarchy under current node
Parameters
Optional includeDescendants: boolean
Include bounding info from descendants as well (true by default)
Optional predicate: Nullable<((abstractMesh: AbstractMesh) => boolean)>
defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
Returns { max: Vector3; min: Vector3 }
the new bounding vectors
get IndexSearch playground for getIndex
Gets the node index in matrix array generated for rendering
Returns number
the node index
get Inverted Absolute TransformSearch playground for getInvertedAbsoluteTransform
Gets the inverse of the absolute transform matrix. This matrix will be multiplied by local matrix to get the difference matrix (ie. the difference between original state and current state)
Returns Matrix
a matrix
get Local MatrixSearch playground for getLocalMatrix
Gets the local matrix
Returns Matrix
a matrix
get Local Position From AbsoluteSearch playground for getLocalPositionFromAbsolute
Get the local position of a point that is in world space
Parameters
position: Vector3
The world position
Optional tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to
Returns Vector3
The local position
get Local Position From Absolute To RefSearch playground for getLocalPositionFromAbsoluteToRef
Get the local position of a point that is in world space and copy it to the result param
Parameters
position: Vector3
The world position
tNode: undefined | Nullable<TransformNode>
The TransformNode that this bone is attached to
result: Vector3
The vector3 that the local position should be copied to
Returns void
get ParentSearch playground for getParent
get PositionSearch playground for getPosition
Get the position of the bone in local or world space
Parameters
Optional space: Space
The space that the returned position is in
Optional tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to. This is only used in world space
Returns Vector3
The position of the bone
get Position To RefSearch playground for getPositionToRef
Copy the position of the bone to a vector3 in local or world space
Parameters
space: undefined | Space
The space that the returned position is in
tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to. This is only used in world space
result: Vector3
The vector3 to copy the position to
Returns void
get Rest PoseSearch playground for getRestPose
Gets the rest pose matrix
Returns Matrix
a matrix
get RotationSearch playground for getRotation
Get the euler rotation of the bone in local or world space
Parameters
Optional space: Space
The space that the rotation should be in
Optional tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to. This is only used in world space
Returns Vector3
The euler rotation
get Rotation MatrixSearch playground for getRotationMatrix
Get the rotation matrix of the bone in local or world space
Parameters
space: undefined | Space
The space that the rotation should be in
tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns Matrix
The rotation matrix
get Rotation Matrix To RefSearch playground for getRotationMatrixToRef
Copy the rotation matrix of the bone to a matrix. The rotation can be in either local or world space
Parameters
space: undefined | Space
The space that the rotation should be in
tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
result: Matrix
The quaternion that the rotation should be copied to
Returns void
get Rotation QuaternionSearch playground for getRotationQuaternion
Get the quaternion rotation of the bone in either local or world space
Parameters
Optional space: Space
The space that the rotation should be in
Optional tNode: Nullable<TransformNode>
The TransformNode that this bone is attached to. This is only used in world space
Returns Quaternion
The quaternion rotation
get Rotation Quaternion To RefSearch playground for getRotationQuaternionToRef
Copy the quaternion rotation of the bone to a quaternion. The rotation can be in either local or world space
Parameters
space: undefined | Space
The space that the rotation should be in
tNode: undefined | Nullable<TransformNode>
The TransformNode that this bone is attached to. This is only used in world space
result: Quaternion
The quaternion that the rotation should be copied to
Returns void
get Rotation To RefSearch playground for getRotationToRef
Copy the euler rotation of the bone to a vector3. The rotation can be in either local or world space
Parameters
space: undefined | Space
The space that the rotation should be in
tNode: undefined | Nullable<TransformNode>
The TransformNode that this bone is attached to. This is only used in world space
result: Vector3
The vector3 that the rotation should be copied to
Returns void
get ScaleSearch playground for getScale
Gets the current scaling in local space
Returns Vector3
the current scaling vector
get Scale To RefSearch playground for getScaleToRef
Gets the current scaling in local space and stores it in a target vector
Parameters
result: Vector3
defines the target vector
Returns void
get SceneSearch playground for getScene
Gets the scene of the node
Returns Scene
a scene
get SkeletonSearch playground for getSkeleton
Gets the parent skeleton
Returns Skeleton
a skeleton
get Transform NodeSearch playground for getTransformNode
Gets the node used to drive the bone's transformation
Returns Nullable<TransformNode>
a transform node or null
get World MatrixSearch playground for getWorldMatrix
Gets a matrix used to store world matrix (ie. the matrix sent to shaders)
Returns Matrix
is Descendant OfSearch playground for isDescendantOf
Is this node a descendant of the given node? The function will iterate up the hierarchy until the ancestor was found or no more parents defined
Parameters
ancestor: Node
defines the parent node to inspect
Returns boolean
a boolean indicating if this node is a descendant of the given node
is DisposedSearch playground for isDisposed
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is EnabledSearch playground for isEnabled
Is this node enabled? If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
Parameters
Optional checkAncestors: boolean
indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
Returns boolean
whether this node (and its parent) is enabled
is ReadySearch playground for isReady
Is this node ready to be used/rendered
Parameters
Optional _completeCheck: boolean
defines if a complete check (including materials and lights) has to be done (false by default)
Returns boolean
true if the node is ready
link Transform NodeSearch playground for linkTransformNode
Links with the given transform node. The local matrix of this bone is copied from the transform node every frame.
Parameters
transformNode: Nullable<TransformNode>
defines the transform node to link to
Returns void
mark As DirtySearch playground for markAsDirty
Flag the bone as dirty (Forcing it to update everything)
Returns Bone
this bone
remove BehaviorSearch playground for removeBehavior
return To RestSearch playground for returnToRest
Sets the local matrix to rest pose matrix
Returns void
rotateSearch playground for rotate
Add a rotation to the bone on an axis in local or world space
Parameters
axis: Vector3
The axis to rotate the bone on
amount: number
The amount to rotate the bone
Optional space: Space
The space that the axis is in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
scaleSearch playground for scale
Scale the bone on the x, y and z axes (in local space)
Parameters
x: number
The amount to scale the bone on the x axis
y: number
The amount to scale the bone on the y axis
z: number
The amount to scale the bone on the z axis
Optional scaleChildren: boolean
sets this to true if children of the bone should be scaled as well (false by default)
Returns void
serialize Animation RangesSearch playground for serializeAnimationRanges
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set Absolute PositionSearch playground for setAbsolutePosition
Set the absolute position of the bone (world space)
Parameters
position: Vector3
The position to set the bone
Optional tNode: TransformNode
The TransformNode that this bone is attached to
Returns void
set Axis AngleSearch playground for setAxisAngle
Set the rotation of the bone to a particular axis angle in local or world space
Parameters
axis: Vector3
The axis to rotate the bone on
angle: number
The angle that the bone should be rotated to
Optional space: Space
The space that the axis is in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
set Bind PoseSearch playground for setBindPose
Sets the bind pose matrix
Parameters
matrix: Matrix
the local-space bind pose to set for this bone
Returns void
set Current Pose As RestSearch playground for setCurrentPoseAsRest
Set the current local matrix as the restPose for this bone.
Returns void
set EnabledSearch playground for setEnabled
Set the enabled state of this node
Parameters
value: boolean
defines the new enabled state
Returns void
set ParentSearch playground for setParent
set PositionSearch playground for setPosition
Set the position of the bone in local or world space
Parameters
position: Vector3
The position to set the bone
Optional space: Space
The space that the position is in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
set Rest PoseSearch playground for setRestPose
Sets the rest pose matrix
Parameters
matrix: Matrix
the local-space rest pose to set for this bone
Returns void
set RotationSearch playground for setRotation
Set the euler rotation of the bone in local or world space
Parameters
rotation: Vector3
The euler rotation that the bone should be set to
Optional space: Space
The space that the rotation is in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
set Rotation MatrixSearch playground for setRotationMatrix
Set the rotation matrix of the bone in local or world space
Parameters
rotMat: Matrix
The rotation matrix that the bone should be set to
Optional space: Space
The space that the rotation is in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
set Rotation QuaternionSearch playground for setRotationQuaternion
Set the quaternion rotation of the bone in local or world space
Parameters
quat: Quaternion
The quaternion rotation that the bone should be set to
Optional space: Space
The space that the rotation is in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
set ScaleSearch playground for setScale
Set the bone scaling in local space
Parameters
scale: Vector3
defines the scaling vector
Returns void
set Yaw Pitch RollSearch playground for setYawPitchRoll
Set the yaw, pitch, and roll of the bone in local or world space
Parameters
yaw: number
The rotation of the bone on the y axis
pitch: number
The rotation of the bone on the x axis
roll: number
The rotation of the bone on the z axis
Optional space: Space
The space that the axes of rotation are in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
translateSearch playground for translate
Translate the bone in local or world space
Parameters
vec: Vector3
The amount to translate the bone
Optional space: Space
The space that the translation is in
Optional tNode: TransformNode
The TransformNode that this bone is attached to. This is only used in world space
Returns void
update MatrixSearch playground for updateMatrix
Update the base and local matrices
Parameters
matrix: Matrix
defines the new base or local matrix
Optional updateDifferenceMatrix: boolean
defines if the difference matrix must be updated
Optional updateLocalMatrix: boolean
defines if the local matrix should be updated
Returns void
Static Add Node ConstructorSearch playground for AddNodeConstructor
Add a new node constructor
Parameters
type: string
defines the type name of the node to construct
constructorFunc: NodeConstructor
defines the constructor function
Returns void
Static ConstructSearch playground for Construct
Returns a node constructor based on type name
Parameters
type: string
defines the type name
name: string
defines the new node name
scene: Scene
defines the hosting scene
Optional options: any
defines optional options to transmit to constructors
Returns Nullable<(() => Node)>
the new constructor or null
Class used to store bone information
https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons