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
float direction[3]
[x,y,z]
Definition: CLight.h:43
GLdouble GLdouble z
Definition: glext.h:3872
float constant_attenuation
Definition: CLight.h:44
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &out, const mrpt::opengl::CLight &o)
Definition: CLight.cpp:130
CLight()
Default constructor, sets default values.
Definition: CLight.cpp:22
void readFromStream(mrpt::serialization::CArchive &in)
Definition: CLight.cpp:64
void sendToOpenGL() const
Define the light in the current OpenGL rendering context (users normally don&#39;t need to call this expl...
Definition: CLight.cpp:86
void writeToStream(mrpt::serialization::CArchive &out) const
Definition: CLight.cpp:49
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
Each of the possible lights of a 3D scene.
Definition: CLight.h:24
unsigned char uint8_t
Definition: rptypes.h:41
float color_specular[4]
Definition: CLight.h:37
#define DECLARE_TTYPENAME_CLASSNAME(_CLASSNAME)
Like DECLARE_CUSTOM_TTYPENAME(), but for use within the class declaration body.
Definition: TTypeName.h:100
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
float spot_exponent
Definition: CLight.h:47
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
float linear_attenuation
Definition: CLight.h:45
GLuint in
Definition: glext.h:7274
uint8_t light_ID
OpenGL ID (typical range: 0-7)
Definition: CLight.h:33
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, mrpt::opengl::CLight &o)
Definition: CLight.cpp:124
float color_ambient[4]
Definition: CLight.h:35
GLenum GLint GLint y
Definition: glext.h:3538
float color_diffuse[4]
Definition: CLight.h:36
GLenum GLint x
Definition: glext.h:3538
float quadratic_attenuation
Definition: CLight.h:46
void setPosition(float x, float y, float z, float w)
Definition: CLight.cpp:106
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
void setDirection(float dx, float dy, float dz)
Definition: CLight.cpp:113



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019