Package javax.vecmath

Examples of javax.vecmath.Vector3f.negate()


      normalIndexSubstitutes [index] = normalIndex;
    }
   
    if (cullFace == PolygonAttributes.CULL_NONE) {
      Vector3f oppositeNormal = new Vector3f();
      oppositeNormal.negate(normal);
      // Fill opposite side normal index substitutes array
      return writeNormal(normalsBuffer, transformationToParent, oppositeNormal, index,
          oppositeSideNormalIndexSubstitutes, null, PolygonAttributes.CULL_FRONT, false);
    } else {
      return true;
View Full Code Here


      while (iter.hasNext()){
        AbstractAgent3D agent = iter.next();
        agent.getRigidBody().setActivationState(CollisionObject.ACTIVE_TAG);
        Vector3f position = agent.getPosition();
        Vector3f explosionCenter = new Vector3f(0,-10,0);
        explosionCenter.negate();
        Vector3f direction = new Vector3f ();
        VectorUtil.add(direction, position, explosionCenter);
        float distanceFromExplosion = direction.length();
        direction.normalize();
        direction.scale(1/distanceFromExplosion * 1000f);
 
View Full Code Here

              if (dist_a > 0f) {
                hitFraction = reportHit(triangleNormal, distance, partId, triangleIndex);
              }
              else {
                Vector3f tmp = Stack.alloc(Vector3f.class);
                tmp.negate(triangleNormal);
                hitFraction = reportHit(tmp, distance, partId, triangleIndex);
              }
            }
          }
        }
View Full Code Here

      Vector3f tmp1 = LocalSupport(d, 0, Stack.alloc(Vector3f.class));

      Vector3f tmp = Stack.alloc(Vector3f.class);
      tmp.set(d);
      tmp.negate();
      Vector3f tmp2 = LocalSupport(tmp, 1, Stack.alloc(Vector3f.class));

      v.w.sub(tmp1, tmp2);
      v.w.scaleAdd(margin, d, v.w);
    }
View Full Code Here

        }
        /* Expand hull    */
        for (; iterations < EPA_maxiterations; ++iterations) {
          Face bf = FindBest();
          if (bf != null) {
            tmp.negate(bf.n);
            Mkv w = Support(tmp);
            float d = bf.n.dot(w.w) + bf.d;
            bestface = bf;
            if (d < -accuracy) {
              Face[] cf = new Face[]{null};
View Full Code Here

 
  public void updateWheelTransform(int wheelIndex, boolean interpolatedTransform) {
    WheelInfo wheel = wheelInfo.getQuick(wheelIndex);
    updateWheelTransformsWS(wheel, interpolatedTransform);
    Vector3f up = Stack.alloc(Vector3f.class);
    up.negate(wheel.raycastInfo.wheelDirectionWS);
    Vector3f right = wheel.raycastInfo.wheelAxleWS;
    Vector3f fwd = Stack.alloc(Vector3f.class);
    fwd.cross(up, right);
    fwd.normalize();
    // up = right.cross(fwd);
View Full Code Here

    Vector3f motorImp = Stack.alloc(Vector3f.class);
    motorImp.scale(clippedMotorImpulse, axis);

    body0.applyTorqueImpulse(motorImp);
    if (body1 != null) {
      motorImp.negate();
      body1.applyTorqueImpulse(motorImp);
    }

    return clippedMotorImpulse;
  }
View Full Code Here

    rbAFrame.basis.setRow(0, rbAxisA1.x, rbAxisA2.x, axisInA.x);
    rbAFrame.basis.setRow(1, rbAxisA1.y, rbAxisA2.y, axisInA.y);
    rbAFrame.basis.setRow(2, rbAxisA1.z, rbAxisA2.z, axisInA.z);

    Vector3f axisInB = Stack.alloc(Vector3f.class);
    axisInB.negate(axisInA);
    centerOfMassA.basis.transform(axisInB);

    Quat4f rotationArc = QuaternionUtil.shortestArcQuat(axisInA, axisInB, Stack.alloc(Quat4f.class));
    Vector3f rbAxisB1 = QuaternionUtil.quatRotate(rotationArc, rbAxisA1, Stack.alloc(Vector3f.class));
    Vector3f rbAxisB2 = Stack.alloc(Vector3f.class);
View Full Code Here

        // solve angular positional correction
        // TODO: check
        //Vector3f angularError = -axisA.cross(axisB) *(btScalar(1.)/timeStep);
        Vector3f angularError = Stack.alloc(Vector3f.class);
        angularError.cross(axisA, axisB);
        angularError.negate();
        angularError.scale(1f / timeStep);
        float len2 = angularError.length();
        if (len2 > 0.00001f) {
          Vector3f normal2 = Stack.alloc(Vector3f.class);
          normal2.normalize(angularError);
View Full Code Here

    // this plane might not be aligned...
    Vector4f plane = Stack.alloc(Vector4f.class);
    getPlaneEquation(plane, i);
    planeNormal.set(plane.x, plane.y, plane.z);
    Vector3f tmp = Stack.alloc(Vector3f.class);
    tmp.negate(planeNormal);
    localGetSupportingVertex(tmp, planeSupport);
  }

  @Override
  public int getNumPlanes() {
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.