Package javax.vecmath

Examples of javax.vecmath.Vector4d


/*  141 */       BoundingSphere sphere = (BoundingSphere)boundsObject;
/*  142 */       this.planes = new Vector4d[6];
/*  143 */       this.mag = new double[this.planes.length];
/*  144 */       this.pDotN = new double[this.planes.length];
/*      */
/*  146 */       this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -(sphere.center.x + sphere.radius));
/*  147 */       this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, sphere.center.x - sphere.radius);
/*  148 */       this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -(sphere.center.y + sphere.radius));
/*  149 */       this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, sphere.center.y - sphere.radius);
/*  150 */       this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -(sphere.center.z + sphere.radius));
/*  151 */       this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, sphere.center.z - sphere.radius);
/*  152 */       this.mag[0] = 1.0D;
/*  153 */       this.mag[1] = 1.0D;
/*  154 */       this.mag[2] = 1.0D;
/*  155 */       this.mag[3] = 1.0D;
/*  156 */       this.mag[4] = 1.0D;
/*  157 */       this.mag[5] = 1.0D;
/*  158 */       computeAllVerts();
/*      */     }
/*  160 */     else if (boundsObject.boundId == 1) {
/*  161 */       BoundingBox box = (BoundingBox)boundsObject;
/*  162 */       this.planes = new Vector4d[6];
/*  163 */       this.pDotN = new double[this.planes.length];
/*  164 */       this.mag = new double[this.planes.length];
/*      */
/*  166 */       this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -box.upper.x);
/*  167 */       this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, box.lower.x);
/*  168 */       this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -box.upper.y);
/*  169 */       this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, box.lower.y);
/*  170 */       this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -box.upper.z);
/*  171 */       this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, box.lower.z);
/*  172 */       this.mag[0] = 1.0D;
/*  173 */       this.mag[1] = 1.0D;
/*  174 */       this.mag[2] = 1.0D;
/*  175 */       this.mag[3] = 1.0D;
/*  176 */       this.mag[4] = 1.0D;
/*  177 */       this.mag[5] = 1.0D;
/*  178 */       computeAllVerts();
/*      */     }
/*  180 */     else if (boundsObject.boundId == 4) {
/*  181 */       BoundingPolytope polytope = (BoundingPolytope)boundsObject;
/*  182 */       this.planes = new Vector4d[polytope.planes.length];
/*  183 */       this.mag = new double[this.planes.length];
/*  184 */       this.pDotN = new double[this.planes.length];
/*  185 */       this.nVerts = polytope.nVerts;
/*  186 */       this.verts = new Point3d[this.nVerts];
/*  187 */       for (int i = 0; i < this.planes.length; i++) {
/*  188 */         this.planes[i] = new Vector4d(polytope.planes[i]);
/*  189 */         this.mag[i] = polytope.mag[i];
/*  190 */         this.pDotN[i] = polytope.pDotN[i];
/*      */       }
/*  192 */       for (i = 0; i < this.verts.length; i++) {
/*  193 */         this.verts[i] = new Point3d(polytope.verts[i]);
View Full Code Here


/*  237 */       BoundingSphere sphere = (BoundingSphere)boundsObjects[i];
/*  238 */       this.planes = new Vector4d[6];
/*  239 */       this.mag = new double[this.planes.length];
/*  240 */       this.pDotN = new double[this.planes.length];
/*      */
/*  242 */       this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -(sphere.center.x + sphere.radius));
/*  243 */       this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, sphere.center.x - sphere.radius);
/*  244 */       this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -(sphere.center.y + sphere.radius));
/*  245 */       this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, sphere.center.y - sphere.radius);
/*  246 */       this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -(sphere.center.z + sphere.radius));
/*  247 */       this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, sphere.center.z - sphere.radius);
/*  248 */       this.mag[0] = 1.0D;
/*  249 */       this.mag[1] = 1.0D;
/*  250 */       this.mag[2] = 1.0D;
/*  251 */       this.mag[3] = 1.0D;
/*  252 */       this.mag[4] = 1.0D;
/*  253 */       this.mag[5] = 1.0D;
/*      */
/*  255 */       computeAllVerts();
/*  256 */     } else if (boundsObjects[i].boundId == 1) {
/*  257 */       BoundingBox box = (BoundingBox)boundsObjects[i];
/*  258 */       this.planes = new Vector4d[6];
/*  259 */       this.mag = new double[this.planes.length];
/*  260 */       this.pDotN = new double[this.planes.length];
/*      */
/*  262 */       this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -box.upper.x);
/*  263 */       this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, box.lower.x);
/*  264 */       this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -box.upper.y);
/*  265 */       this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, box.lower.y);
/*  266 */       this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -box.upper.z);
/*  267 */       this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, box.lower.z);
/*  268 */       this.mag[0] = 1.0D;
/*  269 */       this.mag[1] = 1.0D;
/*  270 */       this.mag[2] = 1.0D;
/*  271 */       this.mag[3] = 1.0D;
/*  272 */       this.mag[4] = 1.0D;
/*  273 */       this.mag[5] = 1.0D;
/*      */
/*  275 */       computeAllVerts();
/*  276 */     } else if (boundsObjects[i].boundId == 4) {
/*  277 */       BoundingPolytope polytope = (BoundingPolytope)boundsObjects[i];
/*  278 */       this.planes = new Vector4d[polytope.planes.length];
/*  279 */       this.mag = new double[this.planes.length];
/*  280 */       this.pDotN = new double[this.planes.length];
/*  281 */       this.nVerts = polytope.nVerts;
/*  282 */       this.verts = new Point3d[this.nVerts];
/*  283 */       for (i = 0; i < this.planes.length; i++) {
/*  284 */         this.planes[i] = new Vector4d(polytope.planes[i]);
/*  285 */         this.pDotN[i] = polytope.pDotN[i];
/*  286 */         this.mag[i] = polytope.mag[i];
/*      */       }
/*  288 */       for (i = 0; i < this.verts.length; i++) {
/*  289 */         this.verts[i] = new Point3d(polytope.verts[i]);
View Full Code Here

/*  326 */     for (int i = 0; i < planes.length; i++)
/*      */     {
/*  328 */       this.mag[i] = Math.sqrt(planes[i].x * planes[i].x + planes[i].y * planes[i].y + planes[i].z * planes[i].z);
/*      */
/*  330 */       double invMag = 1.0D / this.mag[i];
/*  331 */       this.planes[i] = new Vector4d(planes[i].x * invMag, planes[i].y * invMag, planes[i].z * invMag, planes[i].w * invMag);
/*      */     }
/*      */
/*  334 */     computeAllVerts();
/*      */   }
View Full Code Here

/*      */     }
/*  426 */     else if (boundsObject.boundId == 4) {
/*  427 */       BoundingPolytope polytope = (BoundingPolytope)boundsObject;
/*  428 */       if (this.planes.length != polytope.planes.length) {
/*  429 */         this.planes = new Vector4d[polytope.planes.length];
/*  430 */         for (int k = 0; k < polytope.planes.length; k++) this.planes[k] = new Vector4d();
/*  431 */         this.mag = new double[polytope.planes.length];
/*  432 */         this.pDotN = new double[polytope.planes.length];
/*      */       }
/*      */
/*  436 */       for (int i = 0; i < polytope.planes.length; i++) {
View Full Code Here

/*  680 */       this.verts[0] = new Point3d(point.x, point.y, point.z);
/*      */
/*  682 */       for (int i = 0; i < this.planes.length; i++) {
/*  683 */         this.pDotN[i] = 0.0D;
/*      */       }
/*  685 */       this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -point.x);
/*  686 */       this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, point.x);
/*  687 */       this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -point.y);
/*  688 */       this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, point.y);
/*  689 */       this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -point.z);
/*  690 */       this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, point.z);
/*  691 */       this.mag[0] = 1.0D;
/*  692 */       this.mag[1] = 1.0D;
/*  693 */       this.mag[2] = 1.0D;
/*  694 */       this.mag[3] = 1.0D;
/*  695 */       this.mag[4] = 1.0D;
View Full Code Here

