Class BasicLightingModel

  • All Implemented Interfaces:
    LightingModel

    public class BasicLightingModel
    extends java.lang.Object
    implements LightingModel
    Provides a simple lighting model with one light. This model uses only OpenGL light 0.
    • Field Detail

      • lightDirection

        protected Vec4 lightDirection
      • lightMaterial

        protected Material lightMaterial
      • frameID

        protected long frameID
    • Constructor Detail

      • BasicLightingModel

        public BasicLightingModel()
    • Method Detail

      • getLightDirection

        public Vec4 getLightDirection()
        Returns the model's light direction.
        Returns:
        the model's light direction.
      • setLightDirection

        public void setLightDirection​(Vec4 lightDirection)
        Specifies the model's light direction.
        Parameters:
        lightDirection - the model's light direction.
        Throws:
        java.lang.IllegalArgumentException - if the light direction is null.
      • getLightMaterial

        public Material getLightMaterial()
        Returns the model's light material.
        Returns:
        the model's light material.
      • setLightMaterial

        public void setLightMaterial​(Material lightMaterial)
        Specifies the model's light direction.
        Parameters:
        lightMaterial - the model's light material.
        Throws:
        java.lang.IllegalArgumentException - if the light material is null.
      • applyStandardLightModel

        protected void applyStandardLightModel​(com.jogamp.opengl.GL2 gl)
      • applyStandardShadeModel

        protected void applyStandardShadeModel​(com.jogamp.opengl.GL2 gl)
      • applyStandardLightMaterial

        protected static void applyStandardLightMaterial​(com.jogamp.opengl.GL2 gl,
                                                         int light,
                                                         Material material)
      • applyStandardLightDirection

        protected void applyStandardLightDirection​(com.jogamp.opengl.GL2 gl,
                                                   int light,
                                                   Vec4 direction)