java.lang.Object
org.spongepowered.math.vector.Vector2i
- All Implemented Interfaces:
Serializable
,Comparable<Vector2i>
,Vectori
@Immutable
public final class Vector2i
extends Object
implements Vectori, Comparable<Vector2i>, Serializable
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabs()
add
(double x, double y) add
(int x, int y) int
float
distance
(double x, double y) float
distance
(int x, int y) float
int
distanceSquared
(double x, double y) int
distanceSquared
(int x, int y) int
div
(double a) div
(double x, double y) div
(int a) div
(int x, int y) int
dot
(double x, double y) int
dot
(int x, int y) int
boolean
static Vector2i
from
(int n) static Vector2i
from
(int x, int y) int
hashCode()
float
length()
int
max
(double x, double y) max
(int x, int y) int
maxAxis()
Return the axis with the maximum value.min
(double x, double y) min
(int x, int y) int
minAxis()
Return the axis with the minimal value.mul
(double a) mul
(double x, double y) mul
(int a) mul
(int x, int y) negate()
pow
(double pow) pow
(int power) project
(double x, double y) project
(int x, int y) sub
(double x, double y) sub
(int x, int y) int[]
toArray()
toDouble()
toFloat()
toInt()
toLong()
toString()
toVector3
(double z) toVector3
(int z) toVector4
(double z, double w) toVector4
(int z, int w) withX
(double x) withX
(int x) withY
(double y) withY
(int y) int
x()
int
y()
-
Field Details
-
ZERO
-
UNIT_X
-
UNIT_Y
-
ONE
-
-
Constructor Details
-
Vector2i
-
Vector2i
-
Vector2i
-
Vector2i
public Vector2i(double x, double y) -
Vector2i
public Vector2i(int x, int y)
-
-
Method Details
-
x
public int x() -
withX
-
withX
-
y
public int y() -
withY
-
withY
-
add
-
add
-
add
-
sub
-
sub
-
sub
-
mul
-
mul
-
mul
-
mul
-
mul
-
div
-
div
-
div
-
div
-
div
-
dot
-
dot
public int dot(double x, double y) -
dot
public int dot(int x, int y) -
project
-
project
-
project
-
pow
-
pow
-
abs
-
negate
-
min
-
min
-
min
-
max
-
max
-
max
-
distanceSquared
-
distanceSquared
public int distanceSquared(double x, double y) -
distanceSquared
public int distanceSquared(int x, int y) -
distance
-
distance
public float distance(double x, double y) -
distance
public float distance(int x, int y) -
lengthSquared
public int lengthSquared()- Specified by:
lengthSquared
in interfaceVectori
-
length
public float length() -
minAxis
public int minAxis()Return the axis with the minimal value. -
maxAxis
public int maxAxis()Return the axis with the maximum value. -
toVector3
-
toVector3
-
toVector3
-
toVector4
-
toVector4
-
toVector4
-
toVectorN
-
toArray
public int[] toArray() -
toInt
-
toLong
-
toFloat
-
toDouble
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Vector2i>
-
equals
-
hashCode
public int hashCode() -
toString
-
from
-
from
-