6 #ifndef GEOM_GEOMETRY_H 7 #define GEOM_GEOMETRY_H 9 #include <Utils/GeometryStructures.h> 17 void InflateRectangle(geom::TRect<T> &rect,
const T margin)
21 rect.width +=
static_cast<T
>(2) * margin;
22 rect.height +=
static_cast<T
>(2) * margin;
27 void DeflateRectangle(geom::TRect<T> &rect,
const T margin)
31 rect.width -=
static_cast<T
>(2) * margin;
32 rect.height -=
static_cast<T
>(2) * margin;
36 GEOM_API Plane FitPlane(
const std::vector<glm::vec3> &points);
39 GEOM_API glm::vec3 GetCentroid(
const std::vector<glm::vec3> &points);
48 GEOM_API
float GetProjectionParameter(
const glm::vec3 &point,
const geom::LineSegment3 &line_segment);
57 GEOM_API
float GetProjectionParameterClamped(
const glm::vec3 &point,
const geom::LineSegment3 &line_segment);
60 GEOM_API
float GetOrientedDistance(
const glm::vec3 &point,
const Plane &plane);
63 GEOM_API
float GetDistance(
const glm::vec3 &point,
const geom::LineSegment3 &line);
66 GEOM_API
float GetDistance(
const glm::vec3 &point,
const Plane &plane);
69 GEOM_API
float GetDistance(
const glm::vec3 &point,
const geom::Line3 &line);
75 GEOM_API
float GetDistance(
const glm::vec3 &point,
const ConicalCapsule &conical_capsuile);
78 GEOM_API glm::vec3 GetProjection(
const glm::vec3 &point,
const Plane &plane);
81 GEOM_API glm::vec3 GetProjection(
const glm::vec3 &point,
const LineSegment3 &line_segment);
84 GEOM_API glm::vec3 GetProjection(
const glm::vec3 &point,
const Line3 &line);
87 GEOM_API glm::vec3 GetProjection(
const glm::vec3 &point,
const ConicalCapsule &capsule);
90 GEOM_API std::optional<glm::vec2> GetIntersection(
const geom::Line2 &line1,
const geom::Line2 &line2);
92 GEOM_API
bool GetIntersection(
const geom::Line2 &line1,
const geom::Line2 &line2, glm::vec2 *out_intersection_point);
93 GEOM_API
bool GetIntersection(
const geom::Line3 &line,
const geom::Plane &plane, glm::vec3 *out_intersection_point);
94 GEOM_API
bool GetIntersection(
const geom::LineSegment3 &linesegment,
const geom::Plane &plane, glm::vec3 *out_intersection_point);
95 GEOM_API
bool GetIntersection(
const geom::Line3 &line,
const geom::HalfPlane &half_plane, glm::vec3 *out_intersection_point);
96 GEOM_API
bool GetIntersection(
const geom::LineSegment3 &linesegment,
const geom::HalfPlane &half_plane, glm::vec3 *out_intersection_point);
97 GEOM_API
bool GetIntersection(
const geom::Triangle3 &triangle,
const geom::HalfPlane &halfplane, geom::LineSegment3 *out_intersection =
nullptr);
98 GEOM_API
bool GetIntersection(
const geom::Line3 &line,
const geom::Aabb3 &aabb);
100 GEOM_API glm::vec3 Barycentric(
const glm::vec3 &p,
const Triangle3 &triangle);
102 struct CollisionResult
113 GEOM_API CollisionResult GetCollision(
const geom::Capsule &capsule_1,
const geom::Capsule &capsule_2);
115 GEOM_API
bool IsTriangleFacingToPoint(
const glm::vec3 &point,
const geom::Triangle3 &triangle);
Definition: Constructors.h:9