<div dir="ltr"><div><div><div><div><div><div><div><div>It looks like Octree is what I want if I can solve a particular problem. First let me articulate what I am looking for.<br><br></div>(1) Objects in 3-d space with no spatial extent. Collision is determined by two objects occupying the same point.'<br><br></div>(2) Efficient insert-delete-update<br><br></div>#2 seems to be the problem. I found this library, thankfully. I believe it's exactly what I am looking for, but for quadtrees.<br><br><a href="https://github.com/AshleyMoni/QuadTree">https://github.com/AshleyMoni/QuadTree</a><br><br></div>I'm a little overwhelmed as this is a new data structure for me. I believe if I can grok what is going on in this library, I can take these ideas and extend them to the octree. I'm referring specifically to this module<br><br><a href="https://github.com/AshleyMoni/QuadTree/blob/master/Data/QuadTree/Internal.hs">https://github.com/AshleyMoni/QuadTree/blob/master/Data/QuadTree/Internal.hs</a><br><br></div>And these functions<br><br>setLocation <span class="pl-k">::</span> <span class="pl-k">Eq</span> <span class="pl-smi">a</span> <span class="pl-k">=></span> <span class="pl-k">Location</span> <span class="pl-k">-></span> <span class="pl-smi">a</span> <span class="pl-k">-></span> <span class="pl-k">QuadTree</span> <span class="pl-smi">a</span> <span class="pl-k">-></span> <span class="pl-k">QuadTree</span> <span class="pl-smi">a</span>
      
      
        
        setLocation = set . atLocation<br><br></div>atLocation (Having difficulty cutting and pasting this to mail.)<br><br></div>I'd like to be able to visualize how the tree is being compressed, it may help to be able to see what happens to the tree when it's not compressed. <br><br></div>Does anyone have a pointer or advice in how to break this library down in parts to help me grok, in a way that will help me extend to octree? <br><div><div><div><br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br><br><br><br><br>
      
      
        
        <br>
      
      
        
                                  <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br>
      
      
        
        <br><br></div></div></div></div>