|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hermes.physics.ImpulseCollision
public class ImpulseCollision
This class is used to store the data for an impulse-based collision between two beings.
Intended for internal use, you do not need to understand or use this class!
It will accumulate an impulse for a collision between two beings, and apply it equally to each
when the collision is resolved.
Constructor Summary | |
---|---|
ImpulseCollision(MassedBeing being1,
MassedBeing being2,
PVector projection,
float elasticity)
Sets up a collision between beings |
Method Summary | |
---|---|
void |
addImpulse()
add an impulse to the beings, calculated between them, based on their current mass and velocity, to the beings |
void |
addImpulse(PVector impulse,
MassedBeing origin)
add an impulse to the collision |
void |
applyDisplacement()
applies the projective displacement to each being |
void |
applyImpulses()
applies the stored impulse to each being clears the impulse vector |
void |
calculateDisplacement()
calculates the projective displacement on each being |
PVector |
getImpulse()
returns the accumulated impulse vector |
PVector |
getProjection()
the projection vector from being1 to being2 |
boolean |
hasBeing(MassedBeing being)
whether the one of the beings in this collision is the specified being |
void |
setProjection(PVector projection)
sets the projection vector for the collision |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImpulseCollision(MassedBeing being1, MassedBeing being2, PVector projection, float elasticity)
being1
- the first being (impulses and projections are from being1 to being2)being2
- the second beingprojection
- the projection vector from being1 to being2Method Detail |
---|
public PVector getProjection()
public void setProjection(PVector projection)
projection
- the projection vectorpublic PVector getImpulse()
public void addImpulse(PVector impulse, MassedBeing origin)
impulse
- the impulse to addorigin
- the origin of the impulse (should be being1 or being2)public void addImpulse()
public void applyImpulses()
public void calculateDisplacement()
public void applyDisplacement()
public boolean hasBeing(MassedBeing being)
being
- the being to check for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |