Skip to content

Commit 23dee88

Browse files
committed
Update bindings to reflect new Triangle BVHs
1 parent 864a095 commit 23dee88

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

bindings/pypbat/geometry/TriangleAabbHierarchy.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ namespace geometry {
1414
void BindTriangleAabbHierarchy(pybind11::module& m)
1515
{
1616
namespace pyb = pybind11;
17-
pbat::common::ForValues<2, 3>([&]<auto Dims>() {
18-
auto constexpr kDims = Dims;
19-
std::string const className = "TriangleAabbHierarchy" + std::to_string(kDims) + "D";
20-
using BvhType = pbat::geometry::TriangleAabbHierarchy<kDims>;
17+
pbat::common::ForTypes<
18+
pbat::geometry::TriangleAabbHierarchy2D,
19+
pbat::geometry::TriangleAabbHierarchy3D>([&]<class BvhType>() {
20+
auto constexpr kDims = BvhType::kDims;
21+
std::string const className = []() {
22+
if constexpr (kDims == 2)
23+
return "TriangleAabbHierarchy2D";
24+
else if constexpr (kDims == 3)
25+
return "TriangleAabbHierarchy3D";
26+
else
27+
static_assert(kDims == 2 || kDims == 3, "Only 2D and 3D BVHs are supported.");
28+
}();
2129
pyb::class_<BvhType>(m, className.data())
2230
.def(
2331
pyb::init(

0 commit comments

Comments
 (0)