Package javax.vecmath

Examples of javax.vecmath.Vector3d.sub()


        }
        distToEdge =
      Utils.rayToSegment (origin, direction,
                 ptope.verts[i], ptope.verts[j],
                 rayPt, null, null);
        vector.sub (rayPt, origin);
        distance = vector.length();
        radius = getRadius (distance);
        if (distToEdge <= radius*radius) {
      return true;
        }
View Full Code Here


      getVertexData(i++, pnt1);
      getVertexData(i++, pnt2);

      // Determine the normal
      vec.sub(pnt0, pnt1);
      tmpvec.sub(pnt1, pnt2);

      // Do the cross product
      normal.cross(vec, tmpvec);
      normal.normalize();
View Full Code Here

        replaceIndex = 0;
    }

    // Determine the normal
    vec.sub(pnt0, pnt1);
    tmpvec.sub(pnt1, pnt2);

    // Do the cross product
    normal.cross(vec, tmpvec);
    normal.normalize();
    // If a degenerate triangle, don't include
View Full Code Here

        System.err.println("new point = " + n.x+" " + n.y+" " +
      n.z);
        test_point(planes, n);

        if (delta == null) delta = new Vector3d();
        delta.sub(n, p);
        delta.normalize();
        System.err.println("p->n direction: " + delta);
        Matrix3d hMatrix = new Matrix3d();
        // check using the the javax.vecmath routine
        hMatrix.m00 = h11;
View Full Code Here

        replaceIndex = 2;
    }

    // Determine the normal
    vec.sub(pnt0, pnt1);
    tmpvec.sub(pnt1, pnt2);

    // Do the cross product
    normal.cross(vec, tmpvec);
    normal.normalize();
    // If a degenerate triangle, don't include
View Full Code Here

        Utils.rayToSegment(origin, direction,
            coordinates[i], coordinates[j],
            iPnt1, iPnt, null);
      }
      if (sqDistToEdge <= radius*radius) {
    originToIpnt.sub (iPnt1, origin);
    dist[0] = originToIpnt.length();
    return true;
      }
  }
  return false;
View Full Code Here

    sqDistToEdge =
        Utils.rayToSegment (origin, direction,
             coordinates[i], coordinates[j],
             iPnt1, iPnt, null);
      }
      originToIpnt.sub(iPnt1, origin);
      distance = originToIpnt.length();
      radius = Math.tan (cone.getSpreadAngle()) * distance;
      if (sqDistToEdge <= radius*radius) {
    //  System.err.println ("intersectCone: edge "+i+" intersected");
    dist[0] = distance;
View Full Code Here

  }
  else {
      sqDist = Utils.ptToRaySquare(pt, origin, direction, iPnt);
  }
  if (sqDist <= radius*radius) {
      originToIpnt.sub (iPnt, origin);
      dist[0] = originToIpnt.length();
      return true;
  }
  return false;
    }
View Full Code Here

      sqDist = Utils.ptToSegSquare(pt, origin, end, iPnt);
  }
  else {
      sqDist = Utils.ptToRaySquare(pt, origin, direction, iPnt);
  }
  originToIpnt.sub(iPnt, origin);
  distance = originToIpnt.length();
  radius = Math.tan (cone.getSpreadAngle()) * distance;
  if (sqDist <= radius*radius) {
      dist[0] = distance;
      return true;
View Full Code Here

  if (bounds instanceof BoundingSphere) {
      Point3d sphCenter = ((BoundingSphere)bounds).getCenter();
      double sphRadius = ((BoundingSphere)bounds).getRadius();
      double sqDist = Utils.ptToSegSquare(sphCenter, origin, end, rayPt);

      vector.sub (rayPt, origin);
      distance = vector.length();
      radius = getRadius (distance);
      if (sqDist <= (sphRadius+radius)*(sphRadius+radius)) {
    return true;
      }
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.