t
Loading...
Searching...
No Matches
PointLight.hpp
1#include "lights/Light.hpp"
2#include "primitives/Color.hpp"
3
4#ifndef POINTLIGHT_HPP
5#define POINTLIGHT_HPP
6
7namespace t {
8
22class PointLight : public Light {
23public:
25 double intensity;
35
45 bool isPointLight() const override { return true; }
46
55 double power() const { return intensity * 4 * M_PI; }
56};
57
58} // namespace t
59
60#endif // POINTLIGHT_HPP
The color class.
Definition Color.hpp:18
The base lighting class.
Definition Light.hpp:17
The point light, which gets emitted from a single point in all directions.
Definition PointLight.hpp:22
double intensity
The intensity of this point light in candela (cd).
Definition PointLight.hpp:25
PointLight(Color color, double intensity)
Creates a new point light with the specified color and intensity.
Definition PointLight.hpp:33
bool isPointLight() const override
Returns whether or not this light is a point light.
Definition PointLight.hpp:45
double power() const
Returns the power of this light.
Definition PointLight.hpp:55
Color color
The color of this point light.
Definition PointLight.hpp:24
The t software 3D graphics library namespace.
Definition algorithms.hpp:12