当前位置: 首页>>代码示例>>Java>>正文


Java OgreMaterialKey类代码示例

本文整理汇总了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;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:33,代码来源:ImportWorldForgeAction.java

示例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);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:31,代码来源:SceneMaterialLoader.java


注:本文中的com.jme3.scene.plugins.ogre.matext.OgreMaterialKey类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。