Areas, what's the way to go?

Discussion in 'Plugin Development' started by molenzwiebel, Apr 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    molenzwiebel

    First, this is a question about performance, not about how to do it. Do not answer if you just want to tell me how to do it.

    So, I let the user configure some different kind of areas such as circles, cuboids, cilinders. My question is, what would be the fastest / best way to determine if a block or location lies in this area. Getting all locations in the area is no problem. Would it be faster to store a list with locations or calculate the area each time a function is called? If you know a better way, please tell me. Otherwise, please only state your opinion, not a way for me to calculate a area.
     
  2. Offline

    Ewe Loon

    with non rectangluar areas it would probibly be best to also record the extents (min / max in all recorded directions x,y,z) and first check if the position is inside them
    this will provide a quick elimination of most tests, test in the following order x,z,y as y will eliminate the least
     
Thread Status:
Not open for further replies.

Share This Page