Package com.bulletphysics.collision.dispatch.CollisionWorld

Examples of com.bulletphysics.collision.dispatch.CollisionWorld.ClosestConvexResultCallback


    //#ifdef USE_BT_CLOCK
    frame_timer.reset();
    //#endif //USE_BT_CLOCK

    for (int i=0; i<NUMRAYS_IN_BAR; i++) {
      ClosestConvexResultCallback cb = new ClosestConvexResultCallback(source[i], dest[i]);

      Quat4f qFrom = Stack.alloc(Quat4f.class);
      Quat4f qTo = Stack.alloc(Quat4f.class);
      QuaternionUtil.setRotation(qFrom, new Vector3f(1f, 0f, 0f), 0f);
      QuaternionUtil.setRotation(qTo, new Vector3f(1f, 0f, 0f), 0.7f);

      Transform from = Stack.alloc(Transform.class);
      Transform to = Stack.alloc(Transform.class);
      from.basis.set(qFrom);
      from.origin.set(source[i]);
      to.basis.set(qTo);
      to.origin.set(dest[i]);
     
      cw.convexSweepTest(boxShape, from, to, cb);

      if (cb.hasHit()) {
        hit_surface[i].set(cb.hitPointWorld);
        VectorUtil.setInterpolate3(hit_com[i], source[i], dest[i], cb.closestHitFraction);
        hit_fraction[i] = cb.closestHitFraction;
        normal[i].set(cb.hitNormalWorld);
        normal[i].normalize();
View Full Code Here

TOP

Related Classes of com.bulletphysics.collision.dispatch.CollisionWorld.ClosestConvexResultCallback

Copyright © 2018 www.massapicom. 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.