Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4469 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 2, 2005, 1:53:08 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: light documented and cleaned up

File:
1 edited

Legend:

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

    r4338 r4469  
    1717#define NUMBEROFLIGHTS GL_MAX_LIGHTS
    1818
     19
    1920// FORWARD DEFINITIONS //
    2021class Vector;
     22
    2123
    2224//! A class that handles Lights. The LightManager operates on this.
     
    2931  void setPosition(Vector position);
    3032  void setPosition(GLfloat x, GLfloat y, GLfloat z);
     33  Vector getPosition() const;
     34
    3135  void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
    3236  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
     
    3539  void setSpotCutoff(GLfloat cutoff);
    3640
    37   Vector getPosition() const;
    3841  /** \returns the lightNumber*/
    3942  int getLightNumber(void) const {return this->lightNumber;}
     
    4548  // attributes
    4649 private:
    47   int lightNumber;            //!< The number of this Light.
    48   GLfloat lightPosition[4];   //!< The Position of this Light.
    49   GLfloat diffuseColor[4];    //!< The Diffuse Color this Light emmits.
    50   GLfloat specularColor[4];   //!< The specular Color of this Light.
    51   float constantAttenuation;  //!< The Factor of the the Constant Attenuation.
    52   float linearAttenuation;    //!< The Factor of the the Linear Attenuation.
    53   float quadraticAttenuation; //!< The Factor of the the Quadratic Attenuation.
    54   GLfloat spotDirection[4];   //!< The direction of the Spot Light.
    55   GLfloat spotCutoff;         //!< The cutoff Angle of the Light Source
     50  int              lightNumber;               //!< The number of this Light.
     51  GLfloat          lightPosition[4];          //!< The Position of this Light.
     52  GLfloat          diffuseColor[4];           //!< The Diffuse Color this Light emmits.
     53  GLfloat          specularColor[4];          //!< The specular Color of this Light.
     54  float            constantAttenuation;       //!< The Factor of the the Constant Attenuation.
     55  float            linearAttenuation;         //!< The Factor of the the Linear Attenuation.
     56  float            quadraticAttenuation;      //!< The Factor of the the Quadratic Attenuation.
     57  GLfloat          spotDirection[4];          //!< The direction of the Spot Light.
     58  GLfloat          spotCutoff;                //!< The cutoff Angle of the Light Source
    5659};
     60
     61
    5762
    5863//! A class that handles Lights
     
    98103class LightManager : public BaseObject
    99104{
    100  private:
    101   LightManager(void);
    102   void initLight(int LightNumber);
    103  
    104   static LightManager* singletonRef;    //!< This is the LightHandlers Reference.
    105   GLfloat ambientColor[4];       //!< The ambient Color of the scene.
    106105
    107   Light** lights;                //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
    108   Light* currentLight;           //!< The current Light, we are working with.
    109  
    110106 public:
     107  virtual ~LightManager(void);
    111108  static LightManager* getInstance();
    112   virtual ~LightManager(void);
    113109
    114110  // set Attributes
     
    139135 
    140136  void debug(void) const;
     137
     138
     139 private:
     140  LightManager(void);
     141  void initLight(int LightNumber);
     142 
     143
     144 private:
     145  static LightManager*    singletonRef;       //!< This is the LightHandlers Reference.
     146  GLfloat                 ambientColor[4];    //!< The ambient Color of the scene.
     147
     148  Light**                 lights;             //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
     149  Light*                  currentLight;       //!< The current Light, we are working with.
     150 
    141151};
    142152
Note: See TracChangeset for help on using the changeset viewer.