Capítulo 155 de 859

Chapter 155: AnimationLoader

Core Idea

Class for loading animation clips in the JSON format. The files are internally loaded via FileLoader.

Code Examples

const loader = new THREE.AnimationLoader();
const animations = await loader.loadAsync( 'animations/animation.js' );
  • What it demonstrates: Typical usage of AnimationLoader.

Reference Tables

Constructor

Signature
new AnimationLoader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )Starts loading from the given URL and pass the loaded animations as an array holding instances of AnimationClip to the onLoad() callback.
.parse( json : Object ) : Array.<AnimationClip>Parses the given JSON object and returns an array of animation clips.

Key Takeaways

  1. AnimationLoader extends: Loader
  2. Key methods: load, parse.

Connects To