Skip to content

Commit

Permalink
Remove collision groups implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Perez <[email protected]>
  • Loading branch information
Blast545 committed Mar 3, 2021
1 parent 4cf6b4e commit d022c34
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
11 changes: 0 additions & 11 deletions bullet/src/Base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,12 @@ inline Eigen::Vector3d convert(btVector3 vec)
class Base : public Implements3d<FeatureList<Feature>>
{
public: std::size_t entityCount = 0;
public: std::size_t collisionGroup = 6;

public: inline std::size_t GetNextEntity()
{
return entityCount++;
}

public: inline std::size_t GetNextCollisionGroup()
{
return collisionGroup++;
}

public: inline Identity InitiateEngine(std::size_t /*_engineID*/) override
{
const auto id = this->GetNextEntity();
Expand All @@ -157,10 +151,6 @@ class Base : public Implements3d<FeatureList<Feature>>
{
const auto id = this->GetNextEntity();
this->models[id] = std::make_shared<ModelInfo>(_modelInfo);

// A collision mask for each different model
this->collisionGroups[id] = 1 << GetNextCollisionGroup();

return this->GenerateIdentity(id, this->models.at(id));
}

Expand Down Expand Up @@ -200,7 +190,6 @@ class Base : public Implements3d<FeatureList<Feature>>
public: std::unordered_map<std::size_t, LinkInfoPtr> links;
public: std::unordered_map<std::size_t, CollisionInfoPtr> collisions;
public: std::unordered_map<std::size_t, JointInfoPtr> joints;
public: std::unordered_map<std::size_t, std::size_t> collisionGroups;

public: int internalTicksDivider = 0;

Expand Down
10 changes: 1 addition & 9 deletions bullet/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,9 @@ Identity SDFFeatures::ConstructSdfLink(

const auto &world = this->worlds.at(modelInfo->world)->world;

// Models collide with everything except themselves
// const int modelCollisionGroup = 1 << this->collisionGroups.at(_modelID);
// const int collisionMask = -1 ^ modelCollisionGroup;
// world->addRigidBody(body, modelCollisionGroup, collisionMask);
// Links collide with everything except elements sharing a joint
world->addRigidBody(body);

// bool isDynamic = !(body->isStaticObject() || body->isKinematicObject());
// int collisionFilterGroup = isDynamic ? 1 << this->collisionGroups.at(_modelID) : int(btBroadphaseProxy::StaticFilter);
// int collisionFilterMask = isDynamic ? int(btBroadphaseProxy::AllFilter) ^ collisionFilterGroup : int(btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter);
// world->addRigidBody(body, collisionFilterGroup, collisionFilterMask);
// Generate an identity for it
const auto linkIdentity = this->AddLink({name, body, _modelID, pose, mass,
linkInertiaDiag});
Expand Down Expand Up @@ -184,7 +177,6 @@ Identity SDFFeatures::ConstructSdfCollision(
->GetElement("ode");
const auto mu = odeFriction->Get<btScalar>("mu");
const auto mu2 = odeFriction->Get<btScalar>("mu2");
// const auto mu3 = odeFriction->Get<btScalar>("mu3");

// Get restitution
// const auto restitution = surfaceElement->GetElement("bounce")
Expand Down

0 comments on commit d022c34

Please sign in to comment.