Package org.jbox2d.collision

Examples of org.jbox2d.collision.AABB


    super(mtApplication, name);
    this.app = mtApplication;
   
    float worldOffset = 10; //Make Physics world slightly bigger than screen borders
    //Physics world dimensions
    AABB worldAABB = new AABB(new Vec2(-worldOffset, -worldOffset), new Vec2((app.width)/scale + worldOffset, (app.height)/scale + worldOffset));
    Vec2 gravity = new Vec2(0, 10);
//    Vec2 gravity = new Vec2(0, 0);
    boolean sleep = true;
    //Create the pyhsics world
    this.world = new World(worldAABB, gravity, sleep);
View Full Code Here


    this.scorePlayer1 = 0;
    this.scorePlayer2 = 0;
   
    float worldOffset = 10; //Make Physics world slightly bigger than screen borders
    //Physics world dimensions
    AABB worldAABB = new AABB(new Vec2(-worldOffset, -worldOffset), new Vec2((app.width)/scale + worldOffset, (app.height)/scale + worldOffset));
    Vec2 gravity = new Vec2(0, 0);
    boolean sleep = true;
    //Create the pyhsics world
    this.world = new World(worldAABB, gravity, sleep);
   
View Full Code Here

   * @param scale the scale
   *
   * @return the edge body
   */
  public static Body addWorldEdgeBoundaries(PApplet app, World world, float scale){
    AABB wAABB = world.getWorldAABB();
    Vec2 l = new Vec2(wAABB.lowerBound);
    Vec2 u = new Vec2(wAABB.upperBound);
   
    float worldWidth = u.x - l.x;
    float worldHeight = u.y - l.y;
View Full Code Here

TOP

Related Classes of org.jbox2d.collision.AABB

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.