Panda3D
Loading...
Searching...
No Matches
rpSpotLight.I
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
28
29inline void RPSpotLight::set_radius(float radius) {
30 _radius = radius;
31 set_needs_update(true);
33}
34
35inline float RPSpotLight::get_radius() const {
36 return _radius;
37}
38
39
40inline void RPSpotLight::set_fov(float fov) {
41 _fov = fov;
42 set_needs_update(true);
44}
45
46inline float RPSpotLight::get_fov() const {
47 return _fov;
48}
49
50inline void RPSpotLight::set_direction(LVecBase3 direction) {
51 _direction = direction;
52 _direction.normalize();
53 set_needs_update(true);
55}
56
57inline void RPSpotLight::set_direction(float dx, float dy, float dz) {
58 _direction.set(dx, dy, dz);
59 _direction.normalize();
60 set_needs_update(true);
62}
63
64inline const LVecBase3& RPSpotLight::get_direction() const {
65 return _direction;
66}
67
68inline void RPSpotLight::look_at(LVecBase3 point) {
69 set_direction(point - _position);
70}
71
72inline void RPSpotLight::look_at(float x, float y, float z) {
73 set_direction(LVecBase3(x, y, z) - _position);
74}
void invalidate_shadows()
Invalidates the shadows.
Definition rpLight.I:153
void set_needs_update(bool flag)
Sets whether the light needs an update.
Definition rpLight.I:80
set_radius
RenderPipeline.
Definition rpSpotLight.h:45