|
@@ -2790,16 +2790,34 @@ THREE.FBXLoader = ( function () {
|
|
if ( curves.y !== undefined ) times = times.concat( curves.y.times );
|
|
if ( curves.y !== undefined ) times = times.concat( curves.y.times );
|
|
if ( curves.z !== undefined ) times = times.concat( curves.z.times );
|
|
if ( curves.z !== undefined ) times = times.concat( curves.z.times );
|
|
|
|
|
|
- // then sort them and remove duplicates
|
|
|
|
|
|
+ // then sort them
|
|
times = times.sort( function ( a, b ) {
|
|
times = times.sort( function ( a, b ) {
|
|
|
|
|
|
return a - b;
|
|
return a - b;
|
|
|
|
|
|
- } ).filter( function ( elem, index, array ) {
|
|
|
|
|
|
+ } );
|
|
|
|
|
|
- return array.indexOf( elem ) == index;
|
|
|
|
|
|
+ // and remove duplicates
|
|
|
|
+ if ( times.length > 1 ) {
|
|
|
|
|
|
- } );
|
|
|
|
|
|
+ var targetIndex = 1;
|
|
|
|
+ var lastValue = times[ 0 ];
|
|
|
|
+ for ( var i = 1; i < times.length; i ++ ) {
|
|
|
|
+
|
|
|
|
+ var currentValue = times[ i ];
|
|
|
|
+ if ( currentValue !== lastValue ) {
|
|
|
|
+
|
|
|
|
+ times[ targetIndex ] = currentValue;
|
|
|
|
+ lastValue = currentValue;
|
|
|
|
+ targetIndex ++;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ times = times.slice( 0, targetIndex );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
return times;
|
|
return times;
|
|
|
|
|