-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhit.h
29 lines (23 loc) · 892 Bytes
/
hit.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
#ifndef __HIT_H__
#define __HIT_H__
class Object;
// Records information about an intersection, which may be needed later for
// Boolean operations or for a subsequent call to Normal.
struct Hit
{
// The primitive geometry whose surface was intersected. This should
// not point at a Union, Difference, or Intersection object. Instead it
// should point at the particular component.
const Object* object;
// Distance along the ray at which this occurred
double t;
// For complex primitives (eg, cylinders), use this to record what part
// was intersected, since you will need to know this to compute the
// normal reliably.
int part;
// Was the ray entering or exiting the primitive geometry stored in
// "object"? This will tell you whether you will need to reverse the
// normal that you compute.
bool ray_exiting;
};
#endif