StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Visuals::PointLight Class Referencefinal

Point light for omni-directional lighting. More...

#include <visuals/Lights.hpp>

Inheritance diagram for StevEngine::Visuals::PointLight:
StevEngine::Visuals::Light StevEngine::Component

Public Member Functions

 PointLight (Utilities::Vector3 diffuse=Utilities::Vector3(1.0), Utilities::Vector3 specular=Utilities::Vector3(1.0), float constant=1.0, float linear=0.02, float quadratic=0.0017)
 Create point light.
 
 PointLight (Utilities::Stream &stream)
 Create point light from text serialized data.
 
std::string GetType () const
 Get component type.
 
Utilities::Stream Export (Utilities::StreamType type) const
 Serialize component to a stream.
 
void UpdateShader (const Renderer::ShaderProgram &program) const
 Update shader uniforms for this light.
 
void ResetShader (const Renderer::ShaderProgram &program) const
 Reset shader uniforms for this light.
 
- Public Member Functions inherited from StevEngine::Visuals::Light
uint32_t GetShaderLightID () const
 Get shader light ID.
 
- Public Member Functions inherited from StevEngine::Component
 Component ()
 Create new component.
 
virtual ~Component ()
 Clean up component resources.
 
GameObjectGetParent () const
 Get parent GameObject.
 
SceneGetScene () const
 Get containing Scene.
 
virtual void Start ()
 Initialize component after creation.
 

Public Attributes

float constant
 Constant attenuation factor.
 
float linear
 Linear attenuation factor.
 
float quadratic
 Quadratic attenuation factor.
 
- Public Attributes inherited from StevEngine::Visuals::Light
Utilities::Vector3 diffuse
 Diffuse light color.
 
Utilities::Vector3 specular
 Specular light color.
 

Additional Inherited Members

- Protected Member Functions inherited from StevEngine::Visuals::Light
 Light (uint32_t shaderID, Utilities::Vector3 diffuse, Utilities::Vector3 specular, std::string type)
 
 Light (Utilities::Stream &stream, std::string type)
 
- Protected Attributes inherited from StevEngine::Visuals::Light
const uint32_t shaderLightID
 Light index in shader.
 
- Protected Attributes inherited from StevEngine::Component
std::vector< std::pair< Utilities::ID, std::string > > handlers
 Event handler registrations.
 

Detailed Description

Point light for omni-directional lighting.

Light emanates in all directions from a point. Intensity diminishes with distance based on attenuation.

Constructor & Destructor Documentation

◆ PointLight() [1/2]

StevEngine::Visuals::PointLight::PointLight ( Utilities::Vector3 diffuse = Utilities::Vector3(1.0),
Utilities::Vector3 specular = Utilities::Vector3(1.0),
float constant = 1.0,
float linear = 0.02,
float quadratic = 0.0017 )

Create point light.

Parameters
diffuseDiffuse light color
specularSpecular light color
constantConstant attenuation factor
linearLinear attenuation factor
quadraticQuadratic attenuation factor

◆ PointLight() [2/2]

StevEngine::Visuals::PointLight::PointLight ( Utilities::Stream & stream)

Create point light from text serialized data.

Parameters
streamStream containing serialized component data

Member Function Documentation

◆ Export()

Utilities::Stream StevEngine::Visuals::PointLight::Export ( Utilities::StreamType type) const
virtual

Serialize component to a stream.

Parameters
typeType of stream to export to
Returns
Serialized stream

Implements StevEngine::Component.

◆ GetType()

std::string StevEngine::Visuals::PointLight::GetType ( ) const
inlinevirtual

Get component type.

Returns
Type identifier string

Implements StevEngine::Component.

◆ ResetShader()

void StevEngine::Visuals::PointLight::ResetShader ( const Renderer::ShaderProgram & program) const
virtual

Reset shader uniforms for this light.

Parameters
programShader program to reset

Implements StevEngine::Visuals::Light.

◆ UpdateShader()

void StevEngine::Visuals::PointLight::UpdateShader ( const Renderer::ShaderProgram & program) const
virtual

Update shader uniforms for this light.

Parameters
programShader program to update

Implements StevEngine::Visuals::Light.


The documentation for this class was generated from the following files: