mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 17:12:51 +02:00
use glm::nan() for platform-agnostic code
This commit is contained in:
parent
f0bb4d3da7
commit
b3452f274e
1 changed files with 3 additions and 3 deletions
|
@ -31,20 +31,20 @@ static void testSphereVsCone(const glm::vec3 coneNormal, const glm::vec3 coneBiN
|
|||
glm::vec3 coneCenter = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
glm::vec3 sphereCenter = coneCenter + coneEdge * sphereDistance;
|
||||
float result = coneSphereAngle(coneCenter, u, sphereCenter, sphereRadius);
|
||||
QCOMPARE(isnan(result), false);
|
||||
QCOMPARE(glm::isnan(result), false);
|
||||
QCOMPARE(result < coneAngle, true);
|
||||
|
||||
// push sphere outward from edge so it is tangent to the cone.
|
||||
glm::vec3 sphereOffset = glm::angleAxis(PI / 2.0f, w) * coneEdge;
|
||||
sphereCenter += sphereOffset * sphereRadius;
|
||||
result = coneSphereAngle(coneCenter, u, sphereCenter, sphereRadius);
|
||||
QCOMPARE(isnan(result), false);
|
||||
QCOMPARE(glm::isnan(result), false);
|
||||
QCOMPARE_WITH_ABS_ERROR(result, coneAngle, 0.001f);
|
||||
|
||||
// push sphere outward from edge a bit further, so it is outside of the cone.
|
||||
sphereCenter += 0.1f * sphereOffset;
|
||||
result = coneSphereAngle(coneCenter, u, sphereCenter, sphereRadius);
|
||||
QCOMPARE(isnan(result), false);
|
||||
QCOMPARE(glm::isnan(result), false);
|
||||
QCOMPARE(result > coneAngle, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue