Class Vector2
java.lang.Object
zombie.iso.Vector2
- All Implemented Interfaces:
Cloneable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Vector2floatangleBetween(Vector2 other) floatclone()floatdistanceTo(Vector2 other) floatdot(float otherX, float otherY) static floatdot(float x, float y, float tx, float ty) floatbooleanintfloorX()intfloorY()static Vector2fromLengthDirection(float length, float direction) floatstatic floatgetDirection(float x, float y) floatDeprecated.floatfloatfloatgetX()floatgetY()static Vector2moveTowards(Vector2 currentVector, Vector2 targetVector, float maxDistanceDelta) mul(float m) floatvoidrotate(float radians) voidscale(float scale) static Vector2set(float x, float y) setDirection(float directionRadians) setLength(float length) setLengthAndDirection(float direction, float length) floatsetMaxLength(float maxLength) voidsetX(float x) voidsetY(float y) voidtangent()toString()
-
Field Details
-
x
public float x -
y
public float y
-
-
Constructor Details
-
Vector2
public Vector2() -
Vector2
-
Vector2
public Vector2(float x, float y)
-
-
Method Details
-
fromLengthDirection
-
dot
public static float dot(float x, float y, float tx, float ty) -
addScaled
-
rotate
public void rotate(float radians) -
add
-
aimAt
-
angleTo
-
angleBetween
-
clone
-
distanceTo
-
dot
-
dot
public float dot(float otherX, float otherY) -
equals
-
getDirection
public float getDirection() -
getDirection
public static float getDirection(float x, float y) -
getDirectionNeg
Deprecated. -
setDirection
-
getLength
public float getLength() -
getLengthSquared
public float getLengthSquared() -
setLength
-
setMaxLength
public float setMaxLength(float maxLength) -
normalize
public float normalize() -
set
-
set
-
setLengthAndDirection
-
mul
-
toString
-
getX
public float getX() -
setX
public void setX(float x) -
getY
public float getY() -
setY
public void setY(float y) -
floorX
public int floorX() -
floorY
public int floorY() -
tangent
public void tangent() -
scale
public void scale(float scale) -
scale
-
moveTowards
-