{"action":"created","issue":{"url":"https://api.github.com/repos/minetest/minetest/issues/3503","labels_url":"https://api.github.com/repos/minetest/minetest/issues/3503/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/3503/comments","events_url":"https://api.github.com/repos/minetest/minetest/issues/3503/events","html_url":"https://github.com/minetest/minetest/pull/3503","id":124368125,"number":3503,"title":"Nodebox: Allow nodeboxes to \"connect\"","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/minetest/minetest/labels/@%20Client%20/%20Audiovisuals","name":"@ Client / Audiovisuals","color":"009800"},{"url":"https://api.github.com/repos/minetest/minetest/labels/@%20Script%20API","name":"@ Script API","color":"009800"},{"url":"https://api.github.com/repos/minetest/minetest/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/minetest/minetest/labels/WIP","name":"WIP","color":"aa3000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-30T16:19:35Z","updated_at":"2015-12-30T19:56:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/minetest/minetest/pulls/3503","html_url":"https://github.com/minetest/minetest/pull/3503","diff_url":"https://github.com/minetest/minetest/pull/3503.diff","patch_url":"https://github.com/minetest/minetest/pull/3503.patch"},"body":"We introduce a new nodebox type \"connected\", and allow these\r\nnodes to have optional nodeboxes that connect it to other\r\nconnecting nodeboxes.\r\n\r\nThis is all done at scenedraw time in the client. The client\r\nwill inspect the surrounding nodes and if they are to be connected\r\nto, it will draw the appropriate connecting nodeboxes to make those\r\nconnections.\r\n\r\nIn the node_box definition, we have to specify separate nodeboxes\r\nfor each valid connection. This allows us to make nodes that connect\r\nonly horizontally (the common case) by providing optional nodeboxes\r\nfor +x, -x, +z, -z directions. Or this allows us to make wires\r\nthat can connect up and down, by providing nodeboxes that connect it\r\nup and down (+y, -y) as well.\r\n\r\nThe optional nodeboxes can be arrays. They are named \"connect_up\",\r\n\"connect_down\", and \"connect_n|e|w|s\".\r\n\r\nAdditionally, a \"fixed\" nodebox list present will always be drawn,\r\nso one can make a central post, for instance. This \"fixed\" nodebox\r\ncan be omitted.\r\n\r\nI've posted a screenshot demonstrating the flexibility at\r\n![screenie]\r\n(http://i.imgur.com/zaJq8jo.png)\r\nIn the screenshot, all connecting nodes are of this new subtype.\r\n\r\nThere are several things to note that are not yet in order:\r\n\r\nTransparent textures render incorrectly, need tuning.\r\n\r\nThese nodes all connect to eachother. This needs to be a configurable\r\nthing, so that one may opt to connect nodes based on a group, or\r\ndrawtype. This logic is not in place yet.\r\n\r\nExample lua code needed to generate these nodes can be found here:\r\n  https://gist.github.com/sofar/b381c8c192c8e53e6062\r\n\r\nLastly, this requires a protocol bump as it needs to send the new\r\noptional nodeboxes to the client in a structured method."},"comment":{"url":"https://api.github.com/repos/minetest/minetest/issues/comments/168064359","html_url":"https://github.com/minetest/minetest/pull/3503#issuecomment-168064359","issue_url":"https://api.github.com/repos/minetest/minetest/issues/3503","id":168064359,"user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T19:56:14Z","updated_at":"2015-12-30T19:56:14Z","body":"The Collision boxes will only contain the \"fixed\" nodeboxes currently. This is indeed still something that needs to be fixed."}}