Main MRPT website > C++ reference for MRPT 1.9.9
CLight.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
13 namespace mrpt
14 {
15 namespace opengl
16 {
17 /** Each of the possible lights of a 3D scene \sa COpenGLViewport
18  * *IMPORTANT NOTE*: It's the user responsibility to define unique light IDs
19  * for each light.
20  * The OpenGL standard only assures that valid IDs are 0,1,..7
21  * Refer to standard OpenGL literature and tutorials for the meaning of each
22  * field.
23  */
24 struct CLight
25 {
26  /** Default constructor, sets default values */
27  CLight();
28 
29  void setPosition(float x, float y, float z, float w);
30  void setDirection(float dx, float dy, float dz);
31 
32  /** OpenGL ID (typical range: 0-7) */
34 
35  float color_ambient[4];
36  float color_diffuse[4];
37  float color_specular[4];
38 
39  /** [x,y,z,w]: w=0 means directional light, w=1 means a light at a real 3D
40  * position. */
41  float position[4];
42  /** [x,y,z] */
43  float direction[3];
48  float spot_cutoff;
49 
52 
53  /** Define the light in the current OpenGL rendering context (users normally
54  * don't need to call this explicitly, it's done from within a \sa
55  * COpenGLViewport) */
56  void sendToOpenGL() const;
57 
59 };
60 
65 
66 } // namespace opengl
67 } // namespace mrpt
mrpt::opengl::CLight::writeToStream
void writeToStream(mrpt::serialization::CArchive &out) const
Definition: CLight.cpp:49
mrpt::opengl::CLight::color_specular
float color_specular[4]
Definition: CLight.h:37
mrpt::opengl::operator>>
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, mrpt::opengl::CLight &o)
Definition: CLight.cpp:124
mrpt::opengl::CLight::linear_attenuation
float linear_attenuation
Definition: CLight.h:45
mrpt::opengl::CLight::direction
float direction[3]
[x,y,z]
Definition: CLight.h:43
DECLARE_TTYPENAME_CLASSNAME
#define DECLARE_TTYPENAME_CLASSNAME(_CLASSNAME)
Like DECLARE_CUSTOM_TTYPENAME(), but for use within the class declaration body.
Definition: TTypeName.h:100
mrpt::opengl::CLight
Each of the possible lights of a 3D scene.
Definition: CLight.h:24
mrpt::opengl::CLight::position
float position[4]
[x,y,z,w]: w=0 means directional light, w=1 means a light at a real 3D position.
Definition: CLight.h:41
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::opengl::CLight::readFromStream
void readFromStream(mrpt::serialization::CArchive &in)
Definition: CLight.cpp:64
w
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::opengl::CLight::color_ambient
float color_ambient[4]
Definition: CLight.h:35
mrpt::opengl::CLight::setPosition
void setPosition(float x, float y, float z, float w)
Definition: CLight.cpp:106
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
mrpt::opengl::CLight::light_ID
uint8_t light_ID
OpenGL ID (typical range: 0-7)
Definition: CLight.h:33
TTypeName.h
mrpt::opengl::CLight::color_diffuse
float color_diffuse[4]
Definition: CLight.h:36
mrpt::opengl::CLight::sendToOpenGL
void sendToOpenGL() const
Define the light in the current OpenGL rendering context (users normally don't need to call this expl...
Definition: CLight.cpp:86
mrpt::opengl::CLight::setDirection
void setDirection(float dx, float dy, float dz)
Definition: CLight.cpp:113
mrpt::opengl::CLight::quadratic_attenuation
float quadratic_attenuation
Definition: CLight.h:46
mrpt::opengl::operator<<
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &out, const mrpt::opengl::CLight &o)
Definition: CLight.cpp:130
serialization_frwds.h
mrpt::opengl::CLight::spot_exponent
float spot_exponent
Definition: CLight.h:47
mrpt::opengl::CLight::CLight
CLight()
Default constructor, sets default values.
Definition: CLight.cpp:22
z
GLdouble GLdouble z
Definition: glext.h:3872
in
GLuint in
Definition: glext.h:7274
y
GLenum GLint GLint y
Definition: glext.h:3538
x
GLenum GLint x
Definition: glext.h:3538
mrpt::opengl::CLight::constant_attenuation
float constant_attenuation
Definition: CLight.h:44
mrpt::opengl::CLight::spot_cutoff
float spot_cutoff
Definition: CLight.h:48



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST