5 #include <glm/vec2.hpp>
6 #include <glm/vec3.hpp>
13 struct AxisAlignedBox;
14 class OrientedBoundingBox;
31 static std::optional<glm::dvec3>
47 static std::optional<glm::dvec2>
63 const glm::dvec2& point,
64 const glm::dvec2& triangleVertA,
65 const glm::dvec2& triangleVertB,
66 const glm::dvec2& triangleVertC) noexcept;
81 const glm::dvec3& point,
82 const glm::dvec3& triangleVertA,
83 const glm::dvec3& triangleVertB,
84 const glm::dvec3& triangleVertC) noexcept;
100 const glm::dvec3& point,
101 const glm::dvec3& triangleVertA,
102 const glm::dvec3& triangleVertB,
103 const glm::dvec3& triangleVertC,
104 glm::dvec3& barycentricCoordinates) noexcept;
120 const glm::dvec3& p0,
121 const glm::dvec3& p1,
122 const glm::dvec3& p2,
123 bool cullBackFaces =
false);
143 const glm::dvec3& p0,
144 const glm::dvec3& p1,
145 const glm::dvec3& p2,
146 bool cullBackFaces =
false);
156 static std::optional<glm::dvec3>
171 static std::optional<double>
182 static std::optional<glm::dvec3>
197 static std::optional<double>
208 static std::optional<glm::dvec3>
223 static std::optional<double>
A bounding sphere with a center and a radius.
Functions for computing the intersection between geometries such as rays, planes, triangles,...
static std::optional< glm::dvec3 > raySphere(const Ray &ray, const BoundingSphere &sphere)
Computes the intersection of a ray and a bounding sphere.
static std::optional< glm::dvec3 > rayPlane(const Ray &ray, const Plane &plane) noexcept
Computes the intersection of a ray and a plane.
static bool pointInTriangle(const glm::dvec3 &point, const glm::dvec3 &triangleVertA, const glm::dvec3 &triangleVertB, const glm::dvec3 &triangleVertC) noexcept
Determines whether a given point is completely inside a triangle defined by three 3D points.
static std::optional< glm::dvec3 > rayOBB(const Ray &ray, const OrientedBoundingBox &obb)
Computes the intersection of a ray and an oriented bounding box.
static std::optional< double > rayAABBParametric(const Ray &ray, const AxisAlignedBox &aabb)
Computes the intersection of an infinite ray and an axis aligned bounding box and returns the paramet...
static std::optional< glm::dvec3 > rayTriangle(const Ray &ray, const glm::dvec3 &p0, const glm::dvec3 &p1, const glm::dvec3 &p2, bool cullBackFaces=false)
Tests if a ray hits a triangle and returns the hit point.
static bool pointInTriangle(const glm::dvec3 &point, const glm::dvec3 &triangleVertA, const glm::dvec3 &triangleVertB, const glm::dvec3 &triangleVertC, glm::dvec3 &barycentricCoordinates) noexcept
Determines whether the point is completely inside a triangle defined by three 3D points....
static std::optional< double > rayTriangleParametric(const Ray &ray, const glm::dvec3 &p0, const glm::dvec3 &p1, const glm::dvec3 &p2, bool cullBackFaces=false)
Tests if an infinite ray hits a triangle and returns the parametric hit position.
static bool pointInTriangle(const glm::dvec2 &point, const glm::dvec2 &triangleVertA, const glm::dvec2 &triangleVertB, const glm::dvec2 &triangleVertC) noexcept
Determines whether a given point is completely inside a triangle defined by three 2D points.
static std::optional< double > rayOBBParametric(const Ray &ray, const OrientedBoundingBox &obb)
Computes the intersection of an infinite ray and an oriented bounding box and returns the parametric ...
static std::optional< glm::dvec3 > rayAABB(const Ray &ray, const AxisAlignedBox &aabb)
Computes the intersection of a ray and an axis aligned bounding box.
static std::optional< glm::dvec2 > rayEllipsoid(const Ray &ray, const glm::dvec3 &radii) noexcept
Computes the intersection of a ray and an ellipsoid with the given radii, centered at the origin.
static std::optional< double > raySphereParametric(const Ray &ray, const BoundingSphere &sphere)
Computes the intersection of an infinite ray and a bounding sphere and returns the parametric hit pos...
A bounding volume defined as a closed and convex cuboid with any orientation.
A plane in Hessian Normal Format.
A ray that extends infinitely from the provided origin in the provided direction.
Basic geometry classes for Cesium.