-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollisionDetector.h
More file actions
50 lines (32 loc) · 1.98 KB
/
CollisionDetector.h
File metadata and controls
50 lines (32 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include "Global.h"
#include <set>
#include <map>
#include "Point3.h"
class CTriangle;
class CMesh;
class CollisionDetector
{
public:
static bool testIntersectionOfTriangleWithTriangle3d( CPoint3d p1, CPoint3d q1, CPoint3d r1, CPoint3d p2, CPoint3d q2, CPoint3d r2 );
static bool testIntersectionOfTriangleWithTriangle3d( CTriangle &t1, CTriangle &t2);
static bool testIntersectionOfTriangleWithTriangle3d( CMesh *mesh1, INDEX_TYPE i1, CMesh *mesh2, INDEX_TYPE i2 );
static bool getIntersectionOfTriangleWithTriangle3d(CPoint3d p1, CPoint3d q1, CPoint3d r1, CPoint3d p2, CPoint3d q2, CPoint3d r2, int &coplanar, CPoint3d &source, CPoint3d &target);
static bool getIntersectionOfTriangleWithTriangle3d(CTriangle& t1, CTriangle& t2, int &coplanar, CPoint3d &source, CPoint3d &target);
static bool getIntersectionOfTriangleWithTriangle3d(CMesh* mesh1, INDEX_TYPE i1, CMesh* mesh2, INDEX_TYPE i2, int &coplanar, CPoint3d &source, CPoint3d &target);
static bool getIntersectionOfTriangleWithMesh3d(CTriangle& t, CMesh* mesh, std::set<INDEX_TYPE>& crossed);
static bool getIntersectionOfMeshWithMesh3d(std::shared_ptr<CMesh> mesh1, std::shared_ptr<CMesh> mesh2, std::map<INDEX_TYPE, std::set<INDEX_TYPE>*> &crossed);
private:
static int tri_tri_overlap_test_3d(double p1[3], double q1[3], double r1[3],
double p2[3], double q2[3], double r2[3]);
static int coplanar_tri_tri3d(double p1[3], double q1[3], double r1[3],
double p2[3], double q2[3], double r2[3],
double N1[3], double N2[3]);
static int tri_tri_overlap_test_2d(double p1[2], double q1[2], double r1[2],
double p2[2], double q2[2], double r2[2]);
static int tri_tri_intersection_test_3d(double p1[3], double q1[3], double r1[3],
double p2[3], double q2[3], double r2[3],
int* coplanar,
double source[3], double target[3]);
static int ccw_tri_tri_intersection_2d(double p1[2], double q1[2], double r1[2], double p2[2], double q2[2], double r2[2]);
};