-new collision layer & mask system for 2D, for more flexible collision masking

This commit is contained in:
Juan Linietsky 2015-05-03 16:47:21 -03:00
parent 5f2aac4bbe
commit af06843982
18 changed files with 147 additions and 32 deletions

View file

@ -234,7 +234,7 @@ bool BodyPair2DSW::setup(float p_step) {
//cannot collide
if ((A->get_layer_mask()&B->get_layer_mask())==0 || A->has_exception(B->get_self()) || B->has_exception(A->get_self()) || (A->get_mode()<=Physics2DServer::BODY_MODE_KINEMATIC && B->get_mode()<=Physics2DServer::BODY_MODE_KINEMATIC && A->get_max_contacts_reported()==0 && B->get_max_contacts_reported()==0)) {
if (!A->test_collision_mask(B) || A->has_exception(B->get_self()) || B->has_exception(A->get_self()) || (A->get_mode()<=Physics2DServer::BODY_MODE_KINEMATIC && B->get_mode()<=Physics2DServer::BODY_MODE_KINEMATIC && A->get_max_contacts_reported()==0 && B->get_max_contacts_reported()==0)) {
collided=false;
return false;
}