Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Light

Add this in your code:

#include <engine/lighting/lighting.h>

Description

Component to produce light.

Variables


NameTypeDescription
colorColorColor of the light

Public methods


SetupPointLight

Setup the light as a point light.

Parameters:

  • color: Light color
  • intensity: Light intensity
  • range: Light Range (Greater or equals to 0)
void SetupPointLight(const Color& color, float intensity, const float range)

SetupDirectionalLight

Setup the light as a directional light.

Parameters:

  • color: Light color
  • intensity: Light intensity
void SetupDirectionalLight(const Color& color, float intensity)

SetupAmbientLight

Setup the light as an ambient light.

Parameters:

  • color: Light color
  • intensity: Light intensity
void SetupAmbientLight(const Color& color, const float intensity)

SetupSpotLight

Setup the light as a spot light.

Parameters:

  • color: Light color
  • intensity: Light intensity
  • range: Light Range (Greater or equals to 0)
  • angle: Spot angle [0;90]
void SetupSpotLight(const Color& color, const float intensity, const float range, const float angle)

SetupSpotLight

Setup the light as a spot light.

Parameters:

  • color: Light color
  • intensity: Light intensity
  • range: Light Range (Greater or equals to 0)
  • angle: Spot angle [0;90]
  • smoothness: Spot smoothness [0;1]
void SetupSpotLight(const Color& color, const float intensity, const float range, const float angle, const float smoothness)

SetupSpotLight

Set light range.

Parameters:

  • value: Light range (Greater or equals to 0)
void SetRange(float value)

SetSpotAngle

Set spot angle.

Parameters:

  • value: Spot angle [0;90]
void SetSpotAngle(float angle)

SetSpotSmoothness

Set spot smoothness.

Parameters:

  • value: Spot smoothness [0;1]
void SetSpotSmoothness(float smoothness)

GetType

Get light type.

LightType GetType() const

GetType

Set light type.

Parameters:

  • type: Light type
void SetType(LightType type)

GetIntensity

Get light intensity.

float GetIntensity() const

SetIntensity

Set light intensity.

Parameters:

  • intensity: Light intensity
void SetIntensity(float intensity)

GetOldConsoleCompatibility

Get if the light should simulate lighting from old consoles (To get the same behavior as PSP)y.

bool GetOldConsoleCompatibility() const

SetOldConsoleCompatibility

Set if the light should simulate lighting from old consoles (To get the same behavior as PSP).

Parameters:

  • value: New value
void SetOldConsoleCompatibility(bool value)