-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScene.hpp
48 lines (40 loc) · 1.55 KB
/
Scene.hpp
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
//
// Created by Göksu Güvendiren on 2019-05-14.
//
#pragma once
#include <vector>
#include "Vector.hpp"
#include "Object.hpp"
#include "Light.hpp"
#include "AreaLight.hpp"
#include "BVH.hpp"
#include "Ray.hpp"
class Scene
{
public:
// setting up options
int width = 1280;
int height = 960;
double fov = 40;
Vector3f backgroundColor = Vector3f(0.235294, 0.67451, 0.843137);
int maxDepth = 1;
float RussianRoulette = 0.8;
Scene(int w, int h) : width(w), height(h)
{}
void Add(Object *object) { objects.push_back(object); }
//void Add(std::unique_ptr<Light> light) { lights.push_back(std::move(light)); }
const std::vector<Object*>& get_objects() const { return objects; }
//const std::vector<std::unique_ptr<Light> >& get_lights() const { return lights; }
Intersection Intersect(const Ray& ray) const;
BVHAccel *bvh;
void buildBVH();
Vector3f castRay(const Ray &ray, int depth) const;
void sampleLight(Intersection &pos, float &pdf) const;
// std::tuple<Vector3f, Vector3f> HandleAreaLight(const AreaLight &light, const Vector3f &hitPoint, const Vector3f &N,
// const Vector3f &shadowPointOrig,
// const std::vector<Object *> &objects, uint32_t &index,
// const Vector3f &dir, float specularExponent);
// creating the scene (adding objects and lights)
std::vector<Object* > objects;
//std::vector<std::unique_ptr<Light> > lights;
};