Package com.jme3.scene.plugins.gltf
Class GltfLoader
java.lang.Object
com.jme3.scene.plugins.gltf.GltfLoader
- All Implemented Interfaces:
com.jme3.asset.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.jme3.plugins.json.JsonObjectcom.jme3.asset.AssetInfogetInfo()com.jme3.scene.Nodeload(com.jme3.asset.AssetInfo assetInfo) protected ObjectloadFromStream(com.jme3.asset.AssetInfo assetInfo, InputStream stream) voidreadAnimation(int animationIndex) readBuffer(Integer bufferViewIndex, int byteOffset, int count, Object store, int numComponents, com.jme3.scene.VertexBuffer.Format format) voidbyte[]readData(int bufferIndex) com.jme3.texture.Texture2DreadImage(int sourceIndex, boolean flip) com.jme3.material.MaterialreadMaterial(int materialIndex) com.jme3.scene.Geometry[]readMeshPrimitives(int meshIndex) readNode(int nodeIndex) com.jme3.anim.JointreadNodeAsBone(int nodeIndex, int jointIndex, int skinIndex, com.jme3.math.Matrix4f inverseModelBindMatrix) com.jme3.texture.Texture2DreadSampler(int samplerIndex, com.jme3.texture.Texture2D texture) voidreadScenes(com.jme3.plugins.json.JsonPrimitive defaultScene, com.jme3.scene.Node rootNode) voidcom.jme3.texture.Texture2DreadTexture(com.jme3.plugins.json.JsonObject texture) com.jme3.texture.Texture2DreadTexture(com.jme3.plugins.json.JsonObject texture, boolean flip) com.jme3.math.TransformreadTransforms(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
-
GltfLoader
public GltfLoader()
-
-
Method Details
-
load
- Specified by:
loadin interfacecom.jme3.asset.AssetLoader- Throws:
IOException
-
loadFromStream
protected Object loadFromStream(com.jme3.asset.AssetInfo assetInfo, InputStream stream) throws IOException - Throws:
IOException
-
readScenes
public void readScenes(com.jme3.plugins.json.JsonPrimitive defaultScene, com.jme3.scene.Node rootNode) throws IOException - Throws:
IOException
-
readNode
- Throws:
IOException
-
readTransforms
public com.jme3.math.Transform readTransforms(com.jme3.plugins.json.JsonObject nodeData) -
readMeshPrimitives
- Throws:
IOException
-
readBuffer
public Object readBuffer(Integer bufferViewIndex, int byteOffset, int count, Object store, int numComponents, com.jme3.scene.VertexBuffer.Format format) throws IOException - Throws:
IOException
-
readData
- Throws:
IOException
-
getBytes
- Throws:
IOException
-
readMaterial
- Throws:
IOException
-
readCameras
- Throws:
IOException
-
readTexture
public com.jme3.texture.Texture2D readTexture(com.jme3.plugins.json.JsonObject texture) throws IOException - Throws:
IOException
-
readTexture
public com.jme3.texture.Texture2D readTexture(com.jme3.plugins.json.JsonObject texture, boolean flip) throws IOException - Throws:
IOException
-
readImage
- Throws:
IOException
-
readAnimation
- Throws:
IOException
-
readSampler
public com.jme3.texture.Texture2D readSampler(int samplerIndex, com.jme3.texture.Texture2D texture) throws IOException - Throws:
IOException
-
readSkins
- Throws:
IOException
-
readNodeAsBone
public com.jme3.anim.Joint readNodeAsBone(int nodeIndex, int jointIndex, int skinIndex, com.jme3.math.Matrix4f inverseModelBindMatrix) throws IOException - Throws:
IOException
-
fetchFromCache
-
addToCache
-
getInfo
public com.jme3.asset.AssetInfo getInfo() -
getDocRoot
public com.jme3.plugins.json.JsonObject getDocRoot() -
getRootNode
public com.jme3.scene.Node 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.
-