Class: Skeleton

pc.Skeleton

Represents a skeleton used to play animations.

Constructor

new Skeleton(graph)

Parameters:
Name Type Description
graph pc.GraphNode The root pc.GraphNode of the skeleton.
Properties:
Name Type Description
looping Boolean Determines whether skeleton is looping its animation.
Source:

Members

animation :pc.Animation

Animation currently assigned to skeleton.
Type:
Source:

currentTime :Number

Current time of currently active animation in seconds. This value is between zero and the duration of the animation.
Type:
  • Number
Source:

(readonly) numNodes :Number

Read-only property that returns number of nodes of a skeleton.
Type:
  • Number
Source:

Methods

addTime(delta)

Progresses the animation assigned to the specified skeleton by the supplied time delta. If the delta takes the animation passed its end point, if the skeleton is set to loop, the animation will continue from the beginning. Otherwise, the animation's current time will remain at its duration (i.e. the end).
Parameters:
Name Type Description
delta Number The time in seconds to progress the skeleton's animation.
Source:

blend(skel1, skel2, alpha)

Blends two skeletons together.
Parameters:
Name Type Description
skel1 pc.Skeleton Skeleton holding the first pose to be blended.
skel2 pc.Skeleton Skeleton holding the second pose to be blended.
alpha Number The value controlling the interpolation in relation to the two input skeletons. The value is in the range 0 to 1, 0 generating skel1, 1 generating skel2 and anything in between generating a spherical interpolation between the two.
Source:

(private) getAnimation() → {pc.Animation}

Returns the animation currently assigned to the specified skeleton.
Deprecated:
  • Yes
Source:
Returns:
The animation set on the skeleton.
Type
pc.Animation

(private) getCurrentTime() → {Number}

Returns the current time of the currently active animation as set on the specified skeleton. This value will be between zero and the duration of the animation.
Deprecated:
  • Yes
Source:
Returns:
The current time of the animation set on the skeleton.
Type
Number

(private) getLooping() → {Boolean}

Queries the specified skeleton to determine whether it is looping its animation.
Deprecated:
  • Yes
Source:
Returns:
True if the skeleton is looping the animation, false otherwise.
Type
Boolean

(private) getNumNodes() → {Number}

Returns the number of nodes held by the specified skeleton.
Deprecated:
  • Yes
Source:
Returns:
The number of nodes held by the specified skeleton.
Type
Number

(private) setAnimation(animation)

Sets an animation on the specified skeleton.
Parameters:
Name Type Description
animation pc.Animation The animation to set on the skeleton.
Deprecated:
  • Yes
Source:

(private) setCurrentTime(time)

Sets the current time of the currently active animation as set on the specified skeleton. This value must be between zero and the duration of the animation.
Parameters:
Name Type Description
time Number The current time of the animation set on the skeleton.
Deprecated:
  • Yes
Source:

setGraph(graph)

Links a skeleton to a node hierarchy. The nodes animated skeleton are then subsequently used to drive the local transformation matrices of the node hierarchy.
Parameters:
Name Type Description
graph pc.GraphNode The root node of the graph that the skeleton is to drive.
Source:

(private) setLooping(looping)

Specified whether a skeleton should loop its animation or not. If the animation loops, it will wrap back to the start when adding time to the skeleton beyond the duration of the animation. Otherwise, the animation stops at its end after a single play through.
Parameters:
Name Type Description
looping Boolean True to cause the animation to loop back to the start on completion and false otherwise.
Deprecated:
  • Yes
Source:

updateGraph()

Synchronizes the currently linked node hierarchy with the current state of the skeleton. Internally, this function converts the interpolated keyframe at each node in the skeleton into the local transformation matrix at each corresponding node in the linked node hierarchy.
Source: