Package javax.vecmath

Examples of javax.vecmath.Vector3d.sub()


      Point3d center = ((BoundingBox)bounds).getCenter ();

      // First, see if cone is too far away from BoundingBox
      double sqDist = Utils.ptToSegSquare(center, origin, end, rayPt);

      vector.sub (rayPt, origin);
      distance = vector.length();
      radius = getRadius (distance);

      double temp = (center.x - lower.x + radius);
      double boxRadiusSquared = temp*temp;
 
View Full Code Here


    //  System.err.println ("Testing edge: "+edges[i][0]+" - "+edges[i][1]);
    double distToEdge =
        Utils.segmentToSegment (origin, end, edges[i][0], edges[i][1],
                 rayPt, null, null);

    vector.sub (rayPt, origin);
    distance = vector.length();
    radius = getRadius (distance);
    /* System.err.println ("PickConeSegment: distance: " +
       distance+" radius: " + radius +
       " distToEdge:" +Math.sqrt(distToEdge));
View Full Code Here

      bsphere.getCenter (sphCenter);
      double sphRadius = bsphere.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 false; // we are too far to intersect
View Full Code Here

        }
        distToEdge =
      Utils.segmentToSegment (origin, end,
               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

/* 1260 */     Vector3d delta0 = new Vector3d();
/* 1261 */     Vector3d delta1 = new Vector3d();
/* 1262 */     Vector3d delta2 = new Vector3d();
/* 1263 */     delta0.sub(coords[index1], coords[index0]);
/* 1264 */     delta1.sub(coords[index2], coords[index0]);
/* 1265 */     delta2.sub(coords[index2], coords[index1]);
/* 1266 */     double len0 = delta0.lengthSquared();
/* 1267 */     double len1 = delta1.lengthSquared();
/* 1268 */     double len2 = delta2.lengthSquared();
/* 1269 */     Vector3d longest = delta0;
/* 1270 */     double maxLen = len0;
View Full Code Here

/*      */     case 1:
/* 1455 */       this.interpWeights[0] = 1.0D;
/* 1456 */       break;
/*      */     case 2:
/* 1458 */       Vector3d delta = new Vector3d();
/* 1459 */       delta.sub(coordinates[1], coordinates[0]);
/* 1460 */       int axis = maxAxis(delta);
/* 1461 */       double factor = getInterpFactor(pt, coordinates[1], coordinates[0], axis);
/* 1462 */       this.interpWeights[0] = factor;
/* 1463 */       this.interpWeights[1] = (1.0D - factor);
/* 1464 */       break;
View Full Code Here

/*     */   }
/*     */
/*     */   public static double rayToSegment(Point3d rayorig, Vector3d raydir, Point3d segstart, Point3d segend, Point3d rayint, Point3d segint, double[] param)
/*     */   {
/*  84 */     Vector3d diff = new Vector3d();
/*  85 */     diff.sub(rayorig, segstart);
/*  86 */     Vector3d segdir = new Vector3d();
/*  87 */     segdir.sub(segend, segstart);
/*     */
/*  92 */     double A = raydir.dot(raydir);
/*  93 */     double B = -raydir.dot(segdir);
View Full Code Here

/*     */   public static double rayToSegment(Point3d rayorig, Vector3d raydir, Point3d segstart, Point3d segend, Point3d rayint, Point3d segint, double[] param)
/*     */   {
/*  84 */     Vector3d diff = new Vector3d();
/*  85 */     diff.sub(rayorig, segstart);
/*  86 */     Vector3d segdir = new Vector3d();
/*  87 */     segdir.sub(segend, segstart);
/*     */
/*  92 */     double A = raydir.dot(raydir);
/*  93 */     double B = -raydir.dot(segdir);
/*  94 */     double C = segdir.dot(segdir);
/*  95 */     double D = raydir.dot(diff);
View Full Code Here

/*     */   }
/*     */
/*     */   public static double rayToRay(Point3d ray0orig, Vector3d ray0dir, Point3d ray1orig, Vector3d ray1dir, Point3d ray0int, Point3d ray1int, double[] param)
/*     */   {
/* 330 */     Vector3d diff = new Vector3d();
/* 331 */     diff.sub(ray0orig, ray1orig);
/*     */
/* 333 */     double A = ray0dir.dot(ray0dir);
/* 334 */     double B = -ray0dir.dot(ray1dir);
/* 335 */     double C = ray1dir.dot(ray1dir);
/* 336 */     double D = ray0dir.dot(diff);
View Full Code Here

/*     */   }
/*     */
/*     */   public static double pointToRay(Point3d pt, Point3d rayorig, Vector3d raydir, Point3d rayint, double[] param)
/*     */   {
/* 497 */     Vector3d diff = new Vector3d();
/* 498 */     diff.sub(pt, rayorig);
/* 499 */     double t = raydir.dot(diff);
/*     */
/* 501 */     if (t <= 0.0D) {
/* 502 */       t = 0.0D;
/* 503 */       if (rayint != null) rayint.set(rayorig);
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.