Exemplo n.º 1
0
 // ---------------------------------------------------------------- //
 @Test
 public void testDecVector3() {
   v.dec(0.5f, -2.0f, 1.0f);
   assertEquals(-0.5f, v.x, eps);
   assertEquals(2.0f, v.y, eps);
   assertEquals(-1.0f, v.z, eps);
 }
Exemplo n.º 2
0
 // ---------------------------------------------------------------- //
 @Test
 public void testIncVector3() {
   v.inc(0.5f, -2.0f, 1.0f);
   assertEquals(0.5f, v.x, eps);
   assertEquals(-2.0f, v.y, eps);
   assertEquals(1.0f, v.z, eps);
 }
Exemplo n.º 3
0
  private boolean findAdjacentPath(Face test, NamedMultiMap<Face> from, FindResults out) {
    float threshold = 0.01f;

    // Store off the first and last verts of the line we're adding
    Vector3 first = test.verts.get(0);
    Vector3 last = test.verts.get(test.verts.size() - 1);

    // Lets look through all the line lists and see if this
    //  line list should be inserted before or after any others in the list.
    boolean found = false;
    out.index = 0;
    out.before = false;
    out.flip = false;

    for (Face l : from) {
      if (l == test) continue;

      Vector3 l0 = l.verts.get(0);
      Vector3 l1 = l.verts.get(l.verts.size() - 1);

      if (l0.sub(last).len() < threshold) {
        found = true;
        out.before = true;
        break;
      } else if (l1.sub(first).len() < threshold) {
        found = true;
        break;
      } else if (l0.sub(first).len() < threshold) {
        found = true;
        out.flip = true;
        out.before = true;
        break;
      } else if (l1.sub(last).len() < threshold) {
        found = true;
        out.flip = true;
        break;
      }

      ++out.index;
    }

    return found;
  }