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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic class
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddToCache(String name, int index, Object object, int maxLength) <T> TfetchFromCache(String name, int index, Class<T> type) protected byte[]com.jme3.plugins.json.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.jme3.plugins.json.JsonPrimitive defaultScene, Node rootNode) voidreadTexture(com.jme3.plugins.json.JsonObject texture) readTexture(com.jme3.plugins.json.JsonObject texture, boolean flip) readTransforms(com.jme3.plugins.json.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- 
GltfLoaderpublic GltfLoader()
 
- 
- 
Method Details- 
loadDescription copied from interface:AssetLoaderLoads asset from the given input stream, parsing it into an application-usable object.- Specified by:
- loadin interface- AssetLoader
- Parameters:
- assetInfo- the located asset
- Returns:
- An object representing the resource.
- Throws:
- IOException- If an I/O error occurs while loading
 
- 
loadFromStream- Throws:
- IOException
 
- 
readScenespublic void readScenes(com.jme3.plugins.json.JsonPrimitive defaultScene, Node rootNode) throws IOException - Throws:
- IOException
 
- 
readNode- Throws:
- IOException
 
- 
readTransforms
- 
readMeshPrimitives- Throws:
- IOException
 
- 
readBufferpublic 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
 
- 
readTexturepublic Texture2D readTexture(com.jme3.plugins.json.JsonObject texture, boolean flip) throws IOException - Throws:
- IOException
 
- 
readImage- Throws:
- IOException
 
- 
readAnimation- Throws:
- IOException
 
- 
readSampler- Throws:
- IOException
 
- 
readSkins- Throws:
- IOException
 
- 
readNodeAsBonepublic Joint readNodeAsBone(int nodeIndex, int jointIndex, int skinIndex, Matrix4f inverseModelBindMatrix) throws IOException - Throws:
- IOException
 
- 
fetchFromCache
- 
addToCache
- 
getInfo
- 
getDocRootpublic com.jme3.plugins.json.JsonObject getDocRoot()
- 
getRootNode
- 
registerExtension
- 
unregisterExtension
- 
registerDefaultExtrasLoaderSets the default extras loader used when no loader is specified in the GltfModelKey.- Parameters:
- loader- the default extras loader.
 
- 
unregisterDefaultExtrasLoaderpublic static void unregisterDefaultExtrasLoader()Unregisters the default extras loader.
 
-