|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsource.ucregents.playground.physics.BaseEntity
source.ucregents.playground.physics.BaseFieldForceEntity
public abstract class BaseFieldForceEntity
The ForceEntity class creates an entity which produces a "force" which can attract or repel "MovingEntities" and can act uniformly on the playing field or drop off over a distance. The ForceEntity does not move itself.
Constructor Summary | |
---|---|
BaseFieldForceEntity()
Constructs a default field force entity at 0,0 with 1 width and 1 height and 0 magnitude |
|
BaseFieldForceEntity(int x_loc,
int y_loc,
int width,
int height)
Constructs a custom field force entity with the given parameters |
|
BaseFieldForceEntity(PolygonOrCircle forceShape,
boolean isVisible)
Constructs a custom field force entity with the given parameters |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
protected java.lang.String |
DefaultImageLocation()
Provides the location of the default image |
void |
Draw(java.awt.Graphics2D g,
boolean verbose)
Draws the field force |
java.awt.geom.Rectangle2D |
getResizingObject()
Gets the area to show resizing arrows |
boolean |
IntersectsWith(MovingEntity entity)
Returns if any entity is in contact with the field |
boolean |
isCollidable()
Determines whether or not this entity can be collided with by other entities. |
protected void |
OnCenterScale(double s)
|
protected void |
OnLocationChange(double deltaX,
double deltaY)
|
protected void |
OnULScale(double s)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface source.ucregents.playground.physics.IForceEntity |
---|
getForceFor |
Constructor Detail |
---|
public BaseFieldForceEntity()
public BaseFieldForceEntity(int x_loc, int y_loc, int width, int height)
x_loc
- X locationy_loc
- Y locationwidth
- Field widthheight
- Field heightpublic BaseFieldForceEntity(PolygonOrCircle forceShape, boolean isVisible)
forceShape
- Bounding field rectangleisVisible
- Field VisibilityMethod Detail |
---|
public java.lang.Object clone()
clone
in class BaseEntity
protected java.lang.String DefaultImageLocation()
BaseEntity
DefaultImageLocation
in class BaseEntity
public void Draw(java.awt.Graphics2D g, boolean verbose)
Draw
in class BaseEntity
g
- The graphics2d to be drawnpublic java.awt.geom.Rectangle2D getResizingObject()
BaseEntity
getResizingObject
in class BaseEntity
public boolean IntersectsWith(MovingEntity entity)
IntersectsWith
in interface IForceEntity
entity
- The entity to check intersection with
public boolean isCollidable()
BaseEntity
isCollidable
in class BaseEntity
protected void OnCenterScale(double s)
OnCenterScale
in class BaseEntity
protected void OnLocationChange(double deltaX, double deltaY)
OnLocationChange
in class BaseEntity
protected void OnULScale(double s)
OnULScale
in class BaseEntity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |