Package com.jme3.scene.plugins.gltf
Class GltfLoader
java.lang.Object
com.jme3.scene.plugins.gltf.GltfLoader
- All Implemented Interfaces:
AssetLoader
- Direct Known Subclasses:
GlbLoader
GLTF 2.0 loader
Created by Nehon on 07/08/2017.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCache(String name, int index, Object object, int maxLength) <T> TfetchFromCache(String name, int index, Class<T> type) protected byte[]com.google.gson.JsonObjectgetInfo()Loads asset from the given input stream, parsing it into an application-usable object.protected ObjectloadFromStream(AssetInfo assetInfo, InputStream stream) voidreadAnimation(int animationIndex) readBuffer(Integer bufferViewIndex, int byteOffset, int count, Object store, int numComponents, VertexBuffer.Format format) voidbyte[]readData(int bufferIndex) readImage(int sourceIndex, boolean flip) readMaterial(int materialIndex) Geometry[]readMeshPrimitives(int meshIndex) readNode(int nodeIndex) readNodeAsBone(int nodeIndex, int jointIndex, int skinIndex, Matrix4f inverseModelBindMatrix) readSampler(int samplerIndex, Texture2D texture) voidreadScenes(com.google.gson.JsonPrimitive defaultScene, Node rootNode) voidreadTexture(com.google.gson.JsonObject texture) readTexture(com.google.gson.JsonObject texture, boolean flip) readTransforms(com.google.gson.JsonObject nodeData)
-
Constructor Details
-
GltfLoader
public GltfLoader()
-
-
Method Details
-
load
Description copied from interface:AssetLoaderLoads asset from the given input stream, parsing it into an application-usable object.- Specified by:
loadin interfaceAssetLoader- Parameters:
assetInfo- the located asset- Returns:
- An object representing the resource.
- Throws:
IOException- If an I/O error occurs while loading
-
loadFromStream
- Throws:
IOException
-
readScenes
public void readScenes(com.google.gson.JsonPrimitive defaultScene, Node rootNode) throws IOException - Throws:
IOException
-
readNode
- Throws:
IOException
-
readTransforms
-
readMeshPrimitives
- Throws:
IOException
-
readBuffer
public Object readBuffer(Integer bufferViewIndex, int byteOffset, int count, Object store, int numComponents, VertexBuffer.Format format) throws IOException - Throws:
IOException
-
readData
- Throws:
IOException
-
getBytes
- Throws:
IOException
-
readMaterial
- Throws:
IOException
-
readCameras
- Throws:
IOException
-
readTexture
- Throws:
IOException
-
readTexture
- Throws:
IOException
-
readImage
- Throws:
IOException
-
readAnimation
- Throws:
IOException
-
readSampler
- Throws:
IOException
-
readSkins
- Throws:
IOException
-
readNodeAsBone
public Joint readNodeAsBone(int nodeIndex, int jointIndex, int skinIndex, Matrix4f inverseModelBindMatrix) throws IOException - Throws:
IOException
-
fetchFromCache
-
addToCache
-
getInfo
-
getDocRoot
public com.google.gson.JsonObject getDocRoot() -
getRootNode
-