public class Line
extends java.lang.Object
Constructor and Description |
---|
Line()
Creates a line with both end points at (0,0).
|
Line(float x1,
float y1,
float x2,
float y2)
Creates a line with the given end-points.
|
Modifier and Type | Method and Description |
---|---|
float |
getX1()
Getters and setters for the member variables of this class.
|
float |
getX2() |
float |
getY1() |
float |
getY2() |
boolean |
intersects(Collider collider)
Returns true if the line intersects with a given collider.
|
void |
set(float x1,
float y1,
float x2,
float y2)
Changes the two end-points of the line.
|
void |
setX1(float x1) |
void |
setX2(float x2) |
void |
setY1(float y1) |
void |
setY2(float y2) |
public Line()
public Line(float x1, float y1, float x2, float y2)
public void set(float x1, float y1, float x2, float y2)
public boolean intersects(Collider collider)
public float getX1()
public void setX1(float x1)
public float getY1()
public void setY1(float y1)
public float getX2()
public void setX2(float x2)
public float getY2()
public void setY2(float y2)