@@ -66,6 +66,11 @@
<h2>Methods</h2>
+ <h3>[method:AnimationClip clone]()</h3>
+ <p>
+ Returns a copy of this clip.
+ </p>
+
<h3>[method:this optimize]()</h3>
<p>
Optimizes each track by removing equivalent sequential keys (which are common in morph target
@@ -62,6 +62,9 @@
<h2>方法</h2>
+ <p></p>
通过移除等效的顺序键(在变形目标序列中很常见)来优化每一个轨道
@@ -38,12 +38,18 @@
返回一个数组,时间和值可以根据此数组排序。
</p>
+ <h3>[method:Number insertKeyframe]( [param:KeyframeTrack track], [param:Number time] )</h3>
<h3>[method:Boolean isTypedArray]( object )</h3>
如果该对象是类型化数组,返回*true*
+ <h3>[method:AnimationClip mergeMorphTargetTracks]( [param:AnimationClip tracks], [param:Object3D root] )</h3>
<h3>[method:Array sortedArray]( values, stride, order )</h3>
将[page:AnimationUtils.getKeyframeOrder getKeyframeOrder]方法返回的数组排序。
@@ -137,6 +137,9 @@
+ <h3>[method:KeyframeTrack clone]()</h3>
<h3>[method:null createInterpolant]()</h3>
根据传入构造器中的插值类型参数,创建线性插值([page:LinearInterpolant LinearInterpolant]),立方插值([page:CubicInterpolant CubicInterpolant])或离散插值
@@ -1408,7 +1408,7 @@ THREE.GLTFExporter.prototype = {
}
- THREE.AnimationUtils.mergeMorphTargetTracks( clip, root );
+ clip = THREE.AnimationUtils.mergeMorphTargetTracks( clip.clone(), root );
var tracks = clip.tracks;
var channels = [];
@@ -445,6 +445,21 @@ Object.assign( AnimationClip.prototype, {
return this;
+ },
+ clone: function () {
+ var tracks = [];
+ for ( var i = 0; i < this.tracks.length; i ++ ) {
+ tracks.push( this.tracks[ i ].clone() );
+ }
+ return new AnimationClip( this.name, this.duration, tracks );
} );