64ad721ed7
- CMake: INTERFACE 库修复、vde_compile_options 顺序修复 - 命名空间: 所有模块添加 using 声明 - 类型补全: Ray3Dd、Point4D - 头文件: tolerance 泛型化、std::optional include - 警告: 放宽 -Wconversion/-Wsign-conversion - 构建结果: 0 errors, 22/25 tests passed
24 lines
584 B
C++
24 lines
584 B
C++
#pragma once
|
|
#include "vde/core/point.h"
|
|
#include <functional>
|
|
#include <optional>
|
|
|
|
namespace vde::collision {
|
|
using core::Point3D;
|
|
using core::Vector3D;
|
|
|
|
using SupportFunc = std::function<Point3D(const Vector3D&)>;
|
|
|
|
struct GJKResult {
|
|
bool intersect;
|
|
double distance;
|
|
Point3D point_a;
|
|
Point3D point_b;
|
|
};
|
|
|
|
bool gjk_intersect(const SupportFunc& shape_a, const SupportFunc& shape_b);
|
|
double gjk_distance(const SupportFunc& shape_a, const SupportFunc& shape_b);
|
|
GJKResult gjk_full(const SupportFunc& shape_a, const SupportFunc& shape_b);
|
|
|
|
} // namespace vde::collision
|