Package javax.vecmath

Examples of javax.vecmath.Vector3f.scale()


          // 0-------+--------1
          // |
          // 2
          Measure.calcNormalizedNormal(ptList[0], ptList[1], ptList[2],
              normal, vAB, vAC);
          normal.scale(dist);
          ptList[3] = new Point3f(center);
          ptList[3].add(normal);
          ptList[1].set(center);
          ptList[1].sub(normal);
          ptList[0].set(pt);
View Full Code Here


          isArrow = false;
      } else if (nVertices == 2 && length != Float.MAX_VALUE) {
        Measure.calcAveragePoint(ptList[0], ptList[1], center);
        normal.set(ptList[1]);
        normal.sub(center);
        normal.scale(0.5f / normal.length() * (length == 0 ? 0.01f : length));
        if (length == 0)
          center.set(ptList[0]);
        ptList[0].set(center);
        ptList[1].set(ptList[0]);
        ptList[0].sub(normal);
View Full Code Here

        ipt = mesh.polygonIndexes[i][iV];
        if (ipt == iptlast)
          continue;
        iptlast = ipt;
        diff.sub(mesh.vertices[ipt], center);
        diff.scale(f);
        diff.add(center);
        mesh.vertices[ipt].set(diff);
      }
    }
  }
View Full Code Here

        explosionCenter.negate();
        Vector3f direction = new Vector3f ();
        VectorUtil.add(direction, position, explosionCenter);
        float distanceFromExplosion = direction.length();
        direction.normalize();
        direction.scale(1/distanceFromExplosion * 1000f);
        agent.getRigidBody().applyCentralImpulse(direction);
      }
    }
  }

 
View Full Code Here

    Vector3f pointOnA = Stack.alloc(Vector3f.class), pointOnB = Stack.alloc(Vector3f.class);
    Transform localTransA = Stack.alloc(input.transformA);
    Transform localTransB = Stack.alloc(input.transformB);
    Vector3f positionOffset = Stack.alloc(Vector3f.class);
    positionOffset.add(localTransA.origin, localTransB.origin);
    positionOffset.scale(0.5f);
    localTransA.origin.sub(positionOffset);
    localTransB.origin.sub(positionOffset);

    float marginA = minkowskiA.getMargin();
    float marginB = minkowskiB.getMargin();
View Full Code Here

          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)
              if (!isValid || (distance2 < distance)) {
                distance = distance2;
View Full Code Here

    public void appy_transform(Transform trans) {
      Vector3f tmp = Stack.alloc(Vector3f.class);

      Vector3f center = Stack.alloc(Vector3f.class);
      center.add(max, min);
      center.scale(0.5f);

      Vector3f extends_ = Stack.alloc(Vector3f.class);
      extends_.sub(max, center);

      // Compute new center
View Full Code Here

    public void appy_transform_trans_cache(BoxBoxTransformCache trans) {
      Vector3f tmp = Stack.alloc(Vector3f.class);

      Vector3f center = Stack.alloc(Vector3f.class);
      center.add(max, min);
      center.scale(0.5f);

      Vector3f extends_ = Stack.alloc(Vector3f.class);
      extends_.sub(max, center);

      // Compute new center
View Full Code Here

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

      Vector3f o = Stack.alloc(Vector3f.class);
      o.scale(-face.d, face.n);

      float[] a = floatArrays.getFixed(3);

      tmp1.sub(face.v[0].w, o);
      tmp2.sub(face.v[1].w, o);
View Full Code Here

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

          tmp1.scale(b.x, features[0][0]);
          tmp2.scale(b.y, features[0][1]);
          tmp3.scale(b.z, features[0][2]);
          VectorUtil.add(nearest[0], tmp1, tmp2, tmp3);

          tmp1.scale(b.x, features[1][0]);
          tmp2.scale(b.y, features[1][1]);
          tmp3.scale(b.z, features[1][2]);
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.