SegmentSegmentCcdIntervalCheck.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013-2015, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_COLLISION_SEGMENTSEGMENTCCDINTERVALCHECK_H
17 #define SURGSIM_COLLISION_SEGMENTSEGMENTCCDINTERVALCHECK_H
18 
21 
22 namespace SurgSim
23 {
24 namespace Collision
25 {
38 {
39 public:
40 
48  {
52  };
53 
63  SegmentSegmentCcdIntervalCheck(const std::array<Math::Vector3d, 2>& pT0,
64  const std::array<Math::Vector3d, 2>& pT1,
65  const std::array<Math::Vector3d, 2>& qT0,
66  const std::array<Math::Vector3d, 2>& qT1,
67  double thicknessP, double thicknessQ,
68  double timePrecisionEpsilon, double distanceEpsilon);
77 
81  Math::Vector3d p1T0() const;
82  Math::Vector3d p1T1() const;
83  Math::Vector3d p2T0() const;
84  Math::Vector3d p2T1() const;
85  Math::Vector3d q1T0() const;
86  Math::Vector3d q1T1() const;
87  Math::Vector3d q2T0() const;
88  Math::Vector3d q2T1() const;
90 
97 
105 
113 
117 
121  double thicknessP() const;
122  double thicknessQ() const;
124 
128  void setTimePrecisionEpsilon(double epsilon);
129  void setDistanceEpsilon(double epsilon);
130  void setTripleProductEpsilon(double epsilon);
131  void setMuNuEpsilon(double epsilon);
133 
137  double timePrecisionEpsilon() const;
138  double distanceEpsilon() const;
139  double tripleProductEpsilon() const;
140  double muNuEpsilon() const;
142 
151 
160 
161 private:
167 
175 
183 
188 
196 
203 
210 
213  double m_thicknessP;
214  double m_thicknessQ;
216 
224 };
225 
226 }; // namespace Collision
227 }; // namespace SurgSim
228 
229 #endif // SURGSIM_COLLISION_SEGMENTSEGMENTCCDINTERVALCHECK_H
double m_distanceEpsilon
Definition: SegmentSegmentCcdIntervalCheck.h:220
Math::Vector3d p1T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:72
void setDistanceEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:166
Math::PolynomialValues< double, 2 > m_P1P2_sq
Definition: SegmentSegmentCcdIntervalCheck.h:200
Definition: CompoundShapeToGraphics.cpp:29
Math::LinearMotionND< double, 3 > m_relativeP1Q1
Definition: SegmentSegmentCcdIntervalCheck.h:179
double thicknessP() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:152
double thicknessQ() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:156
double m_volumeEpsilonTimes6
Definition: SegmentSegmentCcdIntervalCheck.h:221
Math::PolynomialValues< double, 2 > m_P1P2_P1Q1
Definition: SegmentSegmentCcdIntervalCheck.h:192
Math::LinearMotionND< double, 3 > m_motionQ2
Definition: SegmentSegmentCcdIntervalCheck.h:173
Math::Vector3d q2T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:107
void setTimePrecisionEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:161
Math::LinearMotionND< double, 3 > m_motionP2
Definition: SegmentSegmentCcdIntervalCheck.h:171
Math::LinearMotionND< double, 3 > m_motionQ1
Definition: SegmentSegmentCcdIntervalCheck.h:172
const Math::LinearMotionND< double, 3 > & motionQ1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:62
SegmentSegmentCcdIntervalCheck & operator=(const SegmentSegmentCcdIntervalCheck &)
const Math::PolynomialValues< double, 2 > & Q1Q2_P1Q1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:122
Math::LinearMotionND< double, 3 > m_relativeP1P2
Definition: SegmentSegmentCcdIntervalCheck.h:181
Math::Vector3d q1T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:92
double m_muNuEpsilon
Definition: SegmentSegmentCcdIntervalCheck.h:222
Math::Vector3d q1T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:97
IntervalCheckResults possibleCollisionTestWithThickness(const Math::Interval< double > &range) const
Check if a collision is possible within a specified time interval assuming segments with fixed radius...
Definition: SegmentSegmentCcdIntervalCheck.cpp:247
void setMuNuEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:176
Math::Vector3d p1T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:77
const Math::LinearMotionND< double, 3 > & motionP1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:52
void setTripleProductEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:171
Math::PolynomialValues< double, 2 > m_P1P2_Q1Q2
Definition: SegmentSegmentCcdIntervalCheck.h:194
Math::PolynomialValues< double, 2 > m_P1P2xQ1Q2_x
Definition: SegmentSegmentCcdIntervalCheck.h:206
Math::Vector3d p2T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:82
const Math::PolynomialValues< double, 2 > & Q1Q2_sq() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:137
double m_thicknessQ
Definition: SegmentSegmentCcdIntervalCheck.h:214
const Math::LinearMotionND< double, 3 > & motionP2() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:57
double tripleProductEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:191
const Math::PolynomialValues< double, 3 > & P1Q1_P1P2_Q1Q2() const
Triple product value.
Definition: SegmentSegmentCcdIntervalCheck.cpp:112
const Math::PolynomialValues< double, 2 > & P1P2_P1Q1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:117
const Math::PolynomialValues< double, 2 > & P1P2_sq() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:132
Math::PolynomialValues< double, 2 > m_Q1Q2_sq
Definition: SegmentSegmentCcdIntervalCheck.h:201
const Math::PolynomialValues< double, 2 > & P1P2_Q1Q2() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:127
Math::PolynomialValues< double, 2 > m_Q1Q2_P1Q1
Definition: SegmentSegmentCcdIntervalCheck.h:193
Math::PolynomialValues< double, 3 > m_P1Q1_P1P2_Q1Q2
The triple product of (Q1(t) - P1(t)) X (P2(t) - P1(t)) X (Q2(t) - Q1(t)) as a 3rd degree polynomial ...
Definition: SegmentSegmentCcdIntervalCheck.h:187
Math::LinearMotionND< double, 3 > m_relativeQ1Q2
Definition: SegmentSegmentCcdIntervalCheck.h:180
Math::Vector3d q2T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:102
double m_thicknessP
Definition: SegmentSegmentCcdIntervalCheck.h:213
double timePrecisionEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:181
Math::Vector3d p2T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:87
Math::PolynomialValues< double, 2 > m_P1P2xQ1Q2_y
Definition: SegmentSegmentCcdIntervalCheck.h:207
Interval defines the concept of a mathematical interval and provides operations on it including arith...
Definition: IntervalArithmetic.h:34
double m_timePrecisionEpsilon
Definition: SegmentSegmentCcdIntervalCheck.h:219
Math::LinearMotionND< double, 3 > m_motionP1
Definition: SegmentSegmentCcdIntervalCheck.h:170
double distanceEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:186
Math::Interval< double > crossValueOnInterval(const Math::Interval< double > &range) const
Definition: SegmentSegmentCcdIntervalCheck.cpp:142
IntervalCheckResults
Enum Possible interval check return values.
Definition: SegmentSegmentCcdIntervalCheck.h:47
Math::PolynomialValues< double, 2 > m_P1P2xQ1Q2_z
Definition: SegmentSegmentCcdIntervalCheck.h:208
SegmentSegmentCcdIntervalCheck(const std::array< Math::Vector3d, 2 > &pT0, const std::array< Math::Vector3d, 2 > &pT1, const std::array< Math::Vector3d, 2 > &qT0, const std::array< Math::Vector3d, 2 > &qT1, double thicknessP, double thicknessQ, double timePrecisionEpsilon, double distanceEpsilon)
Constructor.
Definition: SegmentSegmentCcdIntervalCheck.cpp:25
double muNuEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:196
IntervalCheckResults possibleCollisionTestNoThickness(const Math::Interval< double > &range) const
Check if a collision is possible within a specified time interval assuming ideal (0 thickness) segmen...
Definition: SegmentSegmentCcdIntervalCheck.cpp:201
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SegmentSegmentCcdIntervalCheck uses the Interval classes including the LinearMotion and Polynomial fa...
Definition: SegmentSegmentCcdIntervalCheck.h:37
const Math::LinearMotionND< double, 3 > & motionQ2() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:67