本文整理汇总了Java中com.jme3.material.RenderState.setWireframe方法的典型用法代码示例。如果您正苦于以下问题:Java RenderState.setWireframe方法的具体用法?Java RenderState.setWireframe怎么用?Java RenderState.setWireframe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.material.RenderState
的用法示例。
在下文中一共展示了RenderState.setWireframe方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCollisionPlane
import com.jme3.material.RenderState; //导入方法依赖的package包/类
/**
* Create collision plane.
*/
@FromAnyThread
private void createCollisionPlane() {
final AssetManager assetManager = EDITOR.getAssetManager();
final Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
final RenderState renderState = material.getAdditionalRenderState();
renderState.setFaceCullMode(RenderState.FaceCullMode.Off);
renderState.setWireframe(true);
final float size = 20000;
final Geometry geometry = new Geometry("plane", new Quad(size, size));
geometry.setMaterial(material);
geometry.setLocalTranslation(-size / 2, -size / 2, 0);
collisionPlane = new Node();
collisionPlane.attachChild(geometry);
}
示例2: getDebugMaterial
import com.jme3.material.RenderState; //导入方法依赖的package包/类
protected static Material getDebugMaterial(Geometry geometry, boolean colors, boolean wire, boolean normals, boolean faceCullOff) {
// RenderState renderState = geometry.getMaterial().getAdditionalRenderState();
Material debugMaterial;
Material originalMaterial = geometry.getMaterial();
if(normals) {
debugMaterial = DebugUtil.createNormalMaterial(geometry);
} else if(colors || !wire || originalMaterial == null) {
debugMaterial = DebugUtil.createDebugMaterial(geometry, colors);
} else {
debugMaterial = geometry.getMaterial().clone();
wire = true;
}
RenderState debugRenderState = debugMaterial.getAdditionalRenderState();
if(wire) {
debugRenderState.setWireframe(originalMaterial == null || !originalMaterial.getAdditionalRenderState().isWireframe());
}
if(faceCullOff) {
debugRenderState.setFaceCullMode(RenderState.FaceCullMode.Off);
}
return debugMaterial;
}
示例3: toggleWireframeMode
import com.jme3.material.RenderState; //导入方法依赖的package包/类
private void toggleWireframeMode(String name, boolean isPressed, float tpf) {
if (!isPressed) {
for (Block block : cosmos.getBlocks()) {
if (!Block.isNullBlock(block)) {
Material material = resourceManager.getMaterial(block);
if (material != null) {
RenderState renderState = material.getAdditionalRenderState();
renderState.setWireframe(!renderState.isWireframe());
}
}
}
}
}
示例4: createDebugMaterial
import com.jme3.material.RenderState; //导入方法依赖的package包/类
private @NotNull Material createDebugMaterial(@NotNull final AssetManager assetManager, @NotNull final ColorRGBA blue) {
final Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
material.setColor("Color", blue);
final RenderState additionalRenderState = material.getAdditionalRenderState();
additionalRenderState.setWireframe(true);
return material;
}