Class GltfMaterialData

java.lang.Object
com.jme3.scene.plugins.gltf.GltfMaterialData

public class GltfMaterialData extends Object
Stores all data of a single material from a GLTF file. This data can then be used by a GltfMaterialFactory to create a new material.

Parameter naming convention

  • Parameter names should use single dots '.' as a separator.
  • All standard parameter names are directly taken from the GLTF specs document (ยง 5.19. Material and following).
  • All additional parameter names from GLTF extensions should start with MATERIAL_EXTENSION_PARAM_PREFIX followed by the name of the extension (e.g. "KHR_materials_unlit") and finished by the parameter name.
  • All additional parameter names from GLTF extras should start with MATERIAL_EXTRA_PARAM_PREFIX.
  • Field Details

  • Constructor Details

    • GltfMaterialData

      public GltfMaterialData()
  • Method Details

    • hasGltfExtension

      public boolean hasGltfExtension(String gltfExtension)
      Checks if the material provides the given GLTF extension.
      Parameters:
      gltfExtension - The GLTF extension name.
      Returns:
      true if the material provides the given GLTF extension, otherwise false.
    • addGltfExtension

      public void addGltfExtension(String gltfExtension)
      Adds the given GLTF extension name.
      Parameters:
      gltfExtension - The GLTF extension name.
    • removeGltfExtension

      public void removeGltfExtension(String gltfExtension)
      Removes the given GLTF extension name.
      Parameters:
      gltfExtension - The GLTF extension name.
    • containsGltfParam

      public boolean containsGltfParam(String gltfParamName)
      Checks if the material provides a material parameter with the given name.
      Parameters:
      gltfParamName - The GLTF parameter name.
      Returns:
      true if the material provides a material parameter with the given name, otherwise false.
    • getGltfParam

      public Object getGltfParam(String gltfParamName)
      Gets the material parameter with the given name.
      Parameters:
      gltfParamName - The GLTF parameter name.
      Returns:
      The value of the material parameter with the given name, or null if no such parameter exists.
    • setGltfParam

      public void setGltfParam(String gltfParamName, Object value)
      Adds a material parameter with the given name and value.
      Parameters:
      gltfParamName - The GLTF parameter name.
      value - The value of the material parameter. Does nothing, if value is null.
    • removeGltfParam

      public Object removeGltfParam(String gltfParamName)
      Removes the material parameter with the given name.
      Parameters:
      gltfParamName - The GLTF parameter name.
      Returns:
      The previous value of the material parameter, or null if there was no such parameter.
    • hasVertexColors

      public boolean hasVertexColors()
      Returns:
      Indicates the existence of a vertex color buffer.
    • setHasVertexColors

      public void setHasVertexColors(boolean hasVertexColors)
      Sets the vertex color flag.
      Parameters:
      hasVertexColors - The value to set.