7 #include "imstkCollidingObject.h" 8 #include "imstkCDObjectFactory.h" 9 #include "imstkGeometry.h" 10 #include "imstkGeometryMap.h" 33 for (
auto& item : m_collisions)
42 m_collisions[other].push_back(data);
45 const std::vector<std::shared_ptr<imstk::CollisionData>>&
46 CollidingObject::getCollisions(std::shared_ptr<CollidingObject> other)
const 48 static const std::vector<std::shared_ptr<imstk::CollisionData>> empty;
50 if (m_collisions.find(other) != m_collisions.end())
52 return m_collisions.at(other);
70 return !m_collisions[other].empty();
73 std::shared_ptr<Geometry>
74 CollidingObject::getCollidingGeometry()
const 80 CollidingObject::setCollidingGeometry(std::shared_ptr<Geometry> geometry)
85 std::shared_ptr<GeometryMap>
86 CollidingObject::getCollidingToVisualMap()
const 92 CollidingObject::setCollidingToVisualMap(std::shared_ptr<GeometryMap> map)
void updateGeometries() override
Updates the geometries from the maps (if defined)
void postModifiedAll() override
Posts modified for all geometries.
virtual void updateGeometries()
Update the geometries.
void clearCollisions()
resets the collision information
void update() override
Update the SceneObject, called during scene update.
bool initialize() override
Initialize the scene object.
void addCollision(std::shared_ptr< CollidingObject > other, std::shared_ptr< imstk::CollisionData > data)
Add data for collision with the object `other.
virtual bool initialize()
Initialize the scene object.
std::shared_ptr< GeometryMap > m_collidingToVisualMap
Maps transformations to visual geometry.
virtual void update()
Update the SceneObject, called during scene update.
static std::string getCDType(const Geometry &obj1, const Geometry &obj2)
Get the CD type from the types of objects colliding.
bool didCollide(std::shared_ptr< CollidingObject > other)
A SceneObject with a geometry for collision.
virtual void postModifiedAll()
Posts modified for all geometries.
std::shared_ptr< Geometry > m_collidingGeometry
Geometry for collisions.