Package javax.vecmath

Examples of javax.vecmath.Vector4d


  boundId = BOUNDING_POLYTOPE;
  planes = new Vector4d[6];
  mag = new double[planes.length];
  pDotN  = new double[planes.length];

  planes[0] = new Vector4d( 1.0, 0.0, 0.0, -1.0 );
  planes[1] = new Vector4d(-1.0, 0.0, 0.0, -1.0 );
  planes[2] = new Vector4d( 0.0, 1.0, 0.0, -1.0 );
  planes[3] = new Vector4d( 0.0,-1.0, 0.0, -1.0 );
  planes[4] = new Vector4d( 0.0, 0.0, 1.0, -1.0 );
  planes[5] = new Vector4d( 0.0, 0.0,-1.0, -1.0 );
  mag[0] = 1.0;
  mag[1] = 1.0;
  mag[2] = 1.0;
  mag[3] = 1.0;
  mag[4] = 1.0;
View Full Code Here


      BoundingSphere sphere = (BoundingSphere)boundsObject;
      planes = new Vector4d[6];
      mag = new double[planes.length];
      pDotN  = new double[planes.length];

      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -(sphere.center.x+sphere.radius) );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,   sphere.center.x-sphere.radius );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -(sphere.center.y+sphere.radius) );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,   sphere.center.y-sphere.radius );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -(sphere.center.z+sphere.radius) );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,   sphere.center.z-sphere.radius );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
      mag[5] = 1.0;
      computeAllVerts(); // XXXX: lazy evaluate

  } else if( boundsObject.boundId == BOUNDING_BOX ){
      BoundingBox box = (BoundingBox)boundsObject;
      planes = new Vector4d[6];
      pDotN  = new double[planes.length];
      mag = new double[planes.length];

      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -box.upper.x );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,  box.lower.x );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -box.upper.y );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,  box.lower.y );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -box.upper.z );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,  box.lower.z );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
      mag[5] = 1.0;
      computeAllVerts(); // XXXX: lazy evaluate

  } else if( boundsObject.boundId == BOUNDING_POLYTOPE ) {
      BoundingPolytope polytope = (BoundingPolytope)boundsObject;
      planes = new Vector4d[polytope.planes.length];
      mag = new double[planes.length];
      pDotN  = new double[planes.length];
      nVerts = polytope.nVerts;
      verts  = new Point3d[nVerts];
      for(i=0;i<planes.length;i++) {
    planes[i] = new Vector4d(polytope.planes[i]);
    mag[i] = polytope.mag[i];
    pDotN[i] = polytope.pDotN[i];
      }
      for(i=0;i<verts.length;i++) {
    verts[i] = new Point3d(polytope.verts[i]);
View Full Code Here

      BoundingSphere sphere = (BoundingSphere)boundsObjects[i];
      planes = new Vector4d[6];
      mag    = new double[planes.length];
      pDotN  = new double[planes.length];

      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -(sphere.center.x+sphere.radius) );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,   sphere.center.x-sphere.radius );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -(sphere.center.y+sphere.radius) );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,   sphere.center.y-sphere.radius );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -(sphere.center.z+sphere.radius) );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,   sphere.center.z-sphere.radius );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
      mag[5] = 1.0;

      computeAllVerts(); // XXXX: lazy evaluate
  } else if( boundsObjects[i].boundId == BOUNDING_BOX ){
      BoundingBox box = (BoundingBox)boundsObjects[i];
      planes = new Vector4d[6];
      mag    = new double[planes.length];
      pDotN  = new double[planes.length];

      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -box.upper.x );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,  box.lower.x );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -box.upper.y );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,  box.lower.y );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -box.upper.z );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,  box.lower.z );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
      mag[5] = 1.0;

      computeAllVerts(); // XXXX: lazy evaluate
  } else if( boundsObjects[i].boundId == BOUNDING_POLYTOPE ) {
      BoundingPolytope polytope = (BoundingPolytope)boundsObjects[i];
      planes = new Vector4d[polytope.planes.length];
      mag    = new double[planes.length];
      pDotN  = new double[planes.length];
      nVerts = polytope.nVerts;
      verts  = new Point3d[nVerts];
      for(i=0;i<planes.length;i++) {
    planes[i] = new Vector4d(polytope.planes[i]);
    pDotN[i] = polytope.pDotN[i];
    mag[i] = polytope.mag[i];
      }
      for(i=0;i<verts.length;i++) {
    verts[i] = new Point3d(polytope.verts[i]);
View Full Code Here

      for(i=0;i<planes.length;i++) {
    // normalize the plane normals
    mag[i] = Math.sqrt(planes[i].x*planes[i].x + planes[i].y*planes[i].y +
           planes[i].z*planes[i].z);
    invMag = 1.0/mag[i];
    this.planes[i] = new Vector4d( planes[i].x*invMag, planes[i].y*invMag,
                 planes[i].z*invMag, planes[i].w*invMag );
      }
      computeAllVerts()// XXXX: lazy evaluate

  }
View Full Code Here

  } else if(boundsObject.boundId == BOUNDING_POLYTOPE) {
      BoundingPolytope polytope = (BoundingPolytope)boundsObject;
      if( planes.length != polytope.planes.length) {
          planes = new Vector4d[polytope.planes.length];
                for(k=0;k<polytope.planes.length;k++) planes[k] = new Vector4d();
    mag    = new double[polytope.planes.length];
    pDotN  = new double[polytope.planes.length];
      }

View Full Code Here

      verts[0] = new Point3d( point.x, point.y, point.z);

      for(i=0;i<planes.length;i++) {
    pDotN[i] 0.0;
      }
      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -point.x );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,  point.x );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -point.y );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,  point.y );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -point.z );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,  point.z );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
