当前位置: 首页>>代码示例>>Java>>正文


Java DynamicTree类代码示例

本文整理汇总了Java中org.jbox2d.collision.broadphase.DynamicTree的典型用法代码示例。如果您正苦于以下问题:Java DynamicTree类的具体用法?Java DynamicTree怎么用?Java DynamicTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DynamicTree类属于org.jbox2d.collision.broadphase包,在下文中一共展示了DynamicTree类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initTest

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
/**
 * @see org.jbox2d.testbed.framework.TestbedTest#initTest()
 */
@Override
public void initTest() {
	worldExtent = 15.0f;
	m_proxyExtent = 0.5f;

	m_tree = new DynamicTree();

	for (int i = 0; i < e_actorCount; ++i) {
		Actor actor = m_actors[i] = new Actor();
		GetRandomAABB(actor.aabb);
		actor.proxyId = m_tree.createProxy(actor.aabb, actor);
	}

	m_stepCount = 0;

	float h = worldExtent;
	m_queryAABB = new AABB();
	m_queryAABB.lowerBound.set(-3.0f, -4.0f + h);
	m_queryAABB.upperBound.set(5.0f, 6.0f + h);

	m_rayCastInput = new RayCastInput();
	m_rayCastInput.p1.set(-5.0f, 5.0f + h);
	m_rayCastInput.p2.set(7.0f, -4.0f + h);
	// m_rayCastInput.p1.set(0.0f, 2.0f + h);
	// m_rayCastInput.p2.set(0.0f, -2.0f + h);
	m_rayCastInput.maxFraction = 1.0f;

	m_rayCastOutput = new RayCastOutput();

	m_automated = false;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:35,代码来源:DynamicTreeTest.java

示例2: initTest

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
@Override
public void initTest(boolean argDeserialized) {
	worldExtent = 15.0f;
	m_proxyExtent = 0.5f;

	m_tree = new DynamicTree();

	for (int i = 0; i < e_actorCount; ++i) {
		Actor actor = m_actors[i] = new Actor();
		GetRandomAABB(actor.aabb);
		actor.proxyId = m_tree.createProxy(actor.aabb, actor);
	}

	m_stepCount = 0;

	float h = worldExtent;
	m_queryAABB = new AABB();
	m_queryAABB.lowerBound.set(-3.0f, -4.0f + h);
	m_queryAABB.upperBound.set(5.0f, 6.0f + h);

	m_rayCastInput = new RayCastInput();
	m_rayCastInput.p1.set(-5.0f, 5.0f + h);
	m_rayCastInput.p2.set(7.0f, -4.0f + h);
	// m_rayCastInput.p1.set(0.0f, 2.0f + h);
	// m_rayCastInput.p2.set(0.0f, -2.0f + h);
	m_rayCastInput.maxFraction = 1.0f;

	m_rayCastOutput = new RayCastOutput();

	m_automated = false;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:32,代码来源:DynamicTreeTest.java

示例3: initTest

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
/**
 * @see org.jbox2d.testbed.framework.TestbedTest#initTest()
 */
@Override
public void initTest() {
	worldExtent = 15.0f;
	m_proxyExtent = 0.5f;

	m_tree = new DynamicTree();

	for (int i = 0; i < e_actorCount; ++i)
	{
		Actor actor = m_actors[i] = new Actor();
		GetRandomAABB(actor.aabb);
		actor.proxyId = m_tree.createProxy(actor.aabb, actor);
	}

	m_stepCount = 0;

	float h = worldExtent;
	m_queryAABB = new AABB();
	m_queryAABB.lowerBound.set(-3.0f, -4.0f + h);
	m_queryAABB.upperBound.set(5.0f, 6.0f + h);

	m_rayCastInput = new RayCastInput();
	m_rayCastInput.p1.set(-5.0f, 5.0f + h);
	m_rayCastInput.p2.set(7.0f, -4.0f + h);
	//m_rayCastInput.p1.set(0.0f, 2.0f + h);
	//m_rayCastInput.p2.set(0.0f, -2.0f + h);
	m_rayCastInput.maxFraction = 1.0f;

	m_rayCastOutput = new RayCastOutput();
	
	m_automated = false;
}
 
开发者ID:dragome,项目名称:dragome-examples,代码行数:36,代码来源:DynamicTreeTest.java

示例4: initTest

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
/**
 * @see org.jbox2d.testbed.framework.TestbedTest#initTest(boolean)
 */
@Override
public void initTest(boolean argDeserialized) {
	worldExtent = 15.0f;
	m_proxyExtent = 0.5f;

	m_tree = new DynamicTree();

	for (int i = 0; i < e_actorCount; ++i) {
		Actor actor = m_actors[i] = new Actor();
		GetRandomAABB(actor.aabb);
		actor.proxyId = m_tree.createProxy(actor.aabb, actor);
	}

	m_stepCount = 0;

	float h = worldExtent;
	m_queryAABB = new AABB();
	m_queryAABB.lowerBound.set(-3.0f, -4.0f + h);
	m_queryAABB.upperBound.set(5.0f, 6.0f + h);

	m_rayCastInput = new RayCastInput();
	m_rayCastInput.p1.set(-5.0f, 5.0f + h);
	m_rayCastInput.p2.set(7.0f, -4.0f + h);
	// m_rayCastInput.p1.set(0.0f, 2.0f + h);
	// m_rayCastInput.p2.set(0.0f, -2.0f + h);
	m_rayCastInput.maxFraction = 1.0f;

	m_rayCastOutput = new RayCastOutput();

	m_automated = false;
}
 
开发者ID:col726,项目名称:game-engine-CMZ,代码行数:35,代码来源:DynamicTreeTest.java

示例5: testDynamicTree

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
@Test
public void testDynamicTree() {
    DynamicTree theTree = new DynamicTree();
    theTree.createProxy(new AABB(), "TEST");
}
 
开发者ID:mirkosertic,项目名称:Bytecoder,代码行数:6,代码来源:JBox2DTest.java

示例6: World

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
/**
 * Construct a world object.
 * 
 * @param gravity the world gravity vector.
 */
public World(Vec2 gravity, IWorldPool pool) {
  this(gravity, pool, new DynamicTree());
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:9,代码来源:World.java

示例7: World

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
/**
 * Construct a world object.
 * 
 * @param gravity the world gravity vector.
 */
public World(Vector2 gravity, IWorldPool pool) {
  this(gravity, pool, new DynamicTree());
}
 
开发者ID:pianoman373,项目名称:Point-Engine,代码行数:9,代码来源:World.java

示例8: ParticleWorld

import org.jbox2d.collision.broadphase.DynamicTree; //导入依赖的package包/类
/**
 * Construct a world object.
 * 
 * @param gravity the world gravity vector.
 */
public ParticleWorld(Vec2 gravity, IWorldPool pool) {
	super(gravity, pool, new DynamicTree());
}
 
开发者ID:Goffredo,项目名称:jBox2D-liquidFun,代码行数:9,代码来源:ParticleWorld.java


注:本文中的org.jbox2d.collision.broadphase.DynamicTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。