[SOLVED] Groups, Categories, Masks, Filters...
Posted: Tue Jun 02, 2015 1:01 am
Hey folks. These forums feel a bit desolate, but I'll give it a shot anyway.
I'm trying to accomplish what I feel should be pretty simple... Somehow it's not working. I must not completely understand all this group/category/mask filtering... Doesn't sound that complicated, but my solution isn't working.
All these shapes (two) are attached to a single body. I want the shield_shape to collide with other shield_shapes, I want the ship shape itself to do the colliding with planets. Well, neither of those collisions take place with this set up. What's up?
I'm trying to accomplish what I feel should be pretty simple... Somehow it's not working. I must not completely understand all this group/category/mask filtering... Doesn't sound that complicated, but my solution isn't working.
Code: Select all
cpShapeSetFilter(shape, cpShapeFilterNew(uid, Game::Object::SHIP, Game::Object::PLANET));
cpShapeSetFilter(shield_shape, cpShapeFilterNew(uid, Game::Object::SHIP, Game::Object::SHIP));
...
cpShapeSetCollisionType(shape, Game::Object::Group::SHIP);
cpShapeSetCollisionType(shield_shape, Game::Object::Group::SHIP);