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


Java AppStateManager类代码示例

本文整理汇总了Java中com.jme3.app.state.AppStateManager的典型用法代码示例。如果您正苦于以下问题:Java AppStateManager类的具体用法?Java AppStateManager怎么用?Java AppStateManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AppStateManager类属于com.jme3.app.state包,在下文中一共展示了AppStateManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:19,代码来源:EditableBulletSceneAppState.java

示例2: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
@JMEThread
public void initialize(@NotNull final AppStateManager stateManager, @NotNull final Application application) {
    super.initialize(stateManager, application);

    final SceneNode currentModel = getCurrentModel();

    if (currentModel != null) {
        getModelNode().attachChild(currentModel);
    }

    final FXAAFilter fxaaFilter = EDITOR.getFXAAFilter();
    fxaaFilter.setEnabled(false);

    final ToneMapFilter toneMapFilter = EDITOR.getToneMapFilter();
    toneMapFilter.setEnabled(false);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:18,代码来源:SceneEditor3DState.java

示例3: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
@JMEThread
public void initialize(@NotNull final AppStateManager stateManager, @NotNull final Application application) {
    super.initialize(stateManager, application);
    this.stateManager = stateManager;

    final Node rootNode = EDITOR.getRootNode();
    rootNode.attachChild(getStateNode());

    final TonegodTranslucentBucketFilter translucentBucketFilter = EDITOR.getTranslucentBucketFilter();
    translucentBucketFilter.setEnabled(true);

    final EditorCamera editorCamera = getEditorCamera();
    final InputManager inputManager = EDITOR.getInputManager();

    checkAndAddMappings(inputManager);
    registerActionListener(inputManager);
    registerAnalogListener(inputManager);

    if (editorCamera != null) {
        editorCamera.setEnabled(true);
        editorCamera.registerInput(inputManager);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:25,代码来源:AdvancedAbstractEditor3DState.java

示例4: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	super.initialize(stateManager, app);
	
	this.app = app;
	
	attachAction(
			"wireframe-mode",
			new KeyTrigger(KeyInput.KEY_TAB),
			this::toggleWireframeMode);
	
	attachAction(
			"mouse-lock",
			new KeyTrigger(KeyInput.KEY_F1),
			this::toggleMouseLock);
	
	attachAction(
			"show-axis",
			new KeyTrigger(KeyInput.KEY_F2),
			this::toggleAxis);
	
	attachAction(
			"show-grids",
			new KeyTrigger(KeyInput.KEY_F3),
			this::toggleGrids);
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:27,代码来源:GameInputState.java

示例5: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	LOGGER.debug("Initializing...");
	
	super.initialize(stateManager, app);
	
	JmeResourceManager resourceManager = (JmeResourceManager)clientEnvironment.getResourceCache();
	
	for (Block block : clientEnvironment.getCosmos().getBlocks()) {
		Material material = resourceManager.getMaterial(block);
		
		if (material != null) {
			materials.add(material);
		}
	}
	
	EntityContainer entityContainer = clientEnvironment.getCurrentRealm().getEntityManager();
	
	for (LightSourceComponent lightComponent : entityContainer.getComponents(LightSourceComponent.class)) {
		processAddOrChange(lightComponent);
	}
	
	updateMaterialParams();
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:25,代码来源:LightingState.java

示例6: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	super.initialize(stateManager, app);
	
	this.app = app;
	
	chunksNode.updateGeometricState();
	
	app.getViewPort().attachScene(chunksNode);
	
	active = true;
	
	new TraceableThread(this::loadChunks, "chunk-loader").start();
	new TraceableThread(this::meshChunks, "chunk-mesher").start();
	
	BitmapFont font = app.getAssetManager().loadFont("Interface/Fonts/Console.fnt");
	
	debugText = new BitmapText(font);
	debugText.setSize(font.getCharSet().getRenderedSize());
	debugText.setColor(ColorRGBA.White);
	debugText.setText("");
	debugText.setLocalTranslation(0.0f, 0.0f, 1.0f);
	debugText.updateGeometricState();
	
	((SimpleApplication)app).getGuiNode().attachChild(debugText);
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:27,代码来源:ChunkManagingState.java

示例7: run

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
public boolean run(String cmdName, CommandLine commandLine) {
	AppStateManager stateManager = console.getApp().getStateManager();
	if (cmdName.equals("et") || cmdName.equals("editTerrain")) {
		if (!TerrainEditorAppState.isEditing(stateManager) && !BuildAppState.buildMode) {
			BuildAppState.setBuildMode(console.getPreferences(), stateManager, true);
		}
		TerrainEditorAppState.toggle(stateManager);
		console.output(TerrainEditorAppState.isEditing(stateManager) ? "Now editing terrain" : "Exiting terrain edit");
	} else if (cmdName.equals("ee") || cmdName.equals("editEnvironment")) {
		EditableEnvironmentSwitcherAppState env = stateManager.getState(EditableEnvironmentSwitcherAppState.class);
		if (env.isEdit() && !BuildAppState.buildMode) {
			BuildAppState.setBuildMode(console.getPreferences(), stateManager, true);
		}
		env.setEdit(!env.isEdit());
		console.output(env.isEdit() ? "Now editing environment" : "Exiting environment edit");
	} else {
		boolean build = !BuildAppState.buildMode;
		BuildAppState.setBuildMode(console.getPreferences(), stateManager, build);
		console.output(build ? "Now in build mode" : "Exited build mode");
	}
	return true;
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:23,代码来源:ToggleBuilding.java

示例8: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public final void initialize(final AppStateManager manager, final Application app) {
	super.initialize(stateManager, app);

	this.app = (Iceclient) app;

	stateManager = app.getStateManager();
	screen = this.app.getScreen();
	start = stateManager.getState(StartAppState.class);
	network = stateManager.getState(NetworkAppState.class);
	character = start.getCharacter();
	creatureSpatial = start.getSpatial();

	// Layer
	layer = new Container(screen);
	layer.setLayoutManager(createLayerLayout());
	this.app.getLayers(ZPriority.LAYERS).addChild(layer);
	

	onInitialize();
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:22,代码来源:AbstractLobbyAppState.java

示例9: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	super.initialize(stateManager, app);

	this.app = (Iceclient) app;
	this.screen = this.app.getScreen();

	layer = new Element(screen);
	layer.setAsContainerOnly();
	layer.setLayoutManager(new MigLayout(screen, "wrap 1", "push[]", "[]"));

	cfg = new AudioVideoToolButtons(screen);
	layer.addChild(cfg, "ax right");

	this.app.getLayers(ZPriority.NORMAL).addChild(layer);
	new EffectHelper().reveal(layer, Effect.EffectType.FadeIn);

}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:19,代码来源:AudioVideoOptionsAppState.java

示例10: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
public void initialize(AppStateManager stateManager, Application app) {
    if (niftyXmlPath != null) {
        NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(app.getAssetManager(),
                app.getInputManager(),
                app.getAudioRenderer(),
                app.getGuiViewPort());
        nifty = niftyDisplay.getNifty();
        nifty.fromXmlWithoutStartScreen(niftyXmlPath);
        app.getGuiViewPort().addProcessor(niftyDisplay);
    }
    for (CinematicEvent cinematicEvent : cinematicEvents) {
        cinematicEvent.initEvent(app, this);
    }



    initialized = true;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:19,代码来源:Cinematic.java

示例11: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);

    originalMats = new HashMap<>();
    clonedMats = new HashMap<>();

    if(sharedMeshes) {
        meshesShared = new HashMap<>();
    }

    if(groupedGeometries) {
        groupedMaterials = new HashMap<>();

        groupColors = new HashMap<>();
    }
}
 
开发者ID:NemesisMate,项目名称:UtilJME3-Debug,代码行数:18,代码来源:DebugMeshState.java

示例12: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
		public void initialize(AppStateManager stateManager, Application app) {
			super.initialize(stateManager, app);

	        // Create a new cam for the gui
	        Camera particlesCam = new Camera(settings.getWidth(), settings.getHeight());
//	        particlesCam.setParallelProjection(true);
	        ViewPort particlesViewPort = renderManager.createPostView("Particles Default", getCamera());
//	        particlesViewPort.setClearFlags(false, false, false);
	        particlesNode = new Node("Particles Node");
//	        particlesNode.setQueueBucket(Bucket.Gui);
//	        particlesNode.setCullHint(CullHint.Never);
	        particlesViewPort.attachScene(particlesNode);



			Box b = new Box(1, 1, 1);
			Geometry geom = new Geometry("Box", b);

			Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
			mat.setColor("Color", ColorRGBA.Red);
			geom.setMaterial(mat);
			particlesNode.attachChild(geom);
		}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:25,代码来源:EffectsExample.java

示例13: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	super.initialize(stateManager, app);

	mWorldNode.attachChild(mLegMarkersGroup);

	mMoveCursorModel = mAssetManager.loadModel("Models/movecursor.obj");
	mMoveCursorModel.setName("moveCursor");
	mMoveCursorModel.setLocalTranslation(0, 0, 1f);
	mMoveCursorModel.setCullHint(CullHint.Always);
	
	updateSceneGraph();

	Vector3D bs = sim.getScanner().platform.scene.getAABB().getSize();
	maxMoveSpeedH = Math.max(bs.getX(), bs.getY()) * 0.003;

	inputManager.addListener(mActionListener, "up", "down", "left", "right", "pgup", "pgdown");
}
 
开发者ID:GIScience,项目名称:helios,代码行数:19,代码来源:EditWaypointsAppState.java

示例14: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	super.initialize(stateManager, app);

	// ######################### BEGIN Add scene part geometries to the root node #####################
	// Create group node for the scene parts:
	// NOTE: This is primarily done to allow easy hiding of the scene (by detaching the scene parts group node from the root node)
	scenePartsGroupNode = new Node();
	mWorldNode.attachChild(scenePartsGroupNode);

	HashMap<de.uni_hd.giscience.helios.core.scene.Material, HashSet<Primitive>> blablubb = new HashMap<>();

	for (Primitive p : sim.getScanner().platform.scene.primitives) {

		if (!blablubb.containsKey(p.material)) {
			blablubb.put(p.material, new HashSet<Primitive>());
		}

		blablubb.get(p.material).add(p);
	}

	createGeometryFromScenePart(blablubb);
	// ########################## END Add scene part geometries to the root node #####################
}
 
开发者ID:GIScience,项目名称:helios,代码行数:25,代码来源:ShowScannedSceneAppState.java

示例15: initialize

import com.jme3.app.state.AppStateManager; //导入依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application _app) {
    super.initialize(stateManager, _app); 
    this.app = (Start) _app;
    float width = LuoYing.getSettings().getWidth();
    float height = LuoYing.getSettings().getHeight();
    
    float btnHeight = UIFactory.getUIConfig().getButtonHeight() * 1.5f;
    float helpHeight = UIFactory.getUIConfig().getButtonHeight();
    float gameListHeight = height - btnHeight - helpHeight;
    
    gameList = new CreateRoomStateGameListPanel(width, gameListHeight);
    helpCreate = new HelpView(width, helpHeight, ResourceManager.get("lan.help.create"));
    helpCreate.setMargin(10, 0, 0, 0);
    btnPanel = new CreateRoomStateBtnPanel(width, btnHeight, this);
    
    LinearLayout localUIRoot = new LinearLayout(width, height);
    localUIRoot.addView(gameList);
    localUIRoot.addView(helpCreate);
    localUIRoot.addView(btnPanel);
    UIState.getInstance().addUI(localUIRoot);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:23,代码来源:CreateRoomState.java


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