Panda3D
rectangleLight.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file rectangleLight.I
10  * @author rdb
11  * @date 2016-12-19
12  */
13 
14 /**
15  *
16  */
17 INLINE RectangleLight::CData::
18 CData() :
19  _max_distance(make_inf((PN_stdfloat)0))
20 {
21 }
22 
23 /**
24  *
25  */
26 INLINE RectangleLight::CData::
27 CData(const RectangleLight::CData &copy) :
28  _max_distance(copy._max_distance)
29 {
30 }
31 
32 /**
33  * Returns the color of specular highlights generated by the light. This is
34  * usually the same as get_color().
35  */
36 INLINE const LColor &RectangleLight::
38  return get_color();
39 }
40 
41 /**
42  * Returns the maximum distance at which the light has any effect, as previously
43  * specified by set_max_distance.
44  */
45 INLINE PN_stdfloat RectangleLight::
46 get_max_distance() const {
47  CDReader cdata(_cycler);
48  return cdata->_max_distance;
49 }
50 
51 /**
52  * Sets the radius of the light's sphere of influence. Beyond this distance, the
53  * light may be attenuated to zero, if this is supported by the shader.
54  */
55 INLINE void RectangleLight::
56 set_max_distance(PN_stdfloat max_distance) {
57  CDWriter cdata(_cycler);
58  cdata->_max_distance = max_distance;
59 }
set_max_distance
Sets the radius of the light's sphere of influence.
const LColor & get_specular_color() const final
Returns the color of specular highlights generated by the light.
get_color
Returns the basic color of the light.
Definition: light.h:49