Package toxi.geom

Examples of toxi.geom.AABB.equalsWithTolerance()


    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)));
  }

  // Rotation from up -1,0,0 to up 0,-1,0
  @Test
View Full Code Here


    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)));
  }

  // Rotation from up 0,1,0 to up 0,-1,0
  @Test
View Full Code Here

    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)));
  }

  // Rotation from up 0,-1,0 to up 0,-1,0
  @Test
View Full Code Here

    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)));
 

  // Rotation from up 0,0,1 to up 0,-1,0
  @Test
View Full Code Here

    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)));
  }

  // Rotation from up 0,0,-1 to up 0,-1,0
  @Test
View Full Code Here

    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)));
  }
 
  /*
   * isUpValid tests
View Full Code Here

   */
  public static boolean isNormalized(Gml gml) {
    AABB refBox = AABB.fromMinMax(new Vec3D(0, 0, 0), new Vec3D(1, 1, 1));
    AABB boundingBox = gml.getBoundingBox();

    return boundingBox.equalsWithTolerance(refBox, 0.0000001f);
  }

  /**
   * Normalizes the Gml to fit within 0-1 for every axis
   * without keeping the aspect ratio which is stored in
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.