diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-07-05 12:43:02 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2024-07-05 12:43:02 +0200 |
commit | 76a36113178cdfceeb2db40126c0ee171dc4dbcd (patch) | |
tree | 0073fbd2786123f4a4bd63955e4de556ddaf2aa9 /src/common/Collision/BoundingIntervalHierarchy.cpp | |
parent | ff4fc1ad4e91e3da9cd8c011f30473a19a3d47bd (diff) |
Core/Vmaps: Replace floatToRawIntBits/intBitsToFloat with standard bit_cast utilities
Diffstat (limited to 'src/common/Collision/BoundingIntervalHierarchy.cpp')
-rw-r--r-- | src/common/Collision/BoundingIntervalHierarchy.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<uint32> &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<uint32>(nodeL); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(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<uint32> &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<uint32>(prevClip); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(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<uint32>(-G3D::finf()); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(prevClip); } // count stats for the unused leaf depth++; @@ -224,8 +224,8 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &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<uint32>(clipL); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(clipR); // prepare L/R child boxes AABound gridBoxL(gridBox), gridBoxR(gridBox); AABound nodeBoxL(nodeBox), nodeBoxR(nodeBox); |