|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hermes.Interactor<A,B> hermes.physics.GenericMassedCollider<A,B>
A
- the first type of MassedBeingB
- the second type of MassedBeingpublic class GenericMassedCollider<A extends MassedBeing,B extends MassedBeing>
This is a collision handler for MassedBeing
and its subclasses which handles collisions
using both projection (instantly separating the bodies) and impulse (changing their velocities).
Use GenericMassedCollider
, as opposed to MassedCollider
, only if you intend to override the behavior
and methods specific to a subclass of MassedBeing
.
Constructor Summary | |
---|---|
GenericMassedCollider()
Default MassedCollider constructor. |
|
GenericMassedCollider(float elasticity)
Creates a MassedCollider with specified collision elasticity. |
Method Summary | |
---|---|
boolean |
detect(A being1,
B being2)
Determines whether an interaction between two objects has occurred. |
void |
handle(A being1,
B being2)
Handles the result of an interaction that has been detected (by detect return true)
for a pair of objects. |
Methods inherited from class hermes.Interactor |
---|
appliedImmediately, multisampled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericMassedCollider()
Default MassedCollider
constructor. In this case, collision elasticity will be the average of the colliding being elasticities.
public GenericMassedCollider(float elasticity)
MassedCollider
with specified collision elasticity.
elasticity
- collision elasticityMethod Detail |
---|
public boolean detect(A being1, B being2)
Interactor
detect
in class Interactor<A extends MassedBeing,B extends MassedBeing>
being1
- the first interacting objectbeing2
- the second interacting object
public void handle(A being1, B being2)
Interactor
detect
return true)
for a pair of objects.
handle
in class Interactor<A extends MassedBeing,B extends MassedBeing>
being1
- the first objectbeing2
- the second object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |