58 m_max_leaf_size( 4u ),
59 m_force_splitting( true ),
60 m_force_alignment( false ),
61 m_single_axis_threshold( 1024*1024*64 ) {}
82 template <
typename Iterator>
96 template <
typename Iterator,
typename CostIterator>
100 CostIterator cost_begin,
102 Stats* stats = NULL);
105 uint32
index(
const uint32 i)
const {
return m_entities[m_indices[0][i]].m_index; }
109 const uint32 n_entities,
131 typedef std::stack<Node> Node_stack;
140 bool find_largest_axis_split(
146 bool find_best_split(
152 struct Bvh_partitioner;
154 uint32 m_max_leaf_size;
155 bool m_force_splitting;
156 bool m_force_alignment;
157 uint32 m_single_axis_threshold;
158 std::vector<int> m_indices[3];
159 std::vector<Entity> m_entities;
160 std::vector<bbox_type> m_bboxes;
161 std::vector<float> m_costs;
162 std::vector<int> m_tmpInt;
163 std::vector<uint8> m_tag_bits;
168 namespace deprecated {
188 m_max_leaf_size( 4u ),
189 m_force_splitting( true ),
190 m_force_alignment( false ),
191 m_partial_build( false ),
192 m_single_axis_threshold( 1024*1024*64 ) {}
216 template <
typename Iterator>
223 uint32
index(
const uint32 i)
const {
return m_entities[i].m_index; }
227 class IndexSortPredicate;
243 typedef std::stack<Node> Node_stack;
252 bool find_best_split(
258 struct Bvh_partitioner;
260 uint32 m_max_leaf_size;
261 bool m_force_splitting;
262 bool m_force_alignment;
263 bool m_partial_build;
264 uint32 m_single_axis_threshold;
265 std::vector<Entity> m_entities;
266 std::vector<bbox_type> m_bboxes;
273 #include <cugar/bvh/bvh_sah_builder_inline.h> Entry point to the generic Bounding Volume Hierarchy library.
void set_single_axis_threshold(const uint32 v)
set single axis test threshold
Definition: bvh_sah_builder.h:207
void set_force_alignment(const bool flag)
set force 'max leaf size'-aligned splits
Definition: bvh_sah_builder.h:70
thrust::device_vector< T >::iterator begin(thrust::device_vector< T > &vec)
Definition: thrust_view.h:89
Definition: bvh_node.h:45
void set_force_splitting(const bool flag)
set force splitting
Definition: bvh_sah_builder.h:198
void set_partial_build(const bool flag)
set partial build
Definition: bvh_sah_builder.h:204
Definition: bvh_sah_builder.h:43
Bvh_sah_builder()
constructor
Definition: bvh_sah_builder.h:187
Definition: bvh_sah_builder.h:173
void set_force_alignment(const bool flag)
set force 'max leaf size'-aligned splits
Definition: bvh_sah_builder.h:201
void set_max_leaf_size(const uint32 max_leaf_size)
set bvh parameters
Definition: bvh_sah_builder.h:64
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
void set_single_axis_threshold(const uint32 v)
set single axis test threshold
Definition: bvh_sah_builder.h:73
Definition: bvh_sah_builder.h:51
Definition: bvh_sah_builder.h:181
void build(Iterator begin, Iterator end, bvh_type *bvh, Stats *stats=NULL)
Definition: bvh_sah_builder_inline.h:187
CUGAR_HOST_DEVICE float area(const Bbox2f &bbox)
Definition: bbox_inline.h:134
uint32 index(const uint32 i) const
remapped point index
Definition: bvh_sah_builder.h:223
void set_max_leaf_size(const uint32 max_leaf_size)
set bvh parameters
Definition: bvh_sah_builder.h:195
Bvh_sah_builder()
constructor
Definition: bvh_sah_builder.h:57
Definition: bvh_sah_builder_inline.h:35
Definition: bvh_sah_builder_inline.h:240
Definition: bvh_sah_builder_inline.h:597
uint32 index(const uint32 i) const
remapped point index
Definition: bvh_sah_builder.h:105
void set_force_splitting(const bool flag)
set force splitting
Definition: bvh_sah_builder.h:67