9 #include "imstkLogger.h" 10 #include "imstkMath.h" 11 #include "imstkTypes.h" 17 enum class CollisionElementType
53 Vec3d pts[4] = { Vec3d::Zero(), Vec3d::Zero(), Vec3d::Zero(), Vec3d::Zero() };
68 int ids[4] = { -1, -1, -1, -1 };
71 CellTypeId cellType = IMSTK_VERTEX;
80 Vec3d pt = Vec3d::Zero();
81 Vec3d dir = Vec3d::Zero();
82 double penetrationDepth = 0.0;
91 Vec3d dir = Vec3d::Zero();
92 double penetrationDepth = 0.0;
107 m_element.m_EmptyElement = element;
108 m_type = CollisionElementType::Empty;
114 m_element.m_CellVertexElement = element;
115 m_type = CollisionElementType::CellVertex;
121 m_element.m_CellIndexElement = element;
122 m_type = CollisionElementType::CellIndex;
128 m_element.m_PointDirectionElement = element;
129 m_type = CollisionElementType::PointDirection;
135 m_element.m_PointIndexDirectionElement = element;
136 m_type = CollisionElementType::PointIndexDirection;
141 m_type = other.m_type;
142 m_ccdData = other.m_ccdData;
145 case CollisionElementType::Empty:
147 case CollisionElementType::CellVertex:
148 m_element.m_CellVertexElement = other.m_element.m_CellVertexElement;
150 case CollisionElementType::CellIndex:
151 m_element.m_CellIndexElement = other.m_element.m_CellIndexElement;
153 case CollisionElementType::PointDirection:
154 m_element.m_PointDirectionElement = other.m_element.m_PointDirectionElement;
156 case CollisionElementType::PointIndexDirection:
157 m_element.m_PointIndexDirectionElement = other.m_element.m_PointIndexDirectionElement;
164 m_type = other.m_type;
165 m_ccdData = other.m_ccdData;
168 case CollisionElementType::Empty:
170 case CollisionElementType::CellVertex:
171 m_element.m_CellVertexElement = other.m_element.m_CellVertexElement;
173 case CollisionElementType::CellIndex:
174 m_element.m_CellIndexElement = other.m_element.m_CellIndexElement;
176 case CollisionElementType::PointDirection:
177 m_element.m_PointDirectionElement = other.m_element.m_PointDirectionElement;
179 case CollisionElementType::PointIndexDirection:
180 m_element.m_PointIndexDirectionElement = other.m_element.m_PointIndexDirectionElement;
203 CollisionElementType m_type;
204 bool m_ccdData =
false;
213 std::vector<CollisionElement> elementsA;
214 std::vector<CollisionElement> elementsB;
215 std::shared_ptr<Geometry> geomA;
216 std::shared_ptr<Geometry> geomB;
217 std::shared_ptr<Geometry> prevGeomA;
218 std::shared_ptr<Geometry> prevGeomB;
Union of collision elements. We use a union to avoid polymorphism. There may be many elements and acc...
Represents a cell by a single cell id OR by N vertex ids. Which case can be determined by the idCount...
Describes the contact manifold between two geometries.
Direclty gives a point-direction contact as its collision data, point given by index.
Represents a cell by its vertex values Possible cells may be: point, edge, triangle, quad, or tetrahedron Maximum 4 vertices (tetrahedron is maximum cell it could represent)
Direclty gives a point-direction contact as its collision data.