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


Java InputCapsule.readFloatBuffer方法代码示例

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


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

示例1: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    hdata = ic.readFloatBuffer("hdata", null);
    width = ic.readInt("width", 0);
    height = ic.readInt("height", 0);
    maxval = ic.readInt("maxval", 0);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:BufferGeomap.java

示例2: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    components = ic.readInt("components", 0);
    usage = ic.readEnum("usage", Usage.class, Usage.Dynamic);
    bufType = ic.readEnum("buffer_type", Type.class, null);
    format = ic.readEnum("format", Format.class, Format.Float);
    normalized = ic.readBoolean("normalized", false);
    offset = ic.readInt("offset", 0);
    stride = ic.readInt("stride", 0);
    componentsLength = components * format.getComponentSize();

    String dataName = "data" + format.name();
    switch (format){
        case Float:
            data = ic.readFloatBuffer(dataName, null);
            break;
        case Short:
        case UnsignedShort:
            data = ic.readShortBuffer(dataName, null);
            break;
        case UnsignedByte:
        case Byte:
        case Half:
            data = ic.readByteBuffer(dataName, null);
            break;
        case Int:
        case UnsignedInt:
            data = ic.readIntBuffer(dataName, null);
            break;
        default:
            throw new IOException("Unsupported import buffer format: "+format);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:34,代码来源:VertexBuffer.java

示例3: read

import com.jme3.export.InputCapsule; //导入方法依赖的package包/类
@Override
public void read(JmeImporter im) throws IOException{
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    varType = ic.readEnum("varType", VarType.class, null);
    binding = ic.readEnum("binding", UniformBinding.class, null);
    switch (varType){
        case Boolean:
            value = ic.readBoolean("valueBoolean", false);
            break;
        case Float:
            value = ic.readFloat("valueFloat", 0);
            break;
        case FloatArray:
            value = ic.readFloatBuffer("valueFloatArray", null);
            break;
        case Int:
            value = ic.readInt("valueInt", 0);
            break;
        case Matrix3:
            multiData = ic.readFloatBuffer("valueMatrix3", null);
            value = multiData;
            break;
        case Matrix4:
            multiData = ic.readFloatBuffer("valueMatrix4", null);
            value = multiData;
            break;
        case Vector2:
            value = ic.readSavable("valueVector2", null);
            break;
        case Vector3:
            value = ic.readSavable("valueVector3", null);
            break;
        case Vector3Array:
            value = ic.readFloatBuffer("valueVector3Array", null);
            break;
        case Vector4:
            value = ic.readSavable("valueVector4", null);
            break;
        case Vector4Array:
            value = ic.readFloatBuffer("valueVector4Array", null);
            break;
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:45,代码来源:Uniform.java


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