Molecular Vis
Improving perception of molecular visualization
DirectionalLight Class Reference

Class defining directional lights. More...

#include <DirectionalLight.h>

Inheritance diagram for DirectionalLight:
Light

Public Member Functions

 DirectionalLight (glm::vec3 color, glm::vec3 direction)
 
- Public Member Functions inherited from Light
virtual void setUniforms (const std::vector< std::shared_ptr< Shader >> &shaders, int index) final
 

Protected Member Functions

virtual void setUniform (std::shared_ptr< Shader > &shader, int index)
 

Detailed Description

Class defining directional lights.

Constructor & Destructor Documentation

◆ DirectionalLight()

DirectionalLight::DirectionalLight ( glm::vec3  color,
glm::vec3  direction 
)

Creates directional light.

Parameters
colorColor of the light. The r,g,b components should be between 0 and 1.
directionThe direction of the light. This gets normalized.

Member Function Documentation

◆ setUniform()

void DirectionalLight::setUniform ( std::shared_ptr< Shader > &  shader,
int  index 
)
protectedvirtual

Sets the directional light related uniforms in a shader. Sets following uniforms: "directionalLights[index].color" "directionalLights[index].direction"

Parameters
shaderShader to be updated
indexindex of the light among lights of the same type (used in shader to index light)

Reimplemented from Light.


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