|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.gatech.cc.is.simulation.AttractorSim | +--EDU.gatech.cc.is.simulation.BinSim
A simple bin for depositing attractors.
Copyright (c)2000 by Tucker Balch
Field Summary | |
protected java.awt.Color |
background
|
static boolean |
DEBUG
|
Fields inherited from class EDU.gatech.cc.is.simulation.AttractorSim |
all_objects,
background,
bottom,
DEBUG,
deposited,
foreground,
left,
picked_up,
position,
RADIUS,
rando,
right,
seed,
top,
unique_id,
visionclass |
Constructor Summary | |
BinSim()
Instantiate a BinSin object. |
Method Summary | |
void |
draw(java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the bin. |
void |
draw(Vec2 pos,
java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the object in a specific spot. |
Vec2 |
getCenter(Vec2 from)
Find the center point of the object from a particular location. |
Vec2 |
getClosestPoint(Vec2 from)
Find the closest point on the object from a particular location. |
void |
init(double xp,
double yp,
double t,
double r,
java.awt.Color f,
java.awt.Color b,
int v,
int i,
long s)
Initialize an BinSim object. |
boolean |
isPickupable()
true if the object can be picked up, false otherwise. |
boolean |
isPushable()
true if the object is pushable false otherwise. |
void |
push(Vec2 d,
Vec2 v)
Try to push the object. |
void |
quit()
Clean up. |
Methods inherited from class EDU.gatech.cc.is.simulation.AttractorSim |
checkCollision,
checkCollision,
clearTrail,
drawIcon,
drawID,
drawState,
drawTrail,
getID,
getPosition,
getVisionClass,
isObstacle,
pickUp,
putDown,
receive,
setID,
setTrailLength,
setVisionClass,
takeStep |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.awt.Color background
public static final boolean DEBUG
Constructor Detail |
public BinSim()
init(double, double, double, double, java.awt.Color, java.awt.Color, int, int, long)
Method Detail |
public void init(double xp, double yp, double t, double r, java.awt.Color f, java.awt.Color b, int v, int i, long s)
xp
- the x coordinate.yp
- the y coordinate.t
- ingored.r
- the radius.f
- the foreground color.b
- ignored.v
- the vision class.i
- the unique id.s
- random number seed.public boolean isPushable()
public boolean isPickupable()
public Vec2 getClosestPoint(Vec2 from)
from
- the place from which the point is determined.public Vec2 getCenter(Vec2 from)
from
- the place from which the point is determined.public void push(Vec2 d, Vec2 v)
d
- the direction and distance of the push.v
- the velocity of the push.public void quit()
public void draw(java.awt.Graphics g, int w, int h, double t, double b, double l, double r)
g
- graphics area to draw the object.w
- the width in pixels of g.h
- the height in pixels of g.t
- the y coordinate represented by the top boundary of
the drawing area.b
- the y coordinate represented by the bottom boundary of
the drawing area.l
- the x coordinate represented by the left boundary of
the drawing area.r
- the x coordinate represented by the right boundary of
the drawing area.public void draw(Vec2 pos, java.awt.Graphics g, int w, int h, double t, double b, double l, double r)
p
- location to draw it at.g
- graphics area to draw the object.w
- the width in pixels of g.h
- the height in pixels of g.t
- the y coordinate represented by the top boundary of
the drawing area.b
- the y coordinate represented by the bottom boundary of
the drawing area.l
- the x coordinate represented by the left boundary of
the drawing area.r
- the x coordinate represented by the right boundary of
the drawing area.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |