Molecular Vis
Improving perception of molecular visualization
LightManager Class Reference

Manages the collection of lights. More...

#include <LightManager.h>

Public Member Functions

 LightManager ()
 
void createPointLight (glm::vec3 color, glm::vec3 position, glm::vec3 attenuation)
 
void createDirectionalLight (glm::vec3 color, glm::vec3 direction)
 
void createSpotLight (glm::vec3 color, glm::vec3 position, glm::vec3 direction, float innerOpeningAngle, float outerOpeningAngle, glm::vec3 attenuation)
 
void setUniforms (const std::vector< std::shared_ptr< Shader >> &shaders)
 

Static Public Attributes

static const int maxDirectionalLights = 1
 
static const int maxPointLights = 1
 
static const int maxSpotLights = 1
 

Detailed Description

Manages the collection of lights.

Is responsible for holding the information of the different lights and setting all the corresponding uniforms.

Constructor & Destructor Documentation

◆ LightManager()

LightManager::LightManager ( )

Creates an empty LightManager

Member Function Documentation

◆ createDirectionalLight()

void LightManager::createDirectionalLight ( glm::vec3  color,
glm::vec3  direction 
)

Creates a directional-light and adds it to the manager. See DirectionalLight.

Parameters
colorColor of the light.
directionDirection of the light.

◆ createPointLight()

void LightManager::createPointLight ( glm::vec3  color,
glm::vec3  position,
glm::vec3  attenuation 
)

Creates a point-light and adds it to the manager. See PointLight.

Parameters
colorColor of the light.
positionPosition of the light.
attenuationAttenuation coefficients of the light.

◆ createSpotLight()

void LightManager::createSpotLight ( glm::vec3  color,
glm::vec3  position,
glm::vec3  direction,
float  innerOpeningAngle,
float  outerOpeningAngle,
glm::vec3  attenuation 
)

Creates a spot-light and adds it to the manager. See SpotLight.

Parameters
colorColor of the light.
positionPosition of the light.
directionDirection of the light.
innerOpeningAngleInner angle in degrees.
outerOpeningAngleOuter angle in degrees.
attenuationAttenuation factors.

◆ setUniforms()

void LightManager::setUniforms ( const std::vector< std::shared_ptr< Shader >> &  shaders)

Sets the light releted uniforms for all shaders in the vector.

Parameters
shadersVector of shaders for which the uniforms will be set.

Member Data Documentation

◆ maxDirectionalLights

const int LightManager::maxDirectionalLights = 1
static

Maximum number of directional-lights.

◆ maxPointLights

const int LightManager::maxPointLights = 1
static

Maximum number of point-lights.

◆ maxSpotLights

const int LightManager::maxSpotLights = 1
static

Maximum number of spot-lights.


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