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.google.gson.JsonElement parent, com.google.gson.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.google.gson.JsonObject extras)
    • applyToArray

      protected void applyToArray(Object array, com.google.gson.JsonObject extras)
    • applyToSpatial

      protected void applyToSpatial(Spatial spatial, com.google.gson.JsonObject extras)
    • toAttribute

      protected Object toAttribute(com.google.gson.JsonElement el, boolean nested)
    • toAttribute

      protected Object toAttribute(com.google.gson.JsonObject jo, boolean nested)
    • toAttribute

      protected Object toAttribute(com.google.gson.JsonArray ja, boolean nested)
    • toAttribute

      protected Object toAttribute(com.google.gson.JsonPrimitive jp, boolean nested)