Capítulo 316 de 859

Chapter 316: AnimationPathHelper

Core Idea

Visualizes the motion path of an animated object based on position keyframes from an AnimationClip.

Key Concepts

  • clip : AnimationClip: The animation clip containing position keyframes.
  • divisions : number: Number of samples for smooth path interpolation.
  • isAnimationPathHelper : boolean (readonly): This flag can be used for type testing.
  • line : Line: The line representing the animation path.
  • object : Object3D: The object whose path is being visualized.
  • points : Points | null: Points marking keyframe positions.
  • root : Object3D: The root object containing the animation clips.

Code Examples

const clip = model.animations[ 0 ];
const helper = new AnimationPathHelper( model, clip, object );
scene.add( helper );
  • What it demonstrates: Typical usage of AnimationPathHelper.

Reference Tables

Constructor

Signature
new AnimationPathHelper( root : Object3D, clip : AnimationClip, object : Object3D, options : Object )

Properties

PropertyDescription
.clip : AnimationClipThe animation clip containing position keyframes.
.divisions : numberNumber of samples for smooth path interpolation.
.isAnimationPathHelper : boolean (readonly)This flag can be used for type testing.
.line : LineThe line representing the animation path.
.object : Object3DThe object whose path is being visualized.
`.points : Pointsnull`
.root : Object3DThe root object containing the animation clips.

Methods

MethodDescription
.dispose()Frees the GPU-related resources allocated by this instance.
`.setColor( color : numberColor
`.setMarkerColor( color : numberColor
.updateMatrixWorld( force : boolean )Updates the helper's transform to match the object's parent.

Key Takeaways

  1. AnimationPathHelper extends: EventDispatcher → Object3D
  2. Most relevant properties: clip, divisions, isAnimationPathHelper, line.
  3. Key methods: dispose, setColor, setMarkerColor, updateMatrixWorld.

Connects To