[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.crossVectors( a, b );

Constructor

[name]( [page:Float x], [page:Float y], [page:Float z] )

x -- todo
y -- todo
z -- todo
todo

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 v] ) [page:Vector3]

Adds *v* to this vector.

.addVectors( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3]

Sets this vector to *a + b*.

.sub( [page:Vector3 v] ) [page:Vector3]

Subtracts *v* from this vector.

.subVectors( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3]

Sets this vector to *a - b*.

.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:Float]

Computes distance of this vector to *v*.

.distanceToSquared( [page:Vector3 v] ) [page:Float]

Computes squared distance of this vector to *v*.

.setLength( [page:Float l] ) [page:Vector3]

Normalizes this vector and multiplies it by *l*.

.cross( [page:Vector3 v] ) [page:Vector3]

Sets this vector to cross product of itself and *v*.

.crossVectors( [page:Vector3 a], [page:Vector3 b] ) [page:Vector3]

Sets this vector to cross product of *a* and *b*.

.getPositionFromMatrix( [page:Matrix4 m] ) [page:Vector3]

Sets this vector extracting position 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*.

.clone() [page:Vector3]

Clones this vector.

.clamp([page:todo min], [page:todo max]) [page:todo]

min -- todo
max -- todo
todo

.applyMatrix3([page:todo m]) [page:todo]

m -- todo
todo

.applyMatrix4([page:todo m]) [page:todo]

m -- todo
todo

.projectOnPlane([page:todo planeNormal]) [page:todo]

planeNormal -- todo
todo

.projectOnVector([page:todo vector]) [page:todo]

vector -- todo
todo

.addScalar([page:todo s]) [page:todo]

s -- todo
todo

.divide([page:todo v]) [page:todo]

v -- todo
todo

.min([page:todo v]) [page:todo]

v -- todo
todo

.setComponent([page:todo index], [page:todo value]) [page:todo]

index -- todo
value -- todo
todo

.transformDirection([page:todo m]) [page:todo]

m -- todo
todo

.multiplyVectors([page:todo a], [page:todo b]) [page:todo]

a -- todo
b -- todo
todo

.getComponent([page:todo index]) [page:todo]

index -- todo
todo

.applyAxisAngle([page:todo axis], [page:todo angle]) [page:todo]

axis -- todo
angle -- todo
todo

.lerp([page:todo v], [page:todo alpha]) [page:todo]

v -- todo
alpha -- todo
todo

.max([page:todo v]) [page:todo]

v -- todo
todo

.angleTo([page:todo v]) [page:todo]

v -- todo
todo

.getColumnFromMatrix([page:todo index], [page:todo matrix]) [page:todo]

index -- todo
matrix -- todo
todo

.reflect([page:todo vector]) [page:todo]

vector -- todo
todo

.fromArray([page:todo array]) [page:todo]

array -- todo
todo

.multiply([page:todo v], [page:todo w]) [page:todo]

v -- todo
w -- todo
todo

.applyProjection([page:todo m]) [page:todo]

m -- todo
todo

.setEulerFromRotationMatrix([page:todo m], [page:todo order]) [page:todo]

m -- todo
order -- todo
todo

.toArray() [page:todo]

todo

.applyEuler([page:todo v], [page:todo eulerOrder]) [page:todo]

v -- todo
eulerOrder -- todo
todo

.applyQuaternion([page:todo q]) [page:todo]

q -- todo
todo

.setEulerFromQuaternion([page:todo q], [page:todo order]) [page:todo]

q -- todo
order -- todo
todo

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]