Package javax.vecmath

Examples of javax.vecmath.Vector3f.cross()


      centerOfMassA.basis.getColumn(1, rbAxisA2);
    } else if (projection <= -1.0f + BulletGlobals.SIMD_EPSILON) {          
      centerOfMassA.basis.getColumn(2, rbAxisA1);                           
      centerOfMassA.basis.getColumn(1, rbAxisA2);
    } else {
      rbAxisA2.cross(axisInA, rbAxisA1);                                                               
      rbAxisA1.cross(rbAxisA2, axisInA);                                                                                           
    }

    rbAFrame.basis.setRow(0, rbAxisA1.x, rbAxisA2.x, axisInA.x);
    rbAFrame.basis.setRow(1, rbAxisA1.y, rbAxisA2.y, axisInA.y);
View Full Code Here


    rbAFrame.basis.setRow(2, rbAxisA1.z, rbAxisA2.z, axisInA.z);

    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);
    rbAxisB2.cross(axisInB, rbAxisB1);

    rbBFrame.origin.set(pivotInB);
    rbBFrame.basis.setRow(0, rbAxisB1.x, rbAxisB2.x, -axisInB.x);
    rbBFrame.basis.setRow(1, rbAxisB1.y, rbAxisB2.y, -axisInB.y);
    rbBFrame.basis.setRow(2, rbAxisB1.z, rbAxisB2.z, -axisInB.z);     
View Full Code Here

    else {
      centerOfMassA.basis.getColumn(1, rbAxisA1);
    }

    Vector3f rbAxisA2 = Stack.alloc(Vector3f.class);
    rbAxisA2.cross(axisInA, rbAxisA1);

    rbAFrame.origin.set(pivotInA);
    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);
View Full Code Here

    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);
    rbAxisB2.cross(axisInB, rbAxisB1);

    rbBFrame.origin.set(pivotInA);
    centerOfMassA.transform(rbBFrame.origin);
    rbBFrame.basis.setRow(0, rbAxisB1.x, rbAxisB2.x, axisInB.x);
    rbBFrame.basis.setRow(1, rbAxisB1.y, rbAxisB2.y, axisInB.y);
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);
View Full Code Here

  public void applyForce(Vector3f force, Vector3f rel_pos) {
    applyCentralForce(force);
   
    Vector3f tmp = Stack.alloc(Vector3f.class);
    tmp.cross(rel_pos, force);
    tmp.scale(angularFactor);
    applyTorque(tmp);
  }

  public void applyCentralImpulse(Vector3f impulse) {
View Full Code Here

  public void applyImpulse(Vector3f impulse, Vector3f rel_pos) {
    if (inverseMass != 0f) {
      applyCentralImpulse(impulse);
      if (angularFactor != 0f) {
        Vector3f tmp = Stack.alloc(Vector3f.class);
        tmp.cross(rel_pos, impulse);
        tmp.scale(angularFactor);
        applyTorqueImpulse(tmp);
      }
    }
  }
View Full Code Here

  }

  public Vector3f getVelocityInLocalPoint(Vector3f rel_pos, Vector3f out) {
    // we also calculate lin/ang velocity for kinematic objects
    Vector3f vec = out;
    vec.cross(angularVelocity, rel_pos);
    vec.add(linearVelocity);
    return out;

    //for kinematic objects, we could also use use:
    //    return   (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
View Full Code Here

  public float computeImpulseDenominator(Vector3f pos, Vector3f normal) {
    Vector3f r0 = Stack.alloc(Vector3f.class);
    r0.sub(pos, getCenterOfMassPosition(Stack.alloc(Vector3f.class)));

    Vector3f c0 = Stack.alloc(Vector3f.class);
    c0.cross(r0, normal);

    Vector3f tmp = Stack.alloc(Vector3f.class);
    MatrixUtil.transposeTransform(tmp, c0, getInvInertiaTensorWorld(Stack.alloc(Matrix3f.class)));

    Vector3f vec = Stack.alloc(Vector3f.class);
View Full Code Here

    Vector3f tmp = Stack.alloc(Vector3f.class);
    MatrixUtil.transposeTransform(tmp, c0, getInvInertiaTensorWorld(Stack.alloc(Matrix3f.class)));

    Vector3f vec = Stack.alloc(Vector3f.class);
    vec.cross(tmp, r0);

    return inverseMass + normal.dot(vec);
  }

  public float computeAngularImpulseDenominator(Vector3f axis) {
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.