本文整理汇总了Java中com.jme3.app.state.AppStateManager.attach方法的典型用法代码示例。如果您正苦于以下问题:Java AppStateManager.attach方法的具体用法?Java AppStateManager.attach怎么用?Java AppStateManager.attach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.app.state.AppStateManager
的用法示例。
在下文中一共展示了AppStateManager.attach方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@Override
public void initialize(@NotNull final AppStateManager stateManager, @NotNull final Application app) {
super.initialize(stateManager, app);
this.stateManager = stateManager;
this.application = app;
startPhysics();
if (isDebugEnabled()) {
debugAppState = new BulletDebugAppState(physicsSpace);
stateManager.attach(debugAppState);
}
final SceneNode sceneNode = getSceneNode();
if (sceneNode != null) {
updateNode(sceneNode, physicsSpace);
}
}
示例2: initialize
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.stateManager = stateManager;
this.app = app;
for (AppState state : states) {
stateManager.attach(state);
}
}
示例3: run
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public boolean run(String cmdName, CommandLine commandLine) {
AppStateManager stateManager = console.getApp().getStateManager();
ForumAppState game = stateManager.getState(ForumAppState.class);
if(game == null) {
stateManager.attach(new ForumAppState());
}
else {
stateManager.detach(game);
}
return true;
}
示例4: run
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public boolean run(String cmdName, CommandLine commandLine) {
final AppStateManager stateManager = console.getApp().getStateManager();
ActionBarsAppState current = stateManager.getState(ActionBarsAppState.class);
if (current != null) {
((Iceclient)console.getApp()).getToolManager().reset(current.getHudType());
ActionBarsAppState newState = new ActionBarsAppState(console.getPreferences(), current.getHudType());
stateManager.detach(current);
stateManager.attach(newState);
return true;
} else {
console.outputError("Toolbox not loaded");
return false;
}
}
示例5: toggle
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public static void toggle(AppStateManager stateManager) {
ToolBoxAppState toolBox = stateManager.getState(ToolBoxAppState.class);
if (toolBox == null) {
stateManager.attach(new ToolBoxAppState());
} else {
stateManager.detach(toolBox);
}
}
示例6: setTweaking
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public static void setTweaking(AppStateManager stateManager, boolean tweak) {
boolean tweaking = isTweaking(stateManager);
if (tweak && !tweaking) {
LOG.info("Enering build mode");
stateManager.attach(new CreatureTweakAppState());
} else if (!tweak && tweaking) {
LOG.info("Leaving build mode");
stateManager.detach(stateManager.getState(CreatureTweakAppState.class));
}
}
示例7: createScene
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
static private boolean createScene(SimpleApplication app, EntityData ed) {
// RendererPlatform.setApp(app);
app.getViewPort().addProcessor(new FilterPostProcessor(app.getAssetManager()));
AppStateManager stateManager = app.getStateManager();
stateManager.attach(new DataState(EditorPlatform.getEntityData()));
stateManager.attach(new SceneSelectorState());
return true;
}
示例8: onInitialized
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@Override
protected void onInitialized(AppStateManager stateManager) {
super.onInitialized(stateManager);
if (stateManager.getState(BulletAppState.class) == null) {
stateManager.attach(new BulletAppState());
}
stateManager.getState(BulletAppState.class).getPhysicsSpace().setGravity(new Vector3f(0, 0, -6));
stateManager.getState(BulletAppState.class).startPhysics();
physicsSpace = stateManager.getState(BulletAppState.class).getPhysicsSpace();
}
示例9: initialize
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
/**
* Initialise play state.
* @param stateManager The application state manager.
* @param app The game application object.
*/
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.app = (SimpleApplication) app;
this.rootNode = this.app.getRootNode();
// Initialise physics.
bullet = new BulletAppState();
stateManager.attach(bullet);
// Create ambient light for world.
AmbientLight ambientLight = new AmbientLight();
ambientLight.setColor(ColorRGBA.White.mult(1.3f));
this.rootNode.addLight(ambientLight);
// Load current course.
Spatial course
= app.getAssetManager().loadModel("Scenes/DeveloperCourse/Course.j3o");
this.rootNode.attachChild(course);
// Fetch and initialise the course path.
coursePath = new CoursePath((Node) course, bullet);
// Create player manager either for server or client.
if (isServer) {
playerManager = new PlayerManager(this.app, coursePath, bullet,
totalPlayers);
} else {
playerManager = new PlayerManager(this.app, coursePath, bullet,
totalPlayers, localPlayerIdx);
// Create the camera attached to the player.
followCamera = new FollowCamera(this.app.getCamera(),
playerManager.getLocalPlayer(), CAMERA_DISTANCE);
// Capture input to player.
InputManager input = app.getInputManager();
String[] mappingNames = new String[] { PlayerInput.MOVE_LEFT,
PlayerInput.MOVE_RIGHT, PlayerInput.MOVE_UP, PlayerInput.MOVE_DOWN };
playerInput = new PlayerInput(playerManager.getLocalPlayer());
input.addListener(playerInput, mappingNames);
input.addMapping(PlayerInput.MOVE_LEFT, new KeyTrigger(KeyInput.KEY_A));
input.addMapping(PlayerInput.MOVE_RIGHT, new KeyTrigger(KeyInput.KEY_D));
input.addMapping(PlayerInput.MOVE_UP, new KeyTrigger(KeyInput.KEY_S));
input.addMapping(PlayerInput.MOVE_DOWN, new KeyTrigger(KeyInput.KEY_W));
}
}
示例10: addAppStateImpl
import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@JMEThread
private void addAppStateImpl(@NotNull final SceneAppState appState) {
final AppStateManager stateManager = EDITOR.getStateManager();
stateManager.attach(appState);
}