Class GltfModelKey

All Implemented Interfaces:
Savable, Cloneable

public class GltfModelKey extends ModelKey
An optional key to use when loading a glTF file It allows you to specify custom data loader, replacing the default ones. MaterialAdapters: Allows you to map glTF standard material model to a non-stock material. ExtensionLoaders: Allows you to provide or override a loader for a given glTF extension. ExtrasLoader: Allows you to load any extras, application specific data of the glTF file. For more information, please see glTF 2.0 specifications Created by Nehon on 08/08/2017.
  • Constructor Details

    • GltfModelKey

      public GltfModelKey(String name)
    • GltfModelKey

      public GltfModelKey()
  • Method Details

    • registerMaterialAdapter

      public void registerMaterialAdapter(String gltfMaterialName, MaterialAdapter adapter)
      Registers a MaterialAdapter for the given materialName. The materialName must be "pbrMetallicRoughness" or any name from KHR_materials glTF Extension (for example "pbrSpecularGlossiness" for "KHR_materials_pbrSpecularGlossiness" extension)
      gltfMaterialName - the name of the gltf material
      adapter - the material adapter
    • registerExtensionLoader

      public void registerExtensionLoader(String extensionName, ExtensionLoader loader)
      Registers an extension loader for the given extension name. For more information on extension please see glTF 2.0 extensions registry
      extensionName - the name of the extension
      loader - the Extension loader
    • getAdapterForMaterial

      public MaterialAdapter getAdapterForMaterial(String gltfMaterialName)
    • getExtensionLoader

      public ExtensionLoader getExtensionLoader(String extensionName)
    • isKeepSkeletonPose

      public boolean isKeepSkeletonPose()
    • setKeepSkeletonPose

      public void setKeepSkeletonPose(boolean keepSkeletonPose)
    • getExtrasLoader

      public ExtrasLoader getExtrasLoader()
    • setExtrasLoader

      public void setExtrasLoader(ExtrasLoader extrasLoader)
      Sets the ExtrasLoader for reading any extra information from the gltf file.
      extrasLoader - the desired loader