|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphysics.CollisionObject
public class CollisionObject
| Constructor Summary | |
|---|---|
CollisionObject(IGraphic shape)
Creates a new CollisionObject instance. |
|
| Method Summary | |
|---|---|
double |
calculateMomentum()
Returns the calculated momentum using the mass and velocity of the object |
void |
collisionReact(CollisionObject co)
Changes the collided boolean value to false Must be overridden to do more |
void |
detectCollision()
Checks for a collision within the group |
boolean |
getCollided()
Returns whether the Object has collided with another object in the current time interval |
DrawingCanvas |
getDP()
getDP
Returns the DrawingPanel this object is drawn upon |
boolean |
getEWall()
Gets the EastWall boolean value returns true if it is the SouthWall, false otherwise |
LineFormula |
getLine()
Returns the Line that the object is traveling on |
int |
getMass()
Returns the mass of the object |
IMotion |
getMotion()
Returns the motion of this object |
boolean |
getNWall()
Gets the NorthWall boolean value returns true if it is the SouthWall, false otherwise |
IGraphic |
getShape()
Returns the shape of this object |
boolean |
getSWall()
Gets the SouthWall boolean value returns true if it is the SouthWall, false otherwise |
boolean |
getWWall()
Gets the WestWall boolean value returns true if it is the SouthWall, false otherwise |
void |
setEastWall(boolean bool)
Sets the EastWall boolean value Set true if it is the SouthWall, false otherwise |
void |
setGroup(CollisionGroup cg)
Sets the CollisionGroup for this Object |
void |
setLine(LineFormula line)
Describe setLine
Sets the line for the Collision Object |
void |
setMass(int mass)
Sets the mass of the object |
void |
setMotion(IMotion im)
Changes the motion for the object and starts the motion's timer |
void |
setNorthWall(boolean bool)
Sets the NorthWall boolean value Set true if it is the SouthWall, false otherwise |
void |
setShape(IGraphic rs)
Sets the shape for this collision object |
void |
setSouthWall(boolean bool)
Sets the SouthWall boolean value Set true if it is the SouthWall, false otherwise |
void |
setWall(boolean b)
Set the boolean value describing if the object is a wall |
void |
setWestWall(boolean bool)
Sets the WestWall boolean value Set true if it is the SouthWall, false otherwise |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollisionObject(IGraphic shape)
CollisionObject instance.
shape - a NGP.Graphics.RectangularShape to use
as the Shape| Method Detail |
|---|
public void collisionReact(CollisionObject co)
public void setSouthWall(boolean bool)
bool - public void setNorthWall(boolean bool)
bool - public void setEastWall(boolean bool)
bool - public void setWestWall(boolean bool)
bool - public boolean getSWall()
bool - public boolean getNWall()
bool - public boolean getEWall()
bool - public boolean getWWall()
bool - public void detectCollision()
public void setGroup(CollisionGroup cg)
cg - a CollisionGrouppublic boolean getCollided()
boolean valuepublic void setMotion(IMotion im)
im - an IMotionpublic IGraphic getShape()
NGP.Graphics.RectangularShapepublic void setShape(IGraphic rs)
rs - a NGP.Graphics.RectangularShapepublic IMotion getMotion()
IMotionpublic DrawingCanvas getDP()
getDP
Returns the DrawingPanel this object is drawn upon
NGP.Containers.DrawingPanelpublic double calculateMomentum()
doublepublic LineFormula getLine()
LineFormulapublic void setLine(LineFormula line)
setLine
Sets the line for the Collision Object
line - a LineFormulapublic void setMass(int mass)
mass - an intpublic int getMass()
intpublic void setWall(boolean b)
b - a boolean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||