From 76a36113178cdfceeb2db40126c0ee171dc4dbcd Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 5 Jul 2024 12:43:02 +0200 Subject: Core/Vmaps: Replace floatToRawIntBits/intBitsToFloat with standard bit_cast utilities --- src/common/Collision/BoundingIntervalHierarchy.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/common/Collision/BoundingIntervalHierarchy.cpp') diff --git a/src/common/Collision/BoundingIntervalHierarchy.cpp b/src/common/Collision/BoundingIntervalHierarchy.cpp index c70ac82c3aa..eeae4be71dc 100644 --- a/src/common/Collision/BoundingIntervalHierarchy.cpp +++ b/src/common/Collision/BoundingIntervalHierarchy.cpp @@ -119,8 +119,8 @@ void BIH::subdivide(int left, int right, std::vector &tempTree, buildDat // write bvh2 clip node stats.updateInner(); tempTree[nodeIndex + 0] = (axis << 30) | (1 << 29) | nextIndex; - tempTree[nodeIndex + 1] = floatToRawIntBits(nodeL); - tempTree[nodeIndex + 2] = floatToRawIntBits(nodeR); + tempTree[nodeIndex + 1] = advstd::bit_cast(nodeL); + tempTree[nodeIndex + 2] = advstd::bit_cast(nodeR); // update nodebox and recurse nodeBox.lo[axis] = nodeL; nodeBox.hi[axis] = nodeR; @@ -185,15 +185,15 @@ void BIH::subdivide(int left, int right, std::vector &tempTree, buildDat // write leaf node stats.updateInner(); tempTree[nodeIndex + 0] = (prevAxis << 30) | nextIndex; - tempTree[nodeIndex + 1] = floatToRawIntBits(prevClip); - tempTree[nodeIndex + 2] = floatToRawIntBits(G3D::finf()); + tempTree[nodeIndex + 1] = advstd::bit_cast(prevClip); + tempTree[nodeIndex + 2] = advstd::bit_cast(G3D::finf()); } else { // create a node with a right child // write leaf node stats.updateInner(); tempTree[nodeIndex + 0] = (prevAxis << 30) | (nextIndex - 3); - tempTree[nodeIndex + 1] = floatToRawIntBits(-G3D::finf()); - tempTree[nodeIndex + 2] = floatToRawIntBits(prevClip); + tempTree[nodeIndex + 1] = advstd::bit_cast(-G3D::finf()); + tempTree[nodeIndex + 2] = advstd::bit_cast(prevClip); } // count stats for the unused leaf depth++; @@ -224,8 +224,8 @@ void BIH::subdivide(int left, int right, std::vector &tempTree, buildDat // write leaf node stats.updateInner(); tempTree[nodeIndex + 0] = (axis << 30) | nextIndex; - tempTree[nodeIndex + 1] = floatToRawIntBits(clipL); - tempTree[nodeIndex + 2] = floatToRawIntBits(clipR); + tempTree[nodeIndex + 1] = advstd::bit_cast(clipL); + tempTree[nodeIndex + 2] = advstd::bit_cast(clipR); // prepare L/R child boxes AABound gridBoxL(gridBox), gridBoxR(gridBox); AABound nodeBoxL(nodeBox), nodeBoxR(nodeBox); -- cgit v1.2.3