Skip to content

Commit ac25a95

Browse files
author
kevyuu
committed
Small stylistic fixes
1 parent 61ec9c4 commit ac25a95

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

include/nbl/asset/utils/CPolygonGeometryManipulator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class NBL_API2 CPolygonGeometryManipulator
243243

244244
static core::smart_refctd_ptr<ICPUPolygonGeometry> createUnweldedList(const ICPUPolygonGeometry* inGeo);
245245

246-
static core::smart_refctd_ptr<ICPUPolygonGeometry> createSmoothVertexNormal(const ICPUPolygonGeometry* inbuffer, bool enableWelding, float epsilon = 1.525e-5f,
246+
static core::smart_refctd_ptr<ICPUPolygonGeometry> createSmoothVertexNormal(const ICPUPolygonGeometry* inbuffer, bool enableWelding = false, float epsilon = 1.525e-5f,
247247
VxCmpFunction vxcmp = [](const CPolygonGeometryManipulator::SSNGVertexData& v0, const CPolygonGeometryManipulator::SSNGVertexData& v1, const ICPUPolygonGeometry* buffer)
248248
{
249249
static constexpr float cosOf45Deg = 0.70710678118f;

src/nbl/asset/utils/CPolygonGeometryManipulator.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,14 @@ core::smart_refctd_ptr<ICPUPolygonGeometry> CPolygonGeometryManipulator::createS
139139
return nullptr;
140140
}
141141

142-
return CSmoothNormalGenerator::calculateNormals(inPolygon, epsilon, vxcmp, enableWelding);
142+
//Mesh need to be unwelded
143+
if (inPolygon->getIndexView())
144+
{
145+
_NBL_DEBUG_BREAK_IF(true);
146+
return nullptr;
147+
}
148+
149+
return CSmoothNormalGenerator::calculateNormals(inPolygon, enableWelding, epsilon, vxcmp);
143150
}
144151

145152
} // end namespace nbl::asset

src/nbl/asset/utils/CSmoothNormalGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static hlsl::float32_t3 getAngleWeight(
9797
acosf((b - c + a) / (2.f * bsqrt * asqrt)));
9898
}
9999

100-
core::smart_refctd_ptr<ICPUPolygonGeometry> CSmoothNormalGenerator::calculateNormals(const asset::ICPUPolygonGeometry* polygon, float epsilon, CPolygonGeometryManipulator::VxCmpFunction vxcmp, bool enableWelding)
100+
core::smart_refctd_ptr<ICPUPolygonGeometry> CSmoothNormalGenerator::calculateNormals(const asset::ICPUPolygonGeometry* polygon, bool enableWelding, float epsilon, CPolygonGeometryManipulator::VxCmpFunction vxcmp)
101101
{
102102
VertexHashMap vertexArray = setupData(polygon, epsilon);
103103
const auto smoothPolygon = processConnectedVertices(polygon, vertexArray, epsilon,vxcmp);

src/nbl/asset/utils/CSmoothNormalGenerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CSmoothNormalGenerator
1616
CSmoothNormalGenerator() = delete;
1717
~CSmoothNormalGenerator() = delete;
1818

19-
static core::smart_refctd_ptr<ICPUPolygonGeometry> calculateNormals(const ICPUPolygonGeometry* polygon, float epsilon, CPolygonGeometryManipulator::VxCmpFunction function, bool enableWelding);
19+
static core::smart_refctd_ptr<ICPUPolygonGeometry> calculateNormals(const ICPUPolygonGeometry* polygon, bool enableWelding, float epsilon, CPolygonGeometryManipulator::VxCmpFunction function);
2020

2121
private:
2222
class VertexHashMap

0 commit comments

Comments
 (0)