Examples of createFixture()


Examples of com.badlogic.gdx.physics.box2d.Body.createFixture()

    final float halfHeight = pHeight * 0.5f / pPixelToMeterRatio;

    boxPoly.setAsBox(halfWidth, halfHeight);
    pFixtureDef.shape = boxPoly;

    boxBody.createFixture(pFixtureDef);

    boxPoly.dispose();

    boxBody.setTransform(boxBody.getWorldCenter(), MathUtils.degToRad(pRotation));

View Full Code Here

Examples of com.badlogic.gdx.physics.box2d.Body.createFixture()

    pFixtureDef.shape = circlePoly;

    final float radius = pRadius / pPixelToMeterRatio;
    circlePoly.setRadius(radius);

    circleBody.createFixture(pFixtureDef);

    circlePoly.dispose();

    return circleBody;
  }
View Full Code Here

Examples of com.badlogic.gdx.physics.box2d.Body.createFixture()

    final PolygonShape linePoly = new PolygonShape();
   
    linePoly.setAsEdge(new Vector2(pX1 / pPixelToMeterRatio, pY1 / pPixelToMeterRatio), new Vector2(pX2 / pPixelToMeterRatio, pY2 / pPixelToMeterRatio));
    pFixtureDef.shape = linePoly;
   
    boxBody.createFixture(pFixtureDef);
   
    linePoly.dispose();
   
    return boxBody;
  }
View Full Code Here

Examples of com.badlogic.gdx.physics.box2d.Body.createFixture()

    final PolygonShape boxPoly = new PolygonShape();

    boxPoly.set(pVertices);
    pFixtureDef.shape = boxPoly;

    boxBody.createFixture(pFixtureDef);

    boxPoly.dispose();

    return boxBody;
  }
View Full Code Here

Examples of com.badlogic.gdx.physics.box2d.Body.createFixture()

      TMP_TRIANGLE[0] = pTriangleVertices.get(i++);

      boxPoly.set(TMP_TRIANGLE);
      pFixtureDef.shape = boxPoly;

      boxBody.createFixture(pFixtureDef);

      boxPoly.dispose();
    }

    return boxBody;
View Full Code Here

Examples of com.badlogic.gdx.physics.box2d.Body.createFixture()

      // Create the BodyDef, set a random position above the
      // ground and create a new body
      boxBodyDef.position.x = -20 + (float) (Math.random() * 40);
      boxBodyDef.position.y = 10 + (float) (Math.random() * 15);
      Body boxBody = world.createBody(boxBodyDef);
      boxBody.createFixture(def);
      balls.add(boxBody);
    }
    ballShape.dispose();
  }

View Full Code Here

Examples of com.badlogic.gdx.physics.box2d.Body.createFixture()

                        bodyDef.type = BodyDef.BodyType.StaticBody;
                        bodyDef.position.set(Detonator.WORLD_TO_BOX2D*((x*Terrain.tileWidth)-(Terrain.tileWidth / 2)), Detonator.WORLD_TO_BOX2D*(y*Terrain.tileHeight));
                        Body boxBody = map.world.createBody(bodyDef);
                        CircleShape circle = new CircleShape();
                        circle.setRadius(Detonator.WORLD_TO_BOX2D*8);
                        boxBody.createFixture(new CircleShape(),0.5f);
                       
                        Log.info("COLLIDES, map coords: "+Detonator.WORLD_TO_BOX2D*((x*Terrain.tileWidth)-(Terrain.tileWidth / 2))+":"+Detonator.WORLD_TO_BOX2D*(y*Terrain.tileHeight));
                       
                    }
                }
View Full Code Here

Examples of org.jbox2d.dynamics.Body.createFixture()

      BodyDef bd = new BodyDef();
      Body ground = getWorld().createBody(bd);

      EdgeShape shape = new EdgeShape();
      shape.set(new Vec2(-40.0f, 0.0f), new Vec2(40.0f, 0.0f));
      ground.createFixture(shape, 0.0f);
    }

    {
      Vec2 vertices[] = new Vec2[3];
      vertices[0] = new Vec2(-0.5f, 0.0f);
View Full Code Here

Examples of org.jbox2d.dynamics.Body.createFixture()

      sd.setAsBox(50.0f, 0.4f);

      BodyDef bd = new BodyDef();
      bd.position.set(0.0f, 0.0f);
      ground = getWorld().createBody(bd);
      ground.createFixture(sd, 0f);

      sd.setAsBox(0.4f, 50.0f, new Vec2(-10.0f, 0.0f), 0.0f);
      ground.createFixture(sd, 0f);
      sd.setAsBox(0.4f, 50.0f, new Vec2(10.0f, 0.0f), 0.0f);
      ground.createFixture(sd, 0f);
View Full Code Here

Examples of org.jbox2d.dynamics.Body.createFixture()

      bd.position.set(0.0f, 0.0f);
      ground = getWorld().createBody(bd);
      ground.createFixture(sd, 0f);

      sd.setAsBox(0.4f, 50.0f, new Vec2(-10.0f, 0.0f), 0.0f);
      ground.createFixture(sd, 0f);
      sd.setAsBox(0.4f, 50.0f, new Vec2(10.0f, 0.0f), 0.0f);
      ground.createFixture(sd, 0f);
    }

    ConstantVolumeJointDef cvjd = new ConstantVolumeJointDef();
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.