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.halt()

AnimationAction.halt() 方法用于停止正在播放的动画,并将动画的时间指针(time)和权重(weight)重置为初始状态。使用此方法可以快速停止动画,而不必等待动画播放完整个周期。

语法

animationAction.halt();

参数

此方法无需参数。

返回值

此方法没有返回值。

使用示例

var mixer = new THREE.AnimationMixer( object );
var action = mixer.clipAction( animationClip );

// 播放动画
action.play();

// 等待一段时间后停止动画
setTimeout( function() {

    action.halt();
    
}, 2000 );

注意事项

AnimationAction.halt() 方法仅影响特定的 AnimationAction 实例,如果您需要停止 AnimationMixer 中的所有动画,则应使用 AnimationMixer.stopAllAction() 方法。