16 #ifndef SURGSIM_COLLISION_COLLISIONPAIR_H 17 #define SURGSIM_COLLISION_COLLISIONPAIR_H 22 #include "SurgSim/Collision/Representation.h" 23 #include "SurgSim/DataStructures/Location.h" 39 Contact(
const CollisionDetectionType& newType,
40 const double& newDepth,
41 const double& newTime,
50 std::shared_ptr<Contact> makeComplimentary()
54 complimentary->force = -
force;
60 std::abs(
time - contact.
time) < 1e-8 &&
65 CollisionDetectionType
type;
86 const std::shared_ptr<Representation>& second);
94 void setRepresentations(
const std::shared_ptr<Representation>& first,
95 const std::shared_ptr<Representation>& second);
99 const std::pair<std::shared_ptr<Representation>, std::shared_ptr<Representation>>&
100 getRepresentations()
const;
104 CollisionDetectionType getType()
const;
107 std::shared_ptr<Representation> getFirst()
const;
110 std::shared_ptr<Representation> getSecond()
const;
113 bool hasContacts()
const;
121 void addCcdContact(
const double&
depth,
132 void addDcdContact(
const double& depth,
139 void addContact(
const std::shared_ptr<Contact>&
contact);
142 void updateRepresentations();
145 std::list<std::shared_ptr<Contact>>& getContacts();
148 void clearContacts();
151 void swapRepresentations();
155 bool isSwapped()
const;
159 bool mayIntersect()
const;
163 std::pair<std::shared_ptr<Representation>, std::shared_ptr<Representation>> m_representations;
166 CollisionDetectionType m_type;
169 std::list<std::shared_ptr<Contact>> m_contacts;
178 template <
typename charT,
typename traits>
179 std::basic_ostream<charT, traits>& operator << (std::basic_ostream<charT, traits>& out,
182 out <<
"Type: " <<
contact.type << std::endl;
183 out <<
"Depth: " <<
contact.depth << std::endl;
184 out <<
"Time: " <<
contact.time << std::endl;
185 out <<
"Contact: " <<
contact.contact.transpose() << std::endl;
186 out <<
"Normal: " <<
contact.normal.transpose() << std::endl;
187 out <<
"Force: " <<
contact.force.transpose() << std::endl;
188 out <<
"Penetration Point 1 :" <<
contact.penetrationPoints.first << std::endl;
189 out <<
"Penetration Point 2 :" <<
contact.penetrationPoints.second << std::endl;
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
A Location defines a local position w.r.t.
Definition: Location.h:39
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
Collision Pair class, it signifies a pair of items that should be checked with the collision algorith...
Definition: CollisionPair.h:78
Definitions of small fixed-size vector types.