16# include <openvdb/openvdb.h>
83 std::shared_ptr<OctreeNode>
get_root()
const;
87 void visualize(std::ofstream &file,
const std::string object_name)
const;
100 void evaluate_volume_density(
106 float3 position_to_index_scale_;
107 float3 index_to_position_scale_;
109 int3 position_to_floor_index(
const float3 p)
const;
110 int3 position_to_ceil_index(
const float3 p)
const;
113 bool should_split(std::shared_ptr<OctreeNode> &node)
const;
116 float volume_scale(
const Object *
object)
const;
119 void recursive_build(std::shared_ptr<OctreeNode> &);
121 std::shared_ptr<OctreeInternalNode> make_internal(std::shared_ptr<OctreeNode> &node);
124 std::shared_ptr<OctreeNode> root_;
136 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