Added spotlight
This commit is contained in:
parent
6981510aaf
commit
b185429475
9 changed files with 139 additions and 11 deletions
|
@ -75,6 +75,8 @@ namespace oglu
|
|||
*/
|
||||
float* GetPositionPointer();
|
||||
|
||||
void SetPosition(const glm::vec3& position);
|
||||
|
||||
public:
|
||||
// TODO: Does this split make sense? I'll keep it for now
|
||||
Color diffusionColor; ///< Diffusion color of the light
|
||||
|
@ -84,7 +86,7 @@ namespace oglu
|
|||
float linear; ///< Coefficient of the linear attenuation term
|
||||
float quadratic; ///< Coefficient of the quadratic attenuation term
|
||||
|
||||
private:
|
||||
protected:
|
||||
glm::vec3* position; ///< Position of the light
|
||||
bool isLinked; ///< Wether the position is linked to an object or not
|
||||
};
|
||||
|
|
27
include/lighting/spotlight.hpp
Normal file
27
include/lighting/spotlight.hpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef SPOTLIGHT_HPP
|
||||
#define SPOTLIGHT_HPP
|
||||
|
||||
#include <core.hpp>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <lighting/point.hpp>
|
||||
|
||||
namespace oglu
|
||||
{
|
||||
class OGLU_API SpotLight : public PointLight
|
||||
{
|
||||
public:
|
||||
SpotLight();
|
||||
SpotLight(const glm::vec3& position, const glm::vec3& direction, float angle, const Color& diffusionColor = Color::White, const Color& specularColor = Color::White);
|
||||
SpotLight(const SpotLight& other);
|
||||
|
||||
float angle;
|
||||
float outerAngle;
|
||||
glm::vec3 direction;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue