78 m_position.set(_p.m_x,_p.m_y,_p.m_z,static_cast<Real>(m_lightMode));
132 void disable() noexcept;
137 virtual void enable() noexcept;
159 void setAttenuation(
Real _constant=1.0,
Real _linear=0.0,
Real _quadratic=0.0 ) noexcept;
164 void loadToShader(
std::string _uniformName )
const noexcept;
169 void setTransform(
Mat4 &_t ) noexcept;
bool m_active
active if true else off
Real m_linearAtten
attenuation value for linear falloff
void setColour(const Colour &_c) noexcept
set the light colour
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
a simple colour class for RGBA colour
main definition of types and namespace
Simple class to encapsulate OpenGL Light functions this will fill in the following structure...
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
Colour getSpecColour() const noexcept
returns the current light Specular colour
implementation files for RibExport class
Colour getColour() const noexcept
returns the current light colour
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
encapsulates a 4d Homogenous Point / Vector object
a simple 3 tuple container for compatibility with glsl
void setSpecColour(const Colour &_c) noexcept
set the specular colour
Colour m_ambient
ambient light colour used for the lights
Colour m_diffuse
Colour used to give the light a colour.
Colour m_specular
specular highlight colour used for the lights
Light() noexcept
default constructor this set nothing so the light will not illuminate
void setPosition(const Vec3 &_p) noexcept
set the light position
Matrix Class to do simple matrix operations included operator overloaded functions for maths and matr...
Vec4 getPos() const noexcept
returns the current light position as a Vector
directional light from old OPenGL
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
virtual ~Light() noexcept
destructor when light is destroyed we turn it off