KrisLibrary  1.0.0
GLLight.h
1 #ifndef GL_LIGHT_H
2 #define GL_LIGHT_H
3 
4 #include "GLColor.h"
6 
7 namespace GLDraw {
8 
9 using namespace Math3D;
10 
14 class GLLight
15 {
16 public:
17  GLLight();
18  GLLight(const Vector3& direction);
19  GLLight(const Vector3& position,const Vector3& direction);
20  GLLight(const GLLight& light);
21 
22  void setColor(const GLColor& col);
23  void setPointLight(const Vector3& pos);
24  void setDirectionalLight(const Vector3& dir);
25  void setSpotLight(const Vector3& pos,const Vector3& dir,float exponent=0,float cutoff=180);
26 
27  void setCurrentGL(const int id=0);
28 
29  Vector4 position;
30  float att2,att1,att0; //quadratic,linear,constant attenuation
31  GLColor diffuse, specular;
32  Vector3 spot_direction;
33  float spot_exponent,spot_cutoff;
34 };
35 
36 } //namespace GLDraw
37 
38 #endif
A 3D vector class.
Definition: math3d/primitives.h:136
Class declarations for useful 3D math types.
A 4D vector class.
Definition: math3d/primitives.h:228
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:13
Contains all definitions in the GLDraw package.
Definition: AnyGeometry.h:14
An OpenGL light.
Definition: GLLight.h:14
An rgba color.
Definition: GLColor.h:9