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
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::possibleCollisionTestWithThickness
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
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::setDistanceEpsilon
void setDistanceEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:166
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::p1T1
Math::Vector3d p1T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:77
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::P1Q1_P1P2_Q1Q2
const Math::PolynomialValues< double, 3 > & P1Q1_P1P2_Q1Q2() const
Triple product value.
Definition: SegmentSegmentCcdIntervalCheck.cpp:112
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_thicknessP
double m_thicknessP
Definition: SegmentSegmentCcdIntervalCheck.h:213
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::q1T1
Math::Vector3d q1T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:97
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::possibleCollisionTestNoThickness
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
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::timePrecisionEpsilon
double timePrecisionEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:181
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_relativeP1P2
Math::LinearMotionND< double, 3 > m_relativeP1P2
Definition: SegmentSegmentCcdIntervalCheck.h:181
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::IntervalCheckPossibleCollision
@ IntervalCheckPossibleCollision
Definition: SegmentSegmentCcdIntervalCheck.h:49
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::q2T0
Math::Vector3d q2T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:102
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::motionQ1
const Math::LinearMotionND< double, 3 > & motionQ1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:62
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::p2T0
Math::Vector3d p2T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:82
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::tripleProductEpsilon
double tripleProductEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:191
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::SegmentSegmentCcdIntervalCheck
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
SurgSim::Math::LinearMotionND< double, 3 >
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::motionQ2
const Math::LinearMotionND< double, 3 > & motionQ2() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:67
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_motionQ2
Math::LinearMotionND< double, 3 > m_motionQ2
Definition: SegmentSegmentCcdIntervalCheck.h:173
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::setTimePrecisionEpsilon
void setTimePrecisionEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:161
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_muNuEpsilon
double m_muNuEpsilon
Definition: SegmentSegmentCcdIntervalCheck.h:222
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_timePrecisionEpsilon
double m_timePrecisionEpsilon
Definition: SegmentSegmentCcdIntervalCheck.h:219
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::IntervalCheckResults
IntervalCheckResults
Enum Possible interval check return values.
Definition: SegmentSegmentCcdIntervalCheck.h:47
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::P1P2_P1Q1
const Math::PolynomialValues< double, 2 > & P1P2_P1Q1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:117
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::P1P2_Q1Q2
const Math::PolynomialValues< double, 2 > & P1P2_Q1Q2() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:127
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::q1T0
Math::Vector3d q1T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:92
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_relativeP1Q1
Math::LinearMotionND< double, 3 > m_relativeP1Q1
Definition: SegmentSegmentCcdIntervalCheck.h:179
SurgSim::Math::PolynomialValues< double, 3 >
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::q2T1
Math::Vector3d q2T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:107
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::IntervalCheckNoCollisionEndpoints
@ IntervalCheckNoCollisionEndpoints
Definition: SegmentSegmentCcdIntervalCheck.h:51
SurgSim::Math::Interval
Interval defines the concept of a mathematical interval and provides operations on it including arith...
Definition: IntervalArithmetic.h:34
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::thicknessQ
double thicknessQ() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:156
LinearMotionArithmetic.h
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_P1P2_sq
Math::PolynomialValues< double, 2 > m_P1P2_sq
Definition: SegmentSegmentCcdIntervalCheck.h:200
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::setTripleProductEpsilon
void setTripleProductEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:171
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::motionP2
const Math::LinearMotionND< double, 3 > & motionP2() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:57
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_P1P2xQ1Q2_y
Math::PolynomialValues< double, 2 > m_P1P2xQ1Q2_y
Definition: SegmentSegmentCcdIntervalCheck.h:207
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::Q1Q2_sq
const Math::PolynomialValues< double, 2 > & Q1Q2_sq() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:137
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::IntervalCheckNoCollisionVolume
@ IntervalCheckNoCollisionVolume
Definition: SegmentSegmentCcdIntervalCheck.h:50
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::setMuNuEpsilon
void setMuNuEpsilon(double epsilon)
Definition: SegmentSegmentCcdIntervalCheck.cpp:176
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_motionP2
Math::LinearMotionND< double, 3 > m_motionP2
Definition: SegmentSegmentCcdIntervalCheck.h:171
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_motionQ1
Math::LinearMotionND< double, 3 > m_motionQ1
Definition: SegmentSegmentCcdIntervalCheck.h:172
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_distanceEpsilon
double m_distanceEpsilon
Definition: SegmentSegmentCcdIntervalCheck.h:220
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_P1P2xQ1Q2_x
Math::PolynomialValues< double, 2 > m_P1P2xQ1Q2_x
Definition: SegmentSegmentCcdIntervalCheck.h:206
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::thicknessP
double thicknessP() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:152
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_P1P2_Q1Q2
Math::PolynomialValues< double, 2 > m_P1P2_Q1Q2
Definition: SegmentSegmentCcdIntervalCheck.h:194
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_P1Q1_P1P2_Q1Q2
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
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::motionP1
const Math::LinearMotionND< double, 3 > & motionP1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:52
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::p1T0
Math::Vector3d p1T0() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:72
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_Q1Q2_sq
Math::PolynomialValues< double, 2 > m_Q1Q2_sq
Definition: SegmentSegmentCcdIntervalCheck.h:201
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_motionP1
Math::LinearMotionND< double, 3 > m_motionP1
Definition: SegmentSegmentCcdIntervalCheck.h:170
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::muNuEpsilon
double muNuEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:196
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_volumeEpsilonTimes6
double m_volumeEpsilonTimes6
Definition: SegmentSegmentCcdIntervalCheck.h:221
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_Q1Q2_P1Q1
Math::PolynomialValues< double, 2 > m_Q1Q2_P1Q1
Definition: SegmentSegmentCcdIntervalCheck.h:193
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_thicknessQ
double m_thicknessQ
Definition: SegmentSegmentCcdIntervalCheck.h:214
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_P1P2_P1Q1
Math::PolynomialValues< double, 2 > m_P1P2_P1Q1
Definition: SegmentSegmentCcdIntervalCheck.h:192
PolynomialValues.h
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_P1P2xQ1Q2_z
Math::PolynomialValues< double, 2 > m_P1P2xQ1Q2_z
Definition: SegmentSegmentCcdIntervalCheck.h:208
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::Q1Q2_P1Q1
const Math::PolynomialValues< double, 2 > & Q1Q2_P1Q1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:122
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::p2T1
Math::Vector3d p2T1() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:87
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::distanceEpsilon
double distanceEpsilon() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:186
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::operator=
SegmentSegmentCcdIntervalCheck & operator=(const SegmentSegmentCcdIntervalCheck &)
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::m_relativeQ1Q2
Math::LinearMotionND< double, 3 > m_relativeQ1Q2
Definition: SegmentSegmentCcdIntervalCheck.h:180
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::P1P2_sq
const Math::PolynomialValues< double, 2 > & P1P2_sq() const
Definition: SegmentSegmentCcdIntervalCheck.cpp:132
SurgSim::Collision::SegmentSegmentCcdIntervalCheck
SegmentSegmentCcdIntervalCheck uses the Interval classes including the LinearMotion and Polynomial fa...
Definition: SegmentSegmentCcdIntervalCheck.h:37
SurgSim::Collision::SegmentSegmentCcdIntervalCheck::crossValueOnInterval
Math::Interval< double > crossValueOnInterval(const Math::Interval< double > &range) const
Definition: SegmentSegmentCcdIntervalCheck.cpp:142