Examples of equalsWithTolerance()


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

Examples of toxi.geom.AABB.equalsWithTolerance()

    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

Examples of toxi.geom.AABB.equalsWithTolerance()

    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

Examples of toxi.geom.AABB.equalsWithTolerance()

    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

Examples of toxi.geom.AABB.equalsWithTolerance()

    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

Examples of toxi.geom.AABB.equalsWithTolerance()

    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

Examples of toxi.geom.AABB.equalsWithTolerance()

   */
  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

Examples of toxi.geom.ReadonlyVec3D.equalsWithTolerance()

        Vec3D w = m.applyTo(v);
        m = m.getInverted();
        ReadonlyVec3D v2 = m.applyTo(w);
        System.out.println(w);
        System.out.println(v2);
        assertTrue(v2.equalsWithTolerance(v, 0.0001f));
    }

    public void testRotate() {
        Matrix4x4 m = new Matrix4x4();
        m.rotateX(MathUtils.HALF_PI);
View Full Code Here

Examples of toxi.geom.Vec2D.equalsWithTolerance()

  @Test
  public void testGetNormalizedX() {
    Vec2D v = new Vec2D(.5f, .4f);
    v = Vec2DUtils.getNormalized(v);

    assertTrue("normalized x=1", v.equalsWithTolerance(new Vec2D(1f, .8f), 0.000001f));
  }

  @Test
  public void testGetNormalizedY() {
    Vec2D v = new Vec2D(.4f, .5f);
View Full Code Here

Examples of toxi.geom.Vec2D.equalsWithTolerance()

  @Test
  public void testGetNormalizedY() {
    Vec2D v = new Vec2D(.4f, .5f);
    v = Vec2DUtils.getNormalized(v);

    assertTrue("normalized y=1", v.equalsWithTolerance(new Vec2D(.8f, 1f), 0.000001f));
  }
}
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.