Class DracoMeshCompressionExtensionLoader

java.lang.Object
com.jme3.scene.plugins.gltf.DracoMeshCompressionExtensionLoader
All Implemented Interfaces:
ExtensionLoader

public class DracoMeshCompressionExtensionLoader extends Object implements ExtensionLoader
A class for handling the KHR_draco_mesh_compression extension when loading a glTF asset. It is registered as the handler for this extension in the glTF CustomContentManager. In the GltfLoader.readMeshPrimitives(int) method, the custom content handler will be called for each mesh primitive, and handle the KHR_draco_mesh_compression of the primitive by calling the handleExtension(com.jme3.scene.plugins.gltf.GltfLoader, java.lang.String, com.jme3.plugins.json.JsonElement, com.jme3.plugins.json.JsonElement, java.lang.Object) method of this class. TODO_DRACO Strictly speaking, the loader should ignore any attribute definitions when the draco extension is present. Right now, this is called after the mesh was already filled with the vertex buffers that have been created by the default loading process. See the check for "bufferViewIndex == null" in VertexBufferPopulator.
  • Constructor Details

    • DracoMeshCompressionExtensionLoader

      public DracoMeshCompressionExtensionLoader()
  • Method Details

    • handleExtension

      public Object handleExtension(GltfLoader loader, String parentName, com.jme3.plugins.json.JsonElement parent, com.jme3.plugins.json.JsonElement extension, Object input) throws IOException
      • The parentName will be "primitive"
      • The parent" will be the JSON element that represents the mesh primitive from the glTF JSON.
      • The extension will be the JSON element that represents the KHR_draco_mesh_compression extension object.
      Handles a glTF extension.
      Specified by:
      handleExtension in interface ExtensionLoader
      Parameters:
      loader - the GltfLoader with all the data structures
      parentName - the name of the element being read
      parent - the element being read
      extension - the content of the extension found in the element being read
      input - an object containing already loaded data from the element, probably a JME object
      Returns:
      An object of the same type as input, containing the data from the input object and the eventual additional data read from the extension
      Throws:
      IOException - for various error conditions