本文整理汇总了Java中org.jbox2d.callbacks.DestructionListener类的典型用法代码示例。如果您正苦于以下问题:Java DestructionListener类的具体用法?Java DestructionListener怎么用?Java DestructionListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DestructionListener类属于org.jbox2d.callbacks包,在下文中一共展示了DestructionListener类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.jbox2d.callbacks.DestructionListener; //导入依赖的package包/类
public void init(TestbedModel argModel) {
model = argModel;
destructionListener = new DestructionListener() {
public void sayGoodbye(Fixture fixture) {
}
public void sayGoodbye(Joint joint) {
if (mouseJoint == joint) {
mouseJoint = null;
} else {
jointDestroyed(joint);
}
}
};
Vec2 gravity = new Vec2(0, -10f);
m_world = new World(gravity, true);
bomb = null;
mouseJoint = null;
BodyDef bodyDef = new BodyDef();
groundBody = m_world.createBody(bodyDef);
init(m_world, false);
}
示例2: getDestructionListener
import org.jbox2d.callbacks.DestructionListener; //导入依赖的package包/类
public DestructionListener getDestructionListener() {
return m_destructionListener;
}
示例3: init
import org.jbox2d.callbacks.DestructionListener; //导入依赖的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();
}
示例4: init
import org.jbox2d.callbacks.DestructionListener; //导入依赖的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();
}
示例5: setDestructionListener
import org.jbox2d.callbacks.DestructionListener; //导入依赖的package包/类
/**
* Register a destruction listener. The listener is owned by you and must remain in scope.
*
* @param listener
*/
public void setDestructionListener(DestructionListener listener) {
m_destructionListener = listener;
}
示例6: setDestructionListener
import org.jbox2d.callbacks.DestructionListener; //导入依赖的package包/类
/**
* Register a destruction listener. The listener is owned by you and must
* remain in scope.
*
* @param listener
*/
public void setDestructionListener(DestructionListener listener) {
m_destructionListener = listener;
}