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
& shadow_ray
, Vec3f
& intensity
)
24 // distance to light source
25 Vec3f dir
= m_pos
-shadow_ray
.origin();
26 float r
= dir
.norm()-Epsilon
;
27 float falloff
= 1.0f
/(r
*r
);
30 intensity
= m_intensity
* falloff
;
32 // modify ray for shadow computation
34 // for shadow calculation
36 // set direction to light source
38 shadow_ray
.setDir(dir
);
44 PointLight::position() const
50 PointLight::intensity() const
This page took 0.050419 seconds and 5 git commands to generate.