本文整理汇总了Java中org.jbox2d.collision.broadphase.BroadPhaseJNI类的典型用法代码示例。如果您正苦于以下问题:Java BroadPhaseJNI类的具体用法?Java BroadPhaseJNI怎么用?Java BroadPhaseJNI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BroadPhaseJNI类属于org.jbox2d.collision.broadphase包,在下文中一共展示了BroadPhaseJNI类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testClass
import org.jbox2d.collision.broadphase.BroadPhaseJNI; //导入依赖的package包/类
@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) {
}
});
}