|
|||||||||
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
source.ucregents.playground.physics.FieldForceEntity
public class FieldForceEntity
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 | |
---|---|
FieldForceEntity()
Constructs a default field force entity at 0,0 with 1 width and 1 height and 0 magnitude |
|
FieldForceEntity(int x_loc,
int y_loc,
int width,
int height,
javax.vecmath.Vector2d force)
Constructs a custom field force entity with the given parameters |
|
FieldForceEntity(PolygonOrCircle forceShape,
boolean isVisible,
javax.vecmath.Vector2d force)
Constructs a custom field force entity with the given parameters |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
Draw(java.awt.Graphics2D g,
boolean verbose)
Draws the field force |
javax.vecmath.Vector2d |
getForceFor(MovingEntity be)
Calculats the force to act on another entity |
double |
getXComponent()
Gets the x component of the force field |
double |
getYComponent()
Gets the y component of the force field |
void |
setXComponent(double f)
Sets the x component of the force field |
void |
setYComponent(double f)
Sets the y component of the force field |
Methods inherited from class source.ucregents.playground.physics.BaseFieldForceEntity |
---|
DefaultImageLocation, getResizingObject, IntersectsWith, isCollidable, OnCenterScale, OnLocationChange, OnULScale |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FieldForceEntity()
public FieldForceEntity(int x_loc, int y_loc, int width, int height, javax.vecmath.Vector2d force)
x_loc
- X locationy_loc
- Y locationwidth
- Field widthheight
- Field heightforce
- A vector2d of the forcepublic FieldForceEntity(PolygonOrCircle forceShape, boolean isVisible, javax.vecmath.Vector2d force)
forceShape
- Bounding field rectangleisVisible
- Field Visibilityforce
- Vector2d of the forceMethod Detail |
---|
public java.lang.Object clone()
clone
in class BaseFieldForceEntity
public void Draw(java.awt.Graphics2D g, boolean verbose)
Draw
in class BaseFieldForceEntity
g
- The graphics2d to be drawnpublic javax.vecmath.Vector2d getForceFor(MovingEntity be)
be
- The base entity to get a force for
public double getXComponent()
public double getYComponent()
public void setXComponent(double f)
f
- The new x component of the force fieldpublic void setYComponent(double f)
f
- The new y component of the force field
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |