public class Wall extends BaseEntity
BaseEntity.DepthOrder
tag, tagNo
Constructor and Description |
---|
Wall(java.lang.String name,
Vector2D start,
Vector2D end,
boolean visible)
Create a 'named' wall.
|
Wall(Vector2D start,
Vector2D end,
boolean visible)
Create a wall.
|
Modifier and Type | Method and Description |
---|---|
Vector2D |
getEndPos()
Get the world end position
|
Vector2D |
getStartPos()
Get the wall start position
|
boolean |
isEitherSide(double x0,
double y0,
double x1,
double y1)
Determines whether the two points given are 'either side of the object' if true then
the two positions are not visible to each other.
|
boolean |
isInDomain(Domain view)
Determine whether this entity is inside or part inside the domain.
|
boolean |
isOver(double px,
double py)
Since the wall is considered to have no thickness then the
world point cannot be over the wall.
|
Vector2D |
norm()
Get the wall normal - it will point 'outside'
|
addFSM, born, colRadius, colRadius, compareTo, die, draw, draw, FSM, hasFSM, ID, isEitherSide, isOverLapAllowed, isVisible, moveBy, moveBy, moveTo, moveTo, name, name, overLapAllowed, pos, removeFSM, renderer, renderer, toString, update, updateFSM, visible, Z, Z
public Wall(Vector2D start, Vector2D end, boolean visible)
start
- wall start position.end
- wall end positionvisible
- whether the wall is visiblepublic Vector2D getStartPos()
public Vector2D getEndPos()
public Vector2D norm()
public boolean isEitherSide(double x0, double y0, double x1, double y1)
isEitherSide
in class BaseEntity
x0
- first point x positiony0
- first point y positionx1
- second point x positiony1
- second point y positionpublic boolean isInDomain(Domain view)
isInDomain
in class BaseEntity
view
- the world domainpublic boolean isOver(double px, double py)
isOver
in class BaseEntity
px
- x position of point of interestpy
- y position of point of interestProcessing library AI_for_2D_Games by Peter Lager. (C) 2013