Class LightingEngine

java.lang.Object
com.csse3200.game.lighting.LightingEngine
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class LightingEngine extends Object implements com.badlogic.gdx.utils.Disposable
Processes lighting components using the Box2DLight library. Sets up the ray handler that is responsible for rendering all lights to the screen.
  • Constructor Details

    • LightingEngine

      public LightingEngine(CameraComponent camera, com.badlogic.gdx.physics.box2d.World world)
      Constructor method for the lighting engine. This is where some of the rayHandler's global variables are set and can be changed.
      Parameters:
      camera - The camera associated with the current renderer for the screen.
      world - The same world registered with the physics engine.
  • Method Details

    • getRayHandler

      public box2dLight.RayHandler getRayHandler()
    • setAmbientLight

      public void setAmbientLight(float ambientLight)
    • render

      public void render()
      Render all lights registered with the ray handler to the screen. This also renders a "shadow" over the entire screen which can be adjusted using the setAmbientLight function.
    • dispose

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