use of com.gemserk.commons.artemis.components.PhysicsComponent.ImmediateModePhysicsListener in project commons-gdx by gemserk.
the class PhysicsContactListener method addBodyToContacts.
/**
* Adds the body to the entity contacts.
*
* @param e
* The entity to add the contact to.
* @param body
* The body to add to the contacts.
* @param contact
* The real contact, used internally to get some data like normals and stuff.
*/
private void addBodyToContacts(Entity e, Contact contact, boolean fixtureA) {
if (e == null)
return;
PhysicsComponent physicsComponent = PhysicsComponent.get(e);
if (physicsComponent == null)
return;
physicsComponent.getContact().addContact(contact, fixtureA);
ImmediateModePhysicsListener physicsListener = physicsComponent.physicsListener;
if (physicsListener != null)
physicsListener.beginContact(e, contact, fixtureA);
}
use of com.gemserk.commons.artemis.components.PhysicsComponent.ImmediateModePhysicsListener in project commons-gdx by gemserk.
the class PhysicsContactListener method executePreSolveListener.
private void executePreSolveListener(Entity e, Contact contact, boolean fixtureA) {
if (e == null)
return;
PhysicsComponent physicsComponent = PhysicsComponent.get(e);
if (physicsComponent == null)
return;
ImmediateModePhysicsListener physicsListener = physicsComponent.physicsListener;
if (physicsListener != null)
physicsListener.preSolve(e, contact, fixtureA);
}
use of com.gemserk.commons.artemis.components.PhysicsComponent.ImmediateModePhysicsListener in project commons-gdx by gemserk.
the class PhysicsContactListener method removeBodyFromContacts.
/**
* Removes body from entity contacts.
*
* @param e
* The entity to remove the contact from.
* @param body
* The body to be removed from contacts.
*/
private void removeBodyFromContacts(Entity e, Contact contact, boolean fixtureA) {
if (e == null)
return;
PhysicsComponent physicsComponent = PhysicsComponent.get(e);
if (physicsComponent == null)
return;
physicsComponent.getContact().removeContact(contact, fixtureA);
ImmediateModePhysicsListener physicsListener = physicsComponent.physicsListener;
if (physicsListener != null)
physicsListener.endContact(e, contact, fixtureA);
}
Aggregations