Readonly
xReadonly
yReadonly
zStatic
Readonly
DownStatic
Readonly
EastStatic
Readonly
NorthStatic
Readonly
SouthStatic
Readonly
UpStatic
Readonly
WestStatic
Readonly
ZeroAdds another vector to the current vector.
The updated vector after addition.
Adds another vector to the current vector.
The updated vector after addition.
Adds another vector to the current vector.
The updated vector after addition.
Adds another vector to the current vector.
The updated vector after addition.
Checks if the current vector is equal to another vector.
Checks if the current vector is equal to another vector.
Checks if the current vector is equal to another vector.
Checks if the current vector is equal to another vector.
Checks if the current vector is equal to another vector.
Computes the angle (in radians) between the current vector and another vector.
The angle in radians between the two vectors.
Computes the angle (in radians) between the current vector and another vector.
The angle in radians between the two vectors.
Computes the angle (in radians) between the current vector and another vector.
The angle in radians between the two vectors.
Computes the angle (in radians) between the current vector and another vector.
The angle in radians between the two vectors.
Computes the angle (in radians) between the current vector and another vector.
The angle in radians between the two vectors.
Ceils the X, Y, and Z components of the vector.
A new vector with the ceiled components.
Creates a copy of the current vector.
A new vector with the same values as the current vector.
Computes the cross product of the current vector with another vector.
A cross product is a vector that is perpendicular to both vectors.
A new vector representing the cross product.
Computes the cross product of the current vector with another vector.
A cross product is a vector that is perpendicular to both vectors.
A new vector representing the cross product.
Computes the cross product of the current vector with another vector.
A cross product is a vector that is perpendicular to both vectors.
A new vector representing the cross product.
Computes the cross product of the current vector with another vector.
A cross product is a vector that is perpendicular to both vectors.
A new vector representing the cross product.
Computes the distance between the current vector and another vector.
The distance between the two vectors.
Computes the distance between the current vector and another vector.
The distance between the two vectors.
Computes the distance between the current vector and another vector.
The distance between the two vectors.
Computes the distance between the current vector and another vector.
The distance between the two vectors.
Computes the distance between the current vector and another vector.
The distance between the two vectors.
Computes the squared distance between the current vector and another vector. This is faster than computing the actual distance and can be useful for comparison purposes.
The squared distance between the two vectors.
Computes the squared distance between the current vector and another vector. This is faster than computing the actual distance and can be useful for comparison purposes.
The squared distance between the two vectors.
Computes the squared distance between the current vector and another vector. This is faster than computing the actual distance and can be useful for comparison purposes.
The squared distance between the two vectors.
Computes the squared distance between the current vector and another vector. This is faster than computing the actual distance and can be useful for comparison purposes.
The squared distance between the two vectors.
Computes the squared distance between the current vector and another vector. This is faster than computing the actual distance and can be useful for comparison purposes.
The squared distance between the two vectors.
Calculates the shortest distance between a point (represented by this Vector3 instance) and a line segment.
This method finds the perpendicular projection of the point onto the line defined by the segment. If this projection lies outside the line segment, then the method calculates the distance from the point to the nearest segment endpoint.
The starting point of the line segment.
The ending point of the line segment.
The shortest distance between the point and the line segment.
Divides the current vector by another vector or scalar.
The updated vector after division.
Divides the current vector by another vector or scalar.
The updated vector after division.
Divides the current vector by another vector or scalar.
The updated vector after division.
Divides the current vector by another vector or scalar.
The updated vector after division.
Divides the current vector by another vector or scalar.
The updated vector after division.
Computes the dot product of the current vector with another vector.
The dot product of the two vectors.
Computes the dot product of the current vector with another vector.
The dot product of the two vectors.
Computes the dot product of the current vector with another vector.
The dot product of the two vectors.
Computes the dot product of the current vector with another vector.
The dot product of the two vectors.
Computes the dot product of the current vector with another vector.
The dot product of the two vectors.
Returns a new vector offset from the current vector down by 1 block.
A new vector offset from the current vector down by 1 block.
Returns a new vector offset from the current vector east by 1 block.
A new vector offset from the current vector east by 1 block.
Checks if the current vector is equal to another vector.
Checks if the current vector is equal to another vector.
Checks if the current vector is equal to another vector.
Checks if the current vector is equal to another vector.
Floors the X, Y, and Z components of the vector.
A new vector with the floored components.
Checks if the current vector is equal to the zero vector.
true if the vector is equal to the zero vector, else returns false.
Computes the length (magnitude) of the vector.
The length of the vector.
Computes the squared length of the vector. This is faster than computing the actual length and can be useful for comparison purposes.
The squared length of the vector.
Computes the linear interpolation between the current vector and another vector, when t is in the range [0, 1]. Computes the extrapolation when t is outside this range.
The other vector.
The interpolation factor.
A new vector after performing the lerp operation.
Multiplies the current vector by another vector or scalar.
The updated vector after multiplication.
Multiplies the current vector by another vector or scalar.
The updated vector after multiplication.
Multiplies the current vector by another vector or scalar.
The updated vector after multiplication.
Multiplies the current vector by another vector or scalar.
The updated vector after multiplication.
Multiplies the current vector by another vector or scalar.
The updated vector after multiplication.
Normalizes the vector to have a length (magnitude) of 1. Normalized vectors are often used as a direction vectors.
The normalized vector.
Returns a new vector offset from the current vector north by 1 block.
A new vector offset from the current vector north by 1 block.
Computes the projection of the current vector onto another vector.
This method finds how much of the current vector lies in the direction of vector v
.
A new vector representing the projection of the current vector onto v
.
Computes the projection of the current vector onto another vector.
This method finds how much of the current vector lies in the direction of vector v
.
A new vector representing the projection of the current vector onto v
.
Computes the projection of the current vector onto another vector.
This method finds how much of the current vector lies in the direction of vector v
.
A new vector representing the projection of the current vector onto v
.
Computes the projection of the current vector onto another vector.
This method finds how much of the current vector lies in the direction of vector v
.
A new vector representing the projection of the current vector onto v
.
Computes the reflection of the current vector against a normal vector. Useful for simulating light reflections or bouncing objects.
A new vector representing the reflection of the current vector.
Computes the reflection of the current vector against a normal vector. Useful for simulating light reflections or bouncing objects.
A new vector representing the reflection of the current vector.
Computes the reflection of the current vector against a normal vector. Useful for simulating light reflections or bouncing objects.
A new vector representing the reflection of the current vector.
Computes the reflection of the current vector against a normal vector. Useful for simulating light reflections or bouncing objects.
A new vector representing the reflection of the current vector.
Rotates the current normalized vector by a given angle around a given axis.
The axis of rotation.
The angle of rotation in degrees.
The rotated vector.
Rounds the X, Y, and Z components of the vector.
A new vector with the rounded components.
Scales the current vector by a scalar.
The updated vector after scaling.
Computes the spherical linear interpolation between the current vector and another vector, when t is in the range [0, 1]. Computes the extrapolation when t is outside this range.
The other vector.
The interpolation factor.
A new vector after performing the slerp operation.
Returns a new vector offset from the current vector south by 1 block.
A new vector offset from the current vector south by 1 block.
Subtracts another vector from the current vector.
The updated vector after subtraction.
Subtracts another vector from the current vector.
The updated vector after subtraction.
Subtracts another vector from the current vector.
The updated vector after subtraction.
Subtracts another vector from the current vector.
The updated vector after subtraction.
Converts the vector to an array containing the X, Y, and Z components of the vector.
An array containing the X, Y, and Z components of the vector.
Returns a new vector with the X, Y, and Z components rounded to the nearest block location.
Converts the vector to a direction. If the vector is not a unit vector, then it will be normalized and rounded to the nearest direction.
Returns a string representation of an object.
Optional
format: "long" | "short"Optional
separator: stringConverts the normal vector to yaw and pitch values.
A Vector2 containing the yaw and pitch values.
Returns a new vector offset from the current vector up by 1 block.
A new vector offset from the current vector up by 1 block.
Updates the X, Y, and Z components of the vector.
The function to use to update the X value.
The function to use to update the Y value.
The function to use to update the Z value.
The updated vector with the new values.
Returns a new vector offset from the current vector west by 1 block.
A new vector offset from the current vector west by 1 block.
Static
fromStatic
fromCreates a new direction vector from yaw and pitch values.
A new vector representing the direction.
Creates a new direction vector from yaw and pitch values.
The yaw value in degrees.
The pitch value in degrees.
A new vector representing the direction.
Remarks
X component of this vector.