examples/FBXLoader.js
function ( curves ) {

			var times = [];

			// first join together the times for each axis, if defined
			if ( curves.x !== undefined ) times = times.concat( curves.x.times );
			if ( curves.y !== undefined ) times = times.concat( curves.y.times );
			if ( curves.z !== undefined ) times = times.concat( curves.z.times );

			// then sort them and remove duplicates
			times = times.sort( function ( a, b ) {

				return a - b;

			} ).filter( function ( elem, index, array ) {

				return array.indexOf( elem ) == index;

			} );

			return times;

		}
function ( curves ) {

			var times = [];

			// first join together the times for each axis, if defined
			if ( curves.x !== undefined ) times = times.concat( curves.x.times );
			if ( curves.y !== undefined ) times = times.concat( curves.y.times );
			if ( curves.z !== undefined ) times = times.concat( curves.z.times );

			// then sort them and remove duplicates
			times = times.sort( function ( a, b ) {

				return a - b;

			} ).filter( function ( elem, index, array ) {

				return array.indexOf( elem ) == index;

			} );

			return times;

		}
function ( curves ) { var times = [ ] ; // first join together the times for each axis, if defined if ( curves . x !== undefined ) times = times . concat ( curves . x . times ) ; if ( curves . y !== undefined ) times = times . concat ( curves . y . times ) ; if ( curves . z !== undefined ) times = times . concat ( curves . z . times ) ; // then sort them and remove duplicates times = times . sort ( function ( a , b ) { return a - b ; } ) . filter ( function ( elem , index , array ) { return array . indexOf ( elem ) == index ; } ) ; return times ; }
For all animated objects, times are defined separately for each axis Here we'll combine the times into one sorted array without duplicates
For all animated objects times are defined separately for each axis Here we ll combine the times into one sorted array without duplicates