-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaccelerator.h
32 lines (28 loc) · 1001 Bytes
/
accelerator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <vector>
class Geom;
struct Ray;
struct Intersection;
class Accelerator {
public:
virtual ~Accelerator();
/**
* Determines what object (if any) a given ray intersects.
*
* @param r the ray to send through the k-d tree
* @param isectOut [out] the intersection information if the ray hit some
* geometry, otherwise unmodified; the pointer must not
* be null
* @returns true if any geom was hit, otherwise false
*/
virtual bool intersect(const Ray& r, Intersection* isectOut) const = 0;
/**
* Determines if any object intersects the given shadow ray within a maximum
* distance.
*
* @param r the shadow ray to send through the k-d tree
* @param maxDist the maximum distance to check for intersections
* @returns true if any geom hit within maxDist, otherwise false
*/
virtual bool intersectShadow(const Ray& r, float maxDist) const = 0;
};