Examples of AABB


Examples of se.llbit.math.AABB

//        new AABB(0.5, 1, 0.5, 1, 0.5, 1),
//        new AABB(0, 0.5, 0.5, 1, 0, 1),
//        new AABB(0, 1, 0, 0.5, 0, 1),
//        new AABB(0.5, 1, 0.5, 1, 0, 1),
//        new AABB(0, 0.5, 0.5, 1, 0, 0.5),
        new AABB(0, 1, 0, 0.5, 0, 1),
        new AABB(0, 1, 0.5, 1, 0, 0.5),
        new AABB(0, 0.5, 0.5, 1, 0.5, 1),
    };
    quads = new Quad[] {
      new Quad(new Vector3d(14/16., 16/16., 2/16.), new Vector3d(2/16., 16/16., 2/16.),
          new Vector3d(14/16., 16/16., 14/16.), new Vector4d(2/16., 14/16., 2/16., 14/16.)),
    };
View Full Code Here

Examples of toxi.geom.AABB

  @Test
  public void testReorientPlusX2MinusY() {
    gml = createGml();
    gml.environment.up = new Vec3D(1, 0, 0);

    AABB aabb = AABB.fromMinMax(new Vec3D(0.35f, 0.15f, 0.25F), new Vec3D(0.95f, 0.9f, 0.7f));
   
    GmlUtils.reorient(gml, true);
    LOGGER.log(Level.FINEST, "testPlusX2MinusY "+gml.getBoundingBox().getMin()+ " / " +gml.getBoundingBox().getMax());
    LOGGER.log(Level.FINEST, "Expected :"+aabb.getMin()+ " / "+ aabb.getMax());
   
    // Check min-max bounding box
    assertTrue("x=1 to y=-1", aabb.equalsWithTolerance(gml.getBoundingBox(), 0.0000001f));
    assertTrue("up vector", gml.environment.up.equals(new Vec3D(0, -1, 0)));
  }
View Full Code Here

Examples of toxi.geom.AABB

  @Test
  public void testReorientMinusX2MinusY() {
    Gml gml = createGml();
    gml.environment.up = new Vec3D(-1, 0, 0);

    AABB aabb = AABB.fromMinMax(new Vec3D(0.05f, 0.1f, 0.25f), new Vec3D(0.65f, 0.85f, 0.7f));

    GmlUtils.reorient(gml, true);
    LOGGER.log(Level.FINEST, "testMinusX2MinusY "+gml.getBoundingBox().getMin()+ " / " +gml.getBoundingBox().getMax());
    LOGGER.log(Level.FINEST, "Expected :"+aabb.getMin()+ " / "+ aabb.getMax());

    // Check min-max bounding box
    assertTrue("x=-1 to y=-1", aabb.equalsWithTolerance(gml.getBoundingBox(), 0.0000001f));
    assertTrue("up vector", gml.environment.up.equals(new Vec3D(0, -1, 0)));
  }
View Full Code Here

Examples of toxi.geom.AABB

  @Test
  public void testReorientPlusY2MinusY() {
    Gml gml = createGml();
    gml.environment.up = new Vec3D(0, 1, 0);

    AABB aabb = AABB.fromMinMax(new Vec3D(0.15f, 0.05f, 0.7f), new Vec3D(0.9f, 0.65f, 0.25f));
   
    GmlUtils.reorient(gml, true);
    LOGGER.log(Level.FINEST, "testPlusY2MinusY "+gml.getBoundingBox().getMin()+ " / " +gml.getBoundingBox().getMax());
    LOGGER.log(Level.FINEST, "Expected :"+aabb.getMin()+ " / "+ aabb.getMax());
   
    // Check min-max bounding box
    assertTrue("y=1 to y=-1", aabb.equalsWithTolerance(gml.getBoundingBox(), 0.0000001f));
    assertTrue("up vector", gml.environment.up.equals(new Vec3D(0, -1, 0)));
  }
View Full Code Here

Examples of toxi.geom.AABB

  @Test
  public void testReorientMinusY2MinusY() {
    Gml gml = createGml();
    gml.environment.up = new Vec3D(0, -1, 0);

    AABB aabb = AABB.fromMinMax(new Vec3D(0.1f, 0.35f, 0.25f), new Vec3D(0.85f, 0.95f, 0.7f));

    GmlUtils.reorient(gml, true);
    LOGGER.log(Level.FINEST, "testMinusY2MinusY "+gml.getBoundingBox().getMin()+ " / " +gml.getBoundingBox().getMax());
    LOGGER.log(Level.FINEST, "Expected :"+aabb.getMin()+ " / "+ aabb.getMax());
   
    // Check min-max bounding box
    assertTrue("y=-1 to y=-1", aabb.equalsWithTolerance(gml.getBoundingBox(), 0.0000001f));
    assertTrue("up vector", gml.environment.up.equals(new Vec3D(0, -1, 0)));
 
View Full Code Here

Examples of toxi.geom.AABB

  @Test
  public void testReorientPlusZ2MinusY() {
    Gml gml = createGml();
    gml.environment.up = new Vec3D(0, 0, 1);

    AABB aabb = AABB.fromMinMax(new Vec3D(0.1f, 0.3f, 0.35f), new Vec3D(0.85f, 0.75f, 0.95f));

    GmlUtils.reorient(gml, true);
    LOGGER.log(Level.FINEST, "plusZ2MinusY "+gml.getBoundingBox().getMin()+ " / " +gml.getBoundingBox().getMax());
    LOGGER.log(Level.FINEST, "Expected :"+aabb.getMin()+ " / "+ aabb.getMax());

    // Check min-max bounding box
    assertTrue("z=1 to y=-1", aabb.equalsWithTolerance(gml.getBoundingBox(), 0.0000001f));
    assertTrue("up vector", gml.environment.up.equals(new Vec3D(0, -1, 0)));
  }
View Full Code Here

Examples of toxi.geom.AABB

  @Test
  public void testReorientMinusZ2MinusY() {
    Gml gml = createGml();
    gml.environment.up = new Vec3D(0, 0, -1);

    AABB aabb = AABB.fromMinMax(new Vec3D(0.15f, 0.25f, 0.35f), new Vec3D(0.9f, 0.7f, 0.95f));

    GmlUtils.reorient(gml, true);
    LOGGER.log(Level.FINEST, "testMinusZ2MinusY "+gml.getBoundingBox().getMin()+ " / " +gml.getBoundingBox().getMax());
    LOGGER.log(Level.FINEST, "Expected :"+aabb.getMin()+ " / "+ aabb.getMax());

    // Check min-max bounding box
    assertTrue("z=-1 to y=-1", aabb.equalsWithTolerance(gml.getBoundingBox(), 0.0000001f));
    assertTrue("up vector", gml.environment.up.equals(new Vec3D(0, -1, 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.