Package javax.vecmath

Examples of javax.vecmath.Vector4d


     * Constructs and initializes model clip planes
     */
    ModelClipRetained() {

  // planes contains the negate default values
  planes[0] = new Vector4d( 1.0, 0.00.0,-1.0);
  planes[1] = new Vector4d(-1.0, 0.00.0,-1.0);
  planes[2] = new Vector4d( 0.0, 1.00.0,-1.0);
  planes[3] = new Vector4d( 0.0,-1.00.0,-1.0);
  planes[4] = new Vector4d( 0.0, 0.01.0,-1.0);
  planes[5] = new Vector4d( 0.0, 0.0, -1.0,-1.0);

  for (int i = 0; i < 6; i++)
      xformPlanes[i] = new Vector4d(planes[i]);

        enables[0] = enables[1] = enables[2] = enables[3] =
      enables[4] = enables[5] = true;
    }
View Full Code Here


    void setPlanes(Vector4d[] planes) {
        Vector4d[] pl = new Vector4d[6];
  initPlanes(planes);

  for (int i = 0; i < 6; i++) {
             pl[i] = new Vector4d(this.xformPlanes[i]);
  }

  sendMessage(PLANES_CHANGED, pl, null);
    }
View Full Code Here

     */
    void setPlane(int planeNum, Vector4d plane) {
  initPlane(planeNum, plane);
  sendMessage(PLANE_CHANGED,
        new Integer(planeNum),
        new Vector4d(this.xformPlanes[planeNum]));
    }
View Full Code Here

  update(cv.ctx, enableMask, getLastLocalToVworld());
    }

void update(Context ctx, int enableMask, Transform3D trans) {
  for (int i = 0; i < 6; i++) {
    Vector4d v = xformPlanes[i];
    boolean enable = ((enableMask & (1 << i)) != 0);
    Pipeline.getPipeline().updateModelClip(ctx, i, enable,
                                           v.x, v.y, v.z, v.w);
  }
}
View Full Code Here

    protected Object clone() {
        ModelClipRetained mc = (ModelClipRetained)super.clone();

        mc.planes = new Vector4d[6];
  for (int i = 0; i < 6; i++) {
       mc.planes[i] = new Vector4d(this.planes[i]);
       mc.xformPlanes[i] = new Vector4d(this.xformPlanes[i]);
  }

        mc.enables = new boolean[6];
        getEnables(mc.enables);
View Full Code Here

/*      */
/* 1771 */     if ((this.upper.x > frustum.lower.x) && (this.lower.x < frustum.upper.x) && (this.upper.y > frustum.lower.y) && (this.lower.y < frustum.upper.y) && (this.upper.z > frustum.lower.z) && (this.lower.z < frustum.upper.z))
/*      */     {
/* 1778 */       int i = 5;
/* 1779 */       while (i >= 0) {
/* 1780 */         Vector4d vc = frustum.clipPlanes[(i--)];
/* 1781 */         if ((this.upper.x * vc.x + this.upper.y * vc.y + this.upper.z * vc.z + vc.w < 1.0E-008D) && (this.upper.x * vc.x + this.lower.y * vc.y + this.upper.z * vc.z + vc.w < 1.0E-008D) && (this.upper.x * vc.x + this.lower.y * vc.y + this.lower.z * vc.z + vc.w < 1.0E-008D) && (this.upper.x * vc.x + this.upper.y * vc.y + this.lower.z * vc.z + vc.w < 1.0E-008D) && (this.lower.x * vc.x + this.upper.y * vc.y + this.upper.z * vc.z + vc.w < 1.0E-008D) && (this.lower.x * vc.x + this.lower.y * vc.y + this.upper.z * vc.z + vc.w < 1.0E-008D) && (this.lower.x * vc.x + this.lower.y * vc.y + this.lower.z * vc.z + vc.w < 1.0E-008D) && (this.lower.x * vc.x + this.upper.y * vc.y + this.lower.z * vc.z + vc.w < 1.0E-008D))
/*      */         {
/* 1798 */           return false;
/*      */         }
/*      */
View Full Code Here

/*  77 */     for (int i = 0; i < 8; i++) {
/*  78 */       this.verts[i] = new Point3d();
/*     */     }
/*     */
/*  81 */     for (i = 0; i < 6; i++) {
/*  82 */       this.clipPlanes[i] = new Vector4d(planes[i]);
/*     */     }
/*  84 */     for (i = 0; i < 12; i++) {
/*  85 */       this.xEdges[i] = new Point4d();
/*  86 */       this.yEdges[i] = new Point4d();
/*  87 */       this.zEdges[i] = new Point4d();
View Full Code Here

/*     */
/* 110 */     for (int i = 0; i < 8; i++) {
/* 111 */       this.verts[i] = new Point3d();
/*     */     }
/* 113 */     for (i = 0; i < 6; i++) {
/* 114 */       this.clipPlanes[i] = new Vector4d();
/*     */     }
/* 116 */     for (i = 0; i < 12; i++) {
/* 117 */       this.xEdges[i] = new Point4d();
/* 118 */       this.yEdges[i] = new Point4d();
/* 119 */       this.zEdges[i] = new Point4d();
View Full Code Here

/*   68 */     for (int i = 0; i < planes.length; i++)
/*      */     {
/*   71 */       this.mag[i] = Math.sqrt(planes[i].x * planes[i].x + planes[i].y * planes[i].y + planes[i].z * planes[i].z);
/*      */
/*   73 */       double invMag = 1.0D / this.mag[i];
/*   74 */       this.planes[i] = new Vector4d(planes[i].x * invMag, planes[i].y * invMag, planes[i].z * invMag, planes[i].w * invMag);
/*      */     }
/*      */
/*   78 */     computeAllVerts();
/*      */   }
View Full Code Here

/*   95 */     this.boundId = 4;
/*   96 */     this.planes = new Vector4d[6];
/*   97 */     this.mag = new double[this.planes.length];
/*   98 */     this.pDotN = new double[this.planes.length];
/*      */
/*  100 */     this.planes[0] = new Vector4d(1.0D, 0.0D, 0.0D, -1.0D);
/*  101 */     this.planes[1] = new Vector4d(-1.0D, 0.0D, 0.0D, -1.0D);
/*  102 */     this.planes[2] = new Vector4d(0.0D, 1.0D, 0.0D, -1.0D);
/*  103 */     this.planes[3] = new Vector4d(0.0D, -1.0D, 0.0D, -1.0D);
/*  104 */     this.planes[4] = new Vector4d(0.0D, 0.0D, 1.0D, -1.0D);
/*  105 */     this.planes[5] = new Vector4d(0.0D, 0.0D, -1.0D, -1.0D);
/*  106 */     this.mag[0] = 1.0D;
/*  107 */     this.mag[1] = 1.0D;
/*  108 */     this.mag[2] = 1.0D;
/*  109 */     this.mag[3] = 1.0D;
/*  110 */     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.