/** Get the type of the child shape. You can use this to down cast to the concrete shape. * @return the shape type. */ public Type getType () { ShapeType type = fixture.getType(); if (type == ShapeType.CIRCLE) return Type.Circle; if (type == ShapeType.EDGE) return Type.Edge; if (type == ShapeType.POLYGON) return Type.Polygon; if (type == ShapeType.CHAIN) return Type.Chain; return Type.Circle; }
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; } }
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); }
private void drawShape(Fixture fixture, Transform xf, Color3f color, boolean wireframe) { switch (fixture.getType()) { case CIRCLE: { CircleShape circle = (CircleShape) fixture.getShape();
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; } }
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); }