-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScytherIntersection.h
More file actions
104 lines (73 loc) · 3.48 KB
/
ScytherIntersection.h
File metadata and controls
104 lines (73 loc) · 3.48 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef SOFA_SCYTHER_INTERSECTION_H
#define SOFA_SCYTHER_INTERSECTION_H
#include "SofaGeneral/config.h"
#include <SofaBaseCollision/BaseProximityIntersection.h>
#include <SofaBaseCollision/MinProximityIntersection.h>
#include <SofaMeshCollision/MeshIntTool.h>
#include <sofa/helper/FnDispatcher.h>
//#include <SofaBaseCollision/CapsuleModel.h>
//#include <SofaBaseCollision/SphereModel.h>
//#include <SofaMeshCollision/LineModel.h>
//#include <SofaMeshCollision/TriangleModel.h>
//#include <SofaMeshCollision/PointModel.h>
//#include <SofaBaseCollision/CubeModel.h>
#include <SofaBaseCollision/IntrUtility3.h>
#include <SofaBaseCollision/CubeModel.h>
#include <SofaMeshCollision/LineModel.h>
#include <SofaMeshCollision/PointModel.h>
#include <SofaMeshCollision/TriangleModel.h>
#include <SofaUserInteraction/RayModel.h>
#include "ScytherCubeModel.h"
#include "ScytherPointModel.h"
#include "ScytherTriangleModel.h"
#include "SofaScytherObject.h"
namespace SofaInterface {
class SOFA_BASE_COLLISION_API ScytherIntersection : public sofa::component::collision::BaseProximityIntersection
{
// typedef sofa::component::collision::MinProximityIntersection::OutputVector
// OutputVector; // should take from elsewhere ???
template <class T>
using Data = sofa::core::objectmodel::Data<T>;
using CubeModel = sofa::component::collision::CubeModel;
using PointModel = sofa::component::collision::PointModel;
using LineModel = sofa::component::collision::LineModel;
using TriangleModel = sofa::component::collision::TriangleModel;
using RayModel = sofa::component::collision::RayModel;
using Cube = sofa::component::collision::Cube;
using Point = sofa::component::collision::Point;
using Line = sofa::component::collision::Line;
using Triangle = sofa::component::collision::Triangle;
using Ray = sofa::component::collision::Ray;
public:
SOFA_CLASS(ScytherIntersection, BaseProximityIntersection);
Data<bool> usePointPoint; ///< activate Point-Point intersection tests
Data<bool> useSurfaceNormals; ///< Compute the norms of the Detection Outputs by considering the normals of the
///< surfaces involved.
protected:
ScytherIntersection();
public:
typedef sofa::core::collision::IntersectorFactory<ScytherIntersection> IntersectorFactory;
void init() override;
bool getUseSurfaceNormals();
void draw(const sofa::core::visual::VisualParams* vparams) override;
bool testIntersection(ScytherCube&, ScytherCube&);
bool testIntersection(ScytherPoint&, ScytherPoint&);
bool testIntersection(ScytherTriangle&, ScytherPoint&);
bool testIntersection(ScytherCube&, Cube&) { return false; }
int computeIntersection(ScytherCube&, ScytherCube&, OutputVector*);
int computeIntersection(ScytherPoint&, ScytherPoint&, OutputVector*);
int computeIntersection(ScytherTriangle&, ScytherPoint&, OutputVector*);
int computeIntersection(ScytherCube&, Cube&, OutputVector*) { return 0; }
/// Actions to accomplish when the broadPhase is started. By default do nothing.
void beginBroadPhase() override;
void endBroadPhase() override;
private:
SReal mainAlarmDistance;
SReal mainContactDistance;
int n;
// ScytherIntersection(sofa::component::collision::MinProximityIntersection* object, bool addSelf=true);
// protected:
// sofa::component::collision::MinProximityIntersection* intersection;
};
} // namespace SofaInterface
#endif