Skip to content

Commit 75d486d

Browse files
author
kevyuu
committed
Remove unnecessary method on Icosphere
1 parent b957ca7 commit 75d486d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/nbl/asset/utils/CGeometryCreator.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -901,9 +901,7 @@ class Icosphere
901901

902902
~Icosphere() {}
903903

904-
unsigned int getPositionCount() const { return (unsigned int)vertices.size() / 3; }
905-
unsigned int getNormalCount() const { return (unsigned int)normals.size() / 3; }
906-
unsigned int getTexCoordCount() const { return (unsigned int)texCoords.size() / 2; }
904+
unsigned int getVertexCount() const { return (unsigned int)vertices.size() / 3; }
907905
unsigned int getIndexCount() const { return (unsigned int)indices.size(); }
908906
unsigned int getLineIndexCount() const { return (unsigned int)lineIndices.size(); }
909907
unsigned int getTriangleCount() const { return getIndexCount() / 3; }
@@ -1815,7 +1813,7 @@ core::smart_refctd_ptr<ICPUPolygonGeometry> CGeometryCreator::createIcoSphere(fl
18151813

18161814
// Create indices
18171815
{
1818-
auto indexView = createIndexView<Icosphere::index_t>(icosphere.getIndexCount(), icosphere.getPositionCount() - 1);
1816+
auto indexView = createIndexView<Icosphere::index_t>(icosphere.getIndexCount(), icosphere.getVertexCount() - 1);
18191817
memcpy(indexView.src.buffer->getPointer(), icosphere.getIndices(), icosphere.getIndexSize());
18201818
retval->setIndexView(std::move(indexView));
18211819
}
@@ -1825,7 +1823,7 @@ core::smart_refctd_ptr<ICPUPolygonGeometry> CGeometryCreator::createIcoSphere(fl
18251823
shapes::AABB<4, float32_t> aabb;
18261824
aabb.maxVx = float32_t4(radius, radius, radius, 0.f);
18271825
aabb.minVx = -aabb.maxVx;
1828-
auto positionView = createPositionView(icosphere.getPositionCount(), aabb);
1826+
auto positionView = createPositionView(icosphere.getVertexCount(), aabb);
18291827
memcpy(positionView.src.buffer->getPointer(), icosphere.getPositions(), icosphere.getPositionSize());
18301828
retval->setPositionView(std::move(positionView));
18311829
}
@@ -1851,10 +1849,10 @@ core::smart_refctd_ptr<ICPUPolygonGeometry> CGeometryCreator::createIcoSphere(fl
18511849
{
18521850
using uv_element_t = uint16_t;
18531851
hlsl::vector<uv_element_t, 2>* uvs;
1854-
auto uvView = createUvView<uv_element_t>(icosphere.getTexCoordCount());
1852+
auto uvView = createUvView<uv_element_t>(icosphere.getVertexCount());
18551853
uvs = reinterpret_cast<decltype(uvs)>(uvView.src.buffer->getPointer());
18561854

1857-
for (auto uv_i = 0u; uv_i < icosphere.getTexCoordCount(); uv_i++)
1855+
for (auto uv_i = 0u; uv_i < icosphere.getVertexCount(); uv_i++)
18581856
{
18591857
const auto texCoords = icosphere.getTexCoords();
18601858
const auto f32_uv = float32_t2{ texCoords[2 * uv_i], texCoords[(2 * uv_i) + 1] };

0 commit comments

Comments
 (0)