API Reference

Class List

pc.Skeleton

Represents a skeleton used to play animations.

Summary

Properties

animationAnimation currently assigned to skeleton.
currentTimeCurrent time of currently active animation in seconds.
loopingDetermines whether skeleton is looping its animation.
numNodesRead-only property that returns number of nodes of a skeleton.[read only]

Methods

addTimeProgresses the animation assigned to the specified skeleton by the supplied time delta.
blendBlends two skeletons together.
setGraphLinks a skeleton to a node hierarchy.
updateGraphSynchronizes the currently linked node hierarchy with the current state of the skeleton.

Details

Constructor

Skeleton(graph)

Parameters

graphpc.GraphNodeThe root pc.GraphNode of the skeleton.

Properties

pc.Animationanimation

Animation currently assigned to skeleton.

NumbercurrentTime

Current time of currently active animation in seconds. This value is between zero and the duration of the animation.

Booleanlooping

Determines whether skeleton is looping its animation.

NumbernumNodes

Read-only property that returns number of nodes of a skeleton.[read only]

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

deltaNumberThe time in seconds to progress the skeleton's animation.

blend(skel1, skel2, alpha)

Blends two skeletons together.

Parameters

skel1pc.SkeletonSkeleton holding the first pose to be blended.
skel2pc.SkeletonSkeleton holding the second pose to be blended.
alphaNumberThe 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.

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

graphpc.GraphNodeThe root node of the graph that the skeleton is to drive.

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.