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 |
com.badlogic.gdx.math.Vector2 |
div(float x,
float y) |
com.badlogic.gdx.math.Vector2 |
div(com.badlogic.gdx.math.Vector2 v) |
boolean |
equals(Point p) |
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 |
com.badlogic.gdx.math.Vector2 |
mul(float scalar) |
com.badlogic.gdx.math.Vector2 |
mul(float x,
float y) |
<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) |
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(Point p)
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 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 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 class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 mul(float x, float y)
mul
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 mul(float scalar)
mul
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 div(float x, float y)
div
in class com.badlogic.gdx.math.Vector2
public com.badlogic.gdx.math.Vector2 div(com.badlogic.gdx.math.Vector2 v)
div
in class com.badlogic.gdx.math.Vector2
Copyright © 2014. All rights reserved.