clray
diff src/scene.h @ 32:4cf4919c3812
performance sucks
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 24 Aug 2010 05:43:57 +0100 |
parents | 353d80127627 |
children | 7d77ded5f890 |
line diff
1.1 --- a/src/scene.h Sun Aug 22 00:50:47 2010 +0100 1.2 +++ b/src/scene.h Tue Aug 24 05:43:57 2010 +0100 1.3 @@ -40,21 +40,12 @@ 1.4 float calc_surface_area() const; 1.5 }; 1.6 1.7 -enum { 1.8 - KDAXIS_X, 1.9 - KDAXIS_Y, 1.10 - KDAXIS_Z 1.11 -}; 1.12 - 1.13 struct KDNode { 1.14 - int axis; 1.15 - float pt; 1.16 AABBox aabb; 1.17 float cost; 1.18 1.19 KDNode *left, *right; 1.20 - int num_faces; // cause on some implementations list::size() is O(n) 1.21 - std::list<const Face*> faces; 1.22 + std::vector<int> face_idx; 1.23 1.24 KDNode(); 1.25 }; 1.26 @@ -115,4 +106,7 @@ 1.27 int kdtree_depth(const KDNode *tree); 1.28 int kdtree_nodes(const KDNode *tree); 1.29 1.30 +bool kdtree_dump(const KDNode *tree, const char *fname); 1.31 +KDNode *kdtree_restore(const char *fname); 1.32 + 1.33 #endif /* MESH_H_ */