本文整理汇总了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();
}
}
}
示例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());
}
}
}
示例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);
}
示例4: VisualAppState
import com.jme3.scene.BatchNode; //导入依赖的package包/类
public VisualAppState() {
this.models = new HashMap<EntityId, Spatial>();
this.batchedNodes = new HashMap<String, BatchNode>();
}
示例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);
}