Examples of Vec3D


Examples of toxi.geom.Vec3D

        || coverPathOther.size() < 2) {
      //System.out.println("cover wrong");
      return null;
    }

    Vec3D prevHere = null;
    Vec3D prevThere = null;

    int vertNum = ((int) (1 / stepRes) * 3 * 2);
    int indNum = (int) (1 / stepRes) * 6;

    float[] gVertices = new float[vertNum];
    int[] gIndices = new int[indNum];

    int SideLen = (int) (1 / stepRes) - 1;
    int trigCount = 0;
    int step = 0;
    for (float i = 0; i <= 1 - stepRes; i += stepRes) {

      Vec2D pHere2D = coverPath.getPos(i);

      Vec3D pHere = new Vec3D(pHere2D.x, pHere2D.y, this.getPlane().z);

      Vec2D pThere2D = coverPathOther.getPos(i);
      Vec3D pThere = new Vec3D(pHere2D.x, pHere2D.y,
          planeOther.getPlane().z);

      if (pHere != null && pThere != null) {
        gVertices[((3 * step) + 0)] = GLOBAL.jBullet.scaleVal(pHere.x)
            - offset.x;
View Full Code Here

Examples of toxi.geom.Vec3D

      GLOBAL.sketchChairs.hybernate();
      UITools.load(this.linkedChair);

      if (GLOBAL.sketchChairs.getCurChair() != null) {
        GLOBAL.sketchChairs.getCurChair().drag(
            new Vec3D(posDelta.x, posDelta.y, 0));
        //float height = (this.maxY - minY)*this.scale;
        //GLOBAL.sketchChairs.curChair.setHeight(height);
      }
      this.destroy();
    }
View Full Code Here

Examples of toxi.geom.Vec3D

    LOGGER.setLevel(Level.FINEST);
  }
 
  //TODO @Before
  public Gml createGml() {
    gml = new Gml(new Vec3D(480, 240, 60));
   
    GmlStroke stroke = new GmlStroke();
    stroke.addPoint(new GmlPoint(new Vec3D(0.1f, 0.35f, 0.25f), 0.01f, 1, new Vec3D(), new Vec3D()));
    stroke.addPoint(new GmlPoint(new Vec3D(0.85f, 0.35f, 0.25f), 0.02f, 1, new Vec3D(), new Vec3D()));
    stroke.addPoint(new GmlPoint(new Vec3D(0.85f, 0.95f, 0.70f), 0.03f, 1, new Vec3D(), new Vec3D()));
    stroke.addPoint(new GmlPoint(new Vec3D(0.10f, 0.95f, 0.70f), 0.04f, 1, new Vec3D(), new Vec3D()));
    stroke.setLayer(0);
    gml.addStroke(stroke);
    return gml;
  }
View Full Code Here

Examples of toxi.geom.Vec3D

 
  // Rotation from up 1,0,0 to up 0,-1,0
  @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.Vec3D

  // Rotation from up -1,0,0 to up 0,-1,0
  @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.Vec3D

  // Rotation from up 0,1,0 to up 0,-1,0
  @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.Vec3D

  // Rotation from up 0,-1,0 to up 0,-1,0
  @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.Vec3D

  // Rotation from up 0,0,1 to up 0,-1,0
  @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.Vec3D

  // Rotation from up 0,0,-1 to up 0,-1,0
  @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

Examples of toxi.geom.Vec3D

  
   */
 
  @Test
  public void testIsUpValidTwoPlusOnes() {
    Vec3D v = new Vec3D(1, 1, 0);
    boolean result = false;
    assertTrue("invalid up", result == GmlUtils.isUpValid(v));   
  }
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.