118 std::tuple<double, Vec3d, Vec3d>
EPA();
137 std::tuple<Vec3d, bool>
157 bool *
const cnt_flag);
167 double *
const min_dist,
bool *
const cnt_flag);
177 double *
const min_dist,
bool *
const cnt_flag);
187 double *
const min_dist,
bool *
const cnt_flag);
197 inline std::tuple<Vec3d, double>
A class representing the geometries associated with a collision.
Definition collision_geometries.hpp:15
An abstract base class for particle-particle collision solvers.
Definition collision_solver_pp.hpp:18
Definition particle.hpp:26
This class represents different types of shapes and performs various calculations on them.
Definition shape.hpp:15
A simplex class for representing a convex hull in n-dimensional space.
Definition gjk_simplex.hpp:18
GJK solver for convex geometries.
Definition solver_gjk_pp.hpp:15
Shape * shape_1
Definition solver_gjk_pp.hpp:92
std::tuple< Vec3d, double > GetFacetNormal(Vec3d const &a, Vec3d const &b, Vec3d const &c)
Computes the normal and distance from origin of a facet defined by three vertices.
Definition solver_gjk_pp.cpp:747
CollisionSolverPP * Clone() const override
Creates a copy of this collision solver.
Definition solver_gjk_pp.cpp:20
double bound_sphere_radius_1
Definition solver_gjk_pp.hpp:93
std::tuple< double, Vec3d, Vec3d > GJK_EROSION()
Runs the Gilbert-Johnson-Keerthi algorithm with erosion applied.
Definition solver_gjk_pp.cpp:213
std::tuple< Vec3d, bool > GetContactPoint_PlaneCase(Vec3d const &dir, const VecXT< Vec3d > &pos_vec_1, const VecXT< Vec3d > &pos_vec_2)
Computes the contact point in the case where one of the shapes is a plane.
Definition solver_gjk_pp.cpp:516
Vec4d dquat_12
Definition solver_gjk_pp.hpp:96
void UpdateSimplexLine(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex when it contains a line segment.
Definition solver_gjk_pp.cpp:610
bool GJK()
Runs the Gilbert-Johnson-Keerthi algorithm.
Definition solver_gjk_pp.cpp:132
void ResolveUpdate(ContactPP *const cnt, double timestep) override
Updates the contact point between two particles at time t > 0.
Definition solver_gjk_pp.cpp:72
bool IsInsidePolygon(VecXT< Vec3d > const &pos_vec, Vec3d const &dir_n, Vec3d const &pos)
Determines whether a point is inside a polygon.
Definition solver_gjk_pp.cpp:930
std::tuple< double, Vec3d, Vec3d > EPA()
Runs the Expanding Polytope Algorithm.
Definition solver_gjk_pp.cpp:294
void GetLooseEdges(VecXT< Vec2i > *const edges, Vec3i const &facet)
Computes the edges of a triangle that could potentially be involved in a collision.
Definition solver_gjk_pp.cpp:776
double bound_sphere_radius_2
Definition solver_gjk_pp.hpp:93
void SortVertices(VecXT< Vec3d > *const pos_vec, Vec3d const &dir_n)
Sorts the vertices of a polygon based on their distance to a given point.
Definition solver_gjk_pp.cpp:882
double erosion_ratio_increment
Whether to use erosion for the terrain or not.
Definition solver_gjk_pp.hpp:21
void GetIntersectionsAggresive(VecXT< Vec3d > *const intersects, Vec3d const &dir_n, Vec3d const &l1_p1, Vec3d const &l1_p2, Vec3d const &l2_p1, Vec3d const &l2_p2)
Computes the intersection points of two line segments using a more aggressive algorithm.
Definition solver_gjk_pp.cpp:845
Vec3d MinkowskiDiff(Vec3d const &dir, double erosion_ratio=0)
Computes the Minkowski difference of two shapes along a given direction.
Definition solver_gjk_pp.cpp:585
Vec3d dpos_12
Definition solver_gjk_pp.hpp:95
Simplex simplex_after_gjk
Definition solver_gjk_pp.hpp:98
double erosion_ratio_initial
< The initial ratio of erosion for the terrain.
Definition solver_gjk_pp.hpp:18
SolverGJKPP()
Default constructor for SolverGJKPP.
Definition solver_gjk_pp.cpp:14
void UpdateSimplex(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex used in the Gilbert-Johnson-Keerthi algorithm.
Definition solver_gjk_pp.cpp:593
bool Detect() override
Detects collisions between the two particles.
Definition solver_gjk_pp.cpp:40
std::tuple< Vec3d, bool > GetContactPoint(Vec3d const &dir)
Computes the contact point along a given direction.
Definition solver_gjk_pp.cpp:436
bool use_erosion
Definition solver_gjk_pp.hpp:24
Vec3d dpos_12_ref
Definition solver_gjk_pp.hpp:95
void Init(Particle *const p1, Particle *const p2) override
Initializes the collision solver with two particles.
Definition solver_gjk_pp.cpp:22
void ResolveInit(ContactPP *const cnt, double timestep) override
Initializes the contact point between two particles at time t = 0.
Definition solver_gjk_pp.cpp:64
bool enable_logging
Flag to determine whether logging is enabled.
Definition solver_gjk_pp.hpp:29
Shape * shape_2
Definition solver_gjk_pp.hpp:92
void GetIntersections(VecXT< Vec3d > *const intersects, Vec3d const &dir_n, Vec3d const &l1_p1, Vec3d const &l1_p2, Vec3d const &l2_p1, Vec3d const &l2_p2)
Computes the intersection points of two line segments.
Definition solver_gjk_pp.cpp:800
Vec4d dquat_12_conj
Definition solver_gjk_pp.hpp:96
Vec3d GetPolygonCentroid(VecXT< Vec3d > const &pos_vec, Vec3d const &dir_n)
Computes the centroid of a polygon.
Definition solver_gjk_pp.cpp:960
void UpdateSimplexTriangle(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex when it contains a triangle.
Definition solver_gjk_pp.cpp:644
void UpdateSimplexTetrahedron(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex when it contains a tetrahedron.
Definition solver_gjk_pp.cpp:684
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
pos
Definition json_serilization.hpp:19
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18
std::array< int, 3 > Vec3i
Definition utils_macros.hpp:14
std::array< double, 4 > Vec4d
Definition utils_macros.hpp:19
dir_n
Definition json_serilization.hpp:19