Package javax.vecmath

Examples of javax.vecmath.Vector3f.cross()


        Vector3f pa = Stack.alloc(Vector3f.class), pb = Stack.alloc(Vector3f.class);
        getEdge(i, pa, pb);
        Vector3f edge = Stack.alloc(Vector3f.class);
        edge.sub(pb, pa);
        Vector3f edgeNormal = Stack.alloc(Vector3f.class);
        edgeNormal.cross(edge, normal);
        edgeNormal.normalize();
        /*float*/ dist = pt.dot(edgeNormal);
        float edgeConst = pa.dot(edgeNormal);
        dist -= edgeConst;
        if (dist < -tolerance) {
View Full Code Here


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

    Vector3f normal = Stack.alloc(Vector3f.class);
    normal.sub(b, a);
    tmp.sub(c, a);
    normal.cross(normal, tmp);

    tmp.sub(p, a);
    float signp = tmp.dot(normal); // [AP AB AC]

    tmp.sub(d, a);
View Full Code Here

    forward.set(eyePos.x, eyePos.y, eyePos.z);
    if (forward.lengthSquared() < BulletGlobals.FLT_EPSILON) {
      forward.set(1f, 0f, 0f);
    }
    Vector3f right = new Vector3f();
    right.cross(cameraUp, forward);
    Quat4f roll = new Quat4f();
    QuaternionUtil.setRotation(roll, right, -rele);

    Matrix3f tmpMat1 = new Matrix3f();
    Matrix3f tmpMat2 = new Matrix3f();
View Full Code Here

    Vector3f rightOffset = new Vector3f();
    Vector3f vertical = new Vector3f(cameraUp);

    Vector3f hor = new Vector3f();
    // TODO: check: hor = rayForward.cross(vertical);
    hor.cross(rayForward, vertical);
    hor.normalize();
    // TODO: check: vertical = hor.cross(rayForward);
    vertical.cross(hor, rayForward);
    vertical.normalize();
View Full Code Here

      // thigh
      Vector3f toBone = new Vector3f(boneOrigin);
      toBone.sub(root);
      toBone.normalize();
      Vector3f axis = new Vector3f();
      axis.cross(toBone,up);
      Quat4f q = new Quat4f();
      QuaternionUtil.setRotation(q, axis, BulletGlobals.SIMD_HALF_PI);
      transform.setRotation(q);
      tmpTrans.mul(offset, transform);
      bodies[1+2*i] = localCreateRigidBody(1.0f, tmpTrans, shapes[1+2*i]);
 
View Full Code Here

      velrelOrthog.scale((1f / denom) * dampingOrthoAng * softnessOrthoAng);
    }

    // solve angular positional correction
    Vector3f angularError = Stack.alloc(Vector3f.class);
    angularError.cross(axisA, axisB);
    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

   
    Vector3f ftorqueAxis1 = Stack.alloc(Vector3f.class);
    Matrix3f tmpMat = Stack.alloc(Matrix3f.class);
   
    {
      ftorqueAxis1.cross(rel_pos1, solverConstraint.contactNormal);
      solverConstraint.relpos1CrossNormal.set(ftorqueAxis1);
      if (body0 != null) {
        solverConstraint.angularComponentA.set(ftorqueAxis1);
        body0.getInvInertiaTensorWorld(tmpMat).transform(solverConstraint.angularComponentA);
      }
View Full Code Here

      else {
        solverConstraint.angularComponentA.set(0f, 0f, 0f);
      }
    }
    {
      ftorqueAxis1.cross(rel_pos2, solverConstraint.contactNormal);
      solverConstraint.relpos2CrossNormal.set(ftorqueAxis1);
      if (body1 != null) {
        solverConstraint.angularComponentB.set(ftorqueAxis1);
        body1.getInvInertiaTensorWorld(tmpMat).transform(solverConstraint.angularComponentB);
      }
View Full Code Here

    //#else
    Vector3f vec = Stack.alloc(Vector3f.class);
    float denom0 = 0f;
    float denom1 = 0f;
    if (body0 != null) {
      vec.cross(solverConstraint.angularComponentA, rel_pos1);
      denom0 = body0.getInvMass() + normalAxis.dot(vec);
    }
    if (body1 != null) {
      vec.cross(solverConstraint.angularComponentB, rel_pos2);
      denom1 = body1.getInvMass() + normalAxis.dot(vec);
View Full Code Here

    if (body0 != null) {
      vec.cross(solverConstraint.angularComponentA, rel_pos1);
      denom0 = body0.getInvMass() + normalAxis.dot(vec);
    }
    if (body1 != null) {
      vec.cross(solverConstraint.angularComponentB, rel_pos2);
      denom1 = body1.getInvMass() + normalAxis.dot(vec);
    }
    //#endif //COMPUTE_IMPULSE_DENOM

    float denom = relaxation / (denom0 + denom1);
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.