Constructors
constructor
- new Vector3(x: number, y: number, z: number): Vector3
-
Parameters
-
x: number
-
y: number
-
z: number
Properties
type
type: string = "vec3"
Accessors
Length
- get Length(): number
-
Returns number
Methods
distance
- distance(v: Vector): number
-
Returns number
distanceSquared
- distanceSquared(v: Vector): number
-
Returns number
divide
- divide(v: number | Vector): Vector3
-
dotProduct
- dotProduct(v: Vector): number
-
Returns number
multiply
- multiply(v: number | Vector): Vector3
-
replace
- replace(v: Vector): void
-
Returns void
toArray
- toArray(): [number, number, number]
-
Returns [number, number, number]
Static
add
- add(v1: Vector, v2: number | Vector): Vector3
-
Parameters
-
v1: Vector
-
v2: number | Vector
Static
addX
- addX(vec: Vector, x: number): Vector3
-
Static
addY
- addY(vec: Vector, y: number): Vector3
-
Static
addZ
- addZ(vec: Vector, z: number): Vector3
-
Static
crossProduct
- crossProduct(v1: Vector, v2: Vector): Vector3
-
Static
divide
- divide(v1: Vector, v2: number | Vector): Vector3
-
Parameters
-
v1: Vector
-
v2: number | Vector
Static
dotProduct
- dotProduct(v1: Vector, v2: Vector): number
-
Returns number
Static
fromArray
- fromArray(primitive: number[] | [number, number, number]): Vector3
-
Parameters
-
primitive: number[] | [number, number, number]
Static
fromArrays
- fromArrays(primitives: number[][] | [number, number, number][]): Vector3[]
-
Parameters
-
primitives: number[][] | [number, number, number][]
Static
multiply
- multiply(v1: Vector, v2: number | Vector): Vector3
-
Parameters
-
v1: Vector
-
v2: number | Vector
Static
subtract
- subtract(v1: Vector, v2: number | Vector): Vector3
-
Parameters
-
v1: Vector
-
v2: number | Vector
The distance between two Vectors.
Returns
Distance between this and another vector.