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


Java BulletAppState.getPhysicsSpace方法代码示例

本文整理汇总了Java中com.jme3.bullet.BulletAppState.getPhysicsSpace方法的典型用法代码示例。如果您正苦于以下问题:Java BulletAppState.getPhysicsSpace方法的具体用法?Java BulletAppState.getPhysicsSpace怎么用?Java BulletAppState.getPhysicsSpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.bullet.BulletAppState的用法示例。


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

示例1: initialize

import com.jme3.bullet.BulletAppState; //导入方法依赖的package包/类
/**
 * Creates a new Forester object.
 * 
 * @param rootNode The rootNode of the scene.
 * @param camera The camera.
 * @param terrain A terrain object.
 * @param app The application.
 */
synchronized
public void initialize(Node rootNode, Camera camera, Terrain terrain, Application app)
{
    this.rootNode = rootNode;
    this.camera = camera;
    this.terrain = terrain;
    this.app = app;
    BulletAppState bas = app.getStateManager().getState(BulletAppState.class);
    if(bas == null){
        log.log(Level.INFO,"No BulletAppState found, physics is disabled.");
    } else {
        physicsSpace = bas.getPhysicsSpace();
        physicsEnabled = true;
    }
    list = new ArrayList<TileLoader>(2);
}
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:25,代码来源:Forester.java

示例2: simpleInitApp

import com.jme3.bullet.BulletAppState; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
	BulletAppState bulletAppState = new BulletAppState();
	stateManager.attach(bulletAppState);
	bulletAppState.getPhysicsSpace().setGravity(new Vector3f(0, 0, -1));
	// stateManager.detach(bulletAppState);

	flyCam.setUpVector(new Vector3f(0, 0, 1));
	flyCam.setEnabled(false);

	MapView view = new MapView(rootNode, guiNode, bulletAppState.getPhysicsSpace(), assetManager, viewPort);

	NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
	BattlefieldController fieldCtrl = new BattlefieldController(view, niftyDisplay.getNifty(), inputManager, cam);

	niftyDisplay.getNifty().setIgnoreKeyboardEvents(true);
	// TODO: validation is needed to be sure everyting in XML is fine. see http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:nifty_gui_best_practices
	// niftyDisplay.getNifty().validateXml("interface/screen.xml");
	niftyDisplay.getNifty().fromXml("interface/screen.xml", "editor");

	stateManager.attach(fieldCtrl);
	fieldCtrl.setEnabled(true);

	ModelManager.setNewBattlefield();

	guiViewPort.addProcessor(niftyDisplay);
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:28,代码来源:Game.java

示例3: simpleInitApp

import com.jme3.bullet.BulletAppState; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
	BulletAppState bulletAppState = new BulletAppState();
	stateManager.attach(bulletAppState);
	bulletAppState.getPhysicsSpace().setGravity(new Vector3f(0, 0, -1));
	// stateManager.detach(bulletAppState);

	flyCam.setUpVector(new Vector3f(0, 0, 1));
	flyCam.setEnabled(false);

	EditorView view = new EditorView(rootNode, guiNode, bulletAppState.getPhysicsSpace(), assetManager, viewPort);

	NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);

	EditorController editorCtrl = new EditorController(view, niftyDisplay.getNifty(), inputManager, cam);

	niftyDisplay.getNifty().setIgnoreKeyboardEvents(true);
	// TODO: validation is needed to be sure everyting in XML is fine. see http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:nifty_gui_best_practices
	// niftyDisplay.getNifty().validateXml("interface/screen.xml");
	niftyDisplay.getNifty().fromXml("interface/screen.xml", "editor");

	stateManager.attach(editorCtrl);
	editorCtrl.setEnabled(true);

	ModelManager.setNewBattlefield();

	guiViewPort.addProcessor(niftyDisplay);
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:29,代码来源:Editor.java

示例4: simpleInitApp

