Package javax.vecmath

Examples of javax.vecmath.Vector3f.dot()


        n.scale(v_dot_n);
      return n;
    }
    Vector3f va_prime_d = new Vector3f();
    va_prime_d.cross(vab, n);
    if (va_prime_d.dot(va_prime_d) != 0)
      va_prime_d.normalize();
    Vector3f vda = new Vector3f();
    Vector3f vcb = new Vector3f(n);
    if (v_dot_n == 0)
      v_dot_n = Float.MIN_VALUE; // allow for perpendicular axis to vab
View Full Code Here


      if (v[1].angle(v[2]) < almost180)
        vTemp2.cross(v[1], v[2]);
      else
        vTemp2.cross(x, v[2]);
      vTemp2.normalize();
      isPlanar = (Math.abs(vTemp2.dot(vTemp)) >= 0.95f);
    }

    boolean isSp3 = (lcaoType.indexOf("sp3") == 0);
    boolean isSp2 = (!isSp3 && lcaoType.indexOf("sp2") == 0);
    boolean isSp = (!isSp3 && !isSp2 && lcaoType.indexOf("sp") == 0);
View Full Code Here

      manifoldPoint.positionWorldOnB.set(manifoldPoint.localPointB);
      trB.transform(manifoldPoint.positionWorldOnB);

      tmp.set(manifoldPoint.positionWorldOnA);
      tmp.sub(manifoldPoint.positionWorldOnB);
      manifoldPoint.distance1 = tmp.dot(manifoldPoint.normalWorldOnB);

      manifoldPoint.lifeTime++;
    }

    // then
View Full Code Here

      else {
        // contact also becomes invalid when relative movement orthogonal to normal exceeds margin
        tmp.scale(manifoldPoint.distance1, manifoldPoint.normalWorldOnB);
        projectedPoint.sub(manifoldPoint.positionWorldOnA, tmp);
        projectedDifference.sub(manifoldPoint.positionWorldOnB, projectedPoint);
        distance2d = projectedDifference.dot(projectedDifference);
        if (distance2d > getContactBreakingThreshold() * getContactBreakingThreshold()) {
          removeContactPoint(i);
        }
        else {
          // contact point processed callback
View Full Code Here

    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);
    dist_b -= dist;

    if (dist_a * dist_b >= 0f) {
View Full Code Here

    triangleNormal.cross(v10, v20);

    float dist = vert0.dot(triangleNormal);
    float dist_a = triangleNormal.dot(from);
    dist_a -= dist;
    float dist_b = triangleNormal.dot(to);
    dist_b -= dist;

    if (dist_a * dist_b >= 0f) {
      return; // same sign
    }
View Full Code Here

        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);
          cp1.cross(v1p, v2p);
          if (cp1.dot(triangleNormal) >= edge_tolerance) {
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

          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);
              }
              else {
View Full Code Here

          if (numIter > maxIter) {
            return false; // todo: report a failure
          }
          float dLambda = 0f;

          float projectedLinearVelocity = r.dot(n);

          dLambda = dist / (projectedLinearVelocity);

          lambda = lambda - dLambda;
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.