sim.physics2D.collisionDetection
Class CollisionPair

java.lang.Object
  extended by sim.physics2D.util.PhysicalObjectPair
      extended by sim.physics2D.collisionDetection.CollisionPair

public class CollisionPair
extends PhysicalObjectPair

CollisionPair represents a pair of objects that are currently colliding


Field Summary
 
Fields inherited from class sim.physics2D.util.PhysicalObjectPair
c1, c2, hashcode
 
Constructor Summary
CollisionPair(PhysicalObject2D c1, PhysicalObject2D c2)
           
 
Method Summary
 void clear()
           
 Double2D getColPoint1()
          Returns a vector pointing from the center of object 1 to the collision point
 Double2D getColPoint2()
          Returns a vector pointing from the center of object 2 to the collision point
 Double2D getNormal()
          Returns the collision normal.
 double getRelativeVelocity()
          Returns the relative velocity of the objects along the collision normal
 boolean getSticky()
          Returns a value indicated whether this is a sticky collision or not.
 void setSticky()
          Indicates that this collision should be perfectly inelastic (so the objects lose all energy along the collision normal).
 
Methods inherited from class sim.physics2D.util.PhysicalObjectPair
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollisionPair

public CollisionPair(PhysicalObject2D c1,
                     PhysicalObject2D c2)
Method Detail

getColPoint1

public Double2D getColPoint1()
Returns a vector pointing from the center of object 1 to the collision point


getColPoint2

public Double2D getColPoint2()
Returns a vector pointing from the center of object 2 to the collision point


getNormal

public Double2D getNormal()
Returns the collision normal. The collision normal points out from object 2.


getRelativeVelocity

public double getRelativeVelocity()
Returns the relative velocity of the objects along the collision normal


setSticky

public void setSticky()
Indicates that this collision should be perfectly inelastic (so the objects lose all energy along the collision normal).


getSticky

public boolean getSticky()
Returns a value indicated whether this is a sticky collision or not.


clear

public void clear()