3#include "scene/lights/Light.hpp"
4#include "scene/Animated.hpp"
5#include "scene/Object.hpp"
27 SpotLight(
const glm::vec3 & worldPosition,
const glm::vec3 & worldDirection,
const glm::vec3 & color,
float innerAngle,
float outerAngle,
float radius);
37 void update(
double fullTime,
double frameTime)
override;
47 glm::vec3
sample(
const glm::vec3 &
position,
float & dist,
float & attenuation)
const override;
97 glm::vec2
_angles = glm::vec2(glm::quarter_pi<float>(), glm::half_pi<float>());
Wraps an animated property so that the initial value is preserved.
Definition: Animated.hpp:11
Represent the smallest axis-aligne box containing a given object or region of space.
Definition: Bounds.hpp:28
A general light with adjustable color intensity, that can cast shadows.
Definition: Light.hpp:20
Base structure of a per-light specialized renderer.
Definition: LightRenderer.hpp:13
A spotlight, where light rays in a given cone are radiating from a single point in space....
Definition: SpotLight.hpp:13
const glm::vec3 & direction() const
Definition: SpotLight.hpp:79
glm::mat4 _viewMatrix
Light view matrix.
Definition: SpotLight.hpp:94
KeyValues encode() const override
Definition: SpotLight.cpp:109
glm::vec3 sample(const glm::vec3 &position, float &dist, float &attenuation) const override
Definition: SpotLight.cpp:52
void draw(LightRenderer &renderer) override
Definition: SpotLight.cpp:11
const glm::vec3 & position() const
Definition: SpotLight.hpp:74
void update(double fullTime, double frameTime) override
Definition: SpotLight.cpp:15
glm::mat4 _projectionMatrix
Light projection matrix.
Definition: SpotLight.hpp:93
float _radius
The attenuation radius.
Definition: SpotLight.hpp:98
const glm::vec2 & angles() const
Definition: SpotLight.hpp:84
Animated< glm::vec3 > _lightDirection
Light direction.
Definition: SpotLight.hpp:95
glm::vec2 _angles
The inner and outer cone attenuation angles.
Definition: SpotLight.hpp:97
Animated< glm::vec3 > _lightPosition
Light position.
Definition: SpotLight.hpp:96
bool decode(const KeyValues ¶ms)
Definition: SpotLight.cpp:83
void setScene(const BoundingBox &sceneBox) override
Definition: SpotLight.cpp:27
float radius() const
Definition: SpotLight.hpp:89
Represent a key-values tuple.
Definition: Config.hpp:9