aboutsummaryrefslogtreecommitdiff
path: root/src/common/Collision/BoundingIntervalHierarchy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Collision/BoundingIntervalHierarchy.cpp')
-rw-r--r--src/common/Collision/BoundingIntervalHierarchy.cpp16
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);