Skip to content

Commit

Permalink
docs: update ray sphere intersection brief
Browse files Browse the repository at this point in the history
  • Loading branch information
recp committed Mar 22, 2024
1 parent ceaa54a commit e4c38cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/cglm/struct/ray.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ glms_ray_(triangle)(vec3s origin,
/*!
* @brief ray sphere intersection
*
* - t1 > 0, t2 > 0: ray intersects the sphere at t1 and t2 both ahead of the origin
* - t1 < 0, t2 > 0: ray starts inside the sphere, exits at t2
* - t1 < 0, t2 < 0: no intersection ahead of the ray
* - the caller can check if the intersection points (t1 and t2) fall within a
* specific range (for example, tmin < t1, t2 < tmax) to determine if the
* intersections are within a desired segment of the ray
*
* @param[in] origin ray origin
* @param[out] dir normalized ray direction
* @param[in] s sphere [center.x, center.y, center.z, radii]
Expand Down

0 comments on commit e4c38cc

Please sign in to comment.