Box2D Static-Dynamic body joint eliminates collisions

Posted by andrewz on Game Development See other posts from Game Development or by andrewz
Published on 2013-09-30T16:29:26Z Indexed on 2013/10/31 16:19 UTC
Read the original article Hit count: 479

Filed under:
|

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);

© Game Development or respective owner

Related posts about collision-detection

Related posts about box2d