Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

BVH: no parameter named near (windows.h macro)

islandmed94935b9e0fe6
diff --git a/src/core/BVH.cpp b/src/core/BVH.cpp
index 1606f291..2e961938 100644
--- a/src/core/BVH.cpp
+++ b/src/core/BVH.cpp
@@ -394,12 +394,12 @@ void BVH::editLeaf(uint32_t leaf) {
++editsSinceBuild_;
}
-void BVH::insertTriangle(const Mesh& mesh, uint32_t t, uint32_t near) {
+void BVH::insertTriangle(const Mesh& mesh, uint32_t t, uint32_t nearby) {
if (nodes_.empty()) {
nodes_.push_back(Node{AABB{}, kNoLeaf, 0, 0});
leafBits_.resize(nodes_.size());
}
- uint32_t leaf = near < triLeaf_.size() ? triLeaf_[near] : kNoLeaf;
+ uint32_t leaf = nearby < triLeaf_.size() ? triLeaf_[nearby] : kNoLeaf;
if (leaf == kNoLeaf) { // down the tree towards the triangle's centroid
const glm::uvec3& tri = mesh.triangles[t];
const glm::vec3 c = (mesh.positions[tri.x] + mesh.positions[tri.y] + mesh.positions[tri.z]) / 3.0f;
diff --git a/src/core/BVH.h b/src/core/BVH.h
index 69f4469b..097154e3 100644
--- a/src/core/BVH.h
+++ b/src/core/BVH.h
@@ -44,10 +44,10 @@ public:
// Dynamic topology (core/Dyntopo.h): a few triangles at a time added, removed or renumbered without a
// rebuild. insertTriangle puts triangle t (a new last index, or one removeTriangle freed) in the leaf of
- // triangle `near` (or, if that isn't in the tree, the leaf its centroid falls in); refitChanged() then
+ // triangle `nearby` (or, if that isn't in the tree, the leaf its centroid falls in); refitChanged() then
// recomputes the boxes of every leaf edited since the last call (growing ancestors, as refit does) and
// splits leaves that grew too big. Boxes only grow, so after many edits rebuild when degraded() says so.
- void insertTriangle(const Mesh& mesh, uint32_t t, uint32_t near);
+ void insertTriangle(const Mesh& mesh, uint32_t t, uint32_t nearby);
void removeTriangle(uint32_t t);
// Triangle `from` is now numbered `to` (a free index); a freed last index can then be dropped with resizeTriangles.
void renumberTriangle(uint32_t from, uint32_t to);