0
\$\begingroup\$

I have a static body A, and a dynamic body B, and a dynamic body C. A is filtered to not collide with anything, B and C collide with each other.

I wish to create a joint between B and A. When I create a joint (ex. revolute), B no longer collides with C - C passes through it as if it does not exist.

What am I doing wrong? How can adding a joint prevent a body from colliding with another body it used to?

EDIT: I want to join B with A, and have B collide with C, but not A collide with C. In realistic terms, I'm trying to create a revolute joint between a wheel (B) and a wall (A), and have a box (C) hit the wheel and the wheel would then rotate.

EDIT: I create a the simplest revolute joint I can with these parameters (C++):

b2RevoluteJointDef def;
def.Initialize(A, B, B -> GetWorldCenter());
world -> CreateJoint(&def);
\$\endgroup\$
1
\$\begingroup\$

Fixture density of body B was 0, it should be a positive value.

b2FixtureDef f;
...
f.density = 10.f; // greater than 0
B -> CreateFixture(f);
\$\endgroup\$
  • \$\begingroup\$ Cheers on getting to the bottom of the issue. Perhaps you could expand this answer with some sample code demonstrating the fix? \$\endgroup\$ – kevintodisco Sep 30 '13 at 20:22
  • \$\begingroup\$ If you are satisfied with your own answer, you should accept it. \$\endgroup\$ – NauticalMile Oct 4 '13 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.