Examples of CircleShape


Examples of org.jbox2d.collision.shapes.CircleShape

    /** Initialize the proxy using the given shape. The shape must remain in scope while the proxy is in use. */
    public final void set (final Shape shape, int index) {
      switch (shape.getType()) {
      case CIRCLE:
        final CircleShape circle = (CircleShape)shape;
        m_vertices[0].set(circle.m_p);
        m_count = 1;
        m_radius = circle.m_radius;

        break;
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

  private final Vec2Array tlvertices = new Vec2Array();

  private void drawShape (Fixture fixture, Transform xf, Color3f color) {
    switch (fixture.getType()) {
    case CIRCLE: {
      CircleShape circle = (CircleShape)fixture.getShape();

      // Vec2 center = Mul(xf, circle.m_p);
      Transform.mulToOutUnsafe(xf, circle.m_p, center);
      float radius = circle.m_radius;
      xf.q.getXAxis(axis);
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

  private final Vec2Array tlvertices = new Vec2Array();

  private void drawShape (Fixture fixture, Transform xf, Color3f color) {
    switch (fixture.getType()) {
    case CIRCLE: {
      CircleShape circle = (CircleShape)fixture.getShape();

      // Vec2 center = Mul(xf, circle.m_p);
      Transform.mulToOutUnsafe(xf, circle.m_p, center);
      float radius = circle.m_radius;
      xf.q.getXAxis(axis);
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

      shape.set(new Vec2(-10.0f, 20.0f), new Vec2(10.0f, 20.0f));
      ground.createFixture(shape, 0.0f);
    }

    float radius = 0.5f;
    CircleShape shape = new CircleShape();
    shape.m_p.setZero();
    shape.m_radius = radius;

    FixtureDef fd = new FixtureDef();
    fd.shape = shape;
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

  }
 
  public void createCircle()
  {
    float radius = 2.0f;
    CircleShape shape = new CircleShape();
    shape.m_p.setZero();
    shape.m_radius = radius;

    FixtureDef fd = new FixtureDef();
    fd.shape = shape;
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

      pshape.setAsBox(0.2f, 1.0f, new Vec2(0.5f, 1.0f), 0.0f);
      body.createFixture(pshape, 0.0f);
    }
    m_poly = new PolygonShape();
    m_poly.setAsBox(2.0f, 0.1f);
    m_circle = new CircleShape();
    m_circle.m_p.setZero();
    m_circle.m_radius = 0.5f;

    BodyDef bd = new BodyDef();
    bd.type = BodyType.DYNAMIC;
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

    m_world.setParticleRadius(0.35f);
    m_world.setParticleDamping(0.2f);

    {
      CircleShape shape = new CircleShape();
      shape.m_p.set(0, 30);
      shape.m_radius = 20;
      ParticleGroupDef pd = new ParticleGroupDef();
      pd.flags = ParticleType.b2_waterParticle;
      pd.shape = shape;
      m_world.createParticleGroup(pd);
    }

    {
      BodyDef bd = new BodyDef();
      bd.type = BodyType.DYNAMIC;
      Body body = m_world.createBody(bd);
      CircleShape shape = new CircleShape();
      shape.m_p.set(0, 80);
      shape.m_radius = 5;
      body.createFixture(shape, 0.5f);
    }
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

      m_polygons[3] = new PolygonShape();
      m_polygons[3].setAsBox(0.5f, 0.5f);
    }

    {
      m_circle = new CircleShape();
      m_circle.m_radius = 0.5f;
    }

    m_bodyIndex = 0;
    m_angle = 0.0f;
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

      vertices[3] = new Vec2(0.0f, 0.9f);
      vertices[4] = new Vec2(-1.15f, 0.9f);
      vertices[5] = new Vec2(-1.5f, 0.2f);
      chassis.set(vertices, 6);

      CircleShape circle = new CircleShape();
      circle.m_radius = 0.4f;

      BodyDef bd = new BodyDef();
      bd.type = BodyType.DYNAMIC;
      bd.position.set(0.0f, 1.0f);
View Full Code Here

Examples of org.jbox2d.collision.shapes.CircleShape

      m_polygons[3] = new PolygonShape();
      m_polygons[3].setAsBox(0.5f, 0.5f);
    }

    {
      m_circle = new CircleShape();
      m_circle.m_radius = 0.5f;
    }

    m_bodyIndex = 0;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.