BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

AnimationAction.getClip()

1. 简介

AnimationAction.getClip()three.js 中的一个方法,用于获取该动画播放器所使用的动画剪辑 AnimationClip实例。

2. 语法

animationAction.getClip()

3. 返回值

返回一个 AnimationClip 实例,该实例表示被该动画播放器所使用的动画。

4. 示例

// 创建动画剪辑
var animationClip = new THREE.AnimationClip('exampleAnimation', 3, [
    new THREE.VectorKeyframeTrack('position.x', [0, 1, 2], [0, 100, 0]),
    new THREE.VectorKeyframeTrack('position.y', [0, 1, 2], [0, 50, 0]),
    new THREE.VectorKeyframeTrack('position.z', [0, 1, 2], [0, 0, 0])
]);

// 创建动画播放器并播放动画
var animationMixer = new THREE.AnimationMixer(mesh);
var animationAction = animationMixer.clipAction(animationClip);
animationAction.play();

// 获取动画剪辑
var currentAnimationClip = animationAction.getClip();
console.log(currentAnimationClip);

5. 参考文献