RayTracing/raytracing.github.io

Book 2 3.4. Missing inclusion of interval header

Closed this issue · 4 comments

Missing inclusion of interval header in aabb.h class:

#ifndef AABB_H
#define AABB_H

class aabb {
  public:
    interval x, y, z;
...

should be:

#ifndef AABB_H
#define AABB_H

#include "interval.h"

class aabb {
  public:
    interval x, y, z;
...

This issue is both in src/TheNextWeek/aabb.h , src/TheRestOfYourLife/aabb.h, and Book 2 Listing 8

But 'rtweekend.h' isn't included in 'aabb.h' either?

Maybe this is a misunderstanding on my part, but even when I try run the code without either 'rtweekend.h' or 'interval.h' included in 'aabb.h', I get errors saying the interval functions aren't defined.

See section 6.7, just after listing 24:

Program files will include rtweekend.h first, so all other header files (where the bulk of our code will reside) can implicitly assume that rtweekend.h has already been included. Header files still need to explicitly include any other necessary header files.