Package javax.vecmath

Examples of javax.vecmath.Vector3f.cross()


        Vector3f v0p = Stack.alloc(Vector3f.class);
        v0p.sub(vert0, point);
        Vector3f v1p = Stack.alloc(Vector3f.class);
        v1p.sub(vert1, point);
        Vector3f cp0 = Stack.alloc(Vector3f.class);
        cp0.cross(v0p, v1p);

        if (cp0.dot(triangleNormal) >= edge_tolerance) {
          Vector3f v2p = Stack.alloc(Vector3f.class);
          v2p.sub(vert2, point);
          Vector3f cp1 = Stack.alloc(Vector3f.class);
View Full Code Here


        if (cp0.dot(triangleNormal) >= edge_tolerance) {
          Vector3f v2p = Stack.alloc(Vector3f.class);
          v2p.sub(vert2, point);
          Vector3f cp1 = Stack.alloc(Vector3f.class);
          cp1.cross(v1p, v2p);
          if (cp1.dot(triangleNormal) >= edge_tolerance) {
            Vector3f cp2 = Stack.alloc(Vector3f.class);
            cp2.cross(v2p, v0p);

            if (cp2.dot(triangleNormal) >= edge_tolerance) {
View Full Code Here

          v2p.sub(vert2, point);
          Vector3f cp1 = Stack.alloc(Vector3f.class);
          cp1.cross(v1p, v2p);
          if (cp1.dot(triangleNormal) >= edge_tolerance) {
            Vector3f cp2 = Stack.alloc(Vector3f.class);
            cp2.cross(v2p, v0p);

            if (cp2.dot(triangleNormal) >= edge_tolerance) {

              if (dist_a > 0f) {
                hitFraction = reportHit(triangleNormal, distance, partId, triangleIndex);
View Full Code Here

   * Calc a plane from a triangle edge an a normal.
   */
  public static void edge_plane(Vector3f e1, Vector3f e2, Vector3f normal, Vector4f plane) {
    Vector3f planenormal = Stack.alloc(Vector3f.class);
    planenormal.sub(e2, e1);
    planenormal.cross(planenormal, normal);
    planenormal.normalize();

    plane.set(planenormal);
    plane.w = e2.dot(planenormal);
  }
View Full Code Here

    Vector3f BD = Stack.alloc(Vector3f.class);
    BD.sub(vB2, vB1);

    Vector3f N = Stack.alloc(Vector3f.class);
    N.cross(AD, BD);
    float[] tp = new float[] { N.lengthSquared() };

    Vector4f _M = Stack.alloc(Vector4f.class);//plane

    if (tp[0] < BulletGlobals.SIMD_EPSILON)//ARE PARALELE
View Full Code Here

        }
      }
      return;
    }

    N.cross(N, BD);
    _M.set(N.x, N.y, N.z, vB1.dot(N));

    // get point A as the plane collision point
    line_plane_collision(_M, AD, vA1, vPointA, tp, 0f, 1f);
View Full Code Here

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

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

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

    }

    public boolean SolveSimplex2(Vector3f ao, Vector3f ab) {
      if (ab.dot(ao) >= 0) {
        Vector3f cabo = Stack.alloc(Vector3f.class);
        cabo.cross(ab, ao);
        if (cabo.lengthSquared() > GJK_sqinsimplex_eps) {
          ray.cross(cabo, ab);
        }
        else {
          return true;
View Full Code Here

    }

    public boolean SolveSimplex3(Vector3f ao, Vector3f ab, Vector3f ac)
    {
      Vector3f tmp = Stack.alloc(Vector3f.class);
      tmp.cross(ab, ac);
      return (SolveSimplex3a(ao,ab,ac,tmp));
    }
   
    public boolean SolveSimplex3a(Vector3f ao, Vector3f ab, Vector3f ac, Vector3f cabc) {
      // TODO: optimize
View Full Code Here

   
    public boolean SolveSimplex3a(Vector3f ao, Vector3f ab, Vector3f ac, Vector3f cabc) {
      // TODO: optimize

      Vector3f tmp = Stack.alloc(Vector3f.class);
      tmp.cross(cabc, ab);

      Vector3f tmp2 = Stack.alloc(Vector3f.class);
      tmp2.cross(cabc, ac);

      if (tmp.dot(ao) < -GJK_insimplex_eps) {
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.