Package com.csse3200.game.lighting
Class LightingEngine
java.lang.Object
com.csse3200.game.lighting.LightingEngine
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionLightingEngine
(CameraComponent camera, com.badlogic.gdx.physics.box2d.World world) Constructor method for the lighting engine. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
box2dLight.RayHandler
void
render()
Render all lights registered with the ray handler to the screen.void
setAmbientLight
(float ambientLight)
-
Constructor Details
-
LightingEngine
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 interfacecom.badlogic.gdx.utils.Disposable
-