|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Morphable
A Morphable is an object that can be "morphed" in various ways: for example, changing its position, velocity, mass, size, Shape or World.
| Method Summary | |
|---|---|
void |
applyForce(Point2D force)
Applies the given force (in the x and y directions) to this Morphable. |
void |
moveTo(Point2D point)
Moves this Morphable object to the given Point2D, by setting the Morphable's position (part of its Shape) to the given Point2D. |
void |
moveTo(Point2D point,
World world)
Moves this Morphable object to the given Point2D in the given World. |
void |
moveTo(World world)
Moves this Morphable object from its current World to the given World, but maintaining the same position (point) at which the Morphable currently lives. |
void |
multiplySize(double multiplier)
Multiplies this Morphable object's size by the given multiplier, thus either shrinking (multiplier < 1) or expanding (multiplier > 1) this Morphable object's size. |
void |
setMass(double mass)
Sets this Morphable object's mass to the given mass. |
void |
setShape(Shape shape)
Sets the Shape of this Morphable object to the given Shape. |
void |
setSize(double size)
Sets this Morphable object's size to the given size. |
void |
setVelocity(Point2D velocity)
Sets the velocity (i.e., speed in x-direction and speed in y-direction) of this Morphable object to the given velocity. |
| Method Detail |
|---|
void moveTo(Point2D point)
point - the Point2D to which this Morphable object should move.void moveTo(World world)
world - the World to which this Morphable object should move.
void moveTo(Point2D point,
World world)
point - the Point2D to which this Morphable object should move.world - the World to which this Morphable object should move.void applyForce(Point2D force)
force - force (in the x and y directions) to apply to this Morphable.void setVelocity(Point2D velocity)
velocity - the new velocity for this Morphable object.void multiplySize(double multiplier)
multiplier - number to multiply this Morphable object's size by.void setSize(double size)
size - size to set this Morphable object's size to.void setMass(double mass)
mass - mass to set this Morphable object's mass to.void setShape(Shape shape)
shape - the new Shape for this Morphable object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||