public class Point extends com.badlogic.gdx.math.Vector2 implements Positionable
Vector2 with some utility methods| Constructor 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)
PositionablePositionChangeListener to be notified of coordinate
changesaddPostionChangeListener in interface Positionablelistener - The PositionChangeListener to addpublic <T extends Positionable> void removePositionChangeListener(PositionChangeListener<T> listener)
PositionablePositionChangeListener to stop it being notified of
coordinate changesremovePositionChangeListener in interface Positionablelistener - The PositionChangeListener to removepublic float getDistanceTo(Positionable positionable)
PositionablePositionable's xy coordinatesgetDistanceTo in interface Positionablepositionable - The Positionable to retrieve the distance frompublic float getX()
PositionablegetX in interface Positionablepublic float getY()
PositionablegetY in interface Positionablepublic com.badlogic.gdx.math.Vector2 set(float x,
float y)
set in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 set(com.badlogic.gdx.math.Vector2 v)
set in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 add(float x,
float y)
add in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 add(com.badlogic.gdx.math.Vector2 v)
add in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 sub(float x,
float y)
sub in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 sub(com.badlogic.gdx.math.Vector2 v)
sub in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 mul(float x,
float y)
mul in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 mul(float scalar)
mul in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 div(float x,
float y)
div in class com.badlogic.gdx.math.Vector2public com.badlogic.gdx.math.Vector2 div(com.badlogic.gdx.math.Vector2 v)
div in class com.badlogic.gdx.math.Vector2Copyright © 2014. All rights reserved.