A Vector3i object uses integer values to describe a point in space.
Name | Parameters | Return value | Notes |
() (constructor) |
|
Vector3i |
Creates a new Vector3i object with zero coords. |
() (constructor) |
x, y, z |
Vector3i |
Creates a new Vector3i object with the specified coords. |
() (constructor) |
Vector3d |
Vector3i |
Creates a new Vector3i object with coords copied and floor()-ed from the specified Vector3d. |
operator * |
Vector3i |
Vector3i |
Returns a new Vector3i object that has each of its coords multiplied by the respective coord of the specified vector. |
operator * |
number |
Vector3i |
Returns a new Vector3i object that has each of its coords multiplied by the specified number |
operator + |
Vector3i |
Vector3i |
Returns a new Vector3f object that holds the vector sum of this vector and the specified vector. |
operator - |
|
Vector3i |
Returns a new Vector3i that is a negative of this vector (all coords multiplied by -1). |
operator - |
Vector3i |
Vector3i |
Returns a new Vector3i object that holds the vector differrence between this vector and the specified vector. |
operator / |
Vector3i |
Vector3i |
Returns a new Vector3i object that has each of its coords divided by the respective coord of the specified vector. |
operator / |
number |
Vector3i |
Returns a new Vector3i object that has each of its coords divided by the specified number |
Abs |
|
|
Updates each coord to its absolute value. |
Clamp |
min, max |
|
Clamps each coord into the specified range. |
Cross |
Vector3d |
Vector3d |
Returns a new Vector3d that is a cross product of this vector and the specified vector. |
Dot |
Vector3d |
number |
Returns the dot product of this vector and the specified vector. |
Equals |
Vector3i |
bool |
Returns true if this vector is exactly the same as the specified vector. |
EqualsEps |
Rhs, Eps |
boolean |
Returns true if the differences between each corresponding coords of this vector and the one specified, are less than the specified Eps. Normally not too useful for integer-only vectors, but still included for API completeness. |
Floor |
|
Vector3i |
Returns a new Vector3i object with coords set to math.floor of this vector's coords. Normally not too useful with integer-only vectors, but still included for API completeness. |
HasNonZeroLength |
|
boolean |
Returns true if the vector has at least one coord non-zero. |
Length |
|
number |
Returns the (euclidean) length of this vector. |
LineCoeffToXYPlane |
Vector3i, Z |
number |
Returns the coefficient for the line from the specified vector through this vector to reach the specified Z coord. The result satisfies the following equation: (this + Result * (Param - this)).z = Z. Returns the NO_INTERSECTION constant if there's no intersection. |
LineCoeffToXZPlane |
Vector3i, Y |
number |
Returns the coefficient for the line from the specified vector through this vector to reach the specified Y coord. The result satisfies the following equation: (this + Result * (Param - this)).y = Y. Returns the NO_INTERSECTION constant if there's no intersection. |
LineCoeffToYZPlane |
Vector3i, X |
number |
Returns the coefficient for the line from the specified vector through this vector to reach the specified X coord. The result satisfies the following equation: (this + Result * (Param - this)).x = X. Returns the NO_INTERSECTION constant if there's no intersection. |
Move |
x, y, z |
|
Moves the vector by the specified amount in each axis direction. |
Move |
Diff |
|
Adds the specified vector to this vector. Is slightly better performant than adding with a "+" because this doesn't create a new object for the result. |
Normalize |
|
|
Normalizes this vector (makes it 1 unit long while keeping the direction). Quite useless for integer-only vectors, since the normalized vector will almost always truncate to zero vector. FIXME: Fails for zero vectors. |
NormalizeCopy |
|
Vector3f |
Returns a copy of this vector that is normalized (1 unit long while keeping the same direction). Quite useless for integer-only vectors, since the normalized vector will almost always truncate to zero vector. FIXME: Fails for zero vectors. |
Set |
x, y, z |
|
Sets all the coords of the vector at once |
SqrLength |
|
number |
Returns the (euclidean) length of this vector, squared. This operation is slightly less computationally expensive than Length(), while it conserves some properties of Length(), such as comparison. |
TurnCCW |
|
|
Rotates the vector 90 degrees counterclockwise around the vertical axis. Note that this is specific to minecraft's axis ordering, which is X+ left, Z+ down. |
TurnCW |
|
|
Rotates the vector 90 degrees clockwise around the vertical axis. Note that this is specific to minecraft's axis ordering, which is X+ left, Z+ down. |
abs |
|
|
OBSOLETE, use Abs() instead. |
clamp |
min, max |
|
OBSOLETE, use Clamp() instead. |