Panda3D
rpPointLight.h
1 /**
2  *
3  * RenderPipeline
4  *
5  * Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23  * THE SOFTWARE.
24  *
25  */
26 
27 #ifndef RPPOINTLIGHT_H
28 #define RPPOINTLIGHT_H
29 
30 #include "pandabase.h"
31 #include "rpLight.h"
32 
33 /**
34  * @brief PointLight class
35  * @details This represents a point light, a light which has a position and
36  * radius. Checkout the RenderPipeline documentation for more information
37  * about this type of light.
38  */
39 class RPPointLight : public RPLight {
40 PUBLISHED:
41  RPPointLight();
42 
43  inline void set_radius(float radius);
44  inline float get_radius() const;
45  MAKE_PROPERTY(radius, get_radius, set_radius);
46 
47  inline void set_inner_radius(float inner_radius);
48  inline float get_inner_radius() const;
49  MAKE_PROPERTY(inner_radius, get_inner_radius, set_inner_radius);
50 
51 public:
52  virtual void write_to_command(GPUCommand &cmd);
53  virtual void update_shadow_sources();
54  virtual void init_shadow_sources();
55 
56 protected:
57  float _radius;
58  float _inner_radius;
59 };
60 
61 #include "rpPointLight.I"
62 
63 #endif // RPPOINTLIGHT_H
virtual void update_shadow_sources()
Updates the shadow sources.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_to_command(GPUCommand &cmd)
Writes the light to a GPUCommand.
Class for storing data to be transferred to the GPU.
Definition: gpuCommand.h:47
virtual void init_shadow_sources()
Inits the shadow sources of the light.
set_inner_radius
Sets the inner radius of the light.
Definition: rpPointLight.h:49
RenderPipeline.
Definition: rpLight.h:41
set_radius
RenderPipeline.
Definition: rpPointLight.h:45
get_inner_radius
Returns the inner radius of the light.
Definition: rpPointLight.h:49
RenderPipeline.
Definition: rpPointLight.h:39
RPPointLight()
RenderPipeline.
get_radius
Returns the lights radius.
Definition: rpPointLight.h:45