Panda3D
lightLensNode.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 lightLensNode.I
10  * @author drose
11  * @date 2002-03-26
12  */
13 
14 /**
15  * Returns true if this light defines a specular color, false if the specular
16  * color is derived automatically from the light color.
17  */
18 INLINE bool LightLensNode::
20  return _has_specular_color;
21 }
22 
23 /**
24  * Returns whether this light is configured to cast shadows or not.
25  */
26 INLINE bool LightLensNode::
27 is_shadow_caster() const {
28  return _shadow_caster;
29 }
30 
31 /**
32  * Returns the sort of the shadow buffer to be created for this light source.
33  */
34 INLINE int LightLensNode::
36  return _sb_sort;
37 }
38 
39 /**
40  * Returns the size of the shadow buffer to be created for this light source.
41  */
42 INLINE LVecBase2i LightLensNode::
43 get_shadow_buffer_size() const {
44  return _sb_size;
45 }
46 
47 /**
48  * Sets the size of the shadow buffer to be created for this light source.
49  */
50 INLINE void LightLensNode::
51 set_shadow_buffer_size(const LVecBase2i &size) {
52  if (size != _sb_size) {
53  clear_shadow_buffers();
54  _sb_size = size;
55  setup_shadow_map();
56  }
57 }
58 
59 /**
60  * Returns the buffer that has been constructed for a given GSG, or NULL if no
61  * such buffer has (yet) been constructed. This should be used for debugging
62  * only, you will not need to call this normally.
63  */
66  ShadowBuffers::iterator it = _sbuffers.find(gsg);
67  if (it == _sbuffers.end()) {
68  return nullptr;
69  } else {
70  return (*it).second;
71  }
72 }
73 
74 /**
75  * Marks this light as having been used by the auto shader.
76  */
77 INLINE void LightLensNode::
79  _used_by_auto_shader = true;
80 }
bool has_specular_color() const
Returns true if this light defines a specular color, false if the specular color is derived automatic...
Definition: lightLensNode.I:19
void mark_used_by_auto_shader() const
Marks this light as having been used by the auto shader.
Definition: lightLensNode.I:78
GraphicsOutputBase * get_shadow_buffer(GraphicsStateGuardianBase *gsg)
Returns the buffer that has been constructed for a given GSG, or NULL if no such buffer has (yet) bee...
Definition: lightLensNode.I:65
set_shadow_buffer_size
Sets the size of the shadow buffer to be created for this light source.
Definition: lightLensNode.h:53
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
int get_shadow_buffer_sort() const
Returns the sort of the shadow buffer to be created for this light source.
Definition: lightLensNode.I:35
An abstract base class for GraphicsOutput, for all the usual reasons.