Examples of lengthSquared()


Examples of javax.vecmath.Vector3f.lengthSquared()

          return ROTX;
        }
        return ROTXYZ;
      }
    }
    else if(v.lengthSquared()==0.f){
      if(isIdentity(m3)){
        if(m.m00==m.m11 && m.m11==m.m22){
          return SCALE;
        }
        if(m.m00==1.f){
View Full Code Here

Examples of javax.vecmath.Vector3f.lengthSquared()

    VectorUtil.setCoord(eyePos, forwardAxis, -cameraDistance);

    Vector3f forward = new Vector3f();
    forward.set(eyePos.x, eyePos.y, eyePos.z);

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

    Vector3f right = new Vector3f();
    right.cross(cameraUp, forward);
View Full Code Here

Examples of javax.vecmath.Vector3f.lengthSquared()

    // Add an epsilon as a tolerance for the raycast,
    // in case the ray hits exacly on the edge of the triangle.
    // It must be scaled for the triangle size.

    if (distance < hitFraction) {
      float edge_tolerance = triangleNormal.lengthSquared();
      edge_tolerance *= -0.0001f;
      Vector3f point = new Vector3f();
      VectorUtil.setInterpolate3(point, from, to, distance);
      {
        Vector3f v0p = Stack.alloc(Vector3f.class);
View Full Code Here

Examples of javax.vecmath.Vector3f.lengthSquared()

              debugDraw/*,input.stackAlloc*/);

          if (isValid2) {
            tmpNormalInB.sub(tmpPointOnB, tmpPointOnA);

            float lenSqr = tmpNormalInB.lengthSquared();
            if (lenSqr > (BulletGlobals.FLT_EPSILON * BulletGlobals.FLT_EPSILON)) {
              tmpNormalInB.scale(1f / (float) Math.sqrt(lenSqr));
              tmp.sub(tmpPointOnA, tmpPointOnB);
              float distance2 = -tmp.length();
              // only replace valid penetrations when the result is deeper (check)
View Full Code Here

Examples of javax.vecmath.Vector3f.lengthSquared()

    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

Examples of javax.vecmath.Vector3f.lengthSquared()

    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

Examples of javax.vecmath.Vector3f.lengthSquared()

      b0.sub(pointCache[2].localPointA);

      Vector3f cross = Stack.alloc(Vector3f.class);
      cross.cross(a0, b0);

      res0 = cross.lengthSquared();
    }

    if (maxPenetrationIndex != 1) {
      Vector3f a1 = Stack.alloc(pt.localPointA);
      a1.sub(pointCache[0].localPointA);
View Full Code Here

Examples of javax.vecmath.Vector3f.lengthSquared()

      Vector3f b1 = Stack.alloc(pointCache[3].localPointA);
      b1.sub(pointCache[2].localPointA);

      Vector3f cross = Stack.alloc(Vector3f.class);
      cross.cross(a1, b1);
      res1 = cross.lengthSquared();
    }

    if (maxPenetrationIndex != 2) {
      Vector3f a2 = Stack.alloc(pt.localPointA);
      a2.sub(pointCache[0].localPointA);
View Full Code Here

Examples of javax.vecmath.Vector3f.lengthSquared()

      b2.sub(pointCache[1].localPointA);

      Vector3f cross = Stack.alloc(Vector3f.class);
      cross.cross(a2, b2);

      res2 = cross.lengthSquared();
    }

    if (maxPenetrationIndex != 3) {
      Vector3f a3 = Stack.alloc(pt.localPointA);
      a3.sub(pointCache[0].localPointA);
View Full Code Here

Examples of javax.vecmath.Vector3f.lengthSquared()

      Vector3f b3 = Stack.alloc(pointCache[2].localPointA);
      b3.sub(pointCache[1].localPointA);

      Vector3f cross = Stack.alloc(Vector3f.class);
      cross.cross(a3, b3);
      res3 = cross.lengthSquared();
    }

    Vector4f maxvec = Stack.alloc(Vector4f.class);
    maxvec.set(res0, res1, res2, res3);
    int biggestarea = VectorUtil.closestAxis4(maxvec);
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.