Easy3D 2.5.3
|
Efficient collision detection. More...
#include <easy3d/algo/collider.h>
Public Member Functions | |
Collider (SurfaceMesh *mesh0, SurfaceMesh *mesh1) | |
std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > | detect (const mat4 &t0, const mat4 &t1) const |
Efficient collision detection.
This class takes two triangle meshes and their transformation matrices as input and outputs the intersecting face pairs. This implementation is a wrapper of Opcode. It can achieve real-time performance for large meshes.
Collider | ( | SurfaceMesh * | mesh0, |
SurfaceMesh * | mesh1 | ||
) |
Constructor. It internally initializes the collider (by building the AABB trees) for subsequent efficient collision detection.
mesh0 | The first mesh (must be triangle mesh). |
mesh1 | The second mesh (must be triangle mesh). |
std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > detect | ( | const mat4 & | t0, |
const mat4 & | t1 | ||
) | const |
Performs collision detection.
t0 | The transformation of the first mesh. |
t1 | The transformation of the second mesh. |