Animation · class
BlendTree
Explained in Animation.
class BlendTreeimport { BlendTree } from '@driftengine/animation';Constructor
new
constructor(root: BlendNode, jointCount: number, bind?: Pose | undefined)| Parameter | Type | Description |
|---|---|---|
root | BlendNode | |
jointCount | number | |
bind? | Pose | undefined | The bind pose, or omitted for one whose channels start at rest.
Supply it whenever the clips are rotation-only, which is most of them. sampleClip leaves
a channel no track mentions exactly as it found it, so a rotation-only clip preserves whatever
translations the pose already held. blendPoses cannot do that — it interpolates every
channel of two poses — so without a bind pose here the scratch poses start at zero translation
and every joint collapses onto its parent's origin the moment a tree or a transition is
involved. Found by building a demo scene with it: one figure folded in on itself and the other,
which happened to go through retargetPose instead, did not. |
Methods
set
set(parameter: string, value: number): voidSet a parameter, refusing a name no node declares.
| Parameter | Type | Description |
|---|---|---|
parameter | string | |
value | number |
More
Loud rather than ignored. A typo silently does nothing, and what a consumer then sees is an animation that will not respond — a symptom a long way from the misspelling that caused it, and one no test of theirs would catch. What it costs is that a caller cannot set a parameter ahead of building the tree that uses it.
evaluate
evaluate(timeSec: number, out: Pose): voidSample the whole tree at timeSec into out. Allocates nothing.
| Parameter | Type | Description |
|---|---|---|
timeSec | number | |
out | Pose |
More
timeSec is the clock for every node that did not name one of its own, so a tree of ordinary
clips behaves exactly as it did before clocks existed.