Example usage for com.badlogic.gdx.utils JsonValue getShort

List of usage examples for com.badlogic.gdx.utils JsonValue getShort

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils JsonValue getShort.

Prototype

public short getShort(int index) 

Source Link

Document

Finds the child with the specified index and returns it as a short.

Usage

From source file:com.mbrlabs.mundus.commons.g3d.MG3dModelLoader.java

License:Apache License

public ModelData parseModel(FileHandle handle) {
    JsonValue json = reader.parse(handle);
    ModelData model = new ModelData();
    JsonValue version = json.require("version");
    model.version[0] = version.getShort(0);
    model.version[1] = version.getShort(1);
    if (model.version[0] != VERSION_HI || model.version[1] != VERSION_LO)
        throw new GdxRuntimeException("Model version not supported");

    model.id = json.getString("id", "");
    parseMeshes(model, json);//from   w  w w .ja v  a2  s.  c  o  m
    parseMaterials(model, json, handle.parent().path());
    parseNodes(model, json);
    parseAnimations(model, json);
    return model;
}