+struct Sphere {
+ glm::vec3 origin;
+ float radius;
+};
+
+std::ostream &operator <<(std::ostream &, const Sphere &);
+
+/// Test for intersection of sphere with double sided infinite plane.
+/// If true, dist will hold the smaller interpenetration depth and norm
+/// the respective contact normal.
+bool Intersection(
+ const Sphere &sphere,
+ const Plane &plane,
+ float &dist,
+ glm::vec3 &norm) noexcept;
+
+/// Test for intersection of sphere with half space defined by the
+/// backface of given plane.
+/// In all cases, dist will hold the distance between the near points
+/// of plane and sphere. Contact normal will always be the plane's normal.
+bool Intersection(
+ const Sphere &sphere,
+ const Plane &plane,
+ float &dist) noexcept;
+