games101-hw/06/Assignment6/Intersection.hpp

30 lines
558 B
C++
Raw Permalink Normal View History

2023-06-19 17:02:04 +08:00
//
// Created by LEI XU on 5/16/19.
//
#ifndef RAYTRACING_INTERSECTION_H
#define RAYTRACING_INTERSECTION_H
#include "Vector.hpp"
#include "Material.hpp"
class Object;
class Sphere;
struct Intersection
{
Intersection(){
happened=false;
coords=Vector3f();
normal=Vector3f();
distance= std::numeric_limits<double>::max();
obj =nullptr;
m=nullptr;
}
bool happened;
Vector3f coords;
Vector3f normal;
double distance;
Object* obj;
Material* m;
};
#endif //RAYTRACING_INTERSECTION_H