Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class Balsa(ConanFile):
"onetbb/2022.0.0",
]

def configure(self):
self.options["hwloc"].shared = True

def generate(self):
meson = MesonToolchain(self)
meson.generate()
6 changes: 3 additions & 3 deletions visualization/include/balsa/scene_graph/BVHData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ class BVHData : public AbstractFeature {
private:
// ── BVH storage (one per K variant) ─────────────────────────────

quiver::spatial::BVH<3, 3> _bvh_3;
quiver::spatial::BVH<3, 9> _bvh_9;
quiver::spatial::BVH<3, 13> _bvh_13;
quiver::spatial::BVH<double, 3, 3> _bvh_3;
quiver::spatial::BVH<double, 3, 9> _bvh_9;
quiver::spatial::BVH<double, 3, 13> _bvh_13;

int _bvh_height = -1;

Expand Down
17 changes: 9 additions & 8 deletions visualization/src/scene_graph/BVHData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ namespace balsa::scene_graph {

// ── Collect BVH node bounds at a given tree depth ───────────────────

template<int8_t SpatialDim, int8_t K, typename DirPolicy>
template<typename T, int8_t SpatialDim, int8_t K, typename DirPolicy>
static auto collect_bounds_at_depth(
const quiver::spatial::BVH<SpatialDim, K, DirPolicy> &bvh,
const quiver::spatial::BVH<T, SpatialDim, K, DirPolicy> &bvh,
int target_depth)
-> std::vector<quiver::spatial::KDOP<SpatialDim, K, DirPolicy>> {
-> std::vector<quiver::spatial::KDOP<T, SpatialDim, K, DirPolicy>> {

using kdop_type = quiver::spatial::KDOP<SpatialDim, K, DirPolicy>;
using kdop_type = quiver::spatial::KDOP<T, SpatialDim, K, DirPolicy>;
std::vector<kdop_type> result;

if (!bvh.is_built() || bvh.node_count() == 0) return result;
Expand Down Expand Up @@ -56,7 +56,7 @@ static auto collect_bounds_at_depth(
template<int8_t K, typename DirPolicy>
static void set_kdop_wireframe(
MeshData &mesh_data,
const std::vector<quiver::spatial::KDOP<3, K, DirPolicy>> &bounds,
const std::vector<quiver::spatial::KDOP<double, 3, K, DirPolicy>> &bounds,
float uniform_color[4]) {

std::vector<Vec3f> all_positions;
Expand Down Expand Up @@ -161,19 +161,20 @@ void BVHData::rebuild_bvh(MeshData &mesh_data) {
config.max_leaf_size = max_leaf_size;

if (kdop_k == 3) {
_bvh_3 = quiver::spatial::make_bvh<2, 3, 3>(mesh, pos, config);
_bvh_3 = quiver::spatial::make_bvh<double, 2, 3, 3>(mesh, pos, config);
_bvh_height = _bvh_3.height();
spdlog::info("Built AABB BVH: {} nodes, height {}",
_bvh_3.node_count(),
_bvh_height);
} else if (kdop_k == 9) {
_bvh_9 = quiver::spatial::make_bvh<2, 3, 9>(mesh, pos, config);
_bvh_9 = quiver::spatial::make_bvh<double, 2, 3, 9>(mesh, pos, config);
_bvh_height = _bvh_9.height();
spdlog::info("Built 9-DOP BVH: {} nodes, height {}",
_bvh_9.node_count(),
_bvh_height);
} else {
_bvh_13 = quiver::spatial::make_bvh<2, 3, 13>(mesh, pos, config);
_bvh_13 =
quiver::spatial::make_bvh<double, 2, 3, 13>(mesh, pos, config);
_bvh_height = _bvh_13.height();
spdlog::info("Built 13-DOP BVH: {} nodes, height {}",
_bvh_13.node_count(),
Expand Down
Loading