Beispiel #1
0
//==============================================================================
void BulletCollisionGroup::removeAllCollisionObjectsFromEngine()
{
  for (const auto& pair : mShapeFrameMap)
    removeCollisionObjectFromEngine(pair.second.get());

  initializeEngineData();
}
Beispiel #2
0
//==============================================================================
void CollisionGroup::removeShapeFrame(const dynamics::ShapeFrame* shapeFrame)
{
  if (!shapeFrame)
    return;

  const auto search
      = std::find_if(mShapeFrameMap.begin(), mShapeFrameMap.end(),
                     [&](const std::pair<const dynamics::ShapeFrame*,
                                         CollisionObjectPtr>& pair)
                     { return pair.first == shapeFrame; });

  if (mShapeFrameMap.end() == search)
    return;

  removeCollisionObjectFromEngine(search->second.get());

  mShapeFrameMap.erase(search);
}