aboutsummaryrefslogtreecommitdiffstats
path: root/src/vec3.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-08-01 16:48:27 +0200
committerladevieq <ladevie.quentin@gmail.com>2021-08-01 16:48:27 +0200
commit0dafba17af044532fa2f14c61176e7994336f56c (patch)
tree076570f30f590b44e7e076ae497fddd18fd80ed9 /src/vec3.cpp
parent17ccf3158443a245ceeabc49cd62f50129a8852d (diff)
Use SAH to generate BVH & fix ray triangle intersection
Diffstat (limited to 'src/vec3.cpp')
-rw-r--r--src/vec3.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/vec3.cpp b/src/vec3.cpp
index 8f7a720..166f681 100644
--- a/src/vec3.cpp
+++ b/src/vec3.cpp
@@ -139,32 +139,3 @@ vec3 refract(const vec3& uv, const vec3& n, float etai_over_etat) {
std::ostream& operator<<(std::ostream& out, vec3 vec) {
return out << vec.x << ' ' << vec.y << ' ' << vec.z << std::endl;
}
-
-// TODO: Use something else to find random point onto a sphere
-vec3 random_in_unit_sphere() {
- while (true) {
- auto p = vec3::random(-1,1);
- if (p.length_sq() >= 1) continue;
- return p;
- }
-}
-
-vec3 random_unit_vector() {
- return random_in_unit_sphere().unit();
-}
-
-vec3 random_in_hemisphere(const vec3& normal) {
- vec3 in_unit_sphere = random_in_unit_sphere();
- if (in_unit_sphere.dot(normal) > 0.0) // In the same hemisphere as the normal
- return in_unit_sphere;
- else
- return -in_unit_sphere;
-}
-
-vec3 random_in_unit_disk() {
- while (true) {
- auto p = vec3(randd(-1, 1), randd(-1, 1), 0);
- if (p.length_sq() >= 1) continue;
- return p;
- }
-}