Class MaterialComponent

java.lang.Object
gaiasky.scene.record.NamedComponent
gaiasky.scene.record.MaterialComponent
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IObserver, IUpdatable<MaterialComponent>, IComponent, IMaterialProvider

public class MaterialComponent extends NamedComponent implements IObserver, IMaterialProvider, IUpdatable<MaterialComponent>
A basic component that fully describes the material of an object. It contains basic textures (diffuse, specular, reflection, emissive, etc.), cubemaps (same as textures), and even some sparse virtual texture trees (SVT).
  • Field Details

  • Constructor Details

    • MaterialComponent

      public MaterialComponent()
  • Method Details

    • initialize

      public void initialize(String name, com.badlogic.gdx.assets.AssetManager manager)
    • initialize

      public void initialize(String name)
      Specified by:
      initialize in interface IComponent
      Overrides:
      initialize in class NamedComponent
    • isFinishedLoading

      public boolean isFinishedLoading(com.badlogic.gdx.assets.AssetManager manager)
    • hasSVT

      public boolean hasSVT()
    • initMaterial

      public void initMaterial(com.badlogic.gdx.assets.AssetManager manager, IntModelInstance instance, float[] diffuseCol, boolean culling)
    • initMaterial

      public void initMaterial(com.badlogic.gdx.assets.AssetManager manager, Material mat, Material ring, float[] diffuseCol, boolean culling)
    • setGenerated

      public void setGenerated(boolean generated)
    • getMaterial

      public Material getMaterial()
      Specified by:
      getMaterial in interface IMaterialProvider
    • getRingMaterial

      public Material getRingMaterial()
    • setBase

      @Deprecated public void setBase(String diffuse)
      Deprecated.
      use setDiffuse(String) instead
    • setDiffuse

      public void setDiffuse(String diffuse)
    • setSpecular

      public void setSpecular(String specular)
    • setSpecular

      public void setSpecular(Double specular)
    • setSpecular

      public void setSpecular(double[] specular)
    • setNormal

      public void setNormal(String normal)
    • setNight

      @Deprecated public void setNight(String emissive)
      Deprecated.
    • setEmissive

      public void setEmissive(String emissive)
    • setEmissive

      public void setEmissive(Double emissive)
    • setEmissive

      public void setEmissive(double[] emissive)
    • setRing

      public void setRing(String ring)
    • setRingnormal

      public void setRingnormal(String ringnormal)
    • setHeight

      public void setHeight(String height)
    • setHeightScaleKm

      public void setHeightScaleKm(Double heightScale)
    • setHeightScaleM

      public void setHeightScaleM(Double heightScale)
    • setHeightScale

      public void setHeightScale(Double heightScale)
    • setHeightMapTopKm

      public void setHeightMapTopKm(Double heightMapTopKm)
    • setHeightMapTopM

      public void setHeightMapTopM(Double heightMapTopM)
    • setColorIfTexture

      public void setColorIfTexture(Boolean colorIfTexture)
    • setNoise

      public void setNoise(NoiseComponent noise)
    • setBiomelut

      public void setBiomelut(String biomeLookupTex)
    • setBiomehueshift

      public void setBiomehueshift(Double hueShift)
    • setReflection

      @Deprecated public void setReflection(Double metallicColor)
      Deprecated.
    • setMetallic

      public void setMetallic(Double metallicColor)
    • setMetallic

      public void setMetallic(String metallic)
    • setReflection

      public void setReflection(double[] metallic)
    • setRoughness

      public void setRoughness(String roughness)
    • setRoughness

      public void setRoughness(Double roughness)
    • setAo

      public void setAo(String ao)
    • setDiffuseCubemap

      public void setDiffuseCubemap(String cubemap)
    • setNormalCubemap

      public void setNormalCubemap(String cubemap)
    • setSpecularCubemap

      public void setSpecularCubemap(String cubemap)
    • setEmissiveColormap

      public void setEmissiveColormap(String cubemap)
    • setHeightCubemap

      public void setHeightCubemap(String cubemap)
    • setMetallicCubemap

      public void setMetallicCubemap(String cubemap)
    • setRoughnessCubemap

      public void setRoughnessCubemap(String cubemap)
    • setReflectionCubemap

      public void setReflectionCubemap(String reflectionCubemap)
    • setSkybox

      public void setSkybox(String diffuseCubemap)
    • setDiffuseSVT

      public void setDiffuseSVT(VirtualTextureComponent virtualTextureComponent)
    • setDiffuseSVT

      public void setDiffuseSVT(Map<Object,Object> virtualTexture)
    • setSpecularSVT

      public void setSpecularSVT(VirtualTextureComponent virtualTextureComponent)
    • setSpecularSVT

      public void setSpecularSVT(Map<Object,Object> virtualTexture)
    • setNormalSVT

      public void setNormalSVT(VirtualTextureComponent virtualTextureComponent)
    • setNormalSVT

      public void setNormalSVT(Map<Object,Object> virtualTexture)
    • setHeightSVT

      public void setHeightSVT(VirtualTextureComponent virtualTextureComponent)
    • setHeightSVT

      public void setHeightSVT(Map<Object,Object> virtualTexture)
    • setEmissiveSVT

      public void setEmissiveSVT(VirtualTextureComponent virtualTextureComponent)
    • setEmissiveSVT

      public void setEmissiveSVT(Map<Object,Object> virtualTexture)
    • setMetallicSVT

      public void setMetallicSVT(VirtualTextureComponent virtualTextureComponent)
    • setMetallicSVT

      public void setMetallicSVT(Map<Object,Object> virtualTexture)
    • setRoughnessSVT

      public void setRoughnessSVT(VirtualTextureComponent virtualTextureComponent)
    • setRoughnessSVT

      public void setRoughnessSVT(Map<Object,Object> virtualTexture)
    • convertToComponent

      public static VirtualTextureComponent convertToComponent(Map<Object,Object> map)
    • hasHeight

      public boolean hasHeight()
    • disposeTexture

      public void disposeTexture(com.badlogic.gdx.assets.AssetManager manager, Material material, String name, String nameUnpacked, int attributeIndex, com.badlogic.gdx.graphics.Texture tex)
    • disposeCubemap

      public void disposeCubemap(com.badlogic.gdx.assets.AssetManager manager, Material mat, int attributeIndex, CubemapComponent cubemap)
    • disposeTextures

      public void disposeTextures(com.badlogic.gdx.assets.AssetManager manager)
      Disposes and unloads all currently loaded textures immediately
      Parameters:
      manager - The asset manager
    • notify

      public void notify(Event event, Object source, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      source - The source object, if any.
      data - The data associated with this event.
    • getTexturesString

      public String getTexturesString()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • copyFrom

      public void copyFrom(MaterialComponent other)
    • randomizeAll

      public void randomizeAll(long seed, double bodySize)
    • print

      public void print(Logger.Log log)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
    • updateWith

      public void updateWith(MaterialComponent object)
      Specified by:
      updateWith in interface IUpdatable<MaterialComponent>