|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object physics.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 ShapeMethod 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 CollisionGroup
public boolean getCollided()
boolean
valuepublic void setMotion(IMotion im)
im
- an IMotion
public IGraphic getShape()
NGP.Graphics.RectangularShape
public void setShape(IGraphic rs)
rs
- a NGP.Graphics.RectangularShape
public IMotion getMotion()
IMotion
public DrawingCanvas getDP()
getDP
Returns the DrawingPanel this object is drawn upon
NGP.Containers.DrawingPanel
public double calculateMomentum()
double
public LineFormula getLine()
LineFormula
public void setLine(LineFormula line)
setLine
Sets the line for the Collision Object
line
- a LineFormula
public void setMass(int mass)
mass
- an int
public int getMass()
int
public void setWall(boolean b)
b
- a boolean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |