Skip to content
Snippets Groups Projects
Commit de18b725 authored by Christian Strømme's avatar Christian Strømme
Browse files

Add intersection test for flat bounding volumes


Change-Id: I3183d38727b2ddc95be0a3fade2ef475717d6f45
Reviewed-by: default avatarAndy Nichols <andy.nichols@qt.io>
parent 12fec5d2
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,12 @@ void intersection::aabbIntersection(const IntersectionFunc &intersectFunc)
res = intersectFunc(globalTransform, bounds, pickRay);
QCOMPARE(res.intersects, true);
{ // Test against a flat bounding volume
QSSGBounds3 boundsFlat { /*min=*/ QVector3D{ -1.0f, 0.0f, -1.0f }, /*max=*/ QVector3D{ 1.0f, 0.0f, 1.0f } };
res = intersectFunc(globalTransform, boundsFlat, QSSGRenderRay(/*Origin=*/{0.0f, 10.0f, 0.0f}, /*Direction=*/{0.0f, -1.0f, 0.0f}));
QCOMPARE(res.intersects, true);
}
{ // horizontal scan
const int steps = 10;
const float stepping = (bounds.maximum.x() - bounds.minimum.x()) / float(steps);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment