Java Code Examples for com.jme3.export.InputCapsule#readIntArray()

The following examples show how to use com.jme3.export.InputCapsule#readIntArray() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Image.java    From jmonkeybuilder with Apache License 2.0 6 votes vote down vote up
public void read(JmeImporter e) throws IOException {
    InputCapsule capsule = e.getCapsule(this);
    format = capsule.readEnum("format", Format.class, Format.RGBA8);
    width = capsule.readInt("width", 0);
    height = capsule.readInt("height", 0);
    depth = capsule.readInt("depth", 0);
    mipMapSizes = capsule.readIntArray("mipMapSizes", null);
    multiSamples = capsule.readInt("multiSamples", 1);
    data = (ArrayList<ByteBuffer>) capsule.readByteBufferArrayList("data", null);
    colorSpace = capsule.readEnum("colorSpace", ColorSpace.class, null);

    if (mipMapSizes != null) {
        needGeneratedMips = false;
        mipsWereGenerated = true;
    }
}
 
Example 2
Source File: Image.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void read(JmeImporter e) throws IOException {
    InputCapsule capsule = e.getCapsule(this);
    format = capsule.readEnum("format", Format.class, Format.RGBA8);
    width = capsule.readInt("width", 0);
    height = capsule.readInt("height", 0);
    depth = capsule.readInt("depth", 0);
    mipMapSizes = capsule.readIntArray("mipMapSizes", null);
    multiSamples = capsule.readInt("multiSamples", 1);
    data = capsule.readByteBufferArrayList("data", null);
    colorSpace = capsule.readEnum("colorSpace", ColorSpace.class, null);

    if (mipMapSizes != null) {
        needGeneratedMips = false;
        mipsWereGenerated = true;
    }
}
 
Example 3
Source File: BitmapCharacter.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    c = (char) ic.readInt("c", 0);
    x = ic.readInt("x", 0);
    y = ic.readInt("y", 0);
    width = ic.readInt("width", 0);
    height = ic.readInt("height", 0);
    xOffset = ic.readInt("xOffset", 0);
    yOffset = ic.readInt("yOffset", 0);
    xAdvance = ic.readInt("xAdvance", 0);

    int[] seconds = ic.readIntArray("seconds", null);
    int[] amounts = ic.readIntArray("amounts", null);

    for (int i = 0; i < seconds.length; i++){
        kerning.put(seconds[i], amounts[i]);
    }
}
 
Example 4
Source File: MBox.java    From Lemur with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter e) throws IOException {
    super.read(e);
    InputCapsule ic = e.getCapsule(this);
    extents = (Vector3f) ic.readSavable("extents", null);
    slices = ic.readIntArray("slices", null);
    sideMask = ic.readInt("sideMask", 0);
}
 
Example 5
Source File: BIHTree.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    mesh = (Mesh) ic.readSavable("mesh", null);
    root = (BIHNode) ic.readSavable("root", null);
    maxTrisPerNode = ic.readInt("tris_per_node", 0);
    pointData = ic.readFloatArray("points", null);
    triIndices = ic.readIntArray("indices", null);
}
 
Example 6
Source File: LodControl.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    trisPerPixel = ic.readFloat("trisPerPixel", 1f);
    distTolerance = ic.readFloat("distTolerance", 1f);
    numLevels = ic.readInt("numLevels", 0);
    numTris = ic.readIntArray("numTris", null);
}
 
Example 7
Source File: PMDMesh.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule c = im.getCapsule(this);
    boneIndexArray = c.readIntArray("boneIndexArray", null);
    boneMatrixArray = new Matrix4f[boneIndexArray.length];
    for(int i=0;i<boneMatrixArray.length;i++) {
        boneMatrixArray[i] = new Matrix4f();
        boneMatrixArray[i].loadIdentity();
    }
}
 
Example 8
Source File: BIHTree.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    mesh = (Mesh) ic.readSavable("mesh", null);
    root = (BIHNode) ic.readSavable("root", null);
    maxTrisPerNode = ic.readInt("tris_per_node", 0);
    pointData = ic.readFloatArray("points", null);
    triIndices = ic.readIntArray("indices", null);
}
 
Example 9
Source File: LodControl.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException{
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    trisPerPixel = ic.readFloat("trisPerPixel", 1f);
    distTolerance = ic.readFloat("distTolerance", 1f);
    numLevels = ic.readInt("numLevels", 0);
    numTris = ic.readIntArray("numTris", null);
}
 
Example 10
Source File: BitmapCharacterSet.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    lineHeight = ic.readInt("lineHeight", 0);
    base = ic.readInt("base", 0);
    renderedSize = ic.readInt("renderedSize", 0);
    width = ic.readInt("width", 0);
    height = ic.readInt("height", 0);
    pageSize = ic.readInt("pageSize", 0);
    int[] styles = ic.readIntArray("styles", null);

    for (int style : styles) {
        characters.put(style, readCharset(ic, style));
    }
}
 
Example 11
Source File: Image.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void read(JmeImporter e) throws IOException {
    InputCapsule capsule = e.getCapsule(this);
    format = capsule.readEnum("format", Format.class, Format.RGBA8);
    width = capsule.readInt("width", 0);
    height = capsule.readInt("height", 0);
    depth = capsule.readInt("depth", 0);
    mipMapSizes = capsule.readIntArray("mipMapSizes", null);
    multiSamples = capsule.readInt("multiSamples", 1);
    data = (ArrayList<ByteBuffer>) capsule.readByteBufferArrayList("data", null);
}