ViewDesignEngine  3.1.0
高性能 CAD 计算几何引擎
gjk.h
浏览该文件的文档.
1 
11 #pragma once
12 #include "vde/core/point.h"
13 #include <functional>
14 #include <optional>
15 
16 namespace vde::collision {
17 using core::Point3D;
18 using core::Vector3D;
19 
33 using SupportFunc = std::function<Point3D(const Vector3D&)>;
34 
38 struct GJKResult {
39  bool intersect;
40  double distance;
43 };
44 
80 bool gjk_intersect(const SupportFunc& shape_a, const SupportFunc& shape_b);
81 
94 double gjk_distance(const SupportFunc& shape_a, const SupportFunc& shape_b);
95 
120 GJKResult gjk_full(const SupportFunc& shape_a, const SupportFunc& shape_b);
121 
122 } // namespace vde::collision
GJKResult gjk_full(const SupportFunc &shape_a, const SupportFunc &shape_b)
GJK 完整检测:碰撞状态、距离、最近点对
bool gjk_intersect(const SupportFunc &shape_a, const SupportFunc &shape_b)
GJK 相交检测(仅判断是否碰撞)
std::function< Point3D(const Vector3D &)> SupportFunc
支撑函数类型
Definition: gjk.h:33
double gjk_distance(const SupportFunc &shape_a, const SupportFunc &shape_b)
GJK 最近距离查询
foundation::Vector3D Vector3D
双精度三维向量(重新导出)
Definition: point.h:49
foundation::Point3D Point3D
双精度三维点(重新导出)
Definition: point.h:31
GJK 完整检测结果
Definition: gjk.h:38