Files
ViewDesignEngine/include/vde/collision/gjk.h
T

24 lines
584 B
C++
Raw Normal View History

#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