Panda3D
Loading...
Searching...
No Matches
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 */
39class RPPointLight : public RPLight {
40PUBLISHED:
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
51public:
52 virtual void write_to_command(GPUCommand &cmd);
53 virtual void update_shadow_sources();
54 virtual void init_shadow_sources();
55
56protected:
57 float _radius;
58 float _inner_radius;
59};
60
61#include "rpPointLight.I"
62
63#endif // RPPOINTLIGHT_H
Class for storing data to be transferred to the GPU.
Definition gpuCommand.h:47
RenderPipeline.
Definition rpLight.h:41
RenderPipeline.
virtual void init_shadow_sources()
Inits the shadow sources of the light.
virtual void write_to_command(GPUCommand &cmd)
Writes the light to a GPUCommand.
get_radius
Returns the lights radius.
set_radius
RenderPipeline.
RPPointLight()
RenderPipeline.
virtual void update_shadow_sources()
Updates the shadow sources.
get_inner_radius
Returns the inner radius of the light.
set_inner_radius
Sets the inner radius of the light.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.