3D vector.
Methods
public add(a: Object): Vector3
Adds v to this vector.
Parameters
Returns
Vector3
public addScalar(s: number): Vector3
Parameters
Returns
Vector3
Sets this vector to a + b.
Parameters
Returns
Vector3
public angleTo(v: Vector3): number
Parameters
Returns
number
public applyAxisAngle(axis: Vector3, angle: number): Vector3
Parameters
Returns
Vector3
Parameters
Returns
Vector3
Parameters
Returns
Vector3
Parameters
Returns
Vector3
Parameters
Returns
Vector3
public clampScalar(min: number, max: number): Vector3
Parameters
Returns
Vector3
public clone(): Vector3
Clones this vector.
Returns
Vector3
Copies value of v to this vector.
Parameters
Returns
Vector3
Sets this vector to cross product of itself and v.
Parameters
Returns
Vector3
Sets this vector to cross product of a and b.
Parameters
Returns
Vector3
public distanceTo(v: Vector3): number
Computes distance of this vector to v.
Parameters
Returns
number
public distanceToSquared(v: Vector3): number
Computes squared distance of this vector to v.
Parameters
Returns
number
Parameters
Returns
Vector3
public divideScalar(s: number): Vector3
Divides this vector by scalar s.
Set vector to ( 0, 0, 0 ) if s == 0.
Parameters
Returns
Vector3
public dot(v: Vector3): number
Computes dot product of this vector and v.
Parameters
Returns
number
public equals(v: Vector3): boolean
Checks for strict equality of this vector and v.
Parameters
Returns
boolean
public fromArray(xyz: Array<number>): Vector3
Parameters
Returns
Vector3
public getComponent(index: number): number
Parameters
Returns
number
public length(): number
Computes length of this vector.
Returns
number
public lengthSq(): number
Computes squared length of this vector.
Returns
number
Parameters
Returns
Vector3
Parameters
Returns
Vector3
Parameters
Returns
Vector3
public multiplyScalar(s: number): Vector3
Multiplies this vector by scalar s.
Parameters
Returns
Vector3
Parameters
Returns
Vector3
public negate(): Vector3
Inverts this vector.
Returns
Vector3
public normalize(): Vector3
Normalizes this vector.
Returns
Vector3
public projectOnPlane(planeNormal: Vector3): Vector3
Parameters
Returns
Vector3
Parameters
Returns
Vector3
public roundToZero(): Vector3
Returns
Vector3
public set(x: number, y: number, z: number): Vector3
Sets value of this vector.
Parameters
-
x: number
-
y: number
-
z: number
Returns
Vector3
public setComponent(index: number, value: number)
Parameters
-
index: number
-
value: number
public setFromMatrixColumn(index: number, matrix: Matrix4): Vector3
Parameters
Returns
Vector3
public setLength(l: number): Vector3
Normalizes this vector and multiplies it by l.
Parameters
Returns
Vector3
public setX(x: number): Vector3
Sets x value of this vector.
Parameters
Returns
Vector3
public setY(y: number): Vector3
Sets y value of this vector.
Parameters
Returns
Vector3
public setZ(z: number): Vector3
Sets z value of this vector.
Parameters
Returns
Vector3
Subtracts v from this vector.
Parameters
Returns
Vector3
Sets this vector to a - b.
Parameters
Returns
Vector3
public toArray(): Array<number>
Returns
Array<number>