Pipeline graphique
 Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Définitions de type Énumérations Valeurs énumérées Macros
Light.h
Aller à la documentation de ce fichier.
1 #ifndef _DEFLIGHT
2 #define _DEFLIGHT
3 #include "libMath.h"
4 
5 
7 
8 struct Light_Global {
9 
12  unsigned int intensiter;
13 
14  bool active;
15 
17  Light_Global() { memset(this,0,sizeof(Light_Global)); }
19  Light_Global(const Math::vecteur3d &_pos, const Math::vecteur3d &_col) : pos(_pos), col(_col), active(true) {}
21  Light_Global(const Math::vecteur3d &_pos, const Math::vecteur3d &_col, bool _active) : pos(_pos), col(_col), active(_active) {}
23  inline void set(const Math::vecteur3d &_pos, const Math::vecteur3d &_col, unsigned int intensiter) { pos=_pos; col=_col; active=true;this->intensiter = intensiter; }
25  inline void on() { active = true; }
27  inline void off() { active = false; }
28 };
29 
31 struct Light_Local {
34  unsigned int intensiter;
35  void print()
36  {
37  std::cout << "Print Lampe: " << std::endl;
38  std::cout << "Position :" << std::endl;
39  pos.print();
40  std::cout << "Couleur :" << std::endl;
41  col.print();
42 
43  }
44 };
45 
46 
47 #endif
void set(const Math::vecteur3d &_pos, const Math::vecteur3d &_col, unsigned int intensiter)
fixe l'état de la lampe
Definition: Light.h:23
Light_Global(const Math::vecteur3d &_pos, const Math::vecteur3d &_col)
construction avec position et couleur, activée.
Definition: Light.h:19
bool active
Pour savoir si la lampe est allumée ou non.
Definition: Light.h:14
Structure utilisée dans les shaders pour ne conserver que les lampes actives.
Definition: Light.h:31
Structure utilisée pour définir une lampe dans la scène.
Definition: Light.h:8
unsigned int intensiter
Definition: Light.h:12
void on()
active la lampe
Definition: Light.h:25
void off()
desactive la lampe
Definition: Light.h:27
void print()
Definition: libMath.h:74
Light_Global()
constructeur par défaut (position à l'origine, couleur noire, lampe inactive)
Definition: Light.h:17
unsigned int intensiter
Definition: Light.h:34
Math::vecteur3d pos
Position de la lampe.
Definition: Light.h:32
Math::vecteur3d col
Couleur de la lumière émise par la lampe.
Definition: Light.h:33
Math::vecteur3d col
Couleur de la lumière émise par la lampe.
Definition: Light.h:11
Math::vecteur3d pos
Position de la lampe.
Definition: Light.h:10
Light_Global(const Math::vecteur3d &_pos, const Math::vecteur3d &_col, bool _active)
idem en spécifiant l'état de la lampe
Definition: Light.h:21
void print()
Definition: Light.h:35