/*  733 */       this.verts[0] = new Point3d(points[0].x, points[0].y, points[0].z);
/*      */
/*  735 */       for (int i = 0; i < this.planes.length; i++) {
/*  736 */         this.pDotN[i] = 0.0D;
/*      */       }
/*  738 */       this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -points[0].x);
/*  739 */       this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, points[0].x);
/*  740 */       this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -points[0].y);
/*  741 */       this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, points[0].y);
/*  742 */       this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -points[0].z);
/*  743 */       this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, points[0].z);
/*  744 */       this.mag[0] = 1.0D;
/*  745 */       this.mag[1] = 1.0D;
/*  746 */       this.mag[2] = 1.0D;
/*  747 */       this.mag[3] = 1.0D;
/*  748 */       this.mag[4] = 1.0D;
View Full Code Here

/*  833 */     for (i = 0; i < this.planes.length; i++)
/*      */     {
/*  836 */       this.mag[i] = Math.sqrt(this.planes[i].x * this.planes[i].x + this.planes[i].y * this.planes[i].y + this.planes[i].z * this.planes[i].z);
/*      */
/*  838 */       double invMag = 1.0D / this.mag[i];
/*  839 */       this.planes[i] = new Vector4d(this.planes[i].x * invMag, this.planes[i].y * invMag, this.planes[i].z * invMag, this.planes[i].w * invMag);
/*      */     }
/*      */
/*  844 */     for (i = 0; i < this.verts.length; i++)
/*  845 */       matrix.transform(this.verts[i]);
/*      */   }
View Full Code Here

