Added basis for point light
This commit is contained in:
parent
862ef6d34b
commit
b51c5a7557
6 changed files with 105 additions and 6 deletions
34
include/lighting/point.hpp
Normal file
34
include/lighting/point.hpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#ifndef POINT_HPP
|
||||
#define POINT_HPP
|
||||
|
||||
#include <core.hpp>
|
||||
#include <color.hpp>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace oglu
|
||||
{
|
||||
class Transformable;
|
||||
|
||||
class OGLU_API PointLight
|
||||
{
|
||||
public:
|
||||
PointLight();
|
||||
PointLight(const glm::vec3& position, const Color& color);
|
||||
PointLight(const PointLight& other);
|
||||
|
||||
~PointLight();
|
||||
|
||||
void LinkPositionToTransformable(Transformable& link);
|
||||
void UnlinkPositionFromTransformable();
|
||||
float* GetPositionPointer();
|
||||
|
||||
public:
|
||||
Color color;
|
||||
|
||||
private:
|
||||
glm::vec3* position;
|
||||
bool isLinked;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -16,6 +16,7 @@
|
|||
#include <camera.hpp>
|
||||
|
||||
#include <lighting/ambient.hpp>
|
||||
#include <lighting/point.hpp>
|
||||
|
||||
namespace oglu
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
namespace oglu
|
||||
{
|
||||
class PointLight;
|
||||
/**
|
||||
* @brief Defines position, rotation and scale.
|
||||
*
|
||||
|
@ -23,6 +24,9 @@ namespace oglu
|
|||
*/
|
||||
class OGLU_API Transformable
|
||||
{
|
||||
private:
|
||||
friend class PointLight;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Create new identity transformation.
|
||||
|
@ -349,7 +353,7 @@ namespace oglu
|
|||
*
|
||||
* @return An array of 16 floats representing the transformation matrix
|
||||
*/
|
||||
virtual const glm::mat4& GetMatrix();
|
||||
virtual const glm::mat4& GetMatrix(bool forceRecalc = false);
|
||||
|
||||
/**
|
||||
* @brief Returns a normal matrix.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue