|
||||||||||
| 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
|
+--fi.utu.cs.physics.BoundaryCurve
A boundary curve.
| Field Summary |
| Fields inherited from class fi.utu.cs.physics.Boundary |
boundaryEpsilon |
| Constructor Summary | |
BoundaryCurve(double px,
double py,
double r)
Constructs a boundary circle with a center in point ( px,
py) and a radius r |
|
BoundaryCurve(double px,
double py,
double r,
double a,
double e)
Constructs a boundary curve with a center in point ( px,
py), a radius r, a start angle a,
and an angular extent e. |
|
BoundaryCurve(Point2 p,
double r)
Constructs a boundary circle with a center in point p
and a radius r |
|
BoundaryCurve(Point2 p,
double r,
double a,
double e)
Constructs a boundary curve with a center in point p,
a radius r, a start angle a,
and an angular extent e. |
|
| Method Summary | |
void |
elasticCollision(Body other)
Realizes an elastic collision for the static boundary and the body other.
|
double |
getAngularExtent()
Returns the angular extent of the boundary curve. |
Point2 |
getCenter()
Returns the center of the boundary curve. |
double |
getRadius()
Returns the radius of the boundary curve. |
double |
getStartAngle()
Returns the start angle of the boundary curve. |
void |
inelasticCollision(Body other)
Realizes an inelastic collision for the static boundary and the body other.
|
protected 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 curve;
otherwise, returns false. |
protected boolean |
isCrossedByLine(double x1,
double y1,
double x2,
double y2)
Returns true, if the line (x1,
y1)-(x2, y2)
crosses the boundary curve; otherwise, returns false. |
java.lang.String |
toString()
Returns a string that contains the values of the attributes. |
| Methods inherited from class fi.utu.cs.physics.Boundary |
isCrossed |
| Methods inherited from class fi.utu.cs.physics.Particle |
addCollisionNotification, clearCollisionNotifications, getOwner, isCollisionNotified, isCollisionNotified, isCorporeal, removeCollisionNotification, setCorporeal, setEthereal, setOwner |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public BoundaryCurve(double px,
double py,
double r)
px,
py) and a radius r
public BoundaryCurve(Point2 p,
double r)
p
and a radius r
public BoundaryCurve(double px,
double py,
double r,
double a,
double e)
px,
py), a radius r, a start angle a,
and an angular extent e. The angles are expressed
in radians clockwise.
public BoundaryCurve(Point2 p,
double r,
double a,
double e)
p,
a radius r, a start angle a,
and an angular extent e. The angles are expressed
in radians clockwise.
| Method Detail |
public Point2 getCenter()
public double getRadius()
public double getStartAngle()
public double getAngularExtent()
protected 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 curve;
otherwise, returns false.
isCrossedByBoundingBox in class Boundary
protected boolean isCrossedByLine(double x1,
double y1,
double x2,
double y2)
true, if the line (x1,
y1)-(x2, y2)
crosses the boundary curve; otherwise, returns false.
isCrossedByLine in class Boundarypublic void elasticCollision(Body other)
other.
The linear momentum and kinetic energy of the body is conserved
in the collision.
elasticCollision in class ParticleParticle.inelasticCollision(Body)public void inelasticCollision(Body other)
other.
The linear momentum is conserved but kinetic energy is lost
in the collision.
inelasticCollision in class ParticleParticle.elasticCollision(Body)public java.lang.String toString()
toString in class Particle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||