EDU.cmu.cs.coral.simulation
Class LineSim

java.lang.Object
  |
  +--EDU.cmu.cs.coral.simulation.LinearObstacleSim
        |
        +--EDU.cmu.cs.coral.simulation.LineSim

public class LineSim
extends LinearObstacleSim


Fields inherited from class EDU.cmu.cs.coral.simulation.LinearObstacleSim
b, center, DEBUG, end, m, mrot, RADIUS, start
 
Constructor Summary
LineSim()
           
 
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.
 double evaluate(double x)
           
 Vec2 getEnd()
           
 Vec2 getStart()
           
 boolean pointOnLine(Vec2 v)
           
 
Methods inherited from class EDU.cmu.cs.coral.simulation.LinearObstacleSim
clearTrail, draw, draw, drawIcon, drawID, drawState, drawTrail, getCenter, getClosestPoint, getID, getPosition, getVisionClass, init, init, isObstacle, isPickupable, isPushable, pickUp, push, putDown, quit, receive, setID, setTrailLength, setVisionClass, takeStep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineSim

public LineSim()
Method Detail

checkCollision

public boolean checkCollision(Circle2 c)
Description copied from interface: SimulatedObject
determine if the object is intersecting with a specified circle. This is useful for obstacle avoidance and so on.
Overrides:
checkCollision in class LinearObstacleSim
Tags copied from interface: SimulatedObject
Parameters:
c - the circle which may be intersecting the current object.
Returns:
true if collision detected.

checkCollision

public boolean checkCollision(Polygon2 p)
Description copied from interface: SimulatedObject
determine if the object is intersecting with a specified polygon. This is useful for obstacle avoidance and so on.
Overrides:
checkCollision in class LinearObstacleSim
Tags copied from interface: SimulatedObject
Parameters:
p - the polygon which may be intersecting the current object.
Returns:
true if collision detected.

evaluate

public double evaluate(double x)

pointOnLine

public boolean pointOnLine(Vec2 v)

getStart

public Vec2 getStart()

getEnd

public Vec2 getEnd()