From 90b53798c22dec45fcd3a232b68adf071884d2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Apr 2022 10:49:43 +0200 Subject: [PATCH] doc: cross-link intersection and bounding volume calculation algos. --- src/Magnum/Math/Intersection.h | 12 ++++++++++-- src/Magnum/MeshTools/BoundingVolume.h | 9 ++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Math/Intersection.h b/src/Magnum/Math/Intersection.h index ddd839db3..f65935fa9 100644 --- a/src/Magnum/Math/Intersection.h +++ b/src/Magnum/Math/Intersection.h @@ -82,7 +82,8 @@ point @f$ \boldsymbol{p} @f$ intersects with a sphere of a center \end{array} @f] -@see @ref Distance::pointPointSquared(), @ref Vector::dot(), @ref pow(T) +@see @ref Distance::pointPointSquared(), @ref Vector::dot(), @ref pow(T), + @see @ref MeshTools::boundingSphereBouncingBubble() */ template inline bool pointSphere(const Vector3& point, const Vector3& sphereCenter, T sphereRadius) { return (sphereCenter - point).dot() <= sphereRadius*sphereRadius; @@ -215,7 +216,7 @@ condition for whether the plane is intersecting the box: @f[ for plane normal @f$ \boldsymbol n @f$ and determinant @f$ w @f$. -@see @ref aabbFrustum() +@see @ref aabbFrustum(), @ref MeshTools::boundingRange() */ template bool rangeFrustum(const Range3D& range, const Frustum& frustum); @@ -234,6 +235,7 @@ a ray inverse, when doing multiple ray / range intersections (for example when traversing an AABB tree). The algorithm implemented is a version of the classical slabs algorithm, see *Listing 1* in [Majercik et al.](http://jcgt.org/published/0007/03/04/). +@see @ref MeshTools::boundingRange() */ template bool rayRange(const Vector3& rayOrigin, const Vector3& inverseRayDirection, const Range3D& range); @@ -261,6 +263,7 @@ template bool aabbFrustum(const Vector3& aabbCenter, const Vector3 bool sphereFrustum(const Vector3& sphereCenter, T sphereRadius, const Frustum& frustum); @@ -350,6 +353,8 @@ performs sphere-cone intersection with the zero-origin -Z axis-aligned cone. The @p sinAngle and @p tanAngle can be precomputed like this: @snippet MagnumMath.cpp Intersection-sinAngle-tanAngle + +@see @ref MeshTools::boundingSphereBouncingBubble() */ template bool sphereConeView(const Vector3& sphereCenter, T sphereRadius, const Matrix4& coneView, T sinAngle, T tanAngle); @@ -389,6 +394,8 @@ testing whether the origin of the original cone intersects the sphere. The @p sinAngle and @p tanAngleSqPlusOne parameters can be precomputed like this: @snippet MagnumMath.cpp Intersection-sinAngle-tanAngleSqPlusOne + +@see @ref MeshTools::boundingSphereBouncingBubble() */ template bool sphereCone(const Vector3& sphereCenter, T sphereRadius, const Vector3& coneOrigin, const Vector3& coneNormal, T sinAngle, T tanAngleSqPlusOne); @@ -447,6 +454,7 @@ template bool aabbCone(const Vector3& aabbCenter, const Vector3& Precomputes a portion of the intersection equation from @p coneAngle and calls @ref rangeCone(const Range3D&, const Vector3&, const Vector3&, T). +@see @ref MeshTools::boundingRange() */ template bool rangeCone(const Range3D& range, const Vector3& coneOrigin, const Vector3& coneNormal, const Rad coneAngle); diff --git a/src/Magnum/MeshTools/BoundingVolume.h b/src/Magnum/MeshTools/BoundingVolume.h index d99a6a382..b4bc83dfb 100644 --- a/src/Magnum/MeshTools/BoundingVolume.h +++ b/src/Magnum/MeshTools/BoundingVolume.h @@ -43,6 +43,9 @@ namespace Magnum { namespace MeshTools { @m_since_latest Same as @ref Math::minmax(const Corrade::Containers::StridedArrayView1D&). +@see @ref Math::Intersection::rayRange(), + @ref Math::Intersection::rangeFrustum(), + @ref Math::Intersection::rangeCone() */ MAGNUM_MESHTOOLS_EXPORT Range3D boundingRange(const Containers::StridedArrayView1D& positions); @@ -59,7 +62,11 @@ radius is never below @ref Math::TypeTraits::epsilon(), even for empty or entirely overlapping lists of points. NaNs are ignored, unless the first position is NaN in which case it is propagated. Algorithm used: * *Bo Tian --- Bouncing Bubble: A fast algorithm for Minimal Enclosing Ball -problem, 2012, https://www.grin.com/document/204869* +problem, 2012, https://www.grin.com/document/204869*. +@see @ref Math::Intersection::pointSphere(), + @ref Math::Intersection::sphereFrustum(), + @ref Math::Intersection::sphereCone(), + @ref Math::Intersection::sphereConeView() */ MAGNUM_MESHTOOLS_EXPORT Containers::Pair boundingSphereBouncingBubble(const Containers::StridedArrayView1D& positions);