build/modelscript.umd.js
function(t, obj) {
            	var V, R = null, x, y, z;
            	if (t.determinant) { R = t.elements; }
            	switch (this.elements.length) {
            	case 2:
                        V = obj.elements || obj;
                        if (V.length != 2) { return null; }
                        if (!R) { R = matrix$2.Rotation(t).elements; }
                        x = this.elements[0] - V[0];
                        y = this.elements[1] - V[1];
                        return Vector.create([
            		V[0] + R[0][0] * x + R[0][1] * y,
            		V[1] + R[1][0] * x + R[1][1] * y
                        ]);
                        break;
            	case 3:
                        if (!obj.direction) { return null; }
                        var C = obj.pointClosestTo(this).elements;
                        if (!R) { R = matrix$2.Rotation(t, obj.direction).elements; }
                        x = this.elements[0] - C[0];
                        y = this.elements[1] - C[1];
                        z = this.elements[2] - C[2];
                        return Vector.create([
            		C[0] + R[0][0] * x + R[0][1] * y + R[0][2] * z,
            		C[1] + R[1][0] * x + R[1][1] * y + R[1][2] * z,
            		C[2] + R[2][0] * x + R[2][1] * y + R[2][2] * z
                        ]);
                        break;
            	default:
                        return null;
            	}
                }
function(t, obj) {
            	var V, R = null, x, y, z;
            	if (t.determinant) { R = t.elements; }
            	switch (this.elements.length) {
            	case 2:
                        V = obj.elements || obj;
                        if (V.length != 2) { return null; }
                        if (!R) { R = matrix$2.Rotation(t).elements; }
                        x = this.elements[0] - V[0];
                        y = this.elements[1] - V[1];
                        return Vector.create([
            		V[0] + R[0][0] * x + R[0][1] * y,
            		V[1] + R[1][0] * x + R[1][1] * y
                        ]);
                        break;
            	case 3:
                        if (!obj.direction) { return null; }
                        var C = obj.pointClosestTo(this).elements;
                        if (!R) { R = matrix$2.Rotation(t, obj.direction).elements; }
                        x = this.elements[0] - C[0];
                        y = this.elements[1] - C[1];
                        z = this.elements[2] - C[2];
                        return Vector.create([
            		C[0] + R[0][0] * x + R[0][1] * y + R[0][2] * z,
            		C[1] + R[1][0] * x + R[1][1] * y + R[1][2] * z,
            		C[2] + R[2][0] * x + R[2][1] * y + R[2][2] * z
                        ]);
                        break;
            	default:
                        return null;
            	}
                }
function ( t , obj ) { var V , R = null , x , y , z ; if ( t . determinant ) { R = t . elements ; } switch ( this . elements . length ) { case 2 : V = obj . elements || obj ; if ( V . length != 2 ) { return null ; } if ( ! R ) { R = matrix$2 . Rotation ( t ) . elements ; } x = this . elements [ 0 ] - V [ 0 ] ; y = this . elements [ 1 ] - V [ 1 ] ; return Vector . create ( [ V [ 0 ] + R [ 0 ] [ 0 ] * x + R [ 0 ] [ 1 ] * y , V [ 1 ] + R [ 1 ] [ 0 ] * x + R [ 1 ] [ 1 ] * y ] ) ; break ; case 3 : if ( ! obj . direction ) { return null ; } var C = obj . pointClosestTo ( this ) . elements ; if ( ! R ) { R = matrix$2 . Rotation ( t , obj . direction ) . elements ; } x = this . elements [ 0 ] - C [ 0 ] ; y = this . elements [ 1 ] - C [ 1 ] ; z = this . elements [ 2 ] - C [ 2 ] ; return Vector . create ( [ C [ 0 ] + R [ 0 ] [ 0 ] * x + R [ 0 ] [ 1 ] * y + R [ 0 ] [ 2 ] * z , C [ 1 ] + R [ 1 ] [ 0 ] * x + R [ 1 ] [ 1 ] * y + R [ 1 ] [ 2 ] * z , C [ 2 ] + R [ 2 ] [ 0 ] * x + R [ 2 ] [ 1 ] * y + R [ 2 ] [ 2 ] * z ] ) ; break ; default : return null ; } }
Rotates the vector about the given object. The object should be a point if the vector is 2D, and a line if it is 3D. Be careful with line directions!
Rotates the vector about the given object . The object should be a point if the vector is 2D and a line if it is 3D . Be careful with line directions!