Model is loaded and added, started to implement ray generation
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <glm/glm.hpp>
|
||||
#include <algorithm>
|
||||
#include "util/Ray.h"
|
||||
#include <iostream>
|
||||
|
||||
struct AABB
|
||||
{
|
||||
@@ -45,9 +46,13 @@ struct AABB
|
||||
}
|
||||
bool intersects(Ray ray, float tmin, float tmax)
|
||||
{
|
||||
std::cout << "Hello1" << std::endl;
|
||||
glm::vec3 invD = 1.0f / ray.direction;
|
||||
std::cout << "Hello2: " << min.x << " " << min.y << " " << min.z << " " << max.x << " " << max.y << " " << max.z << " " << std::endl;
|
||||
glm::vec3 t0s = glm::vec3(min - ray.origin) * invD;
|
||||
std::cout << "Hello3" << std::endl;
|
||||
glm::vec3 t1s = glm::vec3(max - ray.origin) * invD;
|
||||
std::cout << "Hello4" << std::endl;
|
||||
|
||||
glm::vec3 tsmaller = glm::min(t0s, t1s);
|
||||
glm::vec3 tbigger = glm::max(t0s, t1s);
|
||||
|
||||
Reference in New Issue
Block a user