public final class Vector2i extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
int |
x
The vector's X coordinate.
|
int |
y
The vector's Y coordinate.
|
static Vector2i |
ZERO
The zero vector.
|
Constructor and Description |
---|
Vector2i(int x,
int y)
Constructs a new vector with the given coordinates.
|
Vector2i(Vector2f v)
Constructs a new vector by converting a floating point vector.
|
Modifier and Type | Method and Description |
---|---|
static Vector2i |
add(Vector2i a,
Vector2i b)
Adds two vectors.
|
static Vector2i |
componentwiseDiv(Vector2i a,
Vector2i b)
Performs a component-wise division of two vectors.
|
static Vector2i |
componentwiseMul(Vector2i a,
Vector2i b)
Performs a component-wise multiplication of two vectors.
|
static Vector2i |
div(Vector2i a,
int s)
Multiplies a vector by the inverse of a scalar.
|
boolean |
equals(Object o) |
int |
hashCode() |
static Vector2i |
mul(Vector2i a,
int s)
Multiplies a vector by a scalar.
|
static Vector2i |
neg(Vector2i v)
Computes the negation of a vector.
|
static Vector2i |
sub(Vector2i a,
Vector2i b)
Subtracts two vectors.
|
String |
toString() |
public static final Vector2i ZERO
public final int x
public final int y
public Vector2i(int x, int y)
x
- the X coordinate.y
- the Y coordinate.public Vector2i(Vector2f v)
v
- the vector to convert.public static Vector2i add(Vector2i a, Vector2i b)
a
- the first vector.b
- the second vector.public static Vector2i sub(Vector2i a, Vector2i b)
a
- The first vector.b
- The second vector.public static Vector2i componentwiseMul(Vector2i a, Vector2i b)
a
- the left vector.b
- the right vector.public static Vector2i componentwiseDiv(Vector2i a, Vector2i b)
a
- the left vector.b
- the right vector.public static Vector2i mul(Vector2i a, int s)
a
- the vector.s
- the scalar.public static Vector2i div(Vector2i a, int s)
a
- the vector.s
- the scalar to multiply by.public static Vector2i neg(Vector2i v)
v
- the vector.