Molecular Vis
Improving perception of molecular visualization
SpotLight Class Reference

Class for spot-lights. More...

#include <SpotLight.h>

Inheritance diagram for SpotLight:
Light

Public Member Functions

 SpotLight (glm::vec3 color, glm::vec3 position, glm::vec3 direction, float innerOpeningAngle, float outerOpeningAngle, glm::vec3 attenuation)
 
- 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 for spot-lights.

Constructor & Destructor Documentation

◆ SpotLight()

SpotLight::SpotLight ( glm::vec3  color,
glm::vec3  position,
glm::vec3  direction,
float  innerOpeningAngle,
float  outerOpeningAngle,
glm::vec3  attenuation 
)

Creates a spot-light.

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

Member Function Documentation

◆ setUniform()

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

Sets the spot-light related uniforms in a shader. Sets following uniforms: spotLights[index].color spotLights[index].position spotLights[index].attenuation spotLights[index].direction spotLights[index].innerOpeningAngle spotLights[index].outerOpeningAngle

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: