Examples of AABB


Examples of ch.njol.skript.util.AABB

          Iterator<Block> current = this.current;
          while ((current == null || !current.hasNext()) && cs.hasNext()) {
            final Chunk c = cs.next().asBukkitChunk();
            if (c == null)
              continue;
            current = new AABB(c).iterator();
          }
          this.current = current;
          return current != null && current.hasNext();
        }
       
View Full Code Here

Examples of co.paralleluniverse.spacebase.AABB

        try (Element<Record<SpaceshipState>> target = global.sb.readElement(lockedOn)) {
            final Record<SpaceshipState> lockedSpaceship;
            if (target != null && (lockedSpaceship = target.get()) != null) {
                foundLockedOn = true;

                final AABB aabb = getAABB(lockedSpaceship);
                // double angularDiversion = abs(atan2(lockedSpaceship.vx, lockedSpaceship.vy) - getCurrentHeading(shootTime));
                if (inShotRange(aabb) & global.random.nextGaussian() < SHOOT_PROBABLITY) {
                    record(1, "Spaceship", "chaseAndShoot", "%s: shootrange", this);
                    final double range = mag(lockedSpaceship.get($x) - state.get($x), lockedSpaceship.get($y) - state.get($y));
                    final long now = global.now();
View Full Code Here

Examples of com.bulletphysics.extras.gimpact.BoxCollision.AABB

    Vector3f tv1 = Stack.alloc(vertices1[1]);
    t.transform(tv1);
    Vector3f tv2 = Stack.alloc(vertices1[2]);
    t.transform(tv2);

    AABB trianglebox = Stack.alloc(AABB.class);
    trianglebox.init(tv0,tv1,tv2,collisionMargin);
   
    aabbMin.set(trianglebox.min);
    aabbMax.set(trianglebox.max);
  }
View Full Code Here

Examples of com.mojang.minecraft.phys.AABB

  }

  public AABB getSelectionBox(int x, int y, int z)
  {
    AABB aabb = new AABB((float)x + x1, (float)y + y1, (float)z + z1, (float)x + x2, (float)y + y2, (float)z + z2);;

    return aabb;
  }
View Full Code Here

Examples of org.jbox2d.collision.AABB

  }
  public static PixelAABB worldAABBToPixelAABB(AABB aabb){
    return new PixelAABB(coordWorldToPixels(aabb.lowerBound),coordWorldToPixels(aabb.upperBound));
  }
  public static AABB pixelAABBToWorldAABB(PixelAABB aabb){
    return new AABB(coordPixelToWorld(aabb.getLowerVertex()),coordPixelToWorld(aabb.getUpperVertex()));
  }
View Full Code Here

Examples of org.jbox2d.collision.AABB

      Fixture[] fixtures=new Fixture[]{body.createFixture(triFixD),body.createFixture(recFixD)};
     
      this.checker=new Checker(fixtures);
     
      body.setTransform(body.getPosition(),(float)-angle);
      aabb=new AABB();
      aabb.combine(fixtures[0].getAABB(), fixtures[1].getAABB());
      forceVec=new Vec2((float)(radius*FORCE_MAGNITUDE_FACTOR*Math.cos(-angle)),(float)(radius*FORCE_MAGNITUDE_FACTOR*Math.sin(-angle)));
     
    }else{
      this.forceVec=null;
 
View Full Code Here

Examples of org.jbox2d.collision.AABB

    }
    return world;
  }
 
  private World() {
    AABB bounds = new AABB(new Vec2(-10000, -10000), new Vec2(10000, 10000));
    Vec2 gravity = new Vec2(0, 0);
    jbox2dWorld = new org.jbox2d.dynamics.World(bounds, gravity, true);
  }
View Full Code Here

Examples of org.jbox2d.collision.AABB

  /**
   * Get the bounding box that encloses this body and all of its constituent shapes
   * @return bounding box of all shapes enclosed in this body
   */
  public BoundingBox getBoundingBox(){
    AABB bodyAABB = new AABB(new AABB(new Vec2(Float.MAX_VALUE, Float.MAX_VALUE), new Vec2(Float.MIN_VALUE, Float.MIN_VALUE)));
    AABB shapeAABB = new AABB();
    for(org.jbox2d.collision.shapes.Shape jshape : shape.getJBoxShapes()){
      jshape.computeAABB(shapeAABB, jboxBody.m_xf);
      if(shapeAABB.lowerBound.x < bodyAABB.lowerBound.x){
        bodyAABB.lowerBound.x = shapeAABB.lowerBound.x;
      }
View Full Code Here

Examples of org.jbox2d.collision.AABB

   *            x-coordinate of upper-right coordinate
   * @param y2
   *            y-coordinate of upper-right coordinate
   */
  public void setBounds(float x1, float y1, float x2, float y2) {
    worldAABB = new AABB(new Vec2(x1, y1), new Vec2(x2, y2));
    outOfBoundsRegions = new AABB[] {
        // everything below-left and directly left of worldAABB
        new AABB(new Vec2(Float.MIN_VALUE, Float.MIN_VALUE), new Vec2(
            x1, y2)),
        // everything above-left and directly above worldAABB
        new AABB(new Vec2(Float.MIN_VALUE, y2), new Vec2(x2,
            Float.MAX_VALUE)),
        // everything above-right and directly right of worldAABB
        new AABB(new Vec2(x2, y1), new Vec2(Float.MAX_VALUE,
            Float.MAX_VALUE)),
        // everything below-right and directly below worldAABB
        new AABB(new Vec2(x1, Float.MIN_VALUE), new Vec2(
            Float.MAX_VALUE, y1)) };
  }
View Full Code Here

Examples of org.jbox2d.collision.AABB

    } else {
      lowerY = y2;
      upperY = y1;
    }

    AABB aabb = new AABB(new Vec2(lowerX, lowerY), new Vec2(upperX, upperY));
    final List<Body<?>> bodies = new LinkedList<Body<?>>();
    jboxWorld.queryAABB(new BodyQueryCallbackHelper(bodies), aabb);
    return bodies;
  }
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.