public class CollisionEvent extends EventObject
SolidFixture
s in a World
.
The reporting body is the one that sent this event to all its
listeners; the other body is the one it collided with.
Another event giving the opposite view of the collision will be sent
to all listeners attached to the other body.source
Modifier and Type | Method and Description |
---|---|
float |
getFriction()
The combined coefficient of friction of the collision.
|
Vec2 |
getNormal()
A vector of length 1 perpendicular to the line of contact,
pointing toward the other body.
|
Body |
getOtherBody()
The body that collided with the reporting body for this collision event.
|
SolidFixture |
getOtherFixture()
The fixture that collided with the reporting fixture for this collision event.
|
Vec2 |
getPosition()
The position of the collision.
|
Body |
getReportingBody()
The body to which this collision event is being despatched.
|
SolidFixture |
getReportingFixture()
The fixture to which this collision event is being despatched.
|
float |
getRestitution()
The combined coefficient of restitution of the collision.
|
Vec2 |
getVelocity()
Velocity of the other body relative to this one.
|
String |
toString()
String representation of this event.
|
getSource
public String toString()
toString
in class EventObject
public Body getOtherBody()
public Body getReportingBody()
public SolidFixture getOtherFixture()
public SolidFixture getReportingFixture()
public Vec2 getPosition()
public Vec2 getVelocity()
public Vec2 getNormal()
public float getFriction()
public float getRestitution()