[name]
3D vector.
Example
var a = new THREE.Vector3( 1, 0, 0 );
var b = new THREE.Vector3( 0, 1, 0 );
var c = new THREE.Vector3();
c.cross( a, b );
Constructor
[name]( [page:Float x], [page:Float y], [page:Float z] )
Properties
.[page:Float x]
.[page:Float y]
.[page:Float z]
Methods
.set( [page:Float x], [page:Float y], [page:Float z] ) [page:Vector3]
Sets value of this vector.
.setX( [page:Float x] ) [page:Vector3]
Sets x value of this vector.
.setY( [page:Float y] ) [page:Vector3]
Sets y value of this vector.
.setZ( [page:Float z] ) [page:Vector3]
Sets z value of this vector.
.copy( [page:Vector3 v] ) [page:Vector3]
Copies value of *v* to this vector.
.add( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3]
Sets this vector to *a + b*.
.addSelf( [page:Vector3 v] ) [page:Vector3]
Adds *v* to this vector.
.sub( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3]
Sets this vector to *a - b*.
.subSelf( [page:Vector3 v] ) [page:Vector3]
Subtracts *v* from this vector.
.multiplyScalar( [page:Float s] ) [page:Vector3]
Multiplies this vector by scalar *s*.
.divideScalar( [page:Float s] ) [page:Vector3]
Divides this vector by scalar *s*.
Set vector to *( 0, 0, 0 )* if *s == 0*.
.negate() [page:Vector3]
Inverts this vector.
.dot( [page:Vector3 v] ) [page:Float]
Computes dot product of this vector and *v*.
.lengthSq() [page:Float]
Computes squared length of this vector.
.length() [page:Float]
Computes length of this vector.
.lengthManhattan() [page:Float]
Computes Manhattan length of this vector.
[link:http://en.wikipedia.org/wiki/Taxicab_geometry]
.normalize() [page:Vector3]
Normalizes this vector.
.distanceTo( [page:Vector3 v] ) [page:Vector3]
Computes distance of this vector to *v*.
.distanceToSquared( [page:Vector3 v] ) [page:Vector3]
Computes squared distance of this vector to *v*.
.normalize() [page:Vector3]
Normalizes this vector.
.setLength( [page:Float l] ) [page:Vector3]
Normalizes this vector and multiplies it by *l*.
.cross( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3]
Sets this vector to cross product of *a* and *b*.
.crossSelf( [page:Vector3 v] ) [page:Vector3]
Sets this vector to cross product of itself and *v*.
.getPositionFromMatrix( [page:Matrix4 m] ) [page:Vector3]
Sets this vector extracting position from matrix transform.
.getRotationFromMatrix( [page:Matrix4 m] ) [page:Vector3]
Sets this vector extracting Euler angles rotation from matrix transform.
.getScaleFromMatrix( [page:Matrix4 m] ) [page:Vector3]
Sets this vector extracting scale from matrix transform.
.equals( [page:Vector3 v] ) [page:Vector3]
Checks for strict equality of this vector and *v*.
.isZero() [page:Boolean]
Checks if length of this vector is within small epsilon (*0.0001*).
.clone() [page:Vector3]
Clones this vector.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]