|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.gatech.cc.is.simulation.SocFieldSmallSim
Draw an official RoboCup soccer field.
Copyright (c)2000 Tucker Balch
Field Summary | |
protected SimulatedObject[] |
all_objects
|
protected double |
bottom
|
static boolean |
DEBUG
|
protected java.awt.Color |
foreground
|
protected double |
height
|
protected double |
left
|
protected double |
meterspp
|
protected Vec2 |
position
|
protected double |
RADIUS
|
protected double |
right
|
protected double |
top
|
protected int |
unique_id
|
protected int |
visionclass
|
protected double |
width
|
Constructor Summary | |
SocFieldSmallSim()
Instantiate a SocFieldSmallSim object. |
Method Summary | |
boolean |
checkCollision(Circle2 c)
determine if the object is intersecting with a specified circle. |
boolean |
checkCollision(Polygon2 p)
determine if the object is intersecting with a specified polygon. |
void |
clearTrail()
Clear the trail. |
void |
draw(java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the field. |
void |
draw(Vec2 pos,
java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the soccer field in a specific spot. |
void |
drawIcon(java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the object as an icon. |
void |
drawID(java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the objects's ID. |
void |
drawState(java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the objects's State. |
void |
drawTrail(java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the objects's Trail. |
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. |
int |
getID()
Return the id. |
Vec2 |
getPosition()
Find the center point of the object in absolute coordinates. |
int |
getVisionClass()
Return the vision class of the object. |
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 SocFieldSmallSim object. |
boolean |
isObstacle()
true if the object should be considered an obstacle, false otherwise. |
boolean |
isPickupable()
true if the object can be picked up, false otherwise. |
boolean |
isPushable()
true if the object is pushable false otherwise. |
static void |
main(java.lang.String[] args)
|
void |
pickUp(SimulatedObject o)
Try to pick up the object. |
void |
push(Vec2 d,
Vec2 v)
Try to push the object. |
void |
putDown(Vec2 p)
Try to put down the object. |
void |
quit()
Clean up. |
void |
receive(Message m)
Receive a message. |
void |
setID(int i)
Set the id of the object. |
void |
setTrailLength(int l)
Set the length of the trail (in movement steps). |
void |
setVisionClass(int v)
Change the way the object is perceived by vision hardware. |
int |
size(double m)
Convert from size in meters to pixels. |
void |
takeStep(long time_increment,
SimulatedObject[] all_objs)
Take a simulated step; |
int |
X(double x)
Convert x in field coordinates to X in pixel coordinates. |
int |
Y(double y)
Convert y in field coordinates to Y in pixel coordinates. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Vec2 position
protected java.awt.Color foreground
protected SimulatedObject[] all_objects
protected int visionclass
protected int unique_id
protected double RADIUS
protected double top
protected double bottom
protected double left
protected double right
protected double width
protected double height
protected double meterspp
public static final boolean DEBUG
Constructor Detail |
public SocFieldSmallSim()
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
- ignored.yp
- ignored.t
- ingored.r
- ignored.f
- ignored.b
- ignored.v
- vision class (should be 0 for invisible).i
- the unique id.s
- random number seed.public void takeStep(long time_increment, SimulatedObject[] all_objs)
time_increment
- how much time has elapsed since
the last call.all_objects
- the other objects in the simulation.public boolean isObstacle()
public boolean isPushable()
public void receive(Message m)
m
- the message.public boolean isPickupable()
public Vec2 getPosition()
public Vec2 getClosestPoint(Vec2 from)
from
- the place from which the point is determined.public boolean checkCollision(Circle2 c)
c
- the circle which may be intersecting the current object.public boolean checkCollision(Polygon2 p)
p
- the polygon which may be intersecting the current object.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 pickUp(SimulatedObject o)
o
- the object picking it up - this is used for
drawing purposes.public void putDown(Vec2 p)
p
- the location of deposit.public void setVisionClass(int v)
v
- the new vision class.public int getVisionClass()
v
- the new vision class.public void setID(int i)
id
- the new id.public int getID()
public void quit()
public int size(double m)
public int Y(double y)
public int X(double x)
public void drawState(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 drawID(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 drawIcon(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 setTrailLength(int l)
l
- int, the length of the trail.public void clearTrail()
public void drawTrail(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(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.public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |