本文整理汇总了Java中com.jme3.scene.plugins.ogre.matext.OgreMaterialKey类的典型用法代码示例。如果您正苦于以下问题:Java OgreMaterialKey类的具体用法?Java OgreMaterialKey怎么用?Java OgreMaterialKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OgreMaterialKey类属于com.jme3.scene.plugins.ogre.matext包,在下文中一共展示了OgreMaterialKey类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOgreMaterialKey
import com.jme3.scene.plugins.ogre.matext.OgreMaterialKey; //导入依赖的package包/类
private OgreMaterialKey getOgreMaterialKey(String materialName) {
/**
* /base/normalmap/specular
* /base/normalmap
* /base/simple
*/
MaterialExtensionSet matExts = new MaterialExtensionSet();
MaterialExtension baseLightExt = new MaterialExtension("/base/normalmap/specular",
"Common/MatDefs/Light/Lighting.j3md");
baseLightExt.setTextureMapping("DiffuseMap", "DiffuseMap");
baseLightExt.setTextureMapping("NormalHeightMap", "NormalMap");
baseLightExt.setTextureMapping("SpecularMap", "SpecularMap");
matExts.addMaterialExtension(baseLightExt);
MaterialExtension baseLightExt2 = new MaterialExtension("/base/normalmap",
"Common/MatDefs/Light/Lighting.j3md");
baseLightExt2.setTextureMapping("DiffuseMap", "DiffuseMap");
baseLightExt2.setTextureMapping("NormalHeightMap", "NormalMap");
baseLightExt2.setTextureMapping("SpecularMap", "SpecularMap");
matExts.addMaterialExtension(baseLightExt2);
MaterialExtension baseLightExt3 = new MaterialExtension("/base/simple",
"Common/MatDefs/Light/Lighting.j3md");
baseLightExt3.setTextureMapping("DiffuseMap", "DiffuseMap");
baseLightExt3.setTextureMapping("NormalHeightMap", "NormalMap");
baseLightExt3.setTextureMapping("SpecularMap", "SpecularMap");
matExts.addMaterialExtension(baseLightExt3);
OgreMaterialKey key = new OgreMaterialKey(materialName);
key.setMaterialExtensionSet(matExts);
return key;
}
示例2: startElement
import com.jme3.scene.plugins.ogre.matext.OgreMaterialKey; //导入依赖的package包/类
@Override
public void startElement(String uri, String localName, String qName, Attributes attribs) throws SAXException {
if (qName.equals("externals")) {
checkTopNode("scene");
// Has an externals block, create material list.
materialList = new MaterialList();
} else if (qName.equals("item")) {
checkTopNode("externals");
if (!attribs.getValue("type").equals("material")) {
// This is not a material external. Ignore it.
ignoreItem = true;
}
} else if (qName.equals("file")) {
checkTopNode("item");
if (!ignoreItem) {
String materialPath = attribs.getValue("name");
String materialName = new File(materialPath).getName();
String matFile = folderName + materialName;
try {
MaterialList loadedMaterialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(matFile));
materialList.putAll(loadedMaterialList);
} catch (AssetNotFoundException ex) {
logger.log(Level.WARNING, "Cannot locate material file: {0}", matFile);
}
}
}
elementStack.push(qName);
}