36 #include <thrust/transform.h> 37 #include <thrust/tuple.h> 46 struct bvh_packing_functor
50 typedef Bbox4f result_type;
51 typedef thrust::tuple<Bbox4f,Bvh_node> argument_type;
53 CUGAR_HOST_DEVICE Bbox4f operator() (
const argument_type arg)
const 55 Bbox4f bbox = thrust::get<0>(arg);
56 bbox[0][3] =
binary_cast<
float>( thrust::get<1>(arg).m_packed_data );
57 bbox[1][3] =
binary_cast<
float>( thrust::get<1>(arg).m_skip_node );
91 template <
typename Node_iterator,
typename Bbox_iterator,
typename Output_iterator>
96 Output_iterator packed_nodes)
99 thrust::make_zip_iterator(thrust::make_tuple(bboxes,nodes)),
100 thrust::make_zip_iterator(thrust::make_tuple(bboxes,nodes)) + n_nodes,
Entry point to the generic Bounding Volume Hierarchy library.
void transform(const uint32 n, const Iterator in, const Output out, const Functor functor)
Definition: primitives_inl.h:357
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Out binary_cast(const In in)
Definition: types.h:288
void pack(const uint32 n_nodes, Node_iterator nodes, Bbox_iterator bboxes, Output_iterator packed_nodes)
Definition: packing.h:92