use of org.jbox2d.collision.shapes.ShapeType in project libgdx by libgdx.
the class WorldRayCastWrapper method pushContact.
public void pushContact(Contact contact) {
Fixture fixtureA = contact.getFixtureA();
Fixture fixtureB = contact.getFixtureB();
if (contact.m_manifold.pointCount > 0 && !fixtureA.isSensor() && !fixtureB.isSensor()) {
fixtureA.getBody().setAwake(true);
fixtureB.getBody().setAwake(true);
}
ShapeType type1 = fixtureA.getType();
ShapeType type2 = fixtureB.getType();
IDynamicStack<Contact> creator = contactStacks[type1.ordinal()][type2.ordinal()].creator;
creator.push(contact);
}
use of org.jbox2d.collision.shapes.ShapeType in project libgdx by libgdx.
the class WorldRayCastWrapper method popContact.
public Contact popContact(Fixture fixtureA, int indexA, Fixture fixtureB, int indexB) {
final ShapeType type1 = fixtureA.getType();
final ShapeType type2 = fixtureB.getType();
final ContactRegister reg = contactStacks[type1.ordinal()][type2.ordinal()];
if (reg != null) {
if (reg.primary) {
Contact c = reg.creator.pop();
c.init(fixtureA, indexA, fixtureB, indexB);
return c;
} else {
Contact c = reg.creator.pop();
c.init(fixtureB, indexB, fixtureA, indexA);
return c;
}
} else {
return null;
}
}
Aggregations