Vector3i

Contains the definition of a Vector comprising 3 ints and associated transformations.

@author Richard Greenlees @author Kai Burjack @author Hans Uhlig

struct Vector3i {}

Constructors

this
this(int d)

Create a new {@link Vector3i} and initialize all three components with the given value.

this
this(int x, int y, int z)

Create a new {@link Vector3i} with the given component values.

this
this(Vector3i v)

Create a new {@link Vector3i} with the same values as <code>v</code>.

this
this(Vector2i v, int z)

Create a new {@link Vector3i} with the first two components from the given <code>v</code> and the given <code>z</code>

this
this(double x, double y, double z, int mode)

Create a new {@link Vector3i} with the given component values and round using the given {@link RoundingMode}.

this
this(Vector2d v, double z, int mode)

Create a new {@link Vector3i} with the first two components from the given <code>v</code> and the given <code>z</code> and round using the given {@link RoundingMode}.

this
this(Vector3d v, int mode)

Create a new {@link Vector3i} and initialize its components to the rounded value of the given vector.

this
this(int[] xyz)

Create a new {@link Vector3i} and initialize its three components from the first three elements of the given array.

Members

Functions

absolute
Vector3i absolute()

Set <code>this</code> vector's components to their respective absolute values.

absolute
Vector3i absolute(Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
add
Vector3i add(Vector3i v)

Add the supplied vector to this one.

add
Vector3i add(Vector3i v, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
add
Vector3i add(int x, int y, int z)

Increment the components of this vector by the given values.

add
Vector3i add(int x, int y, int z, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
distance
double distance(Vector3i v)
Undocumented in source. Be warned that the author may not have intended to support it.
distance
double distance(int x, int y, int z)
Undocumented in source. Be warned that the author may not have intended to support it.
distanceSquared
long distanceSquared(Vector3i v)
Undocumented in source. Be warned that the author may not have intended to support it.
distanceSquared
long distanceSquared(int x, int y, int z)
Undocumented in source. Be warned that the author may not have intended to support it.
div
Vector3i div(double scalar)

Divide all components of this {@link Vector3i} by the given scalar value.

div
Vector3i div(double scalar, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
div
Vector3i div(int scalar)

Divide all components of this {@link Vector3i} by the given scalar value.

div
Vector3i div(int scalar, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(int x, int y, int z)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(Vector3i other)
Undocumented in source. Be warned that the author may not have intended to support it.
get
int get(int component)
Undocumented in source. Be warned that the author may not have intended to support it.
gridDistance
long gridDistance(Vector3i v)
Undocumented in source. Be warned that the author may not have intended to support it.
gridDistance
long gridDistance(int x, int y, int z)
Undocumented in source. Be warned that the author may not have intended to support it.
hashCode
int hashCode()
Undocumented in source. Be warned that the author may not have intended to support it.
length
double length()
Undocumented in source. Be warned that the author may not have intended to support it.
lengthSquared
long lengthSquared()
Undocumented in source. Be warned that the author may not have intended to support it.
max
Vector3i max(Vector3i v)

Set the components of this vector to be the component-wise maximum of this and the other vector.

max
Vector3i max(Vector3i v, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
maxComponent
int maxComponent()
Undocumented in source. Be warned that the author may not have intended to support it.
min
Vector3i min(Vector3i v)

Set the components of this vector to be the component-wise minimum of this and the other vector.

min
Vector3i min(Vector3i v, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
minComponent
int minComponent()
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Vector3i mul(int scalar)

Multiply all components of this {@link Vector3i} by the given scalar value.

mul
Vector3i mul(int scalar, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Vector3i mul(Vector3i v)

Multiply all components of this {@link Vector3i} by the given vector.

mul
Vector3i mul(Vector3i v, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Vector3i mul(int x, int y, int z)

Multiply the components of this vector by the given values.

mul
Vector3i mul(int x, int y, int z, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
negate
Vector3i negate()

Negate this vector.

negate
Vector3i negate(Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
set
Vector3i set(Vector3i v)

Set the x, y and z components to match the supplied vector.

set
Vector3i set(Vector3d v)

Set this {@link Vector3i} to the values of v using {@link RoundingMode#TRUNCATE} rounding. <p> Note that due to the given vector <code>v</code> storing the components in double-precision, there is the possibility to lose precision.

set
Vector3i set(Vector3d v, int mode)

Set this {@link Vector3i} to the values of v using the given {@link RoundingMode}. <p> Note that due to the given vector <code>v</code> storing the components in double-precision, there is the possibility to lose precision.

set
Vector3i set(Vector2i v, int z)

Set the first two components from the given <code>v</code> and the z component from the given <code>z</code>

set
Vector3i set(int d)

Set the x, y, and z components to the supplied value.

set
Vector3i set(int x, int y, int z)

Set the x, y and z components to the supplied values.

set
Vector3i set(int[] xyz)

Set the three components of this vector to the first three elements of the given array.

setComponent
Vector3i setComponent(int component, int value)

Set the value of the specified component of this vector.

sub
Vector3i sub(Vector3i v)

Subtract the supplied vector from this one and store the result in <code>this</code>.

sub
Vector3i sub(Vector3i v, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
sub
Vector3i sub(int x, int y, int z)

Decrement the components of this vector by the given values.

sub
Vector3i sub(int x, int y, int z, Vector3i dest)
Undocumented in source. Be warned that the author may not have intended to support it.
zero
Vector3i zero()

Set all components to zero.

Static functions

distance
double distance(int x1, int y1, int z1, int x2, int y2, int z2)

Return the distance between <code>(x1, y1, z1)</code> and <code>(x2, y2, z2)</code>.

distanceSquared
long distanceSquared(int x1, int y1, int z1, int x2, int y2, int z2)

Return the squared distance between <code>(x1, y1, z1)</code> and <code>(x2, y2, z2)</code>.

length
double length(int x, int y, int z)

Get the length of a 3-dimensional single-precision vector.

lengthSquared
long lengthSquared(int x, int y, int z)

Get the length squared of a 3-dimensional single-precision vector.

Variables

x
int x;

The x component of the vector.

y
int y;

The y component of the vector.

z
int z;

The z component of the vector.

Meta