-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSceneObject.h
More file actions
41 lines (33 loc) · 1.12 KB
/
SceneObject.h
File metadata and controls
41 lines (33 loc) · 1.12 KB
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
/**
* \author Marie DARRIGOL & Anthony LEONARD & Ophélie PELLOUX-PRAYER & Olivier SOLDANO
* \project Ray-Tracing
* \class SceneObject.h
* \brief virtual class of scene object
*/
#pragma once
#include "Material.h"
#include "Ray.h"
#include <utility>
#include <iostream>
using namespace std;
class SceneObject{
public:
/**
* Determine if the ray have an intersection to the scene object
* return: true and the impact point if intersect, false and origin of the ray if not intersect
**/
virtual pair<bool, Vec3> intersect(Ray &ray){ return pair<bool, Vec3>(false, ray.getOrigin()); };
virtual Vec3 minCoordinates() = 0;
virtual Vec3 maxCoordinates() = 0;
// Used to compute the bump of the object on the impact point if it has a bump map
virtual Vec3 computeBump(const Vec3& impact) const = 0;
inline Vec3 getPosition() const { return position; };
inline Material getMaterial() const { return material; };
virtual void printSceneObject(){ cout << "simple scene object"; };
protected:
SceneObject();
SceneObject(Vec3 &position, Material &material);
// Represents the center of the object
Vec3 position;
Material material;
};