class Vector4
Creates a Vector4 object from the passed floats.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number |
Returns the string with the Vector4 coordinates.
Returns the string "Vector4".
Returns the Vector4 hash code.
Returns a new array populated with 4 elements : the Vector4 coordinates.
Populates the passed array from the passed index with the Vector4 coordinates.
Returns the Vector4.
Name | Type | Description | |
---|---|---|---|
array | FloatArray | ||
optional | index | number |
Adds the passed vector to the current Vector4.
Returns the updated Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Returns a new Vector4 as the result of the addition of the current Vector4 and the passed one.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Updates the passed vector "result" with the result of the addition of the current Vector4 and the passed one.
Returns the current Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 | ||
result | Vector4 |
Subtract in place the passed vector from the current Vector4.
Returns the updated Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Returns a new Vector4 with the result of the subtraction of the passed vector from the current Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Sets the passed vector "result" with the result of the subtraction of the passed vector from the current Vector4.
Returns the current Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 | ||
result | Vector4 |
Returns a new Vector4 set with the result of the subtraction of the passed floats from the current Vector4 coordinates.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number |
Sets the passed vector "result" set with the result of the subtraction of the passed floats from the current Vector4 coordinates.
Returns the current Vector4.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number | ||
w | number |
Returns a new Vector4 set with the current Vector4 negated coordinates.
Multiplies the current Vector4 coordinates by scale (float).
Returns the updated Vector4.
Name | Type | Description | |
---|---|---|---|
scale | number |
Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).
Name | Type | Description | |
---|---|---|---|
scale | number |
Sets the passed vector "result" with the current Vector4 coordinates multiplied by scale (float).
Returns the current Vector4.
Name | Type | Description | |
---|---|---|---|
scale | number | ||
result | Vector4 |
Boolean : True if the current Vector4 coordinates are stricly equal to the passed ones.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Boolean : True if the current Vector4 coordinates are each beneath the distance "epsilon" from the passed vector ones.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 | ||
optional | epsilon | number |
Boolean : True if the passed floats are strictly equal to the current Vector4 coordinates.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number |
Multiplies in place the current Vector4 by the passed one.
Returns the updated Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Returns a new Vector4 set with the multiplication result of the current Vector4 and the passed one.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Updates the passed vector "result" with the multiplication result of the current Vector4 and the passed one.
Returns the current Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 | ||
result | Vector4 |
Returns a new Vector4 set with the multiplication result of the passed floats and the current Vector4 coordinates.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number |
Returns a new Vector4 set with the division result of the current Vector4 by the passed one.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 |
Updates the passed vector "result" with the division result of the current Vector4 by the passed one.
Returns the current Vector4.
Name | Type | Description | |
---|---|---|---|
otherVector | Vector4 | ||
result | Vector4 |
Updates the Vector4 coordinates with the minimum values between its own and the passed vector ones.
Name | Type | Description | |
---|---|---|---|
other | Vector4 |
Updates the Vector4 coordinates with the maximum values between its own and the passed vector ones.
Name | Type | Description | |
---|---|---|---|
other | Vector4 |
Returns the Vector4 length (float).
Returns the Vector4 squared length (float).
Normalizes in place the Vector4.
Returns the updated Vector4.
Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
Returns a new Vector4 copied from the current one.
Updates the current Vector4 with the passed one coordinates.
Returns the updated Vector4.
Name | Type | Description | |
---|---|---|---|
source | Vector4 |
Updates the current Vector4 coordinates with the passed floats.
Returns the updated Vector4.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number |
Updates the current Vector4 coordinates with the passed floats.
Returns the updated Vector4.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number |
Returns a new Vector4 set from the starting index of the passed array.
Name | Type | Description | |
---|---|---|---|
array | ArrayLike<number> | ||
optional | offset | number |
Updates the passed vector "result" from the starting index of the passed array.
Name | Type | Description | |
---|---|---|---|
array | ArrayLike<number> | ||
offset | number | ||
result | Vector4 |
Updates the passed vector "result" from the starting index of the passed Float32Array.
Name | Type | Description | |
---|---|---|---|
array | Float32Array | ||
offset | number | ||
result | Vector4 |
Updates the passed vector "result" coordinates from the passed floats.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number | ||
w | number |
Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)
Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)
Returns a new normalized Vector4 from the passed one.
Name | Type | Description | |
---|---|---|---|
vector | Vector4 |
Updates the passed vector "result" from the normalization of the passed one.
Name | Type | Description | |
---|---|---|---|
vector | Vector4 | ||
result | Vector4 |
Name | Type | Description | |
---|---|---|---|
left | Vector4 | ||
right | Vector4 |
Name | Type | Description | |
---|---|---|---|
left | Vector4 | ||
right | Vector4 |
Returns the distance (float) between the vectors "value1" and "value2".
Name | Type | Description | |
---|---|---|---|
value1 | Vector4 | ||
value2 | Vector4 |
Returns the squared distance (float) between the vectors "value1" and "value2".
Name | Type | Description | |
---|---|---|---|
value1 | Vector4 | ||
value2 | Vector4 |
Returns a new Vector4 located at the center between the vectors "value1" and "value2".
Name | Type | Description | |
---|---|---|---|
value1 | Vector4 | ||
value2 | Vector4 |
Returns a new Vector4 set with the result of the normal transformation by the passed matrix of the passed vector.
This methods computes transformed normalized direction vectors only.
Name | Type | Description | |
---|---|---|---|
vector | Vector4 | ||
transformation | Matrix |
Sets the passed vector "result" with the result of the normal transformation by the passed matrix of the passed vector.
This methods computes transformed normalized direction vectors only.
Name | Type | Description | |
---|---|---|---|
vector | Vector4 | ||
transformation | Matrix | ||
result | Vector4 |
Sets the passed vector "result" with the result of the normal transformation by the passed matrix of the passed floats (x, y, z, w).
This methods computes transformed normalized direction vectors only.
Name | Type | Description | |
---|---|---|---|
x | number | ||
y | number | ||
z | number | ||
w | number | ||
transformation | Matrix |