box2d enable collisions between static/kinematic bodies

subclass b2body.cpp’s bool b2Body::ShouldCollide(const b2Body* other) const

or just comment out:

if (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody)
{
    return false;
}

This is useful if you may need kinematic/static bodies to listen to collisions between each and also want to move them using cocos2d actions.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: