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


Java BatchNode類代碼示例

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


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

示例1: update

import com.jme3.scene.BatchNode; //導入依賴的package包/類
@Override
public void update(float tpf) {
    if(entities.applyChanges()) {
        removeModels(entities.getRemovedEntities());
        addModels(entities.getAddedEntities());
        updateModels(entities.getChangedEntities());
    }
    for(BatchNode batchNode : batchedNodes.values()) {
        if(batchNode.getUserData("batched").equals(false)) {
            batchNode.setUserData("batched", true);
            batchNode.batch();
        }
    }
}
 
開發者ID:Ev1lbl0w,項目名稱:zombie-survival,代碼行數:15,代碼來源:VisualAppState.java

示例2: removeModels

import com.jme3.scene.BatchNode; //導入依賴的package包/類
private void removeModels(Set<Entity> entities) {
    for(Entity e : entities) {
        Spatial s = models.remove(e.getId());
        BatchNode batchNode = batchedNodes.get(s.getName());
        s.removeFromParent();
        if(batchNode.getChildren().isEmpty()) {
            batchNode.removeFromParent();
            batchedNodes.remove(s.getName());
        }
    }
}
 
開發者ID:Ev1lbl0w,項目名稱:zombie-survival,代碼行數:12,代碼來源:VisualAppState.java

示例3: BatchZone

import com.jme3.scene.BatchNode; //導入依賴的package包/類
public BatchZone(String name, Vector3f center, float xExtent, float yExtent, float zExtent) {
    batchZoneNode = new BatchNode(name);
    bb = new BoundingBox(center, xExtent, yExtent, zExtent);
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:5,代碼來源:BatchEntity.java

示例4: VisualAppState

import com.jme3.scene.BatchNode; //導入依賴的package包/類
public VisualAppState() {
    this.models = new HashMap<EntityId, Spatial>();
    this.batchedNodes = new HashMap<String, BatchNode>();
}
 
開發者ID:Ev1lbl0w,項目名稱:zombie-survival,代碼行數:5,代碼來源:VisualAppState.java

示例5: simpleInitApp

import com.jme3.scene.BatchNode; //導入依賴的package包/類
@Override
    public void simpleInitApp() {
        timer = new NanoTimer();
        batch = new BatchNode("theBatchNode");

        /**
         * A cube with a color "bleeding" through transparent texture. Uses
         * Texture from jme3-test-data library!
         */
        Box boxshape4 = new Box(Vector3f.ZERO, 1f, 1f, 1f );
        cube = new Geometry("cube1", boxshape4);
        Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");     
        cube.setMaterial(mat);
//        Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");        
//        mat.setColor("Diffuse", ColorRGBA.Blue);
//        mat.setBoolean("UseMaterialColors", true);
        /**
         * A cube with a color "bleeding" through transparent texture. Uses
         * Texture from jme3-test-data library!
         */
        Box box = new Box(Vector3f.ZERO, 1f, 1f, 1f);
        cube2 = new Geometry("cube2", box);
        cube2.setMaterial(mat);
        
        TangentBinormalGenerator.generate(cube);
        TangentBinormalGenerator.generate(cube2);


         n = new Node("aNode");
       // n.attachChild(cube2);
        batch.attachChild(cube);
        batch.attachChild(cube2);
      //  batch.setMaterial(mat);
        batch.batch();
        rootNode.attachChild(batch);
        cube.setLocalTranslation(3, 0, 0);
        cube2.setLocalTranslation(0, 3, 0);


        dl=new DirectionalLight();
        dl.setColor(ColorRGBA.White.mult(2));
        dl.setDirection(new Vector3f(1, -1, -1));
        rootNode.addLight(dl);
        flyCam.setMoveSpeed(10);
    }
 
開發者ID:chototsu,項目名稱:MikuMikuStudio,代碼行數:46,代碼來源:TestBatchNode.java


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