A simplex class for representing a convex hull in n-dimensional space.
More...
#include <gjk_simplex.hpp>
A simplex class for representing a convex hull in n-dimensional space.
This class provides a set of constructors and methods for working with a simplex, which is a geometric object consisting of the convex hull of a set of n+1 points in n-dimensional space. The class is generic and can be used for any dimensionality n, although in practice it is most often used for 2D and 3D graphics applications. The simplex is represented as an array of Vec3d objects, one for each vertex, and a size variable indicating the number of vertices.
- Examples
- 0_demo_erosion_issue.cpp.
◆ Simplex() [1/5]
netdem::Simplex::Simplex |
( |
| ) |
|
|
inline |
A default constructor for this class (creates an empty simplex).
◆ Simplex() [2/5]
netdem::Simplex::Simplex |
( |
Vec3d const & | a | ) |
|
|
inline |
Construct a simplex with one vertex.
This constructor creates a simplex with a single vertex at the specified point. The size of the simplex is set to 1.
- Parameters
-
a | The position of the first vertex. |
◆ Simplex() [3/5]
netdem::Simplex::Simplex |
( |
Vec3d const & | a, |
|
|
Vec3d const & | b ) |
|
inline |
Construct a simplex with two vertices.
This constructor creates a simplex with two vertices at the specified positions. The size of the simplex is set to 2.
- Parameters
-
a | The position of the first vertex. |
b | The position of the second vertex. |
◆ Simplex() [4/5]
netdem::Simplex::Simplex |
( |
Vec3d const & | a, |
|
|
Vec3d const & | b, |
|
|
Vec3d const & | c ) |
|
inline |
Construct a simplex with three vertices.
This constructor creates a simplex with three vertices at the specified positions. The size of the simplex is set to 3.
- Parameters
-
a | The position of the first vertex. |
b | The position of the second vertex. |
c | The position of the third vertex. |
◆ Simplex() [5/5]
Construct a simplex with four vertices.
This constructor creates a simplex with four vertices at the specified positions. The size of the simplex is set to 4.
- Parameters
-
a | The position of the first vertex. |
b | The position of the second vertex. |
c | The position of the third vertex. |
d | The position of the fourth vertex. |
◆ PushBack()
void netdem::Simplex::PushBack |
( |
Vec3d const & | p | ) |
|
|
inline |
Add a new vertex to the end of the simplex.
This method adds a new vertex to the end of the simplex's point array and increments the size of the simplex by one.
- Parameters
-
p | The position of the new vertex to add. |
◆ PushFront()
void netdem::Simplex::PushFront |
( |
Vec3d const & | p | ) |
|
|
inline |
Add a new vertex to the front of the simplex.
This method adds a new vertex to the front of the simplex's point array, shifting all existing vertices down by one position, and increments the size of the simplex by one.
- Parameters
-
p | The position of the new vertex to add. |
◆ Size()
int netdem::Simplex::Size |
( |
| ) |
|
|
inline |
Return the number of vertices in the simplex.
◆ points
An array of Vec3d objects, one for each vertex of the simplex.
The documentation for this class was generated from the following file:
- /Users/lzhshou/Documents/Research/myProjects/apaam/repo/netdem/src/dem/gjk_simplex.hpp