Skip to content

Latest commit

 

History

History
78 lines (71 loc) · 10.6 KB

decentraland-ecs.vector4.md

File metadata and controls

78 lines (71 loc) · 10.6 KB

Home > decentraland-ecs > Vector4

Vector4 class

Vector4 class created for EulerAngle class conversion to Quaternion

Properties

Property Access Modifier Type Description
w number w value of the vector
x number x value of the vector
y number y value of the vector
z number z value of the vector

Methods

Method Access Modifier Returns Description
constructor(x, y, z, w) Creates a Vector4 object from the given floats.
add(otherVector) Vector4 Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.
Add(vector1, vector2) Vector4 Returns a new Vector4 as the result of the addition of the two given vectors.
addInPlace(otherVector) Vector4 Adds the given vector to the current Vector4.
addToRef(otherVector, result) Vector4 Updates the given vector "result" with the result of the addition of the current Vector4 and the given one.
asArray() number[] Returns a new array populated with 4 elements : the Vector4 coordinates.
Center(value1, value2) Vector4 Returns a new Vector4 located at the center between the vectors "value1" and "value2".
clone() Vector4 Returns a new Vector4 copied from the current one.
copyFrom(source) Vector4 Updates the current Vector4 with the given one coordinates.
copyFromFloats(x, y, z, w) Vector4 Updates the current Vector4 coordinates with the given floats.
Distance(value1, value2) number Returns the distance (float) between the vectors "value1" and "value2".
DistanceSquared(value1, value2) number Returns the squared distance (float) between the vectors "value1" and "value2".
divide(otherVector) Vector4 Returns a new Vector4 set with the division result of the current Vector4 by the given one.
divideInPlace(otherVector) Vector4 Divides the current Vector3 coordinates by the given ones.
divideToRef(otherVector, result) Vector4 Updates the given vector "result" with the division result of the current Vector4 by the given one.
equals(otherVector) boolean Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.
equalsToFloats(x, y, z, w) boolean Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.
equalsWithEpsilon(otherVector, epsilon) boolean Boolean : True if the current Vector4 coordinates are each beneath the distance "epsilon" from the given vector ones.
floor() Vector4 Gets a new Vector4 from current Vector4 floored values
fract() Vector4 Gets a new Vector4 from current Vector3 floored values
FromArray(array, offset) Vector4 Returns a new Vector4 set from the starting index of the given array.
FromArrayToRef(array, offset, result) void Updates the given vector "result" from the starting index of the given array.
FromFloatArrayToRef(array, offset, result) void Updates the given vector "result" from the starting index of the given FloatArray.
FromFloatsToRef(x, y, z, w, result) void Updates the given vector "result" coordinates from the given floats.
getClassName() string Returns the string "Vector4".
getHashCode() number Returns the Vector4 hash code.
length() number Returns the Vector4 length (float).
lengthSquared() number Returns the Vector4 squared length (float).
Maximize(left, right) Vector4 Returns a vector with the maximum values from the left and right vectors
maximizeInPlace(other) Vector4 Updates the Vector4 coordinates with the maximum values between its own and the given vector ones
Minimize(left, right) Vector4 Returns a vector with the minimum values from the left and right vectors
minimizeInPlace(other) Vector4 Updates the Vector4 coordinates with the minimum values between its own and the given vector ones
multiply(otherVector) Vector4 Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.
multiplyByFloats(x, y, z, w) Vector4 Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.
multiplyInPlace(otherVector) Vector4 Multiplies in place the current Vector4 by the given one.
multiplyToRef(otherVector, result) Vector4 Updates the given vector "result" with the multiplication result of the current Vector4 and the given one.
negate() Vector4 Returns a new Vector4 set with the current Vector4 negated coordinates.
normalize() Vector4 Normalizes in place the Vector4.
Normalize(vector) Vector4 Returns a new normalized Vector4 from the given one.
NormalizeToRef(vector, result) void Updates the given vector "result" from the normalization of the given one.
One() Vector4 Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)
scale(scale) Vector4 Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).
scaleAndAddToRef(scale, result) Vector4 Scale the current Vector4 values by a factor and add the result to a given Vector4
scaleInPlace(scale) Vector4 Multiplies the current Vector4 coordinates by scale (float).
scaleToRef(scale, result) Vector4 Sets the given vector "result" with the current Vector4 coordinates multiplied by scale (float).
set(x, y, z, w) Vector4 Updates the current Vector4 coordinates with the given floats.
setAll(v) Vector4 Copies the given float to the current Vector3 coordinates
subtract(otherVector) Vector4 Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.
subtractFromFloats(x, y, z, w) Vector4 Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.
subtractFromFloatsToRef(x, y, z, w, result) Vector4 Sets the given vector "result" set with the result of the subtraction of the given floats from the current Vector4 coordinates.
subtractInPlace(otherVector) Vector4 Subtract in place the given vector from the current Vector4.
subtractToRef(otherVector, result) Vector4 Sets the given vector "result" with the result of the subtraction of the given vector from the current Vector4.
toArray(array, index) Vector4 Populates the given array from the given index with the Vector4 coordinates.
toVector3() Vector3 Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
TransformNormal(vector, transformation) Vector4 Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector. This methods computes transformed normalized direction vectors only.
TransformNormalFromFloatsToRef(x, y, z, w, transformation, result) void Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z, w). This methods computes transformed normalized direction vectors only.
TransformNormalToRef(vector, transformation, result) void Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector. This methods computes transformed normalized direction vectors only.
Zero() Vector4 Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)