131 std::tuple<double, Vec3d, Vec3d>
EPA();
150 std::tuple<Vec3d, bool>
172 bool *
const cnt_flag);
182 double *
const min_dist,
bool *
const cnt_flag);
192 double *
const min_dist,
bool *
const cnt_flag);
202 double *
const min_dist,
bool *
const cnt_flag);
212 inline std::tuple<Vec3d, double>
A class representing the geometries associated with a collision.
Definition collision_geometries.hpp:15
An abstract class representing a collision solver for a particle and a wall.
Definition collision_solver_pw.hpp:20
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_pw.hpp:20
std::tuple< Vec3d, bool > GetContactPoint(Vec3d const &dir)
Computes the contact point given the contact normal.
Definition solver_gjk_pw.cpp:369
std::tuple< Vec3d, double > GetFacetNormal(Vec3d const &a, Vec3d const &b, Vec3d const &c)
Computes the normal and distance of a facet defined by three points.
Definition solver_gjk_pw.cpp:679
void UpdateSimplexLine(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex for the line case.
Definition solver_gjk_pw.cpp:543
void ResolveUpdate(ContactPW *const cnt, double timestep) override
Updates the contact resolution for a contact point.
Definition solver_gjk_pw.cpp:68
bool Detect() override
Detects collisions between a particle and a wall.
Definition solver_gjk_pw.cpp:36
Shape * shape_1
< The shapes involved in the collision.
Definition solver_gjk_pw.hpp:96
double bound_sphere_radius_2
The position difference between the particles.
Definition solver_gjk_pw.hpp:99
bool enable_logging
Definition solver_gjk_pw.hpp:32
Simplex simplex_after_gjk
Definition solver_gjk_pw.hpp:108
void GetLooseEdges(VecXT< Vec2i > *const edges, Vec3i const &facet)
Computes the edges of a polygon defined by a set of vertices.
Definition solver_gjk_pw.cpp:709
double erosion_ratio_increment
Whether to use erosion during collision detection.
Definition solver_gjk_pw.hpp:26
Vec3d GetPolygonCentroid(VecXT< Vec3d > const &pos_vec, Vec3d const &dir_n)
Computes the centroid of a polygon defined by a set of vertices.
Definition solver_gjk_pw.cpp:893
std::tuple< double, Vec3d, Vec3d > GJK_EROSION()
Implements the Gilbert-Johnson-Keerthi algorithm with erosion for collision detection.
Definition solver_gjk_pw.cpp:165
double erosion_ratio_initial
< The initial erosion ratio used by the solver.
Definition solver_gjk_pw.hpp:23
bool use_erosion
Whether to print debug logs during collision detection.
Definition solver_gjk_pw.hpp:29
void Init(Particle *const p, Wall *const w) override
Initializes the collision solver with a particle and a wall.
Definition solver_gjk_pw.cpp:18
void UpdateSimplexTetrahedron(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex for the tetrahedron case.
Definition solver_gjk_pw.cpp:617
CollisionSolverPW * Clone() const override
Creates a copy of the current collision solver.
Definition solver_gjk_pw.cpp:16
void SortVertices(VecXT< Vec3d > *const pos_vec, Vec3d const &dir_n)
Sorts the vertices of a polygon in counter-clockwise order relative to a given direction.
Definition solver_gjk_pw.cpp:815
Shape * shape_2
The radii of the bounding spheres around the shapes.
Definition solver_gjk_pw.hpp:96
Vec3d dpos_12
Definition solver_gjk_pw.hpp:102
double bound_sphere_radius_1
Definition solver_gjk_pw.hpp:99
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_pw.cpp:449
void UpdateSimplexTriangle(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex for the triangle case.
Definition solver_gjk_pw.cpp:577
Vec4d dquat_12_conj
The simplex computed during GJK collision detection.
Definition solver_gjk_pw.hpp:105
Vec3d MinkowskiDiff(Vec3d const &dir, double erosion_ratio=0)
Computes the Minkowski difference between the two shapes along a given direction.
Definition solver_gjk_pw.cpp:518
void ResolveInit(ContactPW *const cnt, double timestep) override
Initializes the contact resolution for a contact point.
Definition solver_gjk_pw.cpp:60
Vec4d dquat_12
Definition solver_gjk_pw.hpp:105
bool IsInsidePolygon(VecXT< Vec3d > const &pos_vec, Vec3d const &dir_n, Vec3d const &pos)
Determines whether a point is inside a polygon defined by a set of vertices.
Definition solver_gjk_pw.cpp:863
void GetIntersections(VecXT< Vec3d > *const intersects, Vec3d const &dir_n, Vec3d const &l1_p, Vec3d const &l1_w, Vec3d const &l2_p, Vec3d const &l2_w)
Computes the intersection points between two 3D line segments.
Definition solver_gjk_pw.cpp:733
std::tuple< double, Vec3d, Vec3d > EPA()
Implements the Expanding Polytope Algorithm for collision resolution.
Definition solver_gjk_pw.cpp:246
SolverGJKPW()
Default constructor for the SolverGJKPW class.
Definition solver_gjk_pw.cpp:12
Vec3d dpos_12_ref
The orientation difference between the particles.
Definition solver_gjk_pw.hpp:102
bool GJK()
Implements the Gilbert-Johnson-Keerthi algorithm for collision detection.
Definition solver_gjk_pw.cpp:116
void GetIntersectionsAggresive(VecXT< Vec3d > *const intersects, Vec3d const &dir_n, Vec3d const &l1_p, Vec3d const &l1_w, Vec3d const &l2_p, Vec3d const &l2_w)
Same as GetInter sections, but uses a more aggressive intersection algorithm.
Definition solver_gjk_pw.cpp:778
void UpdateSimplex(Simplex *const s, Vec3d *const dir, double *const min_dist, bool *const cnt_flag)
Updates the simplex after each GJK iteration based on the distance computed.
Definition solver_gjk_pw.cpp:526
A class representing a wall object in a physics simulation.
Definition wall.hpp:32
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