本文整理汇总了Java中com.jme3.scene.Mesh.setLodLevels方法的典型用法代码示例。如果您正苦于以下问题:Java Mesh.setLodLevels方法的具体用法?Java Mesh.setLodLevels怎么用?Java Mesh.setLodLevels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.scene.Mesh
的用法示例。
在下文中一共展示了Mesh.setLodLevels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endLevelOfDetail
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
private void endLevelOfDetail() {
// set the lod data for each mesh
for (Entry<List<VertexBuffer>> entry : lodLevels) {
Mesh m = geoms.get(entry.getKey()).getMesh();
List<VertexBuffer> levels = entry.getValue();
VertexBuffer[] levelArray = new VertexBuffer[levels.size()];
levels.toArray(levelArray);
m.setLodLevels(levelArray);
}
}
示例2: doUndoTool
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
@Override
protected void doUndoTool(AbstractSceneExplorerNode rootNode, Object undoObject) {
Geometry geom = rootNode.getLookup().lookup(Geometry.class);
Mesh mesh = geom.getMesh();
if (mesh != null) {
VertexBuffer[] vbs = (VertexBuffer[]) undoObject;
if (vbs.length>0){
mesh.setLodLevels((VertexBuffer[]) undoObject);
}else{
mesh.setLodLevels(null);
}
}
}
示例3: doApplyTool
import com.jme3.scene.Mesh; //导入方法依赖的package包/类
@Override
protected Object doApplyTool(AbstractSceneExplorerNode rootNode, Object settings) {
WizardDescriptor wiz = (WizardDescriptor) settings;
Geometry geom = rootNode.getLookup().lookup(Geometry.class);
Mesh mesh = geom.getMesh();
if (mesh != null) {
//save old lods
VertexBuffer[] lods = null;
if (geom.getMesh().getNumLodLevels() > 0) {
lods = new VertexBuffer[geom.getMesh().getNumLodLevels()];
for (int i = 0; i < lods.length; i++) {
lods[i] = geom.getMesh().getLodLevel(i);
}
}
if (wiz != null) {
float[] values = (float[]) wiz.getProperties().get("reductionValues");
if (values != null) {
//generate lods
LodGenerator generator = new LodGenerator(geom);
LodGenerator.TriangleReductionMethod method = (LodGenerator.TriangleReductionMethod) wiz.getProperties().get("reductionMethod");
generator.bakeLods(method, values);
}else{
mesh.setLodLevels(null);
}
}
if(lods == null){
return new VertexBuffer[0];
}
return lods;
}
return null;
}