Added reasons to assertions
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user