Package com.badlogic.gdx.physics.box2d

Examples of com.badlogic.gdx.physics.box2d.World


    this.mSecondsElapsedAccumulator += pSecondsElapsed;

    final int velocityIterations = this.mVelocityIterations;
    final int positionIterations = this.mPositionIterations;

    final World world = this.mWorld;
    final float stepLength = this.mTimeStep;
   
    int stepsAllowed = this.mMaximumStepsPerUpdate;
   
    while(this.mSecondsElapsedAccumulator >= stepLength && stepsAllowed > 0) {
      world.step(stepLength, velocityIterations, positionIterations);
      this.mSecondsElapsedAccumulator -= stepLength;
      stepsAllowed--;
    }
   
    this.mPhysicsConnectorManager.onUpdate(pSecondsElapsed);
View Full Code Here


  public PhysicsWorld(final Vector2 pGravity, final boolean pAllowSleep) {
    this(pGravity, pAllowSleep, VELOCITY_ITERATIONS_DEFAULT, POSITION_ITERATIONS_DEFAULT);
  }

  public PhysicsWorld(final Vector2 pGravity, final boolean pAllowSleep, final int pVelocityIterations, final int pPositionIterations) {
    this.mWorld = new World(pGravity, pAllowSleep);
    this.mVelocityIterations = pVelocityIterations;
    this.mPositionIterations = pPositionIterations;
  }
View Full Code Here

    return stepped;
  }

  private void createPhysicsWorld() {

    world = new World(new Vector2(0, 0), true);
   
    float halfWidth = viewportWidth / 2f;
    ChainShape chainShape = new ChainShape();
    chainShape.createLoop(new Vector2[] {
        new Vector2(-halfWidth, 0f),
View Full Code Here

  @Override
  public void create() {
    camera = new OrthographicCamera(48, 32);
    camera.update();
    world = new World(new Vector2(0, -10), true);
    rayHandler = new RayHandler(world);
    new PointLight(rayHandler, 32);

  }
View Full Code Here

    public void loadMapCollisionInfo (TiledMapGDXContainer map){
   
        Log.info("Have map: "+(map != null));
        Log.info("Have map2: "+(map.getTiledMapGDX() != null));
        Log.info("Have map3: "+(map.getTiledMapGDX().gdxMap != null));
        map.world = new World(new Vector2(), true);
       
TiledMapTileLayer collisionLayer = (TiledMapTileLayer) map.getTiledMapGDX().gdxMap.getLayers().get(Detonator.INSTANCE.obstaclesLayerCode);
       
        if(collisionLayer != null){
            for(int y = 0; y < collisionLayer.getHeight(); y++){
View Full Code Here

  }
 
  private void createPhysicsWorld() {
    // we instantiate a new World with a proper gravity vector
    // and tell it to sleep when possible.
    world = new World(new Vector2(0, 0), false);

//    createEnemies();

    player = new Player(world,5,5,0);
  }
View Full Code Here

    initLevel();
   
  }
 
  private void createPhysicsWorld() {
    world = new World(new Vector2(0, 0), false);
   
//    debugRenderer = new Box2DDebugRenderer( true, true, true, true );
   
    {
      PolygonShape groundPoly = new PolygonShape();
View Full Code Here

    batch.setProjectionMatrix(camera.projection);
    renderer.setProjectionMatrix(camera.projection);
  }

  private void createWorld () {
    world = new World(new Vector2(0, -10), true);

    float[] vertices = {-0.07421887f, -0.16276085f, -0.12109375f, -0.22786504f, -0.157552f, -0.7122401f, 0.04296875f,
      -0.7122401f, 0.110677004f, -0.6419276f, 0.13151026f, -0.49869835f, 0.08984375f, -0.3190109f};

    PolygonShape shape = new PolygonShape();
View Full Code Here

    initLevel();
   
  }
 
  private void createPhysicsWorld() {
    world = new World(new Vector2(0, 0), false);
   
//    debugRenderer = new Box2DDebugRenderer( true, true, true, true );
   
    {
      PolygonShape groundPoly = new PolygonShape();
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.physics.box2d.World

Copyright © 2018 www.massapicom. 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.