Package com.jme3.scene.plugins.gltf
Class DracoMeshCompressionExtensionLoader
java.lang.Object
com.jme3.scene.plugins.gltf.DracoMeshCompressionExtensionLoader
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleExtension(GltfLoader loader, String parentName, com.jme3.plugins.json.JsonElement parent, com.jme3.plugins.json.JsonElement extension, Object input) TheparentNamewill be"primitive"Theparent" will be the JSON element that represents the mesh primitive from the glTF JSON. Theextensionwill be the JSON element that represents theKHR_draco_mesh_compressionextension object. Handles a glTF extension.
-
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
parentNamewill be"primitive" - The
parent" will be the JSON element that represents the mesh primitive from the glTF JSON. - The
extensionwill be the JSON element that represents theKHR_draco_mesh_compressionextension object.
- Specified by:
handleExtensionin interfaceExtensionLoader- Parameters:
loader- the GltfLoader with all the data structuresparentName- the name of the element being readparent- the element being readextension- the content of the extension found in the element being readinput- 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
- The
-