ContactConstraintData.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, 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_PHYSICS_CONTACTCONSTRAINTDATA_H
17 #define SURGSIM_PHYSICS_CONTACTCONSTRAINTDATA_H
18 
20 
21 #include "SurgSim/Math/Vector.h"
22 
23 namespace SurgSim
24 {
25 
26 namespace Physics
27 {
28 
31 {
32 public:
36  m_distance(0.0)
37  {
38  m_normal.setZero();
39  }
40 
43  {
44  }
45 
50  void setPlaneEquation(const SurgSim::Math::Vector3d& n, double d)
51  {
52  m_normal = n;
53  m_distance = d;
54  }
55 
59  {
60  return m_normal;
61  }
62 
65  double getDistance() const
66  {
67  return m_distance;
68  }
69 
70 private:
73 
75  double m_distance;
76 };
77 
78 }; // namespace Physics
79 
80 }; // namespace SurgSim
81 
82 #endif // SURGSIM_PHYSICS_CONTACTCONSTRAINTDATA_H
Definition: DriveElementFromInputBehavior.cpp:27
double getDistance() const
Gets the plane distance to the origin.
Definition: ContactConstraintData.h:65
const SurgSim::Math::Vector3d & getNormal() const
Gets the plane normal vector.
Definition: ContactConstraintData.h:58
Base class for all CosntraintData Derived classes should be specific to a given constraint.
Definition: ConstraintData.h:27
void setPlaneEquation(const SurgSim::Math::Vector3d &n, double d)
Sets the plane equation of the frictionless contact.
Definition: ContactConstraintData.h:50
Definitions of small fixed-size vector types.
double m_distance
Plane equation distance to origin.
Definition: ContactConstraintData.h:75
Class for Frictionless contact (only needs a plane equation)
Definition: ContactConstraintData.h:30
SurgSim::Math::Vector3d m_normal
Plane equation normal vector (normalized vector)
Definition: ContactConstraintData.h:72
ContactConstraintData()
Default constructor.
Definition: ContactConstraintData.h:34
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:56
virtual ~ContactConstraintData()
Destructor.
Definition: ContactConstraintData.h:42