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) static voidregisterDefaultExtrasLoader(Class<? extends ExtrasLoader> loader) Sets the default extras loader used when no loader is specified in the GltfModelKey.static voidregisterExtension(String name, Class<? extends ExtensionLoader> ext) static voidUnregisters the default extras loader.static voidunregisterExtension(String name)  
- 
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
 - 
registerExtension
 - 
unregisterExtension
 - 
registerDefaultExtrasLoader
Sets the default extras loader used when no loader is specified in the GltfModelKey.- Parameters:
 loader- the default extras loader.
 - 
unregisterDefaultExtrasLoader
public static void unregisterDefaultExtrasLoader()Unregisters the default extras loader. 
 -