INFO804 Introduction à l'informatique graphique
Loading...
Searching...
No Matches
Light.h
Go to the documentation of this file.
1/**
2@file Light.h
3@author JOL
4*/
5#pragma once
6#ifndef _LIGHT_H_
7#define _LIGHT_H_
8
9// In order to call opengl commands in all graphical objects
10#include "Viewer.h"
11#include "PointVector.h"
12
13/// Namespace RayTracer
14namespace rt {
15
16 /// Lights are used to give lights in a scene.
17 struct Light {
18
19 /// Default constructor. Nothing to do.
20 Light() {}
21
22 /// Virtual destructor since object contains virtual methods.
23 virtual ~Light() {}
24
25 /// This method is called by Scene::init() at the beginning of the
26 /// display in the OpenGL window.
27 virtual void init( Viewer& /* viewer */ ) = 0;
28
29 /// This method is called by Scene::light() at each frame to
30 /// set the lights in the OpenGL window.
31 virtual void light( Viewer& /* viewer */ ) = 0;
32
33 /// This method is called by Scene::draw() at each frame to
34 /// redisplay objects in the OpenGL window.
35 virtual void draw( Viewer& /* viewer */) = 0;
36
37 /// Given the point \a p, returns the normalized direction to this
38 /// light.
39 virtual Vector3 direction( const Vector3& /* p */ ) const = 0;
40
41 /// @return the color of this light viewed from the given point \a
42 /// p.
43 virtual Color color( const Vector3& /* p */ ) const = 0;
44
45 };
46
47} // namespace rt
48
49#endif // #define _LIGHT_H_
Namespace RayTracer.
Definition Color.h:11
Lights are used to give lights in a scene.
Definition Light.h:17
virtual void init(Viewer &)=0
virtual ~Light()
Virtual destructor since object contains virtual methods.
Definition Light.h:23
virtual Vector3 direction(const Vector3 &) const =0
virtual Color color(const Vector3 &) const =0
Light()
Default constructor. Nothing to do.
Definition Light.h:20
virtual void light(Viewer &)=0
virtual void draw(Viewer &)=0