Class GltfLoader

java.lang.Object
com.jme3.scene.plugins.gltf.GltfLoader
All Implemented Interfaces:
com.jme3.asset.AssetLoader
Direct Known Subclasses:
GlbLoader

public class GltfLoader extends Object implements com.jme3.asset.AssetLoader
GLTF 2.0 loader Created by Nehon on 07/08/2017.
  • Constructor Details

    • GltfLoader

      public GltfLoader()
  • Method Details

    • load

      public Object load(com.jme3.asset.AssetInfo assetInfo) throws IOException
      Specified by:
      load in interface com.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

      public Object readNode(int nodeIndex) throws IOException
      Throws:
      IOException
    • readTransforms

      public com.jme3.math.Transform readTransforms(com.jme3.plugins.json.JsonObject nodeData)
    • readMeshPrimitives

      public com.jme3.scene.Geometry[] readMeshPrimitives(int meshIndex) throws IOException
      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

      public byte[] readData(int bufferIndex) throws IOException
      Throws:
      IOException
    • getBytes

      protected byte[] getBytes(int bufferIndex, String uri, Integer bufferLength) throws IOException
      Throws:
      IOException
    • readMaterial

      public com.jme3.material.Material readMaterial(int materialIndex) throws IOException
      Throws:
      IOException
    • readCameras

      public void readCameras() throws IOException
      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

      public com.jme3.texture.Texture2D readImage(int sourceIndex, boolean flip) throws IOException
      Throws:
      IOException
    • readAnimation

      public void readAnimation(int animationIndex) throws IOException
      Throws:
      IOException
    • readSampler

      public com.jme3.texture.Texture2D readSampler(int samplerIndex, com.jme3.texture.Texture2D texture) throws IOException
      Throws:
      IOException
    • readSkins

      public void readSkins() throws IOException
      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

      public <T> T fetchFromCache(String name, int index, Class<T> type)
    • addToCache

      public void addToCache(String name, int index, Object object, int maxLength)
    • getInfo

      public com.jme3.asset.AssetInfo getInfo()
    • getDocRoot

      public com.jme3.plugins.json.JsonObject getDocRoot()
    • getRootNode

      public com.jme3.scene.Node getRootNode()
    • registerExtension

      public static void registerExtension(String name, Class<? extends ExtensionLoader> ext)
    • unregisterExtension

      public static void unregisterExtension(String name)
    • registerDefaultExtrasLoader

      public static void registerDefaultExtrasLoader(Class<? extends ExtrasLoader> loader)
      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.