當前位置: 首頁>>代碼示例>>Java>>正文


Java Application類代碼示例

本文整理匯總了Java中com.jme3.app.Application的典型用法代碼示例。如果您正苦於以下問題:Java Application類的具體用法?Java Application怎麽用?Java Application使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Application類屬於com.jme3.app包,在下文中一共展示了Application類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialize

import com.jme3.app.Application; //導入依賴的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.Application; //導入依賴的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.Application; //導入依賴的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.Application; //導入依賴的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.Application; //導入依賴的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.Application; //導入依賴的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: initialize

import com.jme3.app.Application; //導入依賴的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

示例8: simpleInitApp

import com.jme3.app.Application; //導入依賴的package包/類
@Override
    public void simpleInitApp() {
        Application a;
        flyCam = new ExtendedFlyByCam(cam);
        flyCam.setDragToRotate(true);
        flyCam.setMoveSpeed(50);
        flyCam.registerWithInput(getInputManager());

        EntityFactory pf = new EntityFactory(this, rootNode);        
        AbstractProp loadingEntity = pf.getProp("Prop/Manipulator/Manipulator-Creature_Load.csm.xml");
//        AbstractProp loadingSpatial = pf.getProp("Props/Prop-Manipulator/Manipulator-Sound.csm.xml");
        
        
        
//        MeshConfiguration meshConfig = MeshConfiguration.get(meshPath);
//        Material propMaterial = createMaterial(meshConfig, assetManager);
//        ((Geometry)loadingSpatial.getChild(0)).setMaterial(propMaterial);
        rootNode.attachChild(loadingEntity.getSpatial());
        
        AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White);
        rootNode.addLight(al);
    }
 
開發者ID:rockfireredmoon,項目名稱:iceclient,代碼行數:24,代碼來源:TestLoading.java

示例9: simpleInitApp

import com.jme3.app.Application; //導入依賴的package包/類
@Override
public void simpleInitApp() {
    Application a;
    flyCam = new ExtendedFlyByCam(cam);
    flyCam.setDragToRotate(true);
    flyCam.setMoveSpeed(50);        
    flyCam.registerWithInput(getInputManager());   

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

    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", ColorRGBA.Blue);
    mat.getAdditionalRenderState().setWireframe(true);
    geom.setMaterial(mat);
    
    Alarm al = new Alarm(this);

    stateManager.attach(new ModifierKeysAppState());
    rootNode.attachChild(geom);
    final MouseManager mouseManager = new MouseManager(rootNode, al);
    mouseManager.addListener(this);        
    stateManager.attach(mouseManager);


}
 
開發者ID:rockfireredmoon,項目名稱:iceclient,代碼行數:27,代碼來源:TestMouseManager.java

示例10: initialize

import com.jme3.app.Application; //導入依賴的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: initEvent

import com.jme3.app.Application; //導入依賴的package包/類
@Override
public void initEvent(Application app, Cinematic cinematic) {
    if (channel == null) {
        Object s = cinematic.getEventData("modelChannels", modelName);
        if (s != null && s instanceof AnimChannel) {
            this.channel = (AnimChannel) s;
        } else if (s == null) {
            Spatial model = cinematic.getScene().getChild(modelName);
            if (model != null) {
                channel = model.getControl(AnimControl.class).createChannel();
                cinematic.putEventData("modelChannels", modelName, channel);
            } else {
                log.log(Level.WARNING, "spatial {0} not found in the scene, cannot perform animation", modelName);
            }
        }

    }
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:19,代碼來源:AnimationTrack.java

示例12: initialize

import com.jme3.app.Application; //導入依賴的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

示例13: createTerrain

import com.jme3.app.Application; //導入依賴的package包/類
private void createTerrain(ComponentDefine cd, JfxSceneEdit jfxEdit, Application application
        , String terrainName, int totalSize, int patchSize, int alphaTextureSize, String assetFolder, float[] heightMap) {
    try {
        // 創建地形
        Terrain terrain = TerrainUtils.doCreateTerrain(application, assetFolder
                , alphaTextureDir, terrainName, totalSize, patchSize, alphaTextureSize, heightMap, TERRAIN_DIRT);
        Spatial terrainSpatial = (Spatial) terrain;
        
        // 保存地形文件
        String terrainFullName = modelDir.substring(1) + "/" + terrainName + ".j3o";
        File terrainFile = new File(assetFolder, terrainFullName);
        BinaryExporter.getInstance().save(terrainSpatial, terrainFile);
        
        UncacheAssetEventListener.getInstance().addUncache(terrainFullName);
        
        // 添加到3D場景編輯
        EntityData ed = Loader.loadData(cd.getId());
        ed.setAttribute("file", terrainFullName); // 去掉"/"
        Jfx.runOnJfx(() -> {
            jfxEdit.addEntityUseUndoRedo(ed);
        });

    } catch (IOException ex) {
        Logger.getLogger(TerrainEntityComponentConverter.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:27,代碼來源:TerrainEntityComponentConverter.java

示例14: initialize

import com.jme3.app.Application; //導入依賴的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

示例15: initialize

import com.jme3.app.Application; //導入依賴的package包/類
/**
     * 初始化環境, 這個方法必須在
     * @param app
     */
    public static void initialize(Application app) {
        LuoYing.app = app;
        
        // remove20170211,以後由外部程序根據情況自己去調用 initializeLogManager()來啟用該功能。
//        LogFactory.initialize(); 
        
        // 注冊載入器,用於載入"*.ini"和 "*.xml"配置文件
        app.getAssetManager().registerLoader(TextFileLoader.class, "ini", "xml");
        // 用於載入".lyo"後,LuoYing內置的物體數據
        app.getAssetManager().registerLoader(LyoFileLoader.class, "lyo");
        
        // 注冊需要序列化的數據,對於網絡版進行序列化時需要用到。
        registerSysBaseSerializer();
        LOG.log(Level.INFO, "registerSerializer ok");
        
        // 載入數據
        reloadData();
    }
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:23,代碼來源:LuoYing.java


注:本文中的com.jme3.app.Application類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。