scene_light.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 */
28 
29 
30 #pragma once
31 
32 #include "api_scene3d.h"
33 #include <memory>
34 
35 namespace clan
36 {
39 
40 class Scene;
41 class SceneLight_Impl;
42 class OctTreeObject;
43 class AxisAlignedBoundingBox;
44 class VSMShadowMapPassLightData;
45 
46 class CL_API_SCENE SceneLight
47 {
48 public:
49  SceneLight();
50  SceneLight(Scene &scene);
51  bool is_null() const { return !impl; }
52 
53  enum Type
54  {
58  type_sun // directional light with parallel split shadow maps
59  };
60 
61  Type get_type() const;
62  Vec3f get_position() const;
63  Quaternionf get_orientation() const;
64 
65  Vec3f get_color() const;
66  float get_falloff() const;
67  float get_hotspot() const;
68  float get_ambient_illumination() const;
69  float get_attenuation_start() const;
70  float get_attenuation_end() const;
71  bool is_rectangle_shape() const;
72  float get_aspect_ratio() const;
73 
74  bool is_shadow_caster() const;
75  bool is_light_caster() const;
76  SceneLight get_shadow_source() const;
77 
78  void set_type(Type type);
79  void set_position(const Vec3f &position);
80  void set_orientation(const Quaternionf &orientation);
81 
82  void set_color(Vec3f color);
83  void set_falloff(float falloff);
84  void set_hotspot(float hotspot);
85  void set_ambient_illumination(float factor);
86  void set_attenuation_start(float attenuation_start);
87  void set_attenuation_end(float attenuation_end);
88  void set_rectangle_shape(bool rectangle);
89  void set_aspect_ratio(float aspect);
90 
91  void set_shadow_caster(bool casts_shadows);
92  void set_light_caster(bool casts_light);
93  void set_shadow_source(SceneLight light);
94 
95 private:
96  std::shared_ptr<SceneLight_Impl> impl;
97 };
98 
99 }
100 
Definition: scene_light.h:57
Definition: scene_light.h:55
Definition: scene_light.h:56
Definition: scene_light.h:46
Type
Definition: scene_light.h:53
bool is_null() const
Definition: scene_light.h:51
Definition: scene.h:50
Quaternion - Float.
Definition: quaternion.h:188