|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Ball
Constructor Summary | |
Ball()
default constructor |
|
Ball(Vector pos,
Vector vel,
java.awt.Color color)
Constructor with three parameters viz. |
Method Summary | |
void |
bounceOffWall(Rectangle rec)
Set the rebounding velocity of the ball after collision with the table edge |
void |
collideWithBall(Ball b)
Set the rebounding velocity of the ball after collision with another ball |
void |
decelerate(Time t)
Decelerate the ball |
Time |
detectBallCollision(Ball b)
Detect the time of collision with any other ball |
Time |
detectTableCollision(Rectangle rec)
Detect the time of collision with any of the table edges |
Time |
ductStopTime(Duct duct)
Get the time after which the pocketed ball comes to a stop in the duct |
void |
endOfDuct(Duct duct)
Update stationary balls in the duct |
boolean |
fallIntoHole(Hole hole)
Check whether the ball has fallen into the hole |
double |
getAccel()
Get the acceleration of the ball |
java.awt.Color |
getColor()
Get the color of the ball |
Vector |
getPosition()
Get the position vector |
double |
getRadius()
Get the radius of the ball |
Vector |
getVelocity()
Get the velocity of the ball |
boolean |
isAlive()
Check whether the ball is on the table |
boolean |
isMoving()
Check whether the ball is in motion |
void |
kill()
Remove the ball from the table |
void |
pushIntoDuct(Duct duct)
Push pocketed ball into duct |
void |
setAccel(double accel)
Set the acceleration of the ball |
void |
setColor(java.awt.Color color)
Set the color of the ball |
void |
setPosition(Vector pos)
Set the position vector |
void |
setVelocity(Vector vel)
Set the velocity vector |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Ball()
public Ball(Vector pos, Vector vel, java.awt.Color color)
Method Detail |
public double getRadius()
public void setPosition(Vector pos)
public Vector getPosition()
public void setVelocity(Vector vel)
public Vector getVelocity()
public void setColor(java.awt.Color color)
public java.awt.Color getColor()
public void kill()
public boolean isAlive()
public boolean isMoving()
public double getAccel()
public void setAccel(double accel)
public boolean fallIntoHole(Hole hole)
public Time detectTableCollision(Rectangle rec)
public Time detectBallCollision(Ball b)
public void bounceOffWall(Rectangle rec)
public void collideWithBall(Ball b)
public void decelerate(Time t)
public Time ductStopTime(Duct duct)
public void pushIntoDuct(Duct duct)
public void endOfDuct(Duct duct)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |