blob: 1f323d9dedf2f3bde33f5963b7615e4da3ec6e4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/*
render/lightenvironment.h
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
#ifndef __INCLUDED_RENDER_LIGHTENVIRONMENT_H__
#define __INCLUDED_RENDER_LIGHTENVIRONMENT_H__
#include <vector>
#include "render/light.h"
namespace render
{
/**
* @brief a collection of lights
* */
class LightEnvironment
{
public:
LightEnvironment();
~LightEnvironment();
/**
* @brief enable all lights in the environment
* */
void enable();
/**
* @brief disable all lights in the environment
* */
void disable();
/**
* @brief remove all lights in the environment
* */
void clear();
/**
* @brief add a light to the environment
* */
void add(Light *light);
/**
* @brief transfer light environment to OpenGL state
*/
void draw();
/**
* @brief transfer light environment to OpenGL state
*/
void draw(const math::Vector3f translate);
/**
* @brief number of lights in the environment
* */
inline size_t size() const {
return env_container.size();
}
private:
typedef std::vector <Light *> Container;
Container env_container;
int env_base_id;
float env_attenuation;
float env_ambient_intensity;
float env_diffuse_intensity;
float env_specular_intensity;
};
}
#endif // __INCLUDED_RENDER_LIGHTENVIRONMENT_H__
|