import com.jme3.bullet.BulletAppState; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
	BulletAppState bulletAppState = new BulletAppState();
	stateManager.attach(bulletAppState);
	bulletAppState.getPhysicsSpace().setGravity(new Vector3f(0, 0, -1));
	// stateManager.detach(bulletAppState);

	flyCam.setUpVector(new Vector3f(0, 0, 1));
	flyCam.setEnabled(false);

	EditorView view = new EditorView(rootNode, guiNode, bulletAppState.getPhysicsSpace(), assetManager, viewPort);

	NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);

	BattlefieldController fieldCtrl = new BattlefieldController(view, niftyDisplay.getNifty(), inputManager, cam);

	niftyDisplay.getNifty().setIgnoreKeyboardEvents(true);
	// TODO: validation is needed to be sure everyting in XML is fine. see http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:nifty_gui_best_practices
	// niftyDisplay.getNifty().validateXml("interface/screen.xml");
	niftyDisplay.getNifty().fromXml("interface/screen.xml", "hud");

	stateManager.attach(fieldCtrl);
	fieldCtrl.setEnabled(true);

	guiViewPort.addProcessor(niftyDisplay);

	if (!mapfilename.isEmpty()) {
		ModelManager.loadBattlefield(mapfilename);
	} else {
		ModelManager.setNewBattlefield();
	}
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:33,代码来源:GameMutliplayer.java

示例5: simpleInitApp

import com.jme3.bullet.BulletAppState; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
	BulletAppState bulletAppState = new BulletAppState();
	stateManager.attach(bulletAppState);
	bulletAppState.getPhysicsSpace().setGravity(new Vector3f(0, 0, -1));
	// stateManager.detach(bulletAppState);

	flyCam.setUpVector(new Vector3f(0, 0, 1));
	flyCam.setEnabled(false);

	view = new MapView(rootNode, guiNode, bulletAppState.getPhysicsSpace(), assetManager, viewPort);

	NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
	fieldCtrl = new BattlefieldController(view, niftyDisplay.getNifty(), inputManager, cam);
	EventManager.register(this);

	niftyDisplay.getNifty().setIgnoreKeyboardEvents(true);
	// TODO: validation is needed to be sure everyting in XML is fine. see http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:nifty_gui_best_practices
	// niftyDisplay.getNifty().validateXml("interface/screen.xml");
	niftyDisplay.getNifty().fromXml("interface/screen.xml", "hud");

	stateManager.attach(fieldCtrl);
	fieldCtrl.setEnabled(true);
	if (view.getMapRend() != null) {
		view.getMapRend().renderTiles();
	}
	guiViewPort.addProcessor(niftyDisplay);
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:29,代码来源:Game.java

示例6: simpleInitApp

import com.jme3.bullet.BulletAppState; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
	bulletAppState = new BulletAppState();
	stateManager.attach(bulletAppState);
	bulletAppState.getPhysicsSpace().setGravity(new Vector3f(0, 0, -1));
	// stateManager.detach(bulletAppState);

	flyCam.setUpVector(new Vector3f(0, 0, 1));
	flyCam.setEnabled(false);

	MaterialManager.setAssetManager(assetManager);
	view = new EditorView(rootNode, guiNode, bulletAppState.getPhysicsSpace(), assetManager, viewPort);

	NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);

	fieldCtrl = new BattlefieldController(view, niftyDisplay.getNifty(), inputManager, cam);
	editorCtrl = new EditorController(view, niftyDisplay.getNifty(), inputManager, cam);
	groundCtrl = new GroundController(view, niftyDisplay.getNifty(), inputManager, cam);
	EventManager.register(this);

	niftyDisplay.getNifty().setIgnoreKeyboardEvents(true);
	// TODO: validation is needed to be sure everyting in XML is fine. see http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:nifty_gui_best_practices
	// niftyDisplay.getNifty().validateXml("interface/screen.xml");
	niftyDisplay.getNifty().fromXml("interface/screen.xml", "editor");

	actualCtrl = editorCtrl;
	stateManager.attach(actualCtrl);
	actualCtrl.setEnabled(true);

	guiViewPort.addProcessor(niftyDisplay);

	CollisionTester.setAssetManager(assetManager);
	CollisionTester.root = rootNode;
	
	ModelManager.setNewBattlefield();
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:37,代码来源:MainRTS.java


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