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

PropertyMixer.restoreOriginalState()

该函数主要用于将属性混合器(PropertyMixer)的目标属性(target property)恢复到初始状态。它将重置动画相关的变量,如当前时间(time)和值(value),以及将当前值设置为目标属性的起始值。

语法

mixer.restoreOriginalState()

参数

该函数没有参数。

返回值

无。

示例

// 创建一个属性混合器
var mixer = new THREE.AnimationMixer(mesh);
var clip = THREE.AnimationClip.CreateFrom... // 创建动画片段
var action = mixer.clipAction(clip);
var propertyMixer = action.getClip();

// 修改属性混合器的值
propertyMixer.time = 1;
propertyMixer.value = new THREE.Vector3(1,2,3);

// 恢复属性混合器的原始状态
propertyMixer.restoreOriginalState();

注意事项

  • 使用此函数前应确保目标属性已经经过了初始值的初始化,即使用了PropertyMixer.bind()绑定后调用PropertyMixer.setValue()设置了起始值。
  • 此函数只能将目标属性恢复到初始状态,无法将其重置到其他特定状态。

参考文献