Class Light

java.lang.Object
com.ijurnove.cpu3d.Light
Direct Known Subclasses:
DirectionalLight, PointLight

public abstract class Light extends Object
Objects that extend the Light class are used by Scene to calculate lighting. Each extension of the Light class must have a LightType and a PhongComponents to describe the color and type of light that it casts.

lightVec(), distance(), shadowValue(), updateShadowMap(), and init() are automatically run in light calculations and should never need to be manually called.

  • Constructor Details

  • Method Details

    • getType

      public LightType getType()
      Returns the LightType.
      Returns:
      the LightType
    • getComponents

      public PhongComponents getComponents()
      Returns the PhongComponents.
      Returns:
      the PhongComponents
    • getParent

      public Scene getParent()
      Returns the parent Scene.
      Returns:
      the parent Scene
    • setParent

      public void setParent(Scene parent)
      Sets the parent Scene of this Light.
      Parameters:
      parent - the scene to set
    • setComponents

      public void setComponents(PhongComponents components)
      Sets the PhongComponents of this Light.
      Parameters:
      components - the PhongComponents to set