/* 1287 */     else if (boundsObject.boundId == 4) {
/* 1288 */       BoundingPolytope polytope = (BoundingPolytope)boundsObject;
/* 1289 */       if (intersect(polytope)) {
/* 1290 */         Vector4d[] newPlanes = new Vector4d[this.planes.length + polytope.planes.length];
/* 1291 */         for (int i = 0; i < this.planes.length; i++) {
/* 1292 */           newPlanes[i] = new Vector4d(this.planes[i]);
/*      */         }
/* 1294 */         for (i = 0; i < polytope.planes.length; i++) {
/* 1295 */           newPlanes[(this.planes.length + i)] = new Vector4d(polytope.planes[i]);
/*      */         }
/* 1297 */         BoundingPolytope newPtope = new BoundingPolytope(newPlanes);
/*      */
/* 1299 */         newBoundPolytope.set(newPtope);
/* 1300 */         return true;
View Full Code Here

/* 1375 */         else if (boundsObjects[i].boundId == 4) {
/* 1376 */           BoundingPolytope polytope = (BoundingPolytope)boundsObjects[i];
/* 1377 */           if (intersect(polytope)) {
/* 1378 */             Vector4d[] newPlanes = new Vector4d[this.planes.length + polytope.planes.length];
/* 1379 */             for (i = 0; i < this.planes.length; i++) {
/* 1380 */               newPlanes[i] = new Vector4d(this.planes[i]);
/*      */             }
/* 1382 */             for (i = 0; i < polytope.planes.length; i++) {
/* 1383 */               newPlanes[(this.planes.length + i)] = new Vector4d(polytope.planes[i]);
/*      */             }
/* 1385 */             BoundingPolytope newPtope = new BoundingPolytope(newPlanes);
/* 1386 */             if (status) {
/* 1387 */               newBoundingPolytope.combine(newPtope);
/*      */             } else {
View Full Code Here

/* 1671 */     this.pDotN = new double[6];
/* 1672 */     this.mag = new double[6];
/* 1673 */     this.verts = new Point3d[this.planes.length * this.planes.length];
/* 1674 */     this.nVerts = 0;
/*      */
/* 1676 */     this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -1.0D);
/* 1677 */     this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, -1.0D);
/* 1678 */     this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -1.0D);
/* 1679 */     this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, -1.0D);
/* 1680 */     this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -1.0D);
/* 1681 */     this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, -1.0D);
/* 1682 */     this.mag[0] = 1.0D;
/* 1683 */     this.mag[1] = 1.0D;
/* 1684 */     this.mag[2] = 1.0D;
/* 1685 */     this.mag[3] = 1.0D;
/* 1686 */     this.mag[4] = 1.0D;
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector4d

Copyright © 2018 www.massapicom. 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.