本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例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();
}