-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtility.h
More file actions
71 lines (44 loc) · 1.8 KB
/
Utility.h
File metadata and controls
71 lines (44 loc) · 1.8 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
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
71
//
// Created by user on 2/28/2021.
//
/* Start Header -------------------------------------------------------
* Copyright (C) 2020 DigiPen Institute of Technology.
* Reproduction or disclosure of this file or its contents without the prior
* written consent of DigiPen Institute of Technology is prohibited.
* File Name: Utility.h
* Purpose: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* Language: C++, G++
* Platform: g++ (Ubuntu 9.3.0-10ubuntu2) 9.3, ThinkPad T430u, Nvidia GT 620M,
* OpenGL version string: 4.6.0 NVIDIA 390.138
* Project: Eye
* Author: Roland Shum, roland.shum@digipen.edu
* Creation date: 2/28/2021
* End Header --------------------------------------------------------*/
#ifndef EYE_UTILITY_H
#define EYE_UTILITY_H
#include "Hittable/IHittable.h"
double degreesToRadians(double degrees);
// Random from [0,1)
double randomDouble();
double randomDouble(double min, double max);
float randomFloat();
float randomFloat(float min, float max);
vec3 randomVec3();
vec3 randomVec3(double min, double max);
vec3 randomInSphere();
vec3 randomUnitVector();
vec3 randomInHemisphere(vec3 const & normal);
bool vecNearZero(vec3 const & vec);
vec3 Reflect(vec3 const & v, vec3 const & n);
vec3 Refract(vec3 const & uv, vec3 const & n, double k);
vec3 RandomUnitDisk();
float randomInt();
float randomInt(float min, float max);
class AABB;
AABB SurroundingBox(AABB box0, AABB box1);
class IHittable;
bool box_compare(const shared_ptr<IHittable>& a, const shared_ptr<IHittable> &b, int axis);
bool box_x_compare (const shared_ptr<IHittable> &a, const shared_ptr<IHittable>& b);
bool box_y_compare (const shared_ptr<IHittable> &a, const shared_ptr<IHittable> &b);
bool box_z_compare (const shared_ptr<IHittable> &a, const shared_ptr<IHittable> &b);
#endif //EYE_UTILITY_H