From 99c1870ad5462d1fd81324c8607aad44d0b2deb1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 21 Aug 2015 17:49:41 +0200 Subject: Cycles: Move primitive splitting into own functions This way it's easy to add more reference types allowed for splitting to the BVH reference split function without making this function too much big. This way it's possible to experiment with such features as splitting object instance references. So far should not be any functional changes. --- intern/cycles/bvh/bvh_split.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'intern/cycles/bvh/bvh_split.h') diff --git a/intern/cycles/bvh/bvh_split.h b/intern/cycles/bvh/bvh_split.h index 5b739311e5f..1b550d11b15 100644 --- a/intern/cycles/bvh/bvh_split.h +++ b/intern/cycles/bvh/bvh_split.h @@ -55,7 +55,26 @@ public: BVHSpatialSplit(BVHBuild *builder, const BVHRange& range, float nodeSAH); void split(BVHBuild *builder, BVHRange& left, BVHRange& right, const BVHRange& range); - void split_reference(BVHBuild *builder, BVHReference& left, BVHReference& right, const BVHReference& ref, int dim, float pos); + void split_reference(BVHBuild *builder, + BVHReference& left, + BVHReference& right, + const BVHReference& ref, + int dim, + float pos); + +protected: + void split_triangle_reference(const BVHReference& ref, + const Mesh *mesh, + int dim, + float pos, + BoundBox& left_bounds, + BoundBox& right_bounds); + void split_curve_reference(const BVHReference& ref, + const Mesh *mesh, + int dim, + float pos, + BoundBox& left_bounds, + BoundBox& right_bounds); }; /* Mixed Object-Spatial Split */ -- cgit v1.2.3