本文整理汇总了Java中org.jbox2d.dynamics.World.setDestructionListener方法的典型用法代码示例。如果您正苦于以下问题:Java World.setDestructionListener方法的具体用法?Java World.setDestructionListener怎么用?Java World.setDestructionListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jbox2d.dynamics.World
的用法示例。
在下文中一共展示了World.setDestructionListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.jbox2d.dynamics.World; //导入方法依赖的package包/类
public void init(World world, boolean deserialized) {
m_world = world;
pointCount = 0;
stepCount = 0;
bombSpawning = false;
model.getDebugDraw().setViewportTransform(camera.getTransform());
world.setDestructionListener(destructionListener);
world.setParticleDestructionListener(particleDestructionListener);
world.setContactListener(this);
world.setDebugDraw(model.getDebugDraw());
title = getTestName();
initTest(deserialized);
}
示例2: init
import org.jbox2d.dynamics.World; //导入方法依赖的package包/类
public void init(World world, boolean deserialized) {
m_world = world;
pointCount = 0;
stepCount = 0;
bombSpawning = false;
model.getDebugDraw().setViewportTransform(camera.getTransform());
world.setDestructionListener(destructionListener);
world.setContactListener(this);
world.setDebugDraw(model.getDebugDraw());
title = getTestName();
initTest(deserialized);
}
示例3: init
import org.jbox2d.dynamics.World; //导入方法依赖的package包/类
public void init(DebugDraw argDebugDraw){
m_debugDraw = argDebugDraw;
destructionListener = new DestructionListener() {
public void sayGoodbye(Fixture fixture) {
}
public void sayGoodbye(Joint joint) {
if(m_mouseJoint == joint){
m_mouseJoint = null;
}else{
jointDestroyed(joint);
}
}
};
Vec2 gravity = new Vec2(0, -10f);
m_world = new World(gravity, true);
m_bomb = null;
m_textLine = 30;
m_mouseJoint = null;
m_pointCount = 0;
m_world.setDestructionListener(destructionListener);
m_world.setContactListener(this);
m_world.setDebugDraw(m_debugDraw);
bombSpawning = false;
m_stepCount = 0;
// Contact.activeContacts = 0;
BodyDef bodyDef = new BodyDef();
m_groundBody = m_world.createBody(bodyDef);
if(hasCachedCamera){
setCamera(cachedCameraX, cachedCameraY, cachedCameraScale);
}else{
setCamera(0, 10, 10);
}
setTitle(getTestName());
initTest();
}