Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/light.h @ 3440

Last change on this file since 3440 was 3440, checked in by bensch, 19 years ago

orxonox/trunk: Light: added ambientColor, removed fancy effects :)

File size: 1.8 KB
Line 
1/*!
2    \file light.h
3    \brief Handles Lights.
4
5    A Light is one of the more important things in a 3D-environment,
6    without it one sees nothing :)
7    It is here for diffuse-, specular- and Bump-Mappings.
8*/
9
10#ifndef _LIGHT_H
11#define _LIGHT_H
12
13#include "world_entity.h"
14#include "glincl.h"
15
16#define NUMBEROFLIGHTS GL_MAX_LIGHTS
17
18// FORWARD DEFINITIONS //
19class Vector;
20
21//! A class that handles Lights
22/**
23   A Light is a source that emits light rays (photons)
24*/
25class Light : public WorldEntity
26{
27 private:
28  //! A struct that holds information about a Light
29  struct LightValue
30  {
31    int lightNumber;            //!< The number of this Light.
32    GLfloat lightPosition[4];   //!< The Position of this Light.
33    GLfloat lmodelAmbient[4];   //!< The general Ambient Color.
34    GLfloat diffuseColor[4];    //!< The Diffuse Color this Light emmits.
35    GLfloat specularColor[4];   //!< The specular Color of this Light.
36    GLint attenuationType;      //!< The AttenuationType of this Light. \todo implements this;
37
38    LightValue* next;
39  };
40
41  static Light* singletonRef;    //!< This is the LightHandlers Reference.
42  GLfloat ambientColor[4];       //!< The ambient Color of the scene.
43
44
45  Light(void);
46
47  void init(int LightNumber); 
48  LightValue** lights;
49  LightValue* currentLight;
50 
51 public:
52  static Light* getInstance();
53  ~Light(void);
54
55  // set Attributes
56  int addLight(void);
57  int addLight(int lightNumber);
58  void editLightNumber(int lightNumber);
59  void deleteLight(void);
60  void deleteLight(int lightNumber);
61
62  void setPosition(Vector position);
63  void setPosition(GLfloat x, GLfloat y, GLfloat z);
64  void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
65  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
66  void setAmbientColor(GLfloat r, GLfloat g, GLfloat b);
67  // get Attributes
68  Vector getPosition(void);
69};
70
71#endif /* _LIGHT_H */
Note: See TracBrowser for help on using the repository browser.