-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbvh.h
More file actions
30 lines (25 loc) · 666 Bytes
/
bvh.h
File metadata and controls
30 lines (25 loc) · 666 Bytes
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
#ifndef BVH_H
#define BVH_H
#include "Geometry.h"
#include "Plane.h"
#include "Box.h"
#include "GeometryUtil.h"
#include "Util.h"
#include "kernel.h"
typedef struct BVHNode {
BVHNode *left, *right;
Geometry *geom;
BoundingBox bb;
__device__ BVHNode() : left(NULL), right(NULL), geom(NULL) {}
__device__ BVHNode(Geometry *object) : left(NULL), right(NULL), geom(object) {
bb = geom->getBoundingBox();
}
} BVHNode;
typedef struct BVHTree {
BVHNode *root;
Plane **planeList;
int planeListSize;
} BVHTree;
void formBVH(Geometry *dGeomList[], int geomCount, Plane *planeList[],
int planeCount, BVHTree *dTree);
#endif //BVH_H