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