src/Vec3.js
function(v) {
        if (v instanceof Vec3) {
            return new Vec3(this.x + v.x, this.y + v.y, this.z + v.z);
        }
        else if(v instanceof Vec2){
            return new Vec3(this.x + v.x, this.y + v.y, this.z);
        }
        else if(typeof v === 'number') {
            return new Vec3(this.x + v, this.y + v, this.z + v);
        }
        else {
            throw new TypeError('Invalid argument', v);
        }
    }
function(v) {
        if (v instanceof Vec3) {
            return new Vec3(this.x + v.x, this.y + v.y, this.z + v.z);
        }
        else if(v instanceof Vec2){
            return new Vec3(this.x + v.x, this.y + v.y, this.z);
        }
        else if(typeof v === 'number') {
            return new Vec3(this.x + v, this.y + v, this.z + v);
        }
        else {
            throw new TypeError('Invalid argument', v);
        }
    }
function ( v ) { if ( v instanceof Vec3 ) { return new Vec3 ( this . x + v . x , this . y + v . y , this . z + v . z ) ; } else if ( v instanceof Vec2 ) { return new Vec3 ( this . x + v . x , this . y + v . y , this . z ) ; } else if ( typeof v === 'number' ) { return new Vec3 ( this . x + v , this . y + v , this . z + v ) ; } else { throw new TypeError ( 'Invalid argument' , v ) ; } }
Adds the vector to a vector or Number and returns a new vector.
@memberof Vec3#
@param   {Vec3|Vec2|Number} v vector or Number to add.
@returns {Vec3}                resulting vector
Adds the vector to a vector or Number and returns a new vector .