Ocular Engine
LightSource.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_LIGHT_SOURCE__H__
19 #define __H__OCULAR_CORE_LIGHT_SOURCE__H__
20 
21 #include "Scene/SceneObject.hpp"
22 
23 #include "Math/Vector4.hpp"
24 #include "Math/Color.hpp"
25 
26 //------------------------------------------------------------------------------------------
27 
32 namespace Ocular
33 {
38  namespace Core
39  {
43  class LightSource : public SceneObject
44  {
45  public:
46 
47  ~LightSource();
48 
49  virtual void onLoad(BuilderNode const* node) override;
50 
55  void setColor(Core::Color const& color);
56 
60  Color getColor() const;
61 
66  void setIntensity(float intensity);
67 
71  float getIntensity() const;
72 
77  void setRange(float range);
78 
82  float getRange() const;
83 
84  void setAttenuation(Math::Vector3f const& attenuation);
85  Math::Vector3f getAttenuation() const;
86 
91  void setAngle(float angle);
92 
96  float getAngle() const;
97 
101  float getLightType() const;
102 
103  protected:
104 
105  LightSource(std::string const& name, SceneObject* parent, std::string const& type); // Protected as there should be no stand-alone light sources. Must be point, spot, etc.
106 
107  //------------------------------------------------------------
108 
109  Color m_Color;
110 
111  Math::Vector3f m_Attenuation;
112 
113  float m_Intensity;
114  float m_Range;
115  float m_Angle; // Angle is stored internally as radians
116  float m_LightType;
117 
118  private:
119  };
120  }
124 }
129 //------------------------------------------------------------------------------------------
130 
131 #endif
void setAngle(float angle)
Definition: LightSource.cpp:93
float getLightType() const
Definition: LightSource.cpp:113
float getIntensity() const
Definition: LightSource.cpp:78
void setRange(float range)
Definition: LightSource.cpp:83
virtual void onLoad(BuilderNode const *node) override
Definition: LightSource.cpp:51
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Color getColor() const
Definition: LightSource.cpp:68
Definition: Color.hpp:40
void setIntensity(float intensity)
Definition: LightSource.cpp:73
Definition: SceneObject.hpp:93
float getAngle() const
Definition: LightSource.cpp:98
Generic node system used for loading and saving SceneObjects and their components.
Definition: BuilderNode.hpp:51
void setColor(Core::Color const &color)
Definition: LightSource.cpp:63
float getRange() const
Definition: LightSource.cpp:88
Definition: LightSource.hpp:43