public class Puck extends MovablePhysObject
Modifier and Type | Field and Description |
---|---|
(package private) double |
ctrX |
(package private) double |
ctrY |
static CasaLispOperator |
IROBOT_ENV__PUCK
Lisp operator: (iRobot-env.new)
Sends a message to the LAC requesting the registered agents. |
(package private) double |
radius |
env, twoPI
Constructor and Description |
---|
Puck(String name,
double x,
double y,
double r,
Color color) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowMovement(PhysObject obj,
Shape from,
Shape to)
Meant to indicate whether an object can be moved by an impact with another object or not.
|
protected void |
encounteredCliff(PhysObject cliff)
This method will be called at least once during an update cycle to indicate
and encounter with a cliff object: once
per encounter, and if there is no encounter, once only with a null parameter.
|
protected void |
encounteredImovableObstical(Area impact)
This method is called to let this object know that it cannot move when
it encounters an immovable object.
|
protected void |
encounteredVWall(PhysObject vWall)
This method will be called at least once during an update cycle to indicate
and encounter with a virtual wall: once
per encounter, and if there is no encounter, once only with a null parameter.
|
void |
run()
Do nothing -- we react to
allowMovement(PhysObject, Shape, Shape) , which
is called when another object runs into this one. |
move
compareTo, draw, equals, exit, getAngle, getAngleDeg, getColor, getName, getShape, getShowHeader, getWidth, getX, getY, getZOrder, hasExited, isAnimated, isCliff, isCorporeal, isLabeled, isMovable, isPaint, isPersistent, isVWall, moveTo, normalizeAngle, processMouseEvent, processMouseMoveEvent, replace, replace, setAnimated, setCliff, setColor, setCorporeal, setLabeled, setMovable, setName, setPaint, setPersistent, setShape, setVWall, setZOrder, show, toString
double ctrX
double ctrY
double radius
public static final CasaLispOperator IROBOT_ENV__PUCK
public void run()
allowMovement(PhysObject, Shape, Shape)
, which
is called when another object runs into this one.Runnable.run()
public boolean allowMovement(PhysObject obj, Shape from, Shape to)
PhysObject
allowMovement
in class PhysObject
obj
- the object requesting the move.from
- the old position of the requesting object.to
- the proposed new position of the requesting object.protected void encounteredImovableObstical(Area impact)
MovablePhysObject
encounteredImovableObstical
in class MovablePhysObject
impact
- The area describing the impact with the other objectprotected void encounteredCliff(PhysObject cliff)
MovablePhysObject
encounteredCliff
in class MovablePhysObject
cliff
- Either one of the cliff objects encountered or null if none was
encountered during the update cycle.protected void encounteredVWall(PhysObject vWall)
MovablePhysObject
encounteredVWall
in class MovablePhysObject
vWall
- Either one of the cliff objects encountered or null if none was
encountered during the update cycle.