Package javax.vecmath

Examples of javax.vecmath.Vector3f.dot()


  public void batchedUnitVectorGetSupportingVertexWithoutMargin(Vector3f[] vectors, Vector3f[] supportVerticesOut, int numVectors) {
    Vector3f dots = Stack.alloc(Vector3f.class);

    for (int i = 0; i < numVectors; i++) {
      Vector3f dir = vectors[i];
      dots.set(dir.dot(vertices1[0]), dir.dot(vertices1[1]), dir.dot(vertices1[2]));
      supportVerticesOut[i].set(vertices1[VectorUtil.maxAxis(dots)]);
    }
  }

  @Override
View Full Code Here


          diff.sub(p, from);

          Vector3f v = Stack.alloc(Vector3f.class);
          v.sub(to, from);

          float t = v.dot(diff);

          if (t > 0) {
            float dotVV = v.dot(v);
            if (t < dotVV) {
              t /= dotVV;
View Full Code Here

          v.sub(to, from);

          float t = v.dot(diff);

          if (t > 0) {
            float dotVV = v.dot(v);
            if (t < dotVV) {
              t /= dotVV;
              tmp.scale(t, v);
              diff.sub(tmp);
              cachedBC.usedVertices.usedVertexA = true;
View Full Code Here

    Vector3f swingAxis = Stack.alloc(Vector3f.class);
    rbBFrame.basis.getColumn(1, swingAxis);
    centerOfMassB.basis.transform(swingAxis);

    return ScalarUtil.atan2Fast(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
  }
 
  public void setAngularOnly(boolean angularOnly) {
    this.angularOnly = angularOnly;
  }
View Full Code Here

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

    for (int i=0; i<3; i++) {
      Vector3f normal = jacLin[i].linearJointAxis;
      float rel_vel = normal.dot(vel);
      // calculate positional error
      float depth = VectorUtil.getCoord(this.depth, i);
      // get parameters
      float softness = (i != 0)? softnessOrthoLin : (solveLinLim? softnessLimLin : softnessDirLin);
      float restitution = (i != 0)? restitutionOrthoLin : (solveLinLim? restitutionLimLin : restitutionDirLin);
View Full Code Here

    // apply angular motor
    if (poweredAngMotor) {
      if (accumulatedAngMotorImpulse < maxAngMotorForce) {
        Vector3f velrel = Stack.alloc(Vector3f.class);
        velrel.sub(angVelAroundAxisA, angVelAroundAxisB);
        float projRelVel = velrel.dot(axisA);

        float desiredMotorVel = targetAngMotorVelocity;
        float motor_relvel = desiredMotorVel - projRelVel;

        float angImpulse = kAngle * motor_relvel;
 
View Full Code Here

      Vector3f axisA1 = Stack.alloc(Vector3f.class);
      calculatedTransformA.basis.getColumn(2, axisA1);
      Vector3f axisB0 = Stack.alloc(Vector3f.class);
      calculatedTransformB.basis.getColumn(1, axisB0);

      float rot = (float) Math.atan2(axisB0.dot(axisA1), axisB0.dot(axisA0));
      if (rot < lowerAngLimit) {
        angDepth = rot - lowerAngLimit;
        solveAngLim = true;
      }
      else if (rot > upperAngLimit) {
View Full Code Here

      Vector3f axisA1 = Stack.alloc(Vector3f.class);
      calculatedTransformA.basis.getColumn(2, axisA1);
      Vector3f axisB0 = Stack.alloc(Vector3f.class);
      calculatedTransformB.basis.getColumn(1, axisB0);

      float rot = (float) Math.atan2(axisB0.dot(axisA1), axisB0.dot(axisA0));
      if (rot < lowerAngLimit) {
        angDepth = rot - lowerAngLimit;
        solveAngLim = true;
      }
      else if (rot > upperAngLimit) {
View Full Code Here

    forwardW.set(
        chassisTrans.basis.getElement(0, indexForwardAxis),
        chassisTrans.basis.getElement(1, indexForwardAxis),
        chassisTrans.basis.getElement(2, indexForwardAxis));

    if (forwardW.dot(getRigidBody().getLinearVelocity(tmp)) < 0f) {
      currentVehicleSpeedKmHour *= -1f;
    }

    //
    // simulate suspension
View Full Code Here

        fwd.set(
            chassisWorldTransform.basis.getElement(0, indexForwardAxis),
            chassisWorldTransform.basis.getElement(1, indexForwardAxis),
            chassisWorldTransform.basis.getElement(2, indexForwardAxis));

        float proj = fwd.dot(wheel.raycastInfo.contactNormalWS);
        tmp.scale(proj, wheel.raycastInfo.contactNormalWS);
        fwd.sub(tmp);

        float proj2 = fwd.dot(vel);
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.