Constructor
new GLTFAnimationLoader(gltfLoader)
Create a GLTF animation loader
Parameters:
| Name | Type | Description |
|---|---|---|
gltfLoader |
THREE.GLTFLoader |
The Three.js GLTF loader instance |
- Source:
Extends
- AnimationLoader
Members
animationCache :Map.<string, THREE.AnimationClip>
Cache for loaded animations
Type:
- Map.<string, THREE.AnimationClip>
- Source:
gltfLoader :THREE.GLTFLoader
The Three.js GLTF loader
Type:
- THREE.GLTFLoader
- Source:
Methods
clearCache() → {void}
Clear the animation cache
- Source:
Returns:
- Type
- void
getCachedAnimationNames() → {Array.<string>}
Get all cached animation names
- Source:
Returns:
Array of cached animation names
- Type
- Array.<string>
(async) loadAnimation(name) → {Promise.<THREE.AnimationClip>}
Load an animation from GLTF by name
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string |
The animation name to load |
- Source:
Throws:
-
If animation is not found
- Type
- Error
Returns:
The loaded animation clip
- Type
- Promise.<THREE.AnimationClip>
(async) preloadAnimations(gltfModel) → {Promise.<void>}
Preload animations from a GLTF model
Parameters:
| Name | Type | Description |
|---|---|---|
gltfModel |
Object | The loaded GLTF model |
- Source:
Returns:
- Type
- Promise.<void>