Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3437 in orxonox.OLD for orxonox/trunk/src/light.h


Ignore:
Timestamp:
Mar 1, 2005, 8:11:31 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: light is now more like a lightManager. It is a Class, that handles many lights, and as such also glEnable(GL_LIGHTING)…
Until now It is not possible to initialize more than the first Light, but this will be fixed soon :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/light.h

    r3436 r3437  
    1414#include "glincl.h"
    1515
     16#define NUMBEROFLIGHTS GL_MAX_LIGHTS
     17
    1618// FORWARD DEFINITIONS //
    1719class Vector;
     
    2123   A Light is a source that emits light rays (photons)
    2224*/
    23 class Light : public WorldEntity 
     25class Light : public WorldEntity
    2426{
     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
     37    LightValue* next;
     38  };
     39
     40  static Light* singletonRef;    //!< This is the LightHandlers Reference.
     41  Light(void);
     42
     43  void init(int LightNumber); 
     44  LightValue** lights;
     45  LightValue* currentLight;
    2546 
    26 
    2747 public:
    28   Light(void);
    29   Light(Vector position);
     48  static Light* getInstance();
    3049  ~Light(void);
    3150
    3251  // set Attributes
     52  int addLight(void);
     53  int addLight(int lightNumber);
     54  void editLightNumber(int lightNumber);
     55  void deleteLight(void);
     56  void deleteLight(int lightNumber);
     57
    3358  void setPosition(Vector position);
     59  void setPosition(GLfloat x, GLfloat y, GLfloat z);
    3460  void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
    3561  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
    36  
    3762  // get Attributes
    3863  Vector getPosition(void);
    39  private:
    40   GLfloat lightPosition[4];   //!< The Position of this Light
    41   GLfloat lmodelAmbient[4];   //!< The general Ambient Color
    42   GLfloat diffuseColor[4];    //!< The Diffuse Color this Light emmits
    43   GLfloat specularColor[4];   //!< The specular Color of this Light
    44 
    45   void init();
    4664};
    4765
Note: See TracChangeset for help on using the changeset viewer.