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


Java DestructionListener类代码示例

本文整理汇总了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);
}
 
开发者ID:col726,项目名称:game-engine-CMZ,代码行数:27,代码来源:TestbedTest.java

示例2: getDestructionListener

import org.jbox2d.callbacks.DestructionListener; //导入依赖的package包/类
public DestructionListener getDestructionListener() {
  return m_destructionListener;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:4,代码来源:World.java

示例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();
	}
 
开发者ID:mleoking,项目名称:PhET,代码行数:46,代码来源:TestbedTest.java

示例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();
}
 
开发者ID:dragome,项目名称:dragome-examples,代码行数:46,代码来源:BaseExample.java

示例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;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:9,代码来源:World.java

示例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;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:World.java


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