当前位置: 首页>>代码示例>>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;未经允许,请勿转载。