925a6b50cf861e8ca24417208ce3625201c3933b
1 #include "PointLight.hxx"
3 PointLight::PointLight(Scene
* scene
, const Vec3f
& pos
, const Vec3f
& intensity
)
10 PointLight::~PointLight()
14 PointLight::PointLight()
22 PointLight::Illuminate(Ray
& ray
, Vec3f
& intensity
)
24 Vec3f dir
= (ray
.origin() + ray
.direction() * (ray
.t()-Epsilon
)) - m_pos
;
25 float dist
= dir
.norm();
28 float c1
= 1, c2
= 0.5, c3
= 0;
29 //float f_att = 1 / (dist*dist);
30 float f_att
= 1 / (c1
+ c2
*dist
+ c3
*dist
*dist
);
32 intensity
= m_intensity
* f_att
;
34 // store direction from light to hitpoint
40 PointLight::position() const
46 PointLight::intensity() const
This page took 0.043641 seconds and 3 git commands to generate.