Interface GltfMaterialFactory

All Known Implementing Classes:
PBRLightingMaterialFactory, UnshadedMaterialFactory

public interface GltfMaterialFactory
A material factory creates Materials based on the data of a single material from a GLTF file.

All material factories have bo be registered with the GltfLoader by using one of its static register methods.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(com.jme3.asset.AssetKey<?> assetKey, GltfMaterialData gltfMaterialData)
    Checks, if the factory is able to create a new material from the given material data.
    com.jme3.material.Material
    createMaterial(com.jme3.asset.AssetManager assetManager, com.jme3.asset.AssetKey<?> assetKey, GltfMaterialData gltfMaterialData)
    Creates a new material from the given material data.
  • Method Details

    • accepts

      boolean accepts(com.jme3.asset.AssetKey<?> assetKey, GltfMaterialData gltfMaterialData)
      Checks, if the factory is able to create a new material from the given material data. If it accepts the material data, the createMaterial(AssetManager, AssetKey, GltfMaterialData) method can be used to create a new material.
      Parameters:
      assetKey - The AssetKey used for loading the GLTF model.
      gltfMaterialData - The GltfMaterialData containing all available GLTF material data.
      Returns:
      true if the factory is able to create a material from the given material data, otherwise false.
    • createMaterial

      com.jme3.material.Material createMaterial(com.jme3.asset.AssetManager assetManager, com.jme3.asset.AssetKey<?> assetKey, GltfMaterialData gltfMaterialData)
      Creates a new material from the given material data.
      Parameters:
      assetManager - The AssetManager instance.
      assetKey - The AssetKey used for loading the GLTF model.
      gltfMaterialData - The GltfMaterialData containing all available GLTF material data.
      Returns:
      The new created Material.