Add light module
This commit is contained in:
parent
72c0d1475e
commit
14b246b6e9
3 changed files with 76 additions and 0 deletions
46
src/light.cc
Normal file
46
src/light.cc
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/* light.cc
|
||||
*
|
||||
* Lights light the scene.
|
||||
*
|
||||
* Eryn Wells <eryn@erynwells.me>
|
||||
*/
|
||||
|
||||
#include "basics.h"
|
||||
#include "light.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
Light::Light()
|
||||
: Light(1.0)
|
||||
{ }
|
||||
|
||||
|
||||
Light::Light(float i)
|
||||
: Light(Vector3::Zero, i)
|
||||
{ }
|
||||
|
||||
|
||||
Light::Light(Vector3 o, float i)
|
||||
: Object(o),
|
||||
intensity(i)
|
||||
{ }
|
||||
|
||||
|
||||
/*
|
||||
* Light::get_intensity --
|
||||
* Light::set_intensity --
|
||||
*
|
||||
* Get and set the intensity of this light.
|
||||
*/
|
||||
float
|
||||
Light::get_intensity()
|
||||
const
|
||||
{
|
||||
return intensity;
|
||||
}
|
||||
|
||||
void
|
||||
Light::set_intensity(float i)
|
||||
{
|
||||
intensity = i;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue