So out of curiositity i decided to ask this question. This question come in mine when i read this thread (http://forums.pocketmine.net/threads/protect-new-protect-or-guard-plugin-ideas.18638/) where someone requested a world protect like plugin, but the twist is to select and protect a non rectangular area. (image below) Spoiler For the sake of simplicity : I will use this function to check when an event is triggered, What i do doesn't matter here, that is not the point this thread the point is to discuss and help future developers who could do with this. Keep in mind i an very bad on math so if there something obvious i am missing please point it out kindly and fancy math talk just confuses me further so explain it like i am 5 should make our life easier. First idea come into mind would be to split it into 2 squares sounds easy right? No not that easy if you are not a human. so How do you even: efficiently pass all the points into the function, efficiently cut the selection into pieces efficiently check if player is in bound Keep in mind that the function provided should work with how many points present Edit a better term "polygon"
Thanks a bit of research here and there i think i should look into volex ray casting as since this is a voxle based game anyway
nope i dont think i could do it unless i blindly translate without understanding what it even does (i recommend you to just re make a plugin request maybe it will get some attention)