|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fi.utu.cs.physics.Particle | +--fi.utu.cs.physics.Boundary
A static physical boundary which can be open or closed.
The boundary can be owned by an instance of the class
Universe
. The boundary can be either corporeal or
ethereal, which determines whether it can be collided or not
(i.e., only the corporeal boundaries can be collided).
Universe
,
Body
Field Summary | |
protected static EpsilonComparator |
boundaryEpsilon
An epsilon comparator for boundary calculations. |
Constructor Summary | |
protected |
Boundary()
Constructs a boundary that has no owner. |
Method Summary | |
boolean |
isCrossed(Body other,
double dt)
Checks whether the boundary will be crossed by the body other within the next dt seconds. |
protected abstract boolean |
isCrossedByBoundingBox(double x1,
double y1,
double x2,
double y2,
double r)
Returns true , if the bounding box of the path
(x1 , y1 )-(x2 , y2 )
of a circle with a radius r crosses the boundary;
otherwise, returns false . |
protected abstract boolean |
isCrossedByLine(double x1,
double y1,
double x2,
double y2)
Returns true , if the line (x1 ,
y1 )-(x2 , y2 )
crosses the boundary; otherwise, returns false . |
Methods inherited from class fi.utu.cs.physics.Particle |
addCollisionNotification, clearCollisionNotifications, elasticCollision, getOwner, inelasticCollision, isCollisionNotified, isCollisionNotified, isCorporeal, removeCollisionNotification, setCorporeal, setEthereal, setOwner, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final EpsilonComparator boundaryEpsilon
Constructor Detail |
protected Boundary()
Method Detail |
protected abstract boolean isCrossedByBoundingBox(double x1, double y1, double x2, double y2, double r)
true
, if the bounding box of the path
(x1
, y1
)-(x2
, y2
)
of a circle with a radius r
crosses the boundary;
otherwise, returns false
.
protected abstract boolean isCrossedByLine(double x1, double y1, double x2, double y2)
true
, if the line (x1
,
y1
)-(x2
, y2
)
crosses the boundary; otherwise, returns false
.
public boolean isCrossed(Body other, double dt)
other
within the next dt
seconds.
Body.advance(double)
,
isCrossedByBoundingBox(double,double,double,double,double)
,
isCrossedByLine(double,double,double,double)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |