Package com.hypixel.hytale.math.vector
Class Vector2d
java.lang.Object
com.hypixel.hytale.math.vector.Vector2d
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Vector2dstatic final Vector2dArrayCodecDeprecated.static final BuilderCodec<Vector2d> static final Vector2d[]static final Vector2dprivate intstatic final Vector2dstatic final Vector2dstatic final Vector2dstatic final Vector2dstatic final Vector2dstatic final Vector2dstatic final Vector2ddoubledoublestatic final Vector2d -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(double x, double y) assign(double v) assign(double[] v) assign(double x, double y) assign(float[] v) ceil()clampLength(double maxLength) clipToZero(double epsilon) clone()booleancloseToZero(double epsilon) static doubledistance(double x1, double y1, double x2, double y2) static doubledistanceSquared(double x1, double y1, double x2, double y2) doubledistanceSquaredTo(double x, double y) doubledoubledistanceTo(double x, double y) doubledoubledropHash()booleanfloor()doublegetX()doublegetY()inthashCode()booleanisFinite()doublelength()static Vector2dstatic Vector2dlerpUnclamped(Vector2d a, Vector2d b, double t) static Vector2dstatic Vector2dnegate()scale(double s) setLength(double newLen) voidsetX(double x) voidsetY(double y) doublesubtract(double x, double y) toString()
-
Field Details
-
CODEC
-
AS_ARRAY_CODEC
Deprecated. -
ZERO
-
UP
-
POS_Y
-
DOWN
-
NEG_Y
-
RIGHT
-
POS_X
-
LEFT
-
NEG_X
-
ALL_ONES
-
DIRECTIONS
-
x
public double x -
y
public double y -
hash
private transient int hash
-
-
Constructor Details
-
Vector2d
public Vector2d() -
Vector2d
-
Vector2d
public Vector2d(double x, double y) -
Vector2d
-
-
Method Details
-
getX
public double getX() -
setX
public void setX(double x) -
getY
public double getY() -
setY
public void setY(double y) -
assign
-
assign
-
assign
-
assign
-
assign
-
add
-
add
-
addScaled
-
subtract
-
subtract
-
negate
-
scale
-
scale
-
dot
-
distanceTo
-
distanceTo
public double distanceTo(double x, double y) -
distanceSquaredTo
-
distanceSquaredTo
public double distanceSquaredTo(double x, double y) -
normalize
-
length
public double length() -
squaredLength
public double squaredLength() -
setLength
-
clampLength
-
floor
-
ceil
-
clipToZero
-
closeToZero
public boolean closeToZero(double epsilon) -
isFinite
public boolean isFinite() -
dropHash
-
max
-
min
-
lerp
-
lerpUnclamped
-
distance
public static double distance(double x1, double y1, double x2, double y2) -
distanceSquared
public static double distanceSquared(double x1, double y1, double x2, double y2) -
clone
-
equals
-
hashCode
public int hashCode() -
toString
-