Package javax.vecmath

Examples of javax.vecmath.Vector3f.dot()


      rbBFrame.basis.getColumn(1, b2Axis2);
      getRigidBodyB().getCenterOfMassTransform(tmpTrans).basis.transform(b2Axis2);

      Quat4f rotationArc = QuaternionUtil.shortestArcQuat(b2Axis1, b1Axis1, Stack.alloc(Quat4f.class));
      Vector3f TwistRef = QuaternionUtil.quatRotate(rotationArc, b2Axis2, Stack.alloc(Vector3f.class));
      float twist = ScalarUtil.atan2Fast(TwistRef.dot(b1Axis3), TwistRef.dot(b1Axis2));

      float lockedFreeFactor = (twistSpan > 0.05f) ? limitSoftness : 0f;
      if (twist <= -twistSpan * lockedFreeFactor) {
        twistCorrection = -(twist + twistSpan);
        solveTwistLimit = true;
View Full Code Here


      for (int i = 0; i < 3; i++) {
        Vector3f normal = jac[i].linearJointAxis;
        float jacDiagABInv = 1f / jac[i].getDiagonal();

        float rel_vel;
        rel_vel = normal.dot(vel);
        // positional error (zeroth order error)
        tmp.sub(pivotAInW, pivotBInW);
        float depth = -(tmp).dot(normal); // this is the error projected on the normal
        float impulse = depth * tau / timeStep * jacDiagABInv - rel_vel * jacDiagABInv;
        appliedImpulse += impulse;
View Full Code Here

    // fixed axis in worldspace
    Vector3f rbAxisA1 = Stack.alloc(Vector3f.class);
    Transform centerOfMassA = rbA.getCenterOfMassTransform(Stack.alloc(Transform.class));
    centerOfMassA.basis.getColumn(0, rbAxisA1);

    float projection = rbAxisA1.dot(axisInA);
    if (projection > BulletGlobals.FLT_EPSILON) {
      rbAxisA1.scale(projection);
      rbAxisA1.sub(axisInA);
    }
    else {
View Full Code Here

      for (int i = 0; i < 3; i++) {
        Vector3f normal = jac[i].linearJointAxis;
        float jacDiagABInv = 1f / jac[i].getDiagonal();

        float rel_vel;
        rel_vel = normal.dot(vel);
        // positional error (zeroth order error)
        tmp.sub(pivotAInW, pivotBInW);
        float depth = -(tmp).dot(normal); // this is the error projected on the normal
        float impulse = depth * tau / timeStep * jacDiagABInv - rel_vel * jacDiagABInv;
        appliedImpulse += impulse;
View Full Code Here

        Vector3f angularLimit = Stack.alloc(Vector3f.class);
        angularLimit.set(0f, 0f, 0f);

        Vector3f velrel = Stack.alloc(Vector3f.class);
        velrel.sub(angVelAroundHingeAxisA, angVelAroundHingeAxisB);
        float projRelVel = velrel.dot(axisA);

        float desiredMotorVel = motorTargetVelocity;
        float motor_relvel = desiredMotorVel - projRelVel;

        float unclippedMotorImpulse = kHinge * motor_relvel;
 
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

        for (int i=0; i<leaves.size(); i++) {
          leaves.getQuick(i).volume.Center(x);
          x.sub(org);
          for (int j=0; j<3; j++) {
            splitcount[j][x.dot(axis[j]) > 0f? 1 : 0]++;
          }
        }
        for (int i=0; i<3; i++) {
          if ((splitcount[i][0] > 0) && (splitcount[i][1] > 0)) {
            int midp = Math.abs(splitcount[i][0] - splitcount[i][1]);
View Full Code Here

    trans.transform(center);

    Vector3f extent = Stack.alloc(Vector3f.class);
    Vector3f tmp = Stack.alloc(Vector3f.class);
    abs_b.getRow(0, tmp);
    extent.x = tmp.dot(localHalfExtents);
    abs_b.getRow(1, tmp);
    extent.y = tmp.dot(localHalfExtents);
    abs_b.getRow(2, tmp);
    extent.z = tmp.dot(localHalfExtents);
View Full Code Here

    Vector3f extent = Stack.alloc(Vector3f.class);
    Vector3f tmp = Stack.alloc(Vector3f.class);
    abs_b.getRow(0, tmp);
    extent.x = tmp.dot(localHalfExtents);
    abs_b.getRow(1, tmp);
    extent.y = tmp.dot(localHalfExtents);
    abs_b.getRow(2, tmp);
    extent.z = tmp.dot(localHalfExtents);

    aabbMin.sub(center, extent);
    aabbMax.add(center, extent);
View Full Code Here

    abs_b.getRow(0, tmp);
    extent.x = tmp.dot(localHalfExtents);
    abs_b.getRow(1, tmp);
    extent.y = tmp.dot(localHalfExtents);
    abs_b.getRow(2, tmp);
    extent.z = tmp.dot(localHalfExtents);

    aabbMin.sub(center, extent);
    aabbMax.add(center, extent);
  }
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.