net.jinx.physics
Interface CollisionDetector

All Known Implementing Classes:
SphereCollisionDetector

public interface CollisionDetector


Method Summary
 void added(PhysicalObject obj)
          Called by Universe to notify that a PhysicalObject has been added to the simulation.
 java.util.Set firstContacts(PhysicalObject obj, float initial, float deltaTime, Universe u)
          Checks for collisions between PhysicalObject instances previously added via the added(PhysicalObject) method and obj.
 void removed(PhysicalObject obj)
          Called by Universe to notify that a PhysicalObject has been removed from the simulation.
 

Method Detail

added

void added(PhysicalObject obj)
Called by Universe to notify that a PhysicalObject has been added to the simulation.

Parameters:
obj - the PhysicalObject that was added.

removed

void removed(PhysicalObject obj)
Called by Universe to notify that a PhysicalObject has been removed from the simulation.

Parameters:
obj - the PhysicalObject that was removed.

firstContacts

java.util.Set firstContacts(PhysicalObject obj,
                            float initial,
                            float deltaTime,
                            Universe u)
Checks for collisions between PhysicalObject instances previously added via the added(PhysicalObject) method and obj. How it does this is unimportant, but some kind of Tag for a bounding volume is likely required.

Parameters:
obj - the object that collisions are being detected for.
u - the Universe that collisions are being detected in.
Returns:
a Set containing all the first Contacts that occured simultaneously. This may be an empty Set if no Contacts occured.