Class ModelComponent

  • All Implemented Interfaces:
    com.badlogic.gdx.utils.Disposable, IObserver

    public class ModelComponent
    extends java.lang.Object
    implements com.badlogic.gdx.utils.Disposable, IObserver
    • Field Detail

      • forceInit

        public boolean forceInit
      • env

        public com.badlogic.gdx.graphics.g3d.Environment env
      • dLight

        public com.badlogic.gdx.graphics.g3d.environment.DirectionalLight dLight
        Directional light
      • params

        public java.util.Map<java.lang.String,​java.lang.Object> params
      • type

        public java.lang.String type
      • modelFile

        public java.lang.String modelFile
      • scale

        public double scale
      • culling

        public boolean culling
    • Constructor Detail

      • ModelComponent

        public ModelComponent()
      • ModelComponent

        public ModelComponent​(java.lang.Boolean initEnvironment)
    • Method Detail

      • toggleAmbientLight

        public static void toggleAmbientLight​(boolean on)
      • setAmbientLight

        public static void setAmbientLight​(float level)
        Sets the ambient light
        Parameters:
        level - Ambient light level between 0 and 1
      • initialize

        public void initialize()
      • initialize

        public void initialize​(boolean mesh)
      • doneLoading

        public void doneLoading​(com.badlogic.gdx.assets.AssetManager manager,
                                com.badlogic.gdx.math.Matrix4 localTransform,
                                float[] cc)
      • doneLoading

        public void doneLoading​(com.badlogic.gdx.assets.AssetManager manager,
                                com.badlogic.gdx.math.Matrix4 localTransform,
                                float[] cc,
                                boolean mesh)
      • update

        public void update​(com.badlogic.gdx.math.Matrix4 localTransform,
                           float alpha,
                           int blendSrc,
                           int blendDst)
      • update

        public void update​(com.badlogic.gdx.math.Matrix4 localTransform,
                           float alpha)
      • update

        public void update​(float alpha)
      • touch

        public void touch()
      • touch

        public void touch​(com.badlogic.gdx.math.Matrix4 localTransform)
        Initialises the model or texture if LAZY_X_INIT is on
      • addColorToMat

        public void addColorToMat()
      • addDirectionalLight

        public void addDirectionalLight​(float r,
                                        float g,
                                        float b,
                                        float x,
                                        float y,
                                        float z)
      • dispose

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

        public void setTransparency​(float alpha,
                                    int src,
                                    int dst)
      • setDepthTest

        public void setDepthTest​(int func,
                                 boolean mask)
      • setTransparency

        public void setTransparency​(float alpha)
      • setTransparencyColor

        public void setTransparencyColor​(float alpha)
      • setType

        public void setType​(java.lang.String type)
        Sets the type of the model to construct.
        Parameters:
        type - The type. Currently supported types are sphere|cylinder|ring|disc.
      • setModel

        public void setModel​(java.lang.String model)
        Sets the model file path (this must be a .g3db, .g3dj or .obj).
        Parameters:
        model -
      • setStaticlight

        public void setStaticlight​(java.lang.String staticLight)
      • setStaticlight

        public void setStaticlight​(java.lang.Boolean staticLight)
      • setStaticlight

        public void setStaticlight​(java.lang.Double lightLevel)
      • setParams

        public void setParams​(java.util.Map<java.lang.String,​java.lang.Object> params)
      • setScale

        public void setScale​(java.lang.Double scale)
      • setScale

        public void setScale​(java.lang.Long scale)
      • setCulling

        public void setCulling​(java.lang.String culling)
      • setCulling

        public void setCulling​(java.lang.Boolean culling)
      • setUsecolor

        public void setUsecolor​(java.lang.String usecolor)
      • setUsecolor

        public void setUsecolor​(java.lang.Boolean usecolor)
      • updateVelocityBufferUniforms

        public void updateVelocityBufferUniforms​(ICamera camera)
      • updateVelocityBufferUniforms

        public void updateVelocityBufferUniforms​(com.badlogic.gdx.graphics.g3d.Material mat,
                                                 ICamera camera)
      • updateRelativisticEffects

        public void updateRelativisticEffects​(ICamera camera)
      • updateRelativisticEffects

        public void updateRelativisticEffects​(ICamera camera,
                                              float vc)
      • updateRelativisticEffects

        public void updateRelativisticEffects​(com.badlogic.gdx.graphics.g3d.Material mat,
                                              ICamera camera)
      • updateRelativisticEffects

        public void updateRelativisticEffects​(com.badlogic.gdx.graphics.g3d.Material mat,
                                              ICamera camera,
                                              float vc)
      • hasHeight

        public boolean hasHeight()
      • notify

        public void notify​(Events event,
                           java.lang.Object... data)
        Specified by:
        notify in interface IObserver