35 m_lightMode = _lightMode;
38 m_quadraticAtten=0.0f;
41 m_position.m_w=
static_cast<Real>(m_lightMode);
49 m_position=_l.m_position;
50 m_diffuse=_l.m_diffuse;
51 m_specular=_l.m_specular;
52 m_lightMode = _l.m_lightMode;
53 m_constantAtten=_l.m_constantAtten;
54 m_linearAtten=_l.m_linearAtten;
55 m_quadraticAtten=_l.m_quadraticAtten;
58 m_position.m_w=
static_cast<Real>(_l.m_lightMode);
61 m_cutoffAngle=_l.m_cutoffAngle;
70 m_specular.set(_specColour);
71 m_lightMode=_lightMode;
74 m_quadraticAtten=0.0f;
77 m_position.m_w=
static_cast<Real>(m_lightMode);
bool m_active
active if true else off
Real m_linearAtten
attenuation value for linear falloff
Real m_cutoffAngle
the spot cutoff angle for directional and point lights this is set to 180 by default, and other values are cos(radians(angle))
Real m_constantAtten
attenuation value for constant falloff
simple class to hold colour information and set the basic opengl colour state. also has overloaded me...
simple Vector class for OpenGL graphics, contains overloaded operators for most math functions...
Vec4 m_position
m_pos is used to store the light position w used for point / dir light values
Real m_r
red component of the colour tuple
void setShaderParam1f(const std::string &_paramName, float _p1) noexcept
set a shader param by name for 1 float param note that the shader must be the currently active shader...
Real m_b
blue component of the colour tuple
Simple class to encapsulate OpenGL Light functions this will fill in the following structure...
Singleton Class to init and Use GLSL Shaders the class stores the shaders as a map of shader objects ...
void setTransform(Mat4 &_t) noexcept
set a transform so that the light position is multiplied by this value (default is identity matrix) ...
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
main shader loader / manager class for GLSL shaders
implementation files for RibExport class
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
Real m_g
green component of the colour tuple
virtual void enable() noexcept
Enables the light and automatically allocates an OpenGL light ID.
an encapsulation of an OpenGL Light
void loadToShader(std::string _uniformName) const noexcept
method to load the current light values to the shader that is active at present
void setAttenuation(Real _constant=1.0, Real _linear=0.0, Real _quadratic=0.0) noexcept
set the light attenuation
Colour m_ambient
ambient light colour used for the lights
Colour m_diffuse
Colour used to give the light a colour.
void disable() noexcept
Disable the light by calling glDisable(GL_LIGHT0+LightNo);.
Colour m_specular
specular highlight colour used for the lights
static ShaderLib * instance()
Get the instance.
Light() noexcept
default constructor this set nothing so the light will not illuminate
Real m_a
alpha the transparent element
Matrix Class to do simple matrix operations included operator overloaded functions for maths and matr...
void setShaderParam4f(const std::string &_paramName, float _p1, float _p2, float _p3, float _p4) noexcept
set a shader param by name for 4 float params note that the shader must be the currently active shade...
GLsizei const GLchar *const * string
Mat4 m_transform
the transform applied to the light before loading to the shader this is usually the inverse projectio...
Real m_quadraticAtten
attenuation value for Quadratic falloff
LightModes m_lightMode
used to hold the current lights mode