-
Notifications
You must be signed in to change notification settings - Fork 0
/
surface.cpp
70 lines (58 loc) · 1.46 KB
/
surface.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*****************************************************************************
Base class for all object surface properties in the raycaster/raytracer
NAME:surface.cpp
DATE:17/11/1996
AUTHOR: Z.A. Nolan
*****************************************************************************/
// include the header file
#include "surface.h"
// constructor
TSurfaceProperties::TSurfaceProperties ()
{
_Colour=TColour(0.0,0.0,0.0) ;
}
TSurfaceProperties::TSurfaceProperties
(const TColour &Colour,const double Diffuse,
const double Specular,const double Shine,
const int Roughness)
{
_Colour=Colour ;
_Diffuse=Diffuse ;
_Specular=Specular ;
_Shine=Shine ;
_Roughness=Roughness ;
}
// return the colour of the object
TColour TSurfaceProperties::Colour() const
{
return _Colour ;
}
// return the diffuse value of the object of the object
double TSurfaceProperties::Diffuse() const
{
return _Diffuse ;
}
// return the specular value of the object
double TSurfaceProperties::Specular() const
{
return _Specular ;
}
// return the roughness of the object
int TSurfaceProperties::Roughness() const
{
return _Roughness ;
}
// return the shine of the object
double TSurfaceProperties::Shine() const
{
return _Shine ;
}
// copy
TSurfaceProperties::Copy(TSurfaceProperties &Surface)
{
_Colour=Surface.Colour() ;
_Diffuse=Surface.Diffuse() ;
_Specular=Surface.Specular() ;
_Shine=Surface.Shine() ;
_Roughness=Surface.Roughness() ;
}