Package javax.vecmath

Examples of javax.vecmath.Vector3f.cross()


          n[9] = vb.x;
          n[10] = vb.y;
          n[11] = vb.z;
        }
        if (c < 0) {
          vc.cross(va, vb);
          vc.normalize();
          n[12] = vc.x;
          n[13] = vc.y;
          n[14] = vc.z;
        }
View Full Code Here


        int iOrder = (int) (order + 0.01f);
        boolean isIntegerOrder = (order - iOrder <= 0.02f);
        if (!isIntegerOrder || (iOrder = iOrder + firstProper) >= maxAxis)
          continue;
        if (nAxes[iOrder] < axesMaxN[iOrder]) {
          v3.cross(v1, v2);
          checkAxisOrder(iOrder, v3, center);
        }
      }
    }
View Full Code Here

              if (elements[k] == iMin) {
                v1.sub(atoms[i], atoms[j]);
                v2.sub(atoms[i], atoms[k]);
                v1.normalize();
                v2.normalize();
                v3.cross(v1, v2);
                getAllAxes(v3);
//                checkAxisOrder(3, v3, center);
                v1.set(atoms[i]);
                v1.add(atoms[j]);
                v1.add(atoms[k]);
View Full Code Here

        pt.add(a1, a2);
        pt.scale(0.5f);
        v1.sub(a1, center);
        v2.sub(a2, center);
        if (!isParallel(v1, v2)) {
          v3.cross(v1, v2);
          v3.normalize();
          nPlanes = getPlane(v3);
        }

        // second, look for planes perpendicular to the A -- B line
View Full Code Here

      Vector3f v2 = new Vector3f();
      pt1f.set(imesh.vertices[0]);
      viewer.transformPoint(pt1f, pt1f);
      v1.sub(pt2f, pt1f);
      v2.set(v1.x, v1.y, v1.z + 1);
      v2.cross(v2,v1);
      v2.normalize();
      float f = viewer.scaleToScreen((int)pt1f.z, 100);
      v2.scale(f);
      pt1f.set(pt2f);
      pt1f.add(v2);
View Full Code Here

    Vector3f y = new Vector3f();
    boolean isReverse = (lcaoCartoon.length() > 0 && lcaoCartoon.charAt(0) == '-');
    if (isReverse)
      lcaoCartoon = lcaoCartoon.substring(1);
    int sense = (isReverse ? -1 : 1);
    y.cross(z, x);
    if (rotRadians != 0) {
      AxisAngle4f a = new AxisAngle4f();
      if (rotAxis.x != 0)
        a.set(x, rotRadians);
      else if (rotAxis.y != 0)
View Full Code Here

    if (forward.lengthSquared() < BulletGlobals.FLT_EPSILON) {
      forward.set(1f, 0f, 0f);
    }

    Vector3f right = new Vector3f();
    right.cross(cameraUp, forward);
    Quat4f roll = new Quat4f();
    QuaternionUtil.setRotation(roll, right, -rele);

    Matrix3f tmpMat1 = new Matrix3f();
    Matrix3f tmpMat2 = new Matrix3f();
View Full Code Here

   
    s1.sub(base);
    s2.sub(base);
   
    Vector3f n = new Vector3f();
    n.cross(s1, s2);
   
    n.normalize();

    return n;
  }
View Full Code Here

    Vector3f tmp2 = Stack.alloc(Vector3f.class);

    Vector3f normal = Stack.alloc(Vector3f.class);
    tmp1.sub(vertices1[1], vertices1[0]);
    tmp2.sub(vertices1[2], vertices1[0]);
    normal.cross(tmp1, tmp2);
    normal.normalize();

    plane.set(normal.x, normal.y, normal.z, vertices1[0].dot(normal));
  }
View Full Code Here

    Vector3f v20 = Stack.alloc(Vector3f.class);
    v20.sub(vert2, vert0);

    Vector3f triangleNormal = Stack.alloc(Vector3f.class);
    triangleNormal.cross(v10, v20);

    float dist = vert0.dot(triangleNormal);
    float dist_a = triangleNormal.dot(from);
    dist_a -= dist;
    float dist_b = triangleNormal.dot(to);
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.