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 TypeMethodDescriptionbooleanaccepts(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.MaterialcreateMaterial(com.jme3.asset.AssetManager assetManager, com.jme3.asset.AssetKey<?> assetKey, GltfMaterialData gltfMaterialData) Creates a new material from the given material data.
-
Method Details
-
accepts
Checks, if the factory is able to create a new material from the given material data. If it accepts the material data, thecreateMaterial(AssetManager, AssetKey, GltfMaterialData)method can be used to create a new material.- Parameters:
assetKey- TheAssetKeyused for loading the GLTF model.gltfMaterialData- TheGltfMaterialDatacontaining 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- TheAssetManagerinstance.assetKey- TheAssetKeyused for loading the GLTF model.gltfMaterialData- TheGltfMaterialDatacontaining all available GLTF material data.- Returns:
- The new created
Material.
-