Class UserDataLoader

java.lang.Object
com.jme3.scene.plugins.gltf.UserDataLoader
All Implemented Interfaces:
ExtrasLoader

public class UserDataLoader extends Object implements ExtrasLoader
Import user data from glTF extras. Derived from Simsilica JmeConvert (https://github.com/Simsilica/JmeConvert/blob/master/src/main/java/com/simsilica/jmec/gltf/GltfExtrasLoader.java) by Paul Speed (Copyright (c) 2019, Simsilica, LLC)
  • Constructor Details

    • UserDataLoader

      public UserDataLoader()
  • Method Details

    • handleExtras

      public Object handleExtras(GltfLoader loader, String parentName, com.jme3.plugins.json.JsonElement parent, com.jme3.plugins.json.JsonElement extras, Object input)
      Description copied from interface: ExtrasLoader
      Handles a glTF extra. This method will be invoked every time an "extras" element is found in the glTF file. The parentName indicates where the "extras" element was found.
      Specified by:
      handleExtras in interface ExtrasLoader
      Parameters:
      loader - the GltfLoader with all the data structures
      parentName - the name of the element being read
      parent - the element being read
      extras - the content of the extras found in the element being read
      input - an object containing already loaded data from the element, this is most 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 extras
    • apply

      protected void apply(Object input, com.jme3.plugins.json.JsonObject extras)
    • applyToArray

      protected void applyToArray(Object array, com.jme3.plugins.json.JsonObject extras)
    • applyToSpatial

      protected void applyToSpatial(Spatial spatial, com.jme3.plugins.json.JsonObject extras)
    • toAttribute

      protected Object toAttribute(com.jme3.plugins.json.JsonElement el, boolean nested)
    • toAttribute

      protected Object toAttribute(com.jme3.plugins.json.JsonObject jo, boolean nested)
    • toAttribute

      protected Object toAttribute(com.jme3.plugins.json.JsonArray ja, boolean nested)
    • toAttribute

      protected Object toAttribute(com.jme3.plugins.json.JsonPrimitive jp, boolean nested)