ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Light.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Geometry>
11 #include <cmath>
12 
13 namespace cloudViewer {
14 namespace visualization {
15 namespace rendering {
16 
17 struct Light {
19 
20  // common light parameters
21  Eigen::Vector3f color = Eigen::Vector3f(1.f, 1.f, 1.f);
22  Eigen::Vector3f position = Eigen::Vector3f(0.f, 0.f, 0.f);
24  float intensity = 10000.f;
25  float falloff = 10.f;
26  bool cast_shadows = false;
27 
28  Eigen::Vector3f direction = Eigen::Vector3f(0.f, 0.f, -1.f);
29 
30  // Spot lights parameters
31  float light_cone_inner = float(M_PI / 4.0);
32  float light_cone_outer = float(M_PI / 2.0);
33 };
34 
35 } // namespace rendering
36 } // namespace visualization
37 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
cloudViewer::visualization::rendering::Light::falloff
float falloff
Definition: Light.h:25
M_PI
constexpr double M_PI
Pi.
Definition: CVConst.h:19
cloudViewer::visualization::rendering::Light::direction
Eigen::Vector3f direction
Definition: Light.h:28
cloudViewer::visualization::rendering::Light
Definition: Light.h:17
float
float
Definition: my_point_types.h:154
cloudViewer::visualization::rendering::Light::type
eLightType type
Definition: Light.h:23
cloudViewer::visualization::rendering::Light::intensity
float intensity
Definition: Light.h:24
cloudViewer::visualization::rendering::Light::SPOT
@ SPOT
Definition: Light.h:18
cloudViewer::visualization::rendering::Light::cast_shadows
bool cast_shadows
Definition: Light.h:26
cloudViewer::visualization::rendering::Light::light_cone_outer
float light_cone_outer
Definition: Light.h:32
cloudViewer::visualization::rendering::Light::POINT
@ POINT
Definition: Light.h:18
cloudViewer::visualization::rendering::Light::light_cone_inner
float light_cone_inner
Definition: Light.h:31
cloudViewer::visualization::rendering::Light::eLightType
eLightType
Definition: Light.h:18
cloudViewer::visualization::rendering::Light::position
Eigen::Vector3f position
Definition: Light.h:22
cloudViewer::visualization::rendering::Light::color
Eigen::Vector3f color
Definition: Light.h:21
cloudViewer::visualization::rendering::Light::DIRECTIONAL
@ DIRECTIONAL
Definition: Light.h:18