Added reasons to assertions

This commit is contained in:
2023-07-23 10:15:37 -07:00
parent 1b0218c9f3
commit a5b36fb24a
79 changed files with 359 additions and 291 deletions

View File

@ -39,9 +39,9 @@ bool_t Dawn::raytestTriangle(
glm::vec3 *hitNormal,
float_t *hitDistance
) {
assertNotNull(hitPoint);
assertNotNull(hitNormal);
assertNotNull(hitDistance);
assertNotNull(hitPoint, "Ray3D::raytestTriangle: hitPoint cannot be null");
assertNotNull(hitNormal, "Ray3D::raytestTriangle: hitNormal cannot be null");
assertNotNull(hitDistance, "Ray3D::raytestTriangle: hitDistance cannot be null");
// Calculate the normal of the triangle
glm::vec3 e0 = triangle.v1 - triangle.v0;
@ -92,9 +92,9 @@ bool_t Dawn::raytestAABB(
glm::vec3 *normal,
float_t *distance
) {
assertNotNull(point);
assertNotNull(normal);
assertNotNull(distance);
assertNotNull(point, "Ray3D::raytestAABB: point cannot be null");
assertNotNull(normal, "Ray3D::raytestAABB: normal cannot be null");
assertNotNull(distance, "Ray3D::raytestAABB: distance cannot be null");
// Compute the inverse direction of the ray, for numerical stability
glm::vec3 invDir(1.0f / ray.direction.x, 1.0f / ray.direction.y, 1.0f / ray.direction.z);
@ -176,9 +176,9 @@ bool_t Dawn::raytestQuad(
glm::vec3 *normal,
float_t *distance
) {
assertNotNull(point);
assertNotNull(normal);
assertNotNull(distance);
assertNotNull(point, "Ray3D::raytestQuad: point cannot be null");
assertNotNull(normal, "Ray3D::raytestQuad: normal cannot be null");
assertNotNull(distance, "Ray3D::raytestQuad: distance cannot be null");
// transform ray into local space of the quad
glm::mat4 inverseTransform = glm::inverse(transform);