View Full Code Here

      verts[0] = new Point3d( points[0].x, points[0].y, points[0].z);

      for(i=0;i<planes.length;i++) {
    pDotN[i] 0.0;
      }
      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -points[0].x );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,  points[0].x );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -points[0].y );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,  points[0].y );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -points[0].z );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,  points[0].z );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
View Full Code Here

      // normalize the plane normals
      mag[i] = Math.sqrt(planes[i].x*planes[i].x + planes[i].y*planes[i].y +
             planes[i].z*planes[i].z);
      invMag = 1.0/mag[i];
      this.planes[i] = new Vector4d( planes[i].x*invMag, planes[i].y*invMag,
             planes[i].z*invMag, planes[i].w*invMag );

  }

  for (i=0; i < verts.length; i++) {
View Full Code Here

      }

  } else if(boundsObject.boundId == BOUNDING_POLYTOPE) {
      BoundingPolytope polytope = (BoundingPolytope)boundsObject;
      if( this.intersect( polytope)) {
    Vector4d newPlanes[] = new Vector4d[planes.length + polytope.planes.length];
    for(i=0;i<planes.length;i++) {
        newPlanes[i] = new Vector4d(planes[i]);
    }
    for(i=0;i<polytope.planes.length;i++) {
        newPlanes[planes.length + i] = new Vector4d(polytope.planes[i]);
    }
    BoundingPolytope newPtope= new BoundingPolytope( newPlanes );

    newBoundPolytope.set(newPtope);
    return true;
View Full Code Here

    }

      } else if(boundsObjects[i].boundId == BOUNDING_POLYTOPE) {
    BoundingPolytope polytope = (BoundingPolytope)boundsObjects[i];
    if( this.intersect( polytope)) {
        Vector4d newPlanes[] = new Vector4d[planes.length + polytope.planes.length];
        for(i=0;i<planes.length;i++) {
      newPlanes[i] = new Vector4d(planes[i]);
        }
        for(i=0;i<polytope.planes.length;i++) {
      newPlanes[planes.length + i] = new Vector4d(polytope.planes[i]);
        }
        BoundingPolytope newPtope= new BoundingPolytope( newPlanes );
        if ( status ) {
      newBoundingPolytope.combine( newPtope );
        } else {
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.