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


Java InputCapsule.readStringSavableMap方法代码示例

本文整理汇总了Java中com.jme3.export.InputCapsule.readStringSavableMap方法的典型用法代码示例。如果您正苦于以下问题:Java InputCapsule.readStringSavableMap方法的具体用法?Java InputCapsule.readStringSavableMap怎么用?Java InputCapsule.readStringSavableMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.export.InputCapsule的用法示例。


在下文中一共展示了InputCapsule.readStringSavableMap方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule in = im.getCapsule(this);
    skeleton = (Skeleton) in.readSavable("skeleton", null);
    animationMap = (HashMap<String, BoneAnimation>) in.readStringSavableMap("animations", null);

    if (im.getFormatVersion() == 0){
        //changed for backward compatibility with j3o files generated before the AnimControl/SkeletonControl split
        //if we find a target mesh array the AnimControl creates the SkeletonControl for old files and add it to the spatial.        
        //When backward compatibility won't be needed anymore this can deleted        
        Savable[] sav = in.readSavableArray("targets", null);
        if (sav != null) {
            Mesh[] targets = new Mesh[sav.length];
            System.arraycopy(sav, 0, targets, 0, sav.length);
            skeletonControl = new SkeletonControl(targets, skeleton);
            spatial.addControl(skeletonControl);
        }
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:AnimControl.java

示例2: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);

    name = ic.readString("name", null);
    worldBound = (BoundingVolume) ic.readSavable("world_bound", null);
    cullHint = ic.readEnum("cull_mode", CullHint.class, CullHint.Inherit);
    queueBucket = ic.readEnum("queue", RenderQueue.Bucket.class,
            RenderQueue.Bucket.Inherit);
    shadowMode = ic.readEnum("shadow_mode", ShadowMode.class,
            ShadowMode.Inherit);

    localTransform = (Transform) ic.readSavable("transform", Transform.IDENTITY);

    localLights = (LightList) ic.readSavable("lights", null);
    localLights.setOwner(this);

    //changed for backward compatibility with j3o files generated before the AnimControl/SkeletonControl split
    //the AnimControl creates the SkeletonControl for old files and add it to the spatial.
    //The SkeletonControl must be the last in the stack so we add the list of all other control before it.
    //When backward compatibility won't be needed anymore this can be replaced by : 
    //controls = ic.readSavableArrayList("controlsList", null));
    controls.addAll(0, ic.readSavableArrayList("controlsList", null));

    userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:Spatial.java

示例3: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    blenderKeys = (Map<String, BlenderKey>) ic.readStringSavableMap("keys", null);
    lastUsedKey = (BlenderKey) ic.readSavable("last-key", null);
    useModelKey = ic.readBoolean("use-model-key", false);
    String logLevelName = ic.readString("log-level", Level.INFO.getName());
    logLevel = logLevelName == null ? Level.INFO : Level.parse(logLevelName);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:ConfigDialog.java

示例4: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
public void read(JmeImporter im) throws IOException{
    InputCapsule ic = im.getCapsule(this);
    language = ic.readString("language", null);
    shaderList = ic.readSavableArrayList("shaderList", null);
    attribs = (IntMap<Attribute>) ic.readIntSavableMap("attribs", null);

    HashMap<String, Uniform> uniMap = (HashMap<String, Uniform>) ic.readStringSavableMap("uniforms", null);
    uniforms = new ListMap<String, Uniform>(uniMap);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:Shader.java

示例5: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);

    cinematicEvents = ic.readSavableArrayList("cinematicEvents", null);
    cameras = (Map<String, CameraNode>) ic.readStringSavableMap("cameras", null);
    timeLine = (TimeLine) ic.readSavable("timeLine", null);
    niftyXmlPath = ic.readString("niftyXmlPath", null);

}
 
开发者ID:mleoking,项目名称:PhET,代码行数:12,代码来源:Cinematic.java

示例6: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    id = ic.readString("id", null);
    uniqueId = ic.readLong("uniqueId", 0);
    localData = (HashMap<String, Savable>) ic.readStringSavableMap("localData", null);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:8,代码来源:ObjectData.java

示例7: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    
    additionalState = (RenderState) ic.readSavable("render_state", null);
    transparent = ic.readBoolean("is_transparent", false);

    // Load the material def
    String defName = ic.readString("material_def", null);
    HashMap<String, MatParam> params = (HashMap<String, MatParam>) ic.readStringSavableMap("parameters", null);
    
    boolean enableVcolor = false;
    boolean separateTexCoord = false;
    
    if (im.getFormatVersion() == 0){
        // Enable compatibility with old models
        if (defName.equalsIgnoreCase("Common/MatDefs/Misc/VertexColor.j3md")){
            // Using VertexColor, switch to Unshaded and set VertexColor=true
            enableVcolor = true;
            defName = "Common/MatDefs/Misc/Unshaded.j3md";
        }else if (defName.equalsIgnoreCase("Common/MatDefs/Misc/SimpleTextured.j3md")
               || defName.equalsIgnoreCase("Common/MatDefs/Misc/SolidColor.j3md")){
            // Using SimpleTextured/SolidColor, just switch to Unshaded
            defName = "Common/MatDefs/Misc/Unshaded.j3md";
        }else if (defName.equalsIgnoreCase("Common/MatDefs/Misc/WireColor.j3md")){
            // Using WireColor, set wireframe renderstate = true and use Unshaded
            additionalState.setWireframe(true);
            defName = "Common/MatDefs/Misc/Unshaded.j3md";
        }else if (defName.equalsIgnoreCase("Common/MatDefs/Misc/Unshaded.j3md")){
            // Uses unshaded, ensure that the proper param is set
            MatParam value = params.get("SeperateTexCoord");
            if (value != null && ((Boolean)value.getValue()) == true){
                params.remove("SeperateTexCoord");
                separateTexCoord = true;
            }
        }
    }
    
    def = (MaterialDef) im.getAssetManager().loadAsset(new AssetKey(defName));
    paramValues = new ListMap<String, MatParam>();

    // load the textures and update nextTexUnit
    for (Map.Entry<String, MatParam> entry : params.entrySet()) {
        MatParam param = entry.getValue();
        if (param instanceof MatParamTexture) {
            MatParamTexture texVal = (MatParamTexture) param;

            if (nextTexUnit < texVal.getUnit() + 1) {
                nextTexUnit = texVal.getUnit() + 1;
            }

            // the texture failed to load for this param
            // do not add to param values
            if (texVal.getTextureValue() == null || texVal.getTextureValue().getImage() == null) {
                continue;
            }
        }
        param.setName(checkSetParam(param.getVarType(), param.getName()));
        paramValues.put(param.getName(), param);
    }
    
    if (enableVcolor){
        setBoolean("VertexColor", true);
    }
    if (separateTexCoord){
        setBoolean("SeparateTexCoord", true);
    } 
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:68,代码来源:Material.java


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