/** * Get the world manifold. */ public void getWorldManifold(WorldManifold worldManifold) { final Body bodyA = m_fixtureA.getBody(); final Body bodyB = m_fixtureB.getBody(); final Shape shapeA = m_fixtureA.getShape(); final Shape shapeB = m_fixtureB.getShape(); worldManifold.initialize(m_manifold, bodyA.getTransform(), shapeA.m_radius, bodyB.getTransform(), shapeB.m_radius); }
/** Returns the shape of this fixture */ public Shape getShape () { if (shape == null) { org.jbox2d.collision.shapes.Shape shape2 = fixture.getShape(); ShapeType type = shape2.getType(); if (type == ShapeType.CHAIN) shape = new ChainShape((org.jbox2d.collision.shapes.ChainShape)shape2); if (type == ShapeType.CIRCLE) shape = new CircleShape((org.jbox2d.collision.shapes.CircleShape)shape2); if (type == ShapeType.EDGE) shape = new EdgeShape((org.jbox2d.collision.shapes.EdgeShape)shape2); if (type == ShapeType.POLYGON) shape = new PolygonShape((org.jbox2d.collision.shapes.PolygonShape)shape2); } return shape; }
private void drawShape(Fixture fixture, Transform xf, Color3f color, boolean wireframe) { switch (fixture.getType()) { case CIRCLE: { CircleShape circle = (CircleShape) fixture.getShape(); PolygonShape poly = (PolygonShape) fixture.getShape(); int vertexCount = poly.m_count; assert (vertexCount <= Settings.maxPolygonVertices); EdgeShape edge = (EdgeShape) fixture.getShape(); Transform.mulToOutUnsafe(xf, edge.m_vertex1, v1); Transform.mulToOutUnsafe(xf, edge.m_vertex2, v2); ChainShape chain = (ChainShape) fixture.getShape(); int count = chain.m_count; Vec2[] vertices = chain.m_vertices;
return true; final Shape shape = fixture.getShape(); Body body = fixture.getBody(); int childCount = shape.getChildCount();
return true; final Shape shape = fixture.getShape(); Body b = fixture.getBody(); Vec2 bp = b.getWorldCenter();
context.rotate(body.getAngle()); for (Fixture fixture = body.getFixtureList(); fixture != null; fixture = fixture.getNext()) { Shape shape = fixture.getShape(); if (shape.getType() == ShapeType.CIRCLE) { CircleShape circle = (CircleShape) shape;