16 #ifndef SURGSIM_COLLISION_COLLISIONPAIR_H 17 #define SURGSIM_COLLISION_COLLISIONPAIR_H 39 Contact(
const CollisionDetectionType& newType,
40 const double& newDepth,
41 const double& newTime,
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;
178 template <
typename charT,
typename traits>
179 std::basic_ostream<charT, traits>& operator << (std::basic_ostream<charT, traits>& out,
182 out <<
"Normal: " <<
contact.normal.transpose() << std::endl;
183 out <<
"Depth: " <<
contact.depth << std::endl;
184 out <<
"Time: " <<
contact.time << std::endl;
185 out <<
"Penetration Point 1 :" <<
contact.penetrationPoints.first << std::endl;
186 out <<
"Penetration Point 2 :" <<
contact.penetrationPoints.second << std::endl;
Definition: CompoundShapeToGraphics.cpp:29
std::pair< std::shared_ptr< Representation >, std::shared_ptr< Representation > > m_representations
Pair of objects that are colliding.
Definition: CollisionPair.h:163
A Location defines a local position w.r.t.
Definition: Location.h:39
Collision Pair class, it signifies a pair of items that should be checked with the collision algorith...
Definition: CollisionPair.h:78
bool m_isSwapped
Definition: CollisionPair.h:171
CollisionDetectionType m_type
Collision detection type for this pair.
Definition: CollisionPair.h:166
Definitions of small fixed-size vector types.
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
std::list< std::shared_ptr< Contact > > m_contacts
List of current contacts.
Definition: CollisionPair.h:169