Skip to content

Commit 94c65b6

Browse files
author
kevyuu
committed
Remove forEachBroadphaseNeighborCandidates overload that takes vertex as argument
1 parent ff42165 commit 94c65b6

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

include/nbl/asset/utils/CVertexHashGrid.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,6 @@ class CVertexHashGrid
6565

6666
inline uint32_t getVertexCount() const { return m_vertices.size(); }
6767

68-
template <HashGridIteratorFn<VertexData> Fn>
69-
inline void forEachBroadphaseNeighborCandidates(const VertexData& vertex, Fn&& fn) const
70-
{
71-
std::array<uint32_t, 8> neighboringCells;
72-
const auto cellCount = getNeighboringCellHashes(neighboringCells.data(), vertex.getPosition());
73-
74-
//iterate among all neighboring cells
75-
for (uint8_t i = 0; i < cellCount; i++)
76-
{
77-
const auto& neighborCell = neighboringCells[i];
78-
BucketBounds bounds = getBucketBoundsByHash(neighborCell);
79-
for (; bounds.begin != bounds.end; bounds.begin++)
80-
{
81-
const vertex_data_t& neighborVertex = *bounds.begin;
82-
if (&vertex != &neighborVertex)
83-
if (!std::invoke(std::forward<Fn>(fn), neighborVertex)) break;
84-
}
85-
}
86-
}
87-
8868
template <HashGridIteratorFn<VertexData> Fn>
8969
inline void forEachBroadphaseNeighborCandidates(const hlsl::float32_t3& position, Fn&& fn) const
9070
{

src/nbl/asset/utils/CSmoothNormalGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ core::smart_refctd_ptr<ICPUPolygonGeometry> CSmoothNormalGenerator::processConne
9999
{
100100
auto normal = processedVertex.weightedNormal;
101101

102-
vertexHashMap.forEachBroadphaseNeighborCandidates(processedVertex, [&](const VertexHashMap::vertex_data_t& candidate)
102+
vertexHashMap.forEachBroadphaseNeighborCandidates(processedVertex.getPosition(), [&](const VertexHashMap::vertex_data_t& candidate)
103103
{
104-
if (compareVertexPosition(processedVertex.position, candidate.position, epsilon) &&
104+
if (processedVertex.index != candidate.index && compareVertexPosition(processedVertex.position, candidate.position, epsilon) &&
105105
vxcmp(processedVertex, candidate, polygon))
106106
{
107107
//TODO: better mean calculation algorithm

0 commit comments

Comments
 (0)