Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4734 in orxonox.OLD for orxonox/trunk/src/lib/graphics/light.h


Ignore:
Timestamp:
Jun 29, 2005, 3:05:47 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: light loadable

File:
1 edited

Legend:

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

    r4519 r4734  
    1 /*! 
     1/*!
    22    \file light.h
    33    \brief Handles Lights.
     
    2020// FORWARD DEFINITIONS //
    2121class Vector;
    22 
     22class TiXmlElement;
    2323
    2424//! A class that handles Lights. The LightManager operates on this.
     
    2727 public:
    2828  Light(int lightNumber);
     29  Light(const TiXmlElement* root);
    2930  virtual ~Light(void);
    3031
    31   void setPosition(Vector position);
     32  void init(int lightNumber);
     33  void loadParams(const TiXmlElement* root);
     34
     35  void setPosition(const Vector& position);
    3236  void setPosition(GLfloat x, GLfloat y, GLfloat z);
    3337  Vector getPosition() const;
     
    3640  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
    3741  void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
    38   void setSpotDirection(Vector direction);
     42  void setSpotDirection(const Vector& direction);
     43  void setSpotDirection(float x, float y, float z) { setSpotDirection(Vector(x,y,z)); };
    3944  void setSpotCutoff(GLfloat cutoff);
    4045
    4146  /** \returns the lightNumber*/
    4247  int getLightNumber(void) const {return this->lightNumber;}
    43  
     48
    4449  virtual void draw();
    4550
     
    8994   To redraw the light use
    9095   \li void draw();
    91    
     96
    9297   and to delete one just use
    9398   \li void deleteLight(void);
     
    96101   \li void debug(void) const;
    97102
    98    You can also operate on the single Lights themselves, by first retreaving them with 
     103   You can also operate on the single Lights themselves, by first retreaving them with
    99104   \li Light* getLight(int LightNumber);
    100105   \n
     
    108113  /** \returns a Pointer to the only object of this Class */
    109114  inline static LightManager* getInstance(void) { if (!singletonRef) singletonRef = new LightManager();  return singletonRef; };
     115
     116  void loadParams(const TiXmlElement* root);
    110117
    111118  // set Attributes
     
    132139  Vector getPosition(void) const;
    133140  Vector getPosition(int lightNumber) const;
    134  
     141
    135142  Light* getLight(int lightNumber) const;
    136  
     143
    137144  void debug(void) const;
    138145
     
    141148  LightManager(void);
    142149  void initLight(int LightNumber);
    143  
     150
    144151
    145152 private:
     
    149156  Light**                 lights;             //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
    150157  Light*                  currentLight;       //!< The current Light, we are working with.
    151  
     158
    152159};
    153160
Note: See TracChangeset for help on using the changeset viewer.