Class GltfModelKey

java.lang.Object
com.jme3.asset.AssetKey<Spatial>
com.jme3.asset.ModelKey
com.jme3.scene.plugins.gltf.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 https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md 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)
      Parameters:
      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 https://github.com/KhronosGroup/glTF/blob/master/extensions/README.md
      Parameters:
      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.
      Parameters:
      extrasLoader - the desired loader
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class AssetKey<Spatial>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AssetKey<Spatial>