zenilib: zenilib/jni/external/zenilib/zeni_graphics/Zeni/Light.hxx Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Light.hxx
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2 * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3 *
4 * zenilib is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * zenilib is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef ZENI_LIGHT_HXX
19 #define ZENI_LIGHT_HXX
20
21 #include <Zeni/Light.h>
22
23 namespace Zeni {
24
25 void Light::set_light_type(const LIGHT_TYPE &light_type_) {
26 light_type = light_type_;
27 if(light_type == LIGHT_POINT)
28 spot_theta = spot_phi = 2*Global::pi;
29 }
30
31 void Light::set_spot_theta(const float &spot_theta_) {
32 spot_theta = spot_theta_;
33
34 if(spot_phi < spot_theta)
35 set_spot_phi(spot_theta);
36 }
37
38 void Light::set_spot_phi(const float &spot_phi_) {
39 spot_phi = spot_phi_;
40
41 if(spot_phi == 2*Global::pi)
42 light_type = LIGHT_POINT;
43 else if(spot_phi < Global::pi)
44 light_type = LIGHT_SPOT;
45
46 if(spot_theta > spot_phi)
47 spot_theta = spot_phi;
48 }
49
50 }
51
52 #endif
Zeni::Light::set_spot_theta
void set_spot_theta(const float &spot_theta)
Set the angle, in radians, describing the size of the inner cone (automatically increases phi if nece...
Definition: Light.hxx:31
Zeni::LIGHT_TYPE
LIGHT_TYPE
Definition: Light.h:55
Zeni::Light::spot_theta
float spot_theta
The angle, in radians, describing the size of the inner cone (automatically increases phi if necessar...
Definition: Light.h:93
Zeni::Light::light_type
LIGHT_TYPE light_type
The type of the Light.
Definition: Light.h:82
Zeni::LIGHT_SPOT
Definition: Light.h:55
Light.h
Zeni::Global::pi
const float pi
pi == 3.1415926...
Definition: Vector3f.cpp:27
Zeni::Light::set_spot_phi
void set_spot_phi(const float &spot_phi)
Set the angle, in radians, describing the size of the outer cone (automatically decreases theta if ne...
Definition: Light.hxx:38
Zeni::LIGHT_POINT
Definition: Light.h:55
Zeni::Light::set_light_type
void set_light_type(const LIGHT_TYPE &light_type)
Set the type of the Light.
Definition: Light.hxx:25
Zeni::Light::spot_phi
float spot_phi
The angle, in radians, describing the size of the outer cone (automatically decreases theta if necess...
Definition: Light.h:94