Newer
Older
cg / include / light.h
#ifndef _LIGHT_H
#define _LIGHT_H

#include "vec.h"
#include "thing.h"
#include "material.h"
#include "color.h"

#include <GL/gl.h>
#include <GL/glu.h>

class Light : public Thing {
 protected:
  GLUquadricObj* sphere;
  bool showtrace;
  bool enabled;
  GLenum num;
  Vec *pos;
  Material *mat;
  
  Vec *rot;

 public:
  Light();

  Light(GLenum _num, Vec _pos, Material _mat);
  void init(GLenum _num, Vec _pos, Material _mat);
  void setPosition(Vec newpos);
  void rotate(Vec rot);
  void translate(Vec d);
  void show();
  void hide();
  virtual void draw();
  void trace(bool _s);
};

class SpotLight: public Light{  
 private:
  GLUquadricObj* cone;
  float cutoff_angle;

 public:  
  void draw();
  SpotLight(GLenum _num, Vec _pos, Material _mat, float _angle);
};

#endif