本文整理汇总了Java中com.badlogic.gdx.physics.bullet.DebugDrawer类的典型用法代码示例。如果您正苦于以下问题:Java DebugDrawer类的具体用法?Java DebugDrawer怎么用?Java DebugDrawer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DebugDrawer类属于com.badlogic.gdx.physics.bullet包,在下文中一共展示了DebugDrawer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createWorld
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
private void createWorld(boolean visualized) {
collisionConfiguration = new btDefaultCollisionConfiguration();
dispatcher = new btCollisionDispatcher(collisionConfiguration);
broadPhase = new btDbvtBroadphase();
constraintSolver = new btSequentialImpulseConstraintSolver();
bulletWorld = new btDiscreteDynamicsWorld(dispatcher, broadPhase, constraintSolver, collisionConfiguration);
if (visualized) {
debugDrawer = new DebugDrawer();
bulletWorld.setDebugDrawer(debugDrawer);
rayCallback = new ClosestRayResultCallback(new Vector3(), new Vector3());
}
// btGImpactCollisionAlgorithm.registerAlgorithm(dispatcher); // TODO: Collision between GImpact not needed?
bulletWorld.setGravity(new Vector3(0, 0f, 0));
}
开发者ID:Matsemann,项目名称:eamaster,代码行数:20,代码来源:WheelWorld.java
示例2: World
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public World(String name) {
collisionConfiguration = new btDefaultCollisionConfiguration();
dispatcher = new btCollisionDispatcher(collisionConfiguration);
broadPhase = new btDbvtBroadphase();
constraintSolver = new btSequentialImpulseConstraintSolver();
bulletWorld = new btDiscreteDynamicsWorld(dispatcher, broadPhase, constraintSolver, collisionConfiguration);
debugDrawer = new DebugDrawer();
btGImpactCollisionAlgorithm.registerAlgorithm(dispatcher);
bulletWorld.setDebugDrawer(debugDrawer);
bulletWorld.setGravity(new Vector3(0, -10f, 0));
worldCounter = CounterUtil.getCounter("worldTick" + name);
this.name = name;
rayCallback = new ClosestRayResultCallback(new Vector3(), new Vector3());
logger.info("Iterations: {}", bulletWorld.getSolverInfo().getNumIterations());
logger.info("Erp: {}", bulletWorld.getSolverInfo().getErp());
//
// bulletWorld.getSolverInfo().setNumIterations(20);
// bulletWorld.getSolverInfo().setErp(0.01f);
}
开发者ID:Matsemann,项目名称:eamaster,代码行数:27,代码来源:World.java
示例3: ControllerPhysic
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public ControllerPhysic(float gravity, PhysicsListener listener) {
this.listener = listener;
collisionConfig = new btDefaultCollisionConfiguration();
dispatcher = new btCollisionDispatcher(collisionConfig);
broadphase = new btDbvtBroadphase();
constraintSolver = new btSequentialImpulseConstraintSolver();
dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, broadphase, constraintSolver, collisionConfig);
dynamicsWorld.setGravity(new Vector3(0, 0, gravity * 2.5f));
if (Config.DEBUG_RENDERER) {
debugDrawer = new DebugDrawer();
debugDrawer.setDebugMode(btIDebugDraw.DebugDrawModes.DBG_MAX_DEBUG_DRAW_MODE);
dynamicsWorld.setDebugDrawer(debugDrawer);
}
tickCallback = new TickCallback(dynamicsWorld, listener);
}
开发者ID:aphex-,项目名称:Alien-Ark,代码行数:19,代码来源:ControllerPhysic.java
示例4: GameEngine
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public GameEngine() {
collisionConfig = new btDefaultCollisionConfiguration();
dispatcher = new btCollisionDispatcher(collisionConfig);
broadphase = new btDbvtBroadphase();
constraintSolver = new btSequentialImpulseConstraintSolver();
dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, broadphase,
constraintSolver, collisionConfig);
dynamicsWorld.setGravity(GameSettings.GRAVITY);
debugDrawer = new DebugDrawer();
dynamicsWorld.setDebugDrawer(debugDrawer);
debugDrawer.setDebugMode(btIDebugDraw.DebugDrawModes.DBG_DrawWireframe);
contactListener = new CollisionContactListener();
}
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:15,代码来源:GameEngine.java
示例5: createWorld
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
private void createWorld() {
debugDrawer = new DebugDrawer();
collisionConfig = new btDefaultCollisionConfiguration();
dispatcher = new btCollisionDispatcher(collisionConfig);
constraintSolver = new btSequentialImpulseConstraintSolver();
sweep = new btAxisSweep3(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000));
ghostCallback = new btGhostPairCallback();
sweep.getOverlappingPairCache().setInternalGhostPairCallback(ghostCallback);
bulletWorld = new btDiscreteDynamicsWorld(dispatcher, sweep, constraintSolver, collisionConfig);
bulletWorld.setGravity(new Vector3(0, -9f, 0));
debugDrawer.setDebugMode(btIDebugDraw.DebugDrawModes.DBG_MAX_DEBUG_DRAW_MODE);
}
开发者ID:macbury,项目名称:ForgE,代码行数:14,代码来源:PhysicsSystem.java
示例6: Physics
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public Physics() {
Bullet.init();
shapes = new Array<>();
objects = new Array<>();
disposables = new Array<>();
if (Main.isClient()) {
debugDrawer = new DebugDrawer();
debugDrawer.setDebugMode(btIDebugDraw.DebugDrawModes.DBG_MAX_DEBUG_DRAW_MODE);
}
inst = this;
collisionConfig = new btDefaultCollisionConfiguration();
dispatcher = new btCollisionDispatcher(collisionConfig);
broadphaseInterface = new btDbvtBroadphase();
// TODO is it worth comparing performance with other broadphase types?
//broadphaseInterface = new btSimpleBroadphase();
//broadphaseInterface = new btAxisSweep3(tmp.set(0f, -10, 0f), tmp2.set(GameWorld.WORLD_WIDTH, 200f, GameWorld.WORLD_DEPTH));
world = new btCollisionWorld(dispatcher, broadphaseInterface, collisionConfig);
if (Main.isClient()) {
world.setDebugDrawer(debugDrawer);
}
contactListener = new MyContactListener();
disposables.add(world);
if (debugDrawer != null) {
disposables.add(debugDrawer);
}
disposables.add(collisionConfig);
disposables.add(dispatcher);
disposables.add(broadphaseInterface);
disposables.add(contactListener);
}
开发者ID:jrenner,项目名称:gdx-proto,代码行数:32,代码来源:Physics.java
示例7: setDebugDrawer
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public void setDebugDrawer(DebugDrawer debugDrawer) {
dynamicsWorld.setDebugDrawer(debugDrawer);
}
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:4,代码来源:PhysicsSystem.java
示例8: getDebugDrawer
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public DebugDrawer getDebugDrawer() {
return debugDrawer;
}
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:4,代码来源:DebugRenderingSystem.java
示例9: DebugRenderer
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public DebugRenderer(btCollisionWorld world) {
this.world = world;
this.drawer = new DebugDrawer();
this.drawer.setDebugMode(btIDebugDraw.DebugDrawModes.DBG_DrawNormals);
this.world.setDebugDrawer(this.drawer);
}
开发者ID:ncguy2,项目名称:Argent,代码行数:7,代码来源:DebugRenderer.java
示例10: setDebugMode
import com.badlogic.gdx.physics.bullet.DebugDrawer; //导入依赖的package包/类
public void setDebugMode (final int mode) {
if (mode == btIDebugDraw.DebugDrawModes.DBG_NoDebug && debugDrawer == null) return;
if (debugDrawer == null) collisionWorld.setDebugDrawer(debugDrawer = new DebugDrawer());
debugDrawer.setDebugMode(mode);
}
开发者ID:Matsemann,项目名称:eamaster,代码行数:6,代码来源:BulletWorld.java
注:本文中的com.badlogic.gdx.physics.bullet.DebugDrawer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论