Add material support
This commit is contained in:
parent
6d98c22890
commit
58ffcff459
7 changed files with 112 additions and 36 deletions
17
hittable.hpp
17
hittable.hpp
|
|
@ -1,21 +1,8 @@
|
|||
#ifndef HITTABLE_H
|
||||
#define HITTABLE_H
|
||||
|
||||
#include "ray.hpp"
|
||||
|
||||
/* Representation of a hitpoint of a ray against a hittable object */
|
||||
struct hit_record {
|
||||
point3 p;
|
||||
vec3 normal;
|
||||
double t;
|
||||
bool front_face;
|
||||
|
||||
inline void set_face_normal(const ray& r, const vec3& outward_normal)
|
||||
{
|
||||
front_face = dot(r.direction, outward_normal) < 0;
|
||||
normal = front_face ? outward_normal : -outward_normal;
|
||||
}
|
||||
};
|
||||
#include "rtweekend.hpp"
|
||||
#include "material.hpp"
|
||||
|
||||
/* Virtual class that represents objects who could collide against a ray */
|
||||
struct hittable {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue