build/SPE.js
function( start, end, delta ) {
        'use strict';

        var types = this.types,
            out;

        if ( typeof start === types.NUMBER && typeof end === types.NUMBER ) {
            return start + ( ( end - start ) * delta );
        }
        else if ( start instanceof THREE.Vector2 && end instanceof THREE.Vector2 ) {
            out = start.clone();
            out.x = this.lerp( start.x, end.x, delta );
            out.y = this.lerp( start.y, end.y, delta );
            return out;
        }
        else if ( start instanceof THREE.Vector3 && end instanceof THREE.Vector3 ) {
            out = start.clone();
            out.x = this.lerp( start.x, end.x, delta );
            out.y = this.lerp( start.y, end.y, delta );
            out.z = this.lerp( start.z, end.z, delta );
            return out;
        }
        else if ( start instanceof THREE.Vector4 && end instanceof THREE.Vector4 ) {
            out = start.clone();
            out.x = this.lerp( start.x, end.x, delta );
            out.y = this.lerp( start.y, end.y, delta );
            out.z = this.lerp( start.z, end.z, delta );
            out.w = this.lerp( start.w, end.w, delta );
            return out;
        }
        else if ( start instanceof THREE.Color && end instanceof THREE.Color ) {
            out = start.clone();
            out.r = this.lerp( start.r, end.r, delta );
            out.g = this.lerp( start.g, end.g, delta );
            out.b = this.lerp( start.b, end.b, delta );
            return out;
        }
        else {
            console.warn( 'Invalid argument types, or argument types do not match:', start, end );
        }
    }
function( start, end, delta ) {
        'use strict';

        var types = this.types,
            out;

        if ( typeof start === types.NUMBER && typeof end === types.NUMBER ) {
            return start + ( ( end - start ) * delta );
        }
        else if ( start instanceof THREE.Vector2 && end instanceof THREE.Vector2 ) {
            out = start.clone();
            out.x = this.lerp( start.x, end.x, delta );
            out.y = this.lerp( start.y, end.y, delta );
            return out;
        }
        else if ( start instanceof THREE.Vector3 && end instanceof THREE.Vector3 ) {
            out = start.clone();
            out.x = this.lerp( start.x, end.x, delta );
            out.y = this.lerp( start.y, end.y, delta );
            out.z = this.lerp( start.z, end.z, delta );
            return out;
        }
        else if ( start instanceof THREE.Vector4 && end instanceof THREE.Vector4 ) {
            out = start.clone();
            out.x = this.lerp( start.x, end.x, delta );
            out.y = this.lerp( start.y, end.y, delta );
            out.z = this.lerp( start.z, end.z, delta );
            out.w = this.lerp( start.w, end.w, delta );
            return out;
        }
        else if ( start instanceof THREE.Color && end instanceof THREE.Color ) {
            out = start.clone();
            out.r = this.lerp( start.r, end.r, delta );
            out.g = this.lerp( start.g, end.g, delta );
            out.b = this.lerp( start.b, end.b, delta );
            return out;
        }
        else {
            console.warn( 'Invalid argument types, or argument types do not match:', start, end );
        }
    }
function ( start , end , delta ) { 'use strict' ; var types = this . types , out ; if ( typeof start === types . NUMBER && typeof end === types . NUMBER ) { return start + ( ( end - start ) * delta ) ; } else if ( start instanceof THREE . Vector2 && end instanceof THREE . Vector2 ) { out = start . clone ( ) ; out . x = this . lerp ( start . x , end . x , delta ) ; out . y = this . lerp ( start . y , end . y , delta ) ; return out ; } else if ( start instanceof THREE . Vector3 && end instanceof THREE . Vector3 ) { out = start . clone ( ) ; out . x = this . lerp ( start . x , end . x , delta ) ; out . y = this . lerp ( start . y , end . y , delta ) ; out . z = this . lerp ( start . z , end . z , delta ) ; return out ; } else if ( start instanceof THREE . Vector4 && end instanceof THREE . Vector4 ) { out = start . clone ( ) ; out . x = this . lerp ( start . x , end . x , delta ) ; out . y = this . lerp ( start . y , end . y , delta ) ; out . z = this . lerp ( start . z , end . z , delta ) ; out . w = this . lerp ( start . w , end . w , delta ) ; return out ; } else if ( start instanceof THREE . Color && end instanceof THREE . Color ) { out = start . clone ( ) ; out . r = this . lerp ( start . r , end . r , delta ) ; out . g = this . lerp ( start . g , end . g , delta ) ; out . b = this . lerp ( start . b , end . b , delta ) ; return out ; } else { console . warn ( 'Invalid argument types, or argument types do not match:' , start , end ) ; } }
Linearly interpolates two values of various types. The given values
must be of the same type for the interpolation to work.
@param  {(number|Object)} start The start value of the lerp.
@param  {(number|object)} end   The end value of the lerp.
@param  {Number} delta The delta posiiton of the lerp operation. Ideally between 0 and 1 (inclusive).
@return {(number|object|undefined)}       The result of the operation. Result will be undefined if
the start and end arguments aren't a supported type, or
if their types do not match.
Linearly interpolates two values of various types . The given values must be of the same type for the interpolation to work .