Package com.bulletphysics.linearmath

Examples of com.bulletphysics.linearmath.Transform.mul()


      triface1 = pair.index2;
      CollisionShape colshape0 = retriever0.getChildShape(triface0);
      CollisionShape colshape1 = retriever1.getChildShape(triface1);

      if (child_has_transform0) {
        tmpTrans.mul(orgtrans0, shape0.getChildTransform(triface0));
        body0.setWorldTransform(tmpTrans);
      }

      if (child_has_transform1) {
        tmpTrans.mul(orgtrans1, shape1.getChildTransform(triface1));
View Full Code Here


     * Calc the transformation relative  1 to 0. Inverts matrics by transposing.
     */
    public void calc_from_homogenic(Transform trans0, Transform trans1) {
      Transform temp_trans = Stack.alloc(Transform.class);
      temp_trans.inverse(trans0);
      temp_trans.mul(trans1);

      T1to0.set(temp_trans.origin);
      R1to0.set(temp_trans.basis);

      calc_absolute_matrix();
View Full Code Here

        tmpTrans.mul(orgtrans0, shape0.getChildTransform(triface0));
        body0.setWorldTransform(tmpTrans);
      }

      if (child_has_transform1) {
        tmpTrans.mul(orgtrans1, shape1.getChildTransform(triface1));
        body1.setWorldTransform(tmpTrans);
      }

      // collide two convex shapes
      convex_vs_convex_collision(body0, body1, colshape0, colshape1);
View Full Code Here

        triface0 = child_index;
      }
      CollisionShape colshape0 = retriever0.getChildShape(child_index);

      if (child_has_transform0) {
        tmpTrans.mul(orgtrans0, shape0.getChildTransform(child_index));
        body0.setWorldTransform(tmpTrans);
      }

      // collide two shapes
      if (swapped) {
View Full Code Here

    // getting the trimesh AABB
    Transform gimpactInConcaveSpace = Stack.alloc(Transform.class);

    body1.getWorldTransform(gimpactInConcaveSpace);
    gimpactInConcaveSpace.inverse();
    gimpactInConcaveSpace.mul(body0.getWorldTransform(Stack.alloc(Transform.class)));

    Vector3f minAABB = Stack.alloc(Vector3f.class), maxAABB = Stack.alloc(Vector3f.class);
    shape0.getAabb(gimpactInConcaveSpace, minAABB, maxAABB);

    shape1.processAllTriangles(tricallback, minAABB, maxAABB);
View Full Code Here

    AABB boxshape = Stack.alloc(AABB.class);

    if (shape0.hasBoxSet()) {
      Transform trans1to0 = Stack.alloc(Transform.class);
      trans1to0.inverse(trans0);
      trans1to0.mul(trans1);

      shape1.getAabb(trans1to0, boxshape.min, boxshape.max);

      shape0.getBoxSet().boxQuery(boxshape, collided_primitives);
    }
View Full Code Here

      tmpTrans.inverse(bodies[1+2*i].getWorldTransform(new Transform()));
      tmpTrans.mul(tmpTrans, bodies[0].getWorldTransform(new Transform()));
      localB.mul(tmpTrans, localA) ;
      tmpTrans.inverse(bodies[2+2*i].getWorldTransform(new Transform()));
      tmpTrans.mul(tmpTrans, bodies[0].getWorldTransform(new Transform()));
      localC.mul(tmpTrans, localA) ;
      hingeC = new HingeConstraint(bodies[1+2*i], bodies[2+2*i], localB, localC);
      //hingeC.setLimit(-0.01f, 0.01f);
      hingeC.setLimit(- BulletGlobals.SIMD_2_PI * 0.0625f, 0.2f);
      joints[1+2*i] = hingeC;
      ownerWorld.addConstraint(joints[1+2*i], true);
View Full Code Here

          Transform childTrans = Stack.alloc(Transform.class);
          for (i = 0; i < compoundShape.getNumChildShapes(); i++) {
            compoundShape.getChildTransform(i, childTrans);
            CollisionShape childCollisionShape = compoundShape.getChildShape(i);
            Transform childWorldTrans = Stack.alloc(colObjWorldTransform);
            childWorldTrans.mul(childTrans);
            // replace collision shape so that callback can determine the triangle
            CollisionShape saveCollisionShape = collisionObject.getCollisionShape();
            collisionObject.internalSetTemporaryCollisionShape(childCollisionShape);
            rayTestSingle(rayFromTrans, rayToTrans,
                collisionObject,
View Full Code Here

          CompoundShape compoundShape = (CompoundShape) collisionShape;
          for (int i = 0; i < compoundShape.getNumChildShapes(); i++) {
            Transform childTrans = compoundShape.getChildTransform(i, Stack.alloc(Transform.class));
            CollisionShape childCollisionShape = compoundShape.getChildShape(i);
            Transform childWorldTrans = Stack.alloc(Transform.class);
            childWorldTrans.mul(colObjWorldTransform, childTrans);
            // replace collision shape so that callback can determine the triangle
            CollisionShape saveCollisionShape = collisionObject.getCollisionShape();
            collisionObject.internalSetTemporaryCollisionShape(childCollisionShape);
            objectQuerySingle(castShape, convexFromTrans, convexToTrans,
                              collisionObject,
View Full Code Here

      // backup
      colObj.getWorldTransform(orgTrans);
      colObj.getInterpolationWorldTransform(orgInterpolationTrans);

      compoundShape.getChildTransform(i, childTrans);
      newChildWorldTrans.mul(orgTrans, childTrans);
      colObj.setWorldTransform(newChildWorldTrans);
      colObj.setInterpolationWorldTransform(newChildWorldTrans);
     
      // the contactpoint is still projected back using the original inverted worldtrans
      CollisionShape tmpShape = colObj.getCollisionShape();
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.