Package org.jbox2d.collision.broadphase

Examples of org.jbox2d.collision.broadphase.BroadPhaseJNI


    }
    TestbedModel model = new TestbedModel();
    model.setWorldCreator(new WorldCreator() {
      @Override
      public World createWorld(Vec2 gravity) {
        return new World(gravity, new DefaultWorldPool(100, 40), new BroadPhaseJNI());
      }
    });
    final TestbedController controller =
        new TestbedController(model, UpdateBehavior.UPDATE_CALLED, MouseBehavior.NORMAL,
            new TestbedErrorHandler() {
View Full Code Here


public class JniTest {

  @Test
  public void testClass() {
    BroadPhaseJNI tree = new BroadPhaseJNI();

    Integer a = new Integer(193);
    Integer b = new Integer(1);
    AABB aabb = new AABB();
    aabb.lowerBound.x = -10;
    aabb.lowerBound.y = -10;

    int proxy1 = tree.createProxy(aabb, a);
    System.out.println("proxy1: " + proxy1);
    assertNotNull(tree.getFatAABB(proxy1));
    System.out.println("fat aabb: " + tree.getFatAABB(proxy1));
    assertTrue(tree.getFatAABB(proxy1).contains(aabb));

    System.out.println("getting   user data");
    assertNotNull(tree.getUserData(proxy1));
    System.out.println("verifying same user data");
    assertSame(a, tree.getUserData(proxy1));


    aabb.upperBound.x = -2;
    aabb.upperBound.y = -2;


    int proxy2 = tree.createProxy(aabb, b);
    assertNotNull(tree.getFatAABB(proxy2));
    assertTrue(tree.getFatAABB(proxy2).contains(aabb));
    assertNotNull(tree.getUserData(proxy2));
    assertSame(b, tree.getUserData(proxy2));
   
    tree.updatePairs(new PairCallback() {
     
      @Override
      public void addPair(Object userDataA, Object userDataB) {
       
      }
View Full Code Here

TOP

Related Classes of org.jbox2d.collision.broadphase.BroadPhaseJNI

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.