public class Point extends com.badlogic.gdx.math.Vector2 implements Positionable
Vector2
with some utility methodsConstructor and Description |
---|
Point() |
Point(float x,
float y) |
Point(Point point) |
Modifier and Type | Method and Description |
---|---|
com.badlogic.gdx.math.Vector2 |
add(float x,
float y) |
com.badlogic.gdx.math.Vector2 |
add(com.badlogic.gdx.math.Vector2 v) |
<T extends Positionable> |
addPostionChangeListener(PositionChangeListener<T> listener)
Adds a
PositionChangeListener to be notified of coordinate
changes |
boolean |
equals(com.badlogic.gdx.math.Vector2 v)
Determines if another
Vector2 is exactly equal to this one |
boolean |
equals(com.badlogic.gdx.math.Vector2 v,
float delta)
Determines if a
Vector2 are nearly equal. |
float |
getDistanceTo(Positionable positionable)
Returns this distance between this object's x,y coordinates and the
provided
Positionable 's xy coordinates |
float |
getX()
Returns the x coordinate of this object
|
float |
getY()
Returns the y coordinate of this object
|
boolean |
isOnLineBetween(Point a,
Point b)
Returns if this
Point is between a and b on a line |
<T extends Positionable> |
removePositionChangeListener(PositionChangeListener<T> listener)
Removes a
PositionChangeListener to stop it being notified of
coordinate changes |
void |
rotateAround(Point center,
float degrees)
|
com.badlogic.gdx.math.Vector2 |
set(float x,
float y) |
com.badlogic.gdx.math.Vector2 |
set(com.badlogic.gdx.math.Vector2 v) |
com.badlogic.gdx.math.Vector2 |
sub(float x,
float y) |
com.badlogic.gdx.math.Vector2 |
sub(com.badlogic.gdx.math.Vector2 v) |
angle, angle, angleRad, angleRad, clamp, cpy, crs, crs, dot, dot, dot, dst, dst, dst, dst2, dst2, dst2, epsilonEquals, epsilonEquals, equals, hashCode, hasOppositeDirection, hasSameDirection, interpolate, isCollinear, isCollinear, isCollinearOpposite, isCollinearOpposite, isOnLine, isOnLine, isPerpendicular, isPerpendicular, isUnit, isUnit, isZero, isZero, len, len, len2, len2, lerp, limit, limit2, mul, mulAdd, mulAdd, nor, rotate, rotate90, rotateRad, scl, scl, scl, setAngle, setAngleRad, setLength, setLength2, setZero, toString
public Point()
public Point(float x, float y)
public Point(Point point)
public void rotateAround(Point center, float degrees)
center
- The Point
to rotate arounddegrees
- The angle to rotate by in degreespublic boolean isOnLineBetween(Point a, Point b)
Point
is between a and b on a linepublic boolean equals(com.badlogic.gdx.math.Vector2 v)
Vector2
is exactly equal to this onev
- The Vector2
to compare toVector2
s x and y are exactly equalpublic boolean equals(com.badlogic.gdx.math.Vector2 v, float delta)
Vector2
are nearly equal. A delta of 0.1
means 0.0 and 0.1 would be considered equal but 0.0 and 0.11 would not.v
- The Vector2
to compare todelta
- The amount of error to allow for.public <T extends Positionable> void addPostionChangeListener(PositionChangeListener<T> listener)
Positionable
PositionChangeListener
to be notified of coordinate
changesaddPostionChangeListener
in interface Positionable
listener
- The PositionChangeListener
to addpublic <T extends Positionable> void removePositionChangeListener(PositionChangeListener<T> listener)
Positionable
PositionChangeListener
to stop it being notified of
coordinate changesremovePositionChangeListener
in interface Positionable
listener
- The PositionChangeListener
to removepublic float getDistanceTo(Positionable positionable)
Positionable
Positionable
's xy coordinatesgetDistanceTo
in interface Positionable
positionable
- The Positionable
to retrieve the distance frompublic float getX()
Positionable
getX
in interface Positionable
public float getY()
Positionable
getY
in interface Positionable
public com.badlogic.gdx.math.Vector2 set(float x, float y)
set
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 set(com.badlogic.gdx.math.Vector2 v)
set
in interface com.badlogic.gdx.math.Vector<com.badlogic.gdx.math.Vector2>
set
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 add(float x, float y)
add
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 add(com.badlogic.gdx.math.Vector2 v)
add
in interface com.badlogic.gdx.math.Vector<com.badlogic.gdx.math.Vector2>
add
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 sub(float x, float y)
sub
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 sub(com.badlogic.gdx.math.Vector2 v)
sub
in interface com.badlogic.gdx.math.Vector<com.badlogic.gdx.math.Vector2>
sub
in class com.badlogic.gdx.math.Vector2