16# include <openvdb/openvdb.h>
84 std::shared_ptr<OctreeNode>
get_root()
const;
88 void visualize(std::ofstream &file,
const std::string object_name)
const;
101 void evaluate_volume_density(
107 float3 position_to_index_scale_;
108 float3 index_to_position_scale_;
110 int3 position_to_floor_index(
const float3 p)
const;
111 int3 position_to_ceil_index(
const float3 p)
const;
114 bool should_split(std::shared_ptr<OctreeNode> &
node)
const;
117 float volume_scale(
const Object *
object)
const;
120 void recursive_build(std::shared_ptr<OctreeNode> &);
122 std::shared_ptr<OctreeInternalNode> make_internal(std::shared_ptr<OctreeNode> &
node);
125 std::shared_ptr<OctreeNode> root_;
137 std::atomic<int> num_nodes_ = 1;
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
void visualize(std::ofstream &file, const std::string object_name) const
int get_num_nodes() const
float3 voxel_size() const
int flatten_index(int x, int y, int z) const
void flatten(KernelOctreeNode *, const int, const std::shared_ptr< OctreeNode > &, int &) const
void set_flattened(const bool=true)
float3 index_to_position(int x, int y, int z) const
std::shared_ptr< OctreeNode > get_root() const
void build(Device *, Progress &, const Object *, const Shader *)
bool is_flattened() const
Octree(const BoundBox &bbox)
#define CCL_NAMESPACE_END
OctreeInternalNode(OctreeNode &node)
vector< std::shared_ptr< OctreeNode > > children_
virtual ~OctreeNode()=default
OctreeNode(BoundBox bbox_, int depth_)
void visualize(std::string &str) const