2efe585a8466b41fad76cfdedb6226a031b9d58e
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 float dist
= ((ray
.origin() + ray
.direction() * ray
.t()) - m_pos
).norm();
26 float c1
= 1, c2
= 0.5, c3
= 0;
27 float f_att
= 1 / (c1
+ c2
*dist
+ c3
*dist
*dist
);
29 intensity
= m_intensity
* f_att
;
31 // store direction from light to hitpoint
32 ray
.setDir(ray
.origin() + ray
.direction() * (ray
.t()-Epsilon
) - m_pos
);
37 PointLight::position() const
43 PointLight::intensity() const
This page took 0.043352 seconds and 3 git commands to generate.