{"action":"created","comment":{"url":"https://api.github.com/repos/godotengine/godot/pulls/comments/59264906","id":59264906,"diff_hunk":"@@ -92,17 +136,42 @@ void PhysicsBody::remove_collision_exception_with(Node* p_node) {\n \tPhysicsServer::get_singleton()->body_remove_collision_exception(get_rid(),physics_body->get_rid());\n }\n \n+void PhysicsBody::_set_layers(uint32_t p_mask) {\n+\tset_layer_mask(p_mask);\n+\tset_collision_mask(p_mask);\n+}\n+\n+uint32_t PhysicsBody::_get_layers() const{\n+\n+\treturn get_layer_mask();\n+}\n \n void PhysicsBody::_bind_methods() {\n \tObjectTypeDB::bind_method(_MD(\"set_layer_mask\",\"mask\"),&PhysicsBody::set_layer_mask);\n \tObjectTypeDB::bind_method(_MD(\"get_layer_mask\"),&PhysicsBody::get_layer_mask);\n-\tADD_PROPERTY(PropertyInfo(Variant::INT,\"layers\",PROPERTY_HINT_ALL_FLAGS),_SCS(\"set_layer_mask\"),_SCS(\"get_layer_mask\"));\n+\n+\tObjectTypeDB::bind_method(_MD(\"set_collision_mask\",\"mask\"),&PhysicsBody::set_collision_mask);\n+\tObjectTypeDB::bind_method(_MD(\"get_collision_mask\"),&PhysicsBody::get_collision_mask);\n+\n+\tObjectTypeDB::bind_method(_MD(\"set_collision_mask_bit\",\"bit\",\"value\"),&PhysicsBody::set_collision_mask_bit);\n+\tObjectTypeDB::bind_method(_MD(\"get_collision_mask_bit\",\"bit\"),&PhysicsBody::get_collision_mask_bit);\n+\n+\tObjectTypeDB::bind_method(_MD(\"set_layer_mask_bit\",\"bit\",\"value\"),&PhysicsBody::set_layer_mask_bit);\n+\tObjectTypeDB::bind_method(_MD(\"get_layer_mask_bit\",\"bit\"),&PhysicsBody::get_layer_mask_bit);\n+\n+\tObjectTypeDB::bind_method(_MD(\"_set_layers\",\"mask\"),&PhysicsBody::_set_layers);\n+\tObjectTypeDB::bind_method(_MD(\"_get_layers\"),&PhysicsBody::_get_layers);\n+\n+\tADD_PROPERTY(PropertyInfo(Variant::INT,\"layers\",PROPERTY_HINT_ALL_FLAGS,\"\",0),_SCS(\"_set_layers\"),_SCS(\"_get_layers\")); //for backwards compat","path":"scene/3d/physics_body.cpp","position":82,"original_position":82,"commit_id":"f7c3d6329cdc9c21c205f1522813090313a422d2","original_commit_id":"f7c3d6329cdc9c21c205f1522813090313a422d2","user":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars.githubusercontent.com/u/4701338?v=3","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"body":"Is this needed? The comment hints that it was added for backwards compatibility with the previous layers system (likely for 2D only), so it's probably not needed for the 3D API?","created_at":"2016-04-11T19:24:11Z","updated_at":"2016-04-11T19:24:11Z","html_url":"https://github.com/godotengine/godot/pull/4273#discussion_r59264906","pull_request_url":"https://api.github.com/repos/godotengine/godot/pulls/4273","_links":{"self":{"href":"https://api.github.com/repos/godotengine/godot/pulls/comments/59264906"},"html":{"href":"https://github.com/godotengine/godot/pull/4273#discussion_r59264906"},"pull_request":{"href":"https://api.github.com/repos/godotengine/godot/pulls/4273"}}},"pull_request":{"url":"https://api.github.com/repos/godotengine/godot/pulls/4273","id":65889761,"html_url":"https://github.com/godotengine/godot/pull/4273","diff_url":"https://github.com/godotengine/godot/pull/4273.diff","patch_url":"https://github.com/godotengine/godot/pull/4273.patch","issue_url":"https://api.github.com/repos/godotengine/godot/issues/4273","number":4273,"state":"open","locked":false,"title":"Port collision and layer masks to 3D","user":{"login":"bojidar-bg","id":5276727,"avatar_url":"https://avatars.githubusercontent.com/u/5276727?v=3","gravatar_id":"","url":"https://api.github.com/users/bojidar-bg","html_url":"https://github.com/bojidar-bg","followers_url":"https://api.github.com/users/bojidar-bg/followers","following_url":"https://api.github.com/users/bojidar-bg/following{/other_user}","gists_url":"https://api.github.com/users/bojidar-bg/gists{/gist_id}","starred_url":"https://api.github.com/users/bojidar-bg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bojidar-bg/subscriptions","organizations_url":"https://api.github.com/users/bojidar-bg/orgs","repos_url":"https://api.github.com/users/bojidar-bg/repos","events_url":"https://api.github.com/users/bojidar-bg/events{/privacy}","received_events_url":"https://api.github.com/users/bojidar-bg/received_events","type":"User","site_admin":false},"body":"Fixes #1759.\r\nI added `type_mask` and `layer_mask` to Raycast nodes,  `collision_mask` and `layer_mask` to Area nodes, and `collision_mask` to PhysicsBody nodes.\r\n\r\nI have tested the code, but I'm not sure if I've copied everything from 2D correctly, so it would be nice if you test it too :smile: (though I can just make another PR with missing content).","created_at":"2016-04-09T19:19:02Z","updated_at":"2016-04-11T19:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f6abc834cbedd2b4cd48bd974e160a3cf9f2b63","assignee":null,"milestone":{"url":"https://api.github.com/repos/godotengine/godot/milestones/5","html_url":"https://github.com/godotengine/godot/milestones/2.1","labels_url":"https://api.github.com/repos/godotengine/godot/milestones/5/labels","id":1449703,"number":5,"title":"2.1","description":"","creator":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars.githubusercontent.com/u/4701338?v=3","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"open_issues":179,"closed_issues":22,"state":"open","created_at":"2015-12-08T11:42:22Z","updated_at":"2016-04-11T19:18:58Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/godotengine/godot/pulls/4273/commits","review_comments_url":"https://api.github.com/repos/godotengine/godot/pulls/4273/comments","review_comment_url":"https://api.github.com/repos/godotengine/godot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/4273/comments","statuses_url":"https://api.github.com/repos/godotengine/godot/statuses/f7c3d6329cdc9c21c205f1522813090313a422d2","head":{"label":"bojidar-bg:add-layers-and-masks-to-3d","ref":"add-layers-and-masks-to-3d","sha":"f7c3d6329cdc9c21c205f1522813090313a422d2","user":{"login":"bojidar-bg","id":5276727,"avatar_url":"https://avatars.githubusercontent.com/u/5276727?v=3","gravatar_id":"","url":"https://api.github.com/users/bojidar-bg","html_url":"https://github.com/bojidar-bg","followers_url":"https://api.github.com/users/bojidar-bg/followers","following_url":"https://api.github.com/users/bojidar-bg/following{/other_user}","gists_url":"https://api.github.com/users/bojidar-bg/gists{/gist_id}","starred_url":"https://api.github.com/users/bojidar-bg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bojidar-bg/subscriptions","organizations_url":"https://api.github.com/users/bojidar-bg/orgs","repos_url":"https://api.github.com/users/bojidar-bg/repos","events_url":"https://api.github.com/users/bojidar-bg/events{/privacy}","received_events_url":"https://api.github.com/users/bojidar-bg/received_events","type":"User","site_admin":false},"repo":{"id":42986172,"name":"godot","full_name":"bojidar-bg/godot","owner":{"login":"bojidar-bg","id":5276727,"avatar_url":"https://avatars.githubusercontent.com/u/5276727?v=3","gravatar_id":"","url":"https://api.github.com/users/bojidar-bg","html_url":"https://github.com/bojidar-bg","followers_url":"https://api.github.com/users/bojidar-bg/followers","following_url":"https://api.github.com/users/bojidar-bg/following{/other_user}","gists_url":"https://api.github.com/users/bojidar-bg/gists{/gist_id}","starred_url":"https://api.github.com/users/bojidar-bg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bojidar-bg/subscriptions","organizations_url":"https://api.github.com/users/bojidar-bg/orgs","repos_url":"https://api.github.com/users/bojidar-bg/repos","events_url":"https://api.github.com/users/bojidar-bg/events{/privacy}","received_events_url":"https://api.github.com/users/bojidar-bg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bojidar-bg/godot","description":"Godot Game Engine","fork":true,"url":"https://api.github.com/repos/bojidar-bg/godot","forks_url":"https://api.github.com/repos/bojidar-bg/godot/forks","keys_url":"https://api.github.com/repos/bojidar-bg/godot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bojidar-bg/godot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bojidar-bg/godot/teams","hooks_url":"https://api.github.com/repos/bojidar-bg/godot/hooks","issue_events_url":"https://api.github.com/repos/bojidar-bg/godot/issues/events{/number}","events_url":"https://api.github.com/repos/bojidar-bg/godot/events","assignees_url":"https://api.github.com/repos/bojidar-bg/godot/assignees{/user}","branches_url":"https://api.github.com/repos/bojidar-bg/godot/branches{/branch}","tags_url":"https://api.github.com/repos/bojidar-bg/godot/tags","blobs_url":"https://api.github.com/repos/bojidar-bg/godot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bojidar-bg/godot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bojidar-bg/godot/git/refs{/sha}","trees_url":"https://api.github.com/repos/bojidar-bg/godot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bojidar-bg/godot/statuses/{sha}","languages_url":"https://api.github.com/repos/bojidar-bg/godot/languages","stargazers_url":"https://api.github.com/repos/bojidar-bg/godot/stargazers","contributors_url":"https://api.github.com/repos/bojidar-bg/godot/contributors","subscribers_url":"https://api.github.com/repos/bojidar-bg/godot/subscribers","subscription_url":"https://api.github.com/repos/bojidar-bg/godot/subscription","commits_url":"https://api.github.com/repos/bojidar-bg/godot/commits{/sha}","git_commits_url":"https://api.github.com/repos/bojidar-bg/godot/git/commits{/sha}","comments_url":"https://api.github.com/repos/bojidar-bg/godot/comments{/number}","issue_comment_url":"https://api.github.com/repos/bojidar-bg/godot/issues/comments{/number}","contents_url":"https://api.github.com/repos/bojidar-bg/godot/contents/{+path}","compare_url":"https://api.github.com/repos/bojidar-bg/godot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bojidar-bg/godot/merges","archive_url":"https://api.github.com/repos/bojidar-bg/godot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bojidar-bg/godot/downloads","issues_url":"https://api.github.com/repos/bojidar-bg/godot/issues{/number}","pulls_url":"https://api.github.com/repos/bojidar-bg/godot/pulls{/number}","milestones_url":"https://api.github.com/repos/bojidar-bg/godot/milestones{/number}","notifications_url":"https://api.github.com/repos/bojidar-bg/godot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bojidar-bg/godot/labels{/name}","releases_url":"https://api.github.com/repos/bojidar-bg/godot/releases{/id}","deployments_url":"https://api.github.com/repos/bojidar-bg/godot/deployments","created_at":"2015-09-23T07:45:02Z","updated_at":"2015-09-23T07:45:22Z","pushed_at":"2016-04-09T19:16:07Z","git_url":"git://github.com/bojidar-bg/godot.git","ssh_url":"git@github.com:bojidar-bg/godot.git","clone_url":"https://github.com/bojidar-bg/godot.git","svn_url":"https://github.com/bojidar-bg/godot","homepage":null,"size":81533,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"godotengine:master","ref":"master","sha":"d454e64f429affb89de036eed6daa5c6e5278492","user":{"login":"godotengine","id":6318500,"avatar_url":"https://avatars.githubusercontent.com/u/6318500?v=3","gravatar_id":"","url":"https://api.github.com/users/godotengine","html_url":"https://github.com/godotengine","followers_url":"https://api.github.com/users/godotengine/followers","following_url":"https://api.github.com/users/godotengine/following{/other_user}","gists_url":"https://api.github.com/users/godotengine/gists{/gist_id}","starred_url":"https://api.github.com/users/godotengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godotengine/subscriptions","organizations_url":"https://api.github.com/users/godotengine/orgs","repos_url":"https://api.github.com/users/godotengine/repos","events_url":"https://api.github.com/users/godotengine/events{/privacy}","received_events_url":"https://api.github.com/users/godotengine/received_events","type":"Organization","site_admin":false},"repo":{"id":15634981,"name":"godot","full_name":"godotengine/godot","owner":{"login":"godotengine","id":6318500,"avatar_url":"https://avatars.githubusercontent.com/u/6318500?v=3","gravatar_id":"","url":"https://api.github.com/users/godotengine","html_url":"https://github.com/godotengine","followers_url":"https://api.github.com/users/godotengine/followers","following_url":"https://api.github.com/users/godotengine/following{/other_user}","gists_url":"https://api.github.com/users/godotengine/gists{/gist_id}","starred_url":"https://api.github.com/users/godotengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godotengine/subscriptions","organizations_url":"https://api.github.com/users/godotengine/orgs","repos_url":"https://api.github.com/users/godotengine/repos","events_url":"https://api.github.com/users/godotengine/events{/privacy}","received_events_url":"https://api.github.com/users/godotengine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/godotengine/godot","description":"Godot Game Engine","fork":false,"url":"https://api.github.com/repos/godotengine/godot","forks_url":"https://api.github.com/repos/godotengine/godot/forks","keys_url":"https://api.github.com/repos/godotengine/godot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/godotengine/godot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/godotengine/godot/teams","hooks_url":"https://api.github.com/repos/godotengine/godot/hooks","issue_events_url":"https://api.github.com/repos/godotengine/godot/issues/events{/number}","events_url":"https://api.github.com/repos/godotengine/godot/events","assignees_url":"https://api.github.com/repos/godotengine/godot/assignees{/user}","branches_url":"https://api.github.com/repos/godotengine/godot/branches{/branch}","tags_url":"https://api.github.com/repos/godotengine/godot/tags","blobs_url":"https://api.github.com/repos/godotengine/godot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/godotengine/godot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/godotengine/godot/git/refs{/sha}","trees_url":"https://api.github.com/repos/godotengine/godot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/godotengine/godot/statuses/{sha}","languages_url":"https://api.github.com/repos/godotengine/godot/languages","stargazers_url":"https://api.github.com/repos/godotengine/godot/stargazers","contributors_url":"https://api.github.com/repos/godotengine/godot/contributors","subscribers_url":"https://api.github.com/repos/godotengine/godot/subscribers","subscription_url":"https://api.github.com/repos/godotengine/godot/subscription","commits_url":"https://api.github.com/repos/godotengine/godot/commits{/sha}","git_commits_url":"https://api.github.com/repos/godotengine/godot/git/commits{/sha}","comments_url":"https://api.github.com/repos/godotengine/godot/comments{/number}","issue_comment_url":"https://api.github.com/repos/godotengine/godot/issues/comments{/number}","contents_url":"https://api.github.com/repos/godotengine/godot/contents/{+path}","compare_url":"https://api.github.com/repos/godotengine/godot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/godotengine/godot/merges","archive_url":"https://api.github.com/repos/godotengine/godot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/godotengine/godot/downloads","issues_url":"https://api.github.com/repos/godotengine/godot/issues{/number}","pulls_url":"https://api.github.com/repos/godotengine/godot/pulls{/number}","milestones_url":"https://api.github.com/repos/godotengine/godot/milestones{/number}","notifications_url":"https://api.github.com/repos/godotengine/godot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/godotengine/godot/labels{/name}","releases_url":"https://api.github.com/repos/godotengine/godot/releases{/id}","deployments_url":"https://api.github.com/repos/godotengine/godot/deployments","created_at":"2014-01-04T16:05:36Z","updated_at":"2016-04-11T19:01:42Z","pushed_at":"2016-04-11T18:59:36Z","git_url":"git://github.com/godotengine/godot.git","ssh_url":"git@github.com:godotengine/godot.git","clone_url":"https://github.com/godotengine/godot.git","svn_url":"https://github.com/godotengine/godot","homepage":"http://www.godotengine.org","size":119540,"stargazers_count":5619,"watchers_count":5619,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1488,"mirror_url":null,"open_issues_count":965,"forks":1488,"open_issues":965,"watchers":5619,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/godotengine/godot/pulls/4273"},"html":{"href":"https://github.com/godotengine/godot/pull/4273"},"issue":{"href":"https://api.github.com/repos/godotengine/godot/issues/4273"},"comments":{"href":"https://api.github.com/repos/godotengine/godot/issues/4273/comments"},"review_comments":{"href":"https://api.github.com/repos/godotengine/godot/pulls/4273/comments"},"review_comment":{"href":"https://api.github.com/repos/godotengine/godot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/godotengine/godot/pulls/4273/commits"},"statuses":{"href":"https://api.github.com/repos/godotengine/godot/statuses/f7c3d6329cdc9c21c205f1522813090313a422d2"}}}}