Assignments Assignments

spotLight.h
Go to the documentation of this file.
1#ifndef SPOT_LIGHT_INCLUDED
2#define SPOT_LIGHT_INCLUDED
3#include "light.h"
4
5 namespace Ray
6{
13 class SpotLight : public Light
14 {
16 Util::Point3D _location;
17
19 Util::Point3D _direction;
20
22 double _constAtten;
23
25 double _linearAtten;
26
28 double _quadAtten;
29
31 double _cutOffAngle;
32
34 double _dropOffRate;
35
36 public:
38 static std::string Directive( void ){ return "light_spot"; }
39
41 // Light methods //
43 private:
44 void _write( std::ostream &stream ) const;
45 void _read( std::istream &stream );
46 public:
47 std::string name( void ) const { return "spot light"; }
48 Util::Point3D getAmbient ( Util::Ray3D ray , const class RayShapeIntersectionInfo& iInfo , const Material &material ) const;
49 Util::Point3D getDiffuse ( Util::Ray3D ray , const class RayShapeIntersectionInfo& iInfo , const Material &material ) const;
50 Util::Point3D getSpecular( Util::Ray3D ray , const class RayShapeIntersectionInfo& iInfo , const Material &material ) const;
51 bool isInShadow( const class RayShapeIntersectionInfo& iInfo , const Shape &shape , unsigned int tIdx ) const;
52 Util::Point3D transparency( const class RayShapeIntersectionInfo &iInfo , const class Shape &shape , Util::Point3D cLimit , unsigned int samples , unsigned int tIdx ) const;
53 void drawOpenGL( int index , GLSLProgram * glslProgram ) const;
54 };
55}
56#endif // SPOT_LIGHT_INCLUDED
57
58
GLSLProgram
Definition GLSLProgram.h:33
Ray::Light
Definition light.h:9
Ray::Material
Definition scene.h:249
Ray::RayShapeIntersectionInfo
Definition scene.h:223
Ray::Shape
Definition shape.h:90
Ray::SpotLight
Definition spotLight.h:14
Ray::SpotLight::_cutOffAngle
double _cutOffAngle
Definition spotLight.h:31
Ray::SpotLight::_linearAtten
double _linearAtten
Definition spotLight.h:25
Ray::SpotLight::_read
void _read(std::istream &stream)
Definition spotLight.cpp:16
Ray::SpotLight::_constAtten
double _constAtten
Definition spotLight.h:22
Ray::SpotLight::getDiffuse
Util::Point3D getDiffuse(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const
Definition spotLight.todo.cpp:21
Ray::SpotLight::_dropOffRate
double _dropOffRate
Definition spotLight.h:34
Ray::SpotLight::getSpecular
Util::Point3D getSpecular(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const
Definition spotLight.todo.cpp:30
Ray::SpotLight::_location
Util::Point3D _location
Definition spotLight.h:16
Ray::SpotLight::_write
void _write(std::ostream &stream) const
Definition spotLight.cpp:23
Ray::SpotLight::Directive
static std::string Directive(void)
Definition spotLight.h:38
Ray::SpotLight::drawOpenGL
void drawOpenGL(int index, GLSLProgram *glslProgram) const
Definition spotLight.todo.cpp:57
Ray::SpotLight::transparency
Util::Point3D transparency(const class RayShapeIntersectionInfo &iInfo, const class Shape &shape, Util::Point3D cLimit, unsigned int samples, unsigned int tIdx) const
Definition spotLight.todo.cpp:48
Ray::SpotLight::isInShadow
bool isInShadow(const class RayShapeIntersectionInfo &iInfo, const Shape &shape, unsigned int tIdx) const
Definition spotLight.todo.cpp:39
Ray::SpotLight::_direction
Util::Point3D _direction
Definition spotLight.h:19
Ray::SpotLight::name
std::string name(void) const
Definition spotLight.h:47
Ray::SpotLight::_quadAtten
double _quadAtten
Definition spotLight.h:28
Ray::SpotLight::getAmbient
Util::Point3D getAmbient(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const
Definition spotLight.todo.cpp:12
Util::Point< 3 >
Util::Ray
Definition geometry.h:299
light.h
Ray
Definition box.h:7