public class GltfLoader extends java.lang.Object implements AssetLoader
Modifier and Type | Class and Description |
---|---|
static class |
GltfLoader.SkinBuffers |
static class |
GltfLoader.WeightData |
Constructor and Description |
---|
GltfLoader() |
Modifier and Type | Method and Description |
---|---|
void |
addToCache(java.lang.String name,
int index,
java.lang.Object object,
int maxLength) |
<T> T |
fetchFromCache(java.lang.String name,
int index,
java.lang.Class<T> type) |
protected byte[] |
getBytes(int bufferIndex,
java.lang.String uri,
java.lang.Integer bufferLength) |
com.google.gson.JsonObject |
getDocRoot() |
AssetInfo |
getInfo() |
Node |
getRootNode() |
java.lang.Object |
load(AssetInfo assetInfo)
Loads asset from the given input stream, parsing it into
an application-usable object.
|
protected java.lang.Object |
loadFromStream(AssetInfo assetInfo,
java.io.InputStream stream) |
void |
readAnimation(int animationIndex) |
java.lang.Object |
readBuffer(java.lang.Integer bufferViewIndex,
int byteOffset,
int count,
java.lang.Object store,
int numComponents,
VertexBuffer.Format format) |
void |
readCameras() |
byte[] |
readData(int bufferIndex) |
Texture2D |
readImage(int sourceIndex,
boolean flip) |
Material |
readMaterial(int materialIndex) |
Geometry[] |
readMeshPrimitives(int meshIndex) |
java.lang.Object |
readNode(int nodeIndex) |
Joint |
readNodeAsBone(int nodeIndex,
int jointIndex,
int skinIndex,
Matrix4f inverseModelBindMatrix) |
Texture2D |
readSampler(int samplerIndex,
Texture2D texture) |
void |
readScenes(com.google.gson.JsonPrimitive defaultScene,
Node rootNode) |
void |
readSkins() |
Texture2D |
readTexture(com.google.gson.JsonObject texture) |
Texture2D |
readTexture(com.google.gson.JsonObject texture,
boolean flip) |
Transform |
readTransforms(com.google.gson.JsonObject nodeData) |
public java.lang.Object load(AssetInfo assetInfo) throws java.io.IOException
AssetLoader
load
in interface AssetLoader
assetInfo
- the located assetjava.io.IOException
- If an I/O error occurs while loadingprotected java.lang.Object loadFromStream(AssetInfo assetInfo, java.io.InputStream stream) throws java.io.IOException
java.io.IOException
public void readScenes(com.google.gson.JsonPrimitive defaultScene, Node rootNode) throws java.io.IOException
java.io.IOException
public java.lang.Object readNode(int nodeIndex) throws java.io.IOException
java.io.IOException
public Transform readTransforms(com.google.gson.JsonObject nodeData)
public Geometry[] readMeshPrimitives(int meshIndex) throws java.io.IOException
java.io.IOException
public java.lang.Object readBuffer(java.lang.Integer bufferViewIndex, int byteOffset, int count, java.lang.Object store, int numComponents, VertexBuffer.Format format) throws java.io.IOException
java.io.IOException
public byte[] readData(int bufferIndex) throws java.io.IOException
java.io.IOException
protected byte[] getBytes(int bufferIndex, java.lang.String uri, java.lang.Integer bufferLength) throws java.io.IOException
java.io.IOException
public Material readMaterial(int materialIndex) throws java.io.IOException
java.io.IOException
public void readCameras() throws java.io.IOException
java.io.IOException
public Texture2D readTexture(com.google.gson.JsonObject texture) throws java.io.IOException
java.io.IOException
public Texture2D readTexture(com.google.gson.JsonObject texture, boolean flip) throws java.io.IOException
java.io.IOException
public Texture2D readImage(int sourceIndex, boolean flip) throws java.io.IOException
java.io.IOException
public void readAnimation(int animationIndex) throws java.io.IOException
java.io.IOException
public Texture2D readSampler(int samplerIndex, Texture2D texture) throws java.io.IOException
java.io.IOException
public void readSkins() throws java.io.IOException
java.io.IOException
public Joint readNodeAsBone(int nodeIndex, int jointIndex, int skinIndex, Matrix4f inverseModelBindMatrix) throws java.io.IOException
java.io.IOException
public <T> T fetchFromCache(java.lang.String name, int index, java.lang.Class<T> type)
public void addToCache(java.lang.String name, int index, java.lang.Object object, int maxLength)
public AssetInfo getInfo()
public com.google.gson.JsonObject getDocRoot()
public Node getRootNode()