Skip to content

Commit 7728987

Browse files
author
kevyuu
committed
use hlsl::numbers instead of constant from core
1 parent 2157235 commit 7728987

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/nbl/asset/utils/CGeometryCreator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,15 @@ core::smart_refctd_ptr<ICPUPolygonGeometry> CGeometryCreator::createSphere(float
450450
//if (y==0)
451451
//{
452452
if (normal.y != -1.0f && normal.y != 1.0f)
453-
tu = static_cast<float>(acos(core::clamp(normal.x / sinay, -1.0, 1.0)) * 0.5 * core::RECIPROCAL_PI<double>());
453+
tu = static_cast<float>(acos(core::clamp(normal.x / sinay, -1.0, 1.0)) * 0.5 * numbers::inv_pi<float32_t>());
454454
if (normal.z < 0.0f)
455455
tu = 1 - tu;
456456
//}
457457
//else
458458
//tu = ((float*)(tmpMem+(i-polyCountXPitch)*vertexSize))[4];
459459

460460
positions[vertex_i] = pos;
461-
uvs[vertex_i] = { packSnorm(tu), packSnorm(static_cast<float>(ay * core::RECIPROCAL_PI<double>())) };
461+
uvs[vertex_i] = { packSnorm(tu), packSnorm(static_cast<float>(ay * numbers::inv_pi<float32_t>())) };
462462
memcpy(normals + vertex_i, &quantizedNormal, sizeof(quantizedNormal));
463463

464464
vertex_i++;
@@ -563,7 +563,7 @@ core::smart_refctd_ptr<ICPUPolygonGeometry> CGeometryCreator::createCylinder(
563563
}
564564

565565
const float tesselationRec = 1.f / static_cast<float>(tesselation);
566-
const float step = 2.f * core::PI<float>() * tesselationRec;
566+
const float step = 2.f * numbers::pi<float32_t> * tesselationRec;
567567
for (uint32_t i = 0u; i < tesselation; ++i)
568568
{
569569
const auto f_i = static_cast<float>(i);

0 commit comments

Comments
 (0)