Constructors
constructor
- new Vector3(x?, y?, z?): Vector3
Parameters
Optional
x: numberOptional
y: numberOptional
z: number
Properties
Readonly
isVector3
isVector3
x
x: number
y
y: number
z
z: number
Methods
[iterator]
- [iterator](): Iterator<number, any, undefined>
Returns Iterator<number, any, undefined>
add
- add(v): this
Returns this
addScalar
- addScalar(s): this
Returns this
addScaledVector
- addScaledVector(v, s): this
Returns this
addVectors
- addVectors(a, b): this
Returns this
angleTo
- angleTo(v): number
Returns number
applyAxisAngle
- applyAxisAngle(axis, angle): this
Returns this
applyEuler
- applyEuler(euler): this
Returns this
applyMatrix3
- applyMatrix3(m): this
Returns this
applyMatrix4
- applyMatrix4(m): this
Returns this
applyNormalMatrix
- applyNormalMatrix(m): this
Returns this
applyQuaternion
- applyQuaternion(q): this
Returns this
ceil
- ceil(): this
Returns this
clamp
- clamp(min, max): this
Returns this
clampLength
- clampLength(min, max): this
Returns this
clampScalar
- clampScalar(min, max): this
Returns this
clone
- clone(): this
Returns this
copy
- copy(v): this
Returns this
cross
- cross(a): this
Returns this
crossVectors
- crossVectors(a, b): this
Returns this
distanceTo
- distanceTo(v): number
Returns number
distanceToSquared
- distanceToSquared(v): number
Returns number
divide
- divide(v): this
Returns this
divideScalar
- divideScalar(s): this
Returns this
dot
- dot(v): number
Returns number
equals
- equals(v): boolean
Returns boolean
floor
- floor(): this
Returns this
fromArray
- fromArray(array, offset?): this
Parameters
- array: number[] | ArrayLike<number>
Optional
offset: number
Returns this
fromBufferAttribute
- fromBufferAttribute(attribute, index): this
Returns this
getComponent
- getComponent(index): number
Returns number
length
- length(): number
Returns number
lengthSq
- lengthSq(): number
Returns number
lerp
- lerp(v, alpha): this
Returns this
lerpVectors
- lerpVectors(v1, v2, alpha): this
Returns this
manhattanDistanceTo
- manhattanDistanceTo(v): number
Returns number
manhattanLength
- manhattanLength(): number
Returns number
max
- max(v): this
Returns this
min
- min(v): this
Returns this
multiply
- multiply(v): this
Returns this
multiplyScalar
- multiplyScalar(s): this
Returns this
multiplyVectors
- multiplyVectors(a, b): this
Returns this
negate
- negate(): this
Returns this
normalize
- normalize(): this
Returns this
project
- project(camera): this
Returns this
projectOnPlane
- projectOnPlane(planeNormal): this
Returns this
projectOnVector
- projectOnVector(v): this
Returns this
random
- random(): this
Returns this
randomDirection
- randomDirection(): this
Returns this
reflect
- reflect(vector): this
Returns this
round
- round(): this
Returns this
roundToZero
- roundToZero(): this
Returns this
set
- set(x, y, z): this
Parameters
- x: number
- y: number
- z: number
Returns this
setComponent
- setComponent(index, value): this
Parameters
- index: number
- value: number
Returns this
setFromColor
- setFromColor(color): this
Returns this
setFromCylindrical
- setFromCylindrical(s): this
Returns this
setFromCylindricalCoords
- setFromCylindricalCoords(radius, theta, y): this
Parameters
- radius: number
- theta: number
- y: number
Returns this
setFromEuler
- setFromEuler(e): this
Returns this
setFromMatrix3Column
- setFromMatrix3Column(matrix, index): this
Returns this
setFromMatrixColumn
- setFromMatrixColumn(matrix, index): this
Returns this
setFromMatrixPosition
- setFromMatrixPosition(m): this
Returns this
setFromMatrixScale
- setFromMatrixScale(m): this
Returns this
setFromSpherical
- setFromSpherical(s): this
Returns this
setFromSphericalCoords
- setFromSphericalCoords(r, phi, theta): this
Parameters
- r: number
- phi: number
- theta: number
Returns this
setLength
- setLength(l): this
Returns this
setScalar
- setScalar(scalar): this
Returns this
setX
- setX(x): this
Returns this
setY
- setY(y): this
Returns this
setZ
- setZ(z): this
Returns this
sub
- sub(a): this
Returns this
subScalar
- subScalar(s): this
Returns this
subVectors
- subVectors(a, b): this
Returns this
transformDirection
- transformDirection(m): this
Returns this
unproject
- unproject(camera): this
Returns this
3D vector.
see https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js
Example