public abstract class PhysicalObject extends PolygonMapComponent
HumanAgent
s. It is represented by a list of corner points, of which
the first one is the top left corner of the obstacle.shape
position
map
Constructor and Description |
---|
PhysicalObject(double[] x,
double[] y)
Create a physical object from a list of (x,y) coordinates.
|
PhysicalObject(double topX,
double topY,
double width,
double height)
Creates a rectangular physical object with a specified top left corner,
width and height.
|
PhysicalObject(double x0,
double x1,
double x2,
double x3,
double y0,
double y1,
double y2,
double y3)
Creates a physical object from four corner coordinates.
|
PhysicalObject(java.util.List<Position> corners)
Create a physical object from a list of corner
Position s. |
contains, contains, generatePosition, generatePosition, generatePositions, generatePositions, getCorners, getVectorToPosition, isCollision, isLineCollision, toString
getDistance, getPosition
isDestroyed
public PhysicalObject(double topX, double topY, double width, double height)
topX
- The x coordinate of the top left corner.topY
- The y coordinate of the top left corner.width
- The width of the physical object.height
- The height of the physical object.public PhysicalObject(double x0, double x1, double x2, double x3, double y0, double y1, double y2, double y3)
x0
- The first x coordinate.x1
- The second x coordinate.x2
- The third x coordinate.x3
- The fourth x coordinate.y0
- The first y coordinate.y1
- The second y coordinate.y2
- The third y coordinate.y3
- The fourth y coordinate.public PhysicalObject(double[] x, double[] y)
x
- The x coordinates.y
- The y coordinates.