hermes.physics
Class InsideMassedCollider
java.lang.Object
hermes.Interactor<MassedBeing,MassedBeing>
hermes.physics.InsideMassedCollider
public class InsideMassedCollider
- extends Interactor<MassedBeing,MassedBeing>
A Collider that keeps a being's bounding box contained inside of another by projection and impulse collision.
If the smaller of the beings in the interaction travels hits the inside edge of the larger it will bounce back inside.
This is a multisampled interaction and it is not applied immediately. (See Interactor
documentation.)
Method Summary |
boolean |
detect(MassedBeing being1,
MassedBeing being2)
Determines whether an interaction between two objects has occurred. |
void |
handle(MassedBeing being1,
MassedBeing being2)
Handles the result of an interaction that has been detected (by detect return true)
for a pair of objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InsideMassedCollider
public InsideMassedCollider()
detect
public boolean detect(MassedBeing being1,
MassedBeing being2)
- Description copied from class:
Interactor
- Determines whether an interaction between two objects has occurred.
- Specified by:
detect
in class Interactor<MassedBeing,MassedBeing>
- Parameters:
being1
- the first interacting objectbeing2
- the second interacting object
- Returns:
- Whether or not an interaction has occurred.
handle
public void handle(MassedBeing being1,
MassedBeing being2)
- Description copied from class:
Interactor
- Handles the result of an interaction that has been detected (by
detect
return true)
for a pair of objects.
- Specified by:
handle
in class Interactor<MassedBeing,MassedBeing>
- Parameters:
being1
- the first objectbeing2
- the second object