|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--fi.utu.cs.physics.Body
|
+--fi.utu.cs.asteroids.Asteroid
An asteroid. The properties of the asteroids are defined by the
parameters asteroidMinimumMass,
asteroidMaximumMass, and asteroidsDensity.
| Constructor Summary | |
Asteroid(double m,
Point2 p,
double t)
Creates an asteroid with the mass m at the
position p heading at the direction of the
angle t.
|
|
| Method Summary | |
java.awt.Color |
color()
Returns a Color object that is used for drawing
the outline. |
boolean |
isColliding(Body other)
Returns whether the asteroid collides with the body other.
|
boolean |
isDrawn()
Returns a boolean value indicating whether the outline of the shape is drawn or not. |
boolean |
isFilled()
Returns a boolean value indicating whether the shape is filled or not. |
java.awt.Paint |
paint()
Returns a Paint object that is used for filling
the shape. |
java.awt.Shape |
shape()
Returns a Shape object that defines the appearance
of the object. |
void |
split()
Splits the asteroid. |
java.awt.Stroke |
stroke()
Returns a Stroke object that is used for drawing
the outline. |
java.lang.String |
toString()
Returns a string that contains the values of the attributes. |
| Methods inherited from class fi.utu.cs.physics.Body |
advance, elasticCollision, getAcceleration, getMass, getOwner, getPosition, getRadius, getVelocity, isCorporeal, isOverlapping, setAcceleration, setAcceleration, setCorporeal, setEthereal, setMass, setOwner, setPosition, setPosition, setRadius, setVelocity, setVelocity |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Asteroid(double m,
Point2 p,
double t)
m at the
position p heading at the direction of the
angle t.
The created asteroid uses the initial velocity and acceleration
defined in the parameters asteroidInitialVelocity and
asteroidInitialAcceleration. The angle is
in radians.Game| Method Detail |
public boolean isColliding(Body other)
other.
When an asteroid hits a projectile, the asteroid is split.
The parameter collisionAsteroidAsteroid defines,
whether the asteroids can collide with each other.isColliding in class BodyProjectile,
split()public void split()
asteroidMinFractionOnSplit,
asteroidMaxFractionOnSplit, and
asteroidSumOfFractionsOnSplit. If the parameter
decorations is true, a cloud of debris
is created at the site of the split according to the parameters
debrisOnCloud and debrisMaxVelocity.Debrispublic java.awt.Shape shape()
ShapableShape object that defines the appearance
of the object.shape in interface Shapablefi.utu.cs.appearance.ShapableShapepublic boolean isDrawn()
ShapableisDrawn in interface Shapablefi.utu.cs.appearance.ShapableShapable.stroke(),
Shapable.color()public java.awt.Stroke stroke()
ShapableStroke object that is used for drawing
the outline.stroke in interface Shapablefi.utu.cs.appearance.ShapableShapable.isDrawn(),
Strokepublic java.awt.Color color()
ShapableColor object that is used for drawing
the outline.color in interface Shapablefi.utu.cs.appearance.ShapableShapable.isDrawn(),
Colorpublic boolean isFilled()
ShapableisFilled in interface Shapablefi.utu.cs.appearance.ShapableShapable.paint()public java.awt.Paint paint()
ShapablePaint object that is used for filling
the shape.paint in interface Shapablefi.utu.cs.appearance.ShapableShapable.isFilled(),
Paintpublic java.lang.String toString()
BodytoString in class Body
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||