Aether3D Game Engine
SpotLightComponent.hpp
1 #ifndef SPOT_LIGHT_HPP
2 #define SPOT_LIGHT_HPP
3 
4 #include <string>
5 #include "RenderTexture.hpp"
6 
7 namespace ae3d
8 {
11  {
12  public:
14  class GameObject* GetGameObject() const { return gameObject; }
15 
17  bool CastsShadow() const { return castsShadow; }
18 
21  void SetCastShadow( bool enable, int shadowMapSize );
22 
24  float GetConeAngle() const { return coneAngle; }
25 
27  void SetConeAngle( float degrees ) { coneAngle = degrees; }
28 
30  std::string GetSerialized() const;
31 
32  private:
33  friend class GameObject;
34  friend class Scene;
35 
37  static int Type() { return 7; }
38 
40  static unsigned New();
41 
43  static SpotLightComponent* Get( unsigned index );
44 
45  RenderTexture shadowMap;
46  float coneAngle = 45;
47  GameObject* gameObject = nullptr;
48  bool castsShadow = false;
49  };
50 }
51 #endif
std::string GetSerialized() const
Definition: AudioClip.hpp:4
float GetConeAngle() const
Definition: SpotLightComponent.hpp:24
class GameObject * GetGameObject() const
Definition: SpotLightComponent.hpp:14
void SetCastShadow(bool enable, int shadowMapSize)
Render texture.
Definition: RenderTexture.hpp:12
void SetConeAngle(float degrees)
Definition: SpotLightComponent.hpp:27
GameObject is composed of components that define its behavior.
Definition: GameObject.hpp:9
bool CastsShadow() const
Definition: SpotLightComponent.hpp:17
Spot light illuminates the scene from a given position with a viewing cone.
Definition: SpotLightComponent.hpp:10
Contains game objects in a transform hierarchy.
Definition: Scene.hpp:17