- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 23.5k
 
Add GridMap octant related queries and tests #105332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
7d50194    to
    1f5f668      
    Compare
  
    1f5f668    to
    cf5946c      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality looks good, and I would say the debug PR already justifies adding this API. I have just some comments on the docs.
36f8d01    to
    bf81b6f      
    Compare
  
    | 
           I realized that I needed 2 native functions to get cells and octants inside AABBs that can skip  Realizing further that so many new queries will turn into a nice bug surface at some point I also added some GridMap tests to cover the basics.  | 
    
bf81b6f    to
    ce14fee      
    Compare
  
    ce14fee    to
    4a22ba2      
    Compare
  
    4a22ba2    to
    8c2bfd4      
    Compare
  
    8c2bfd4    to
    f682d5e      
    Compare
  
    db0bf33    to
    d281cf4      
    Compare
  
    Adds GridMap octant queries and tests.
d281cf4    to
    39d8f64      
    Compare
  
    
Adds GridMap octant queries.
Requires #105329 to be merged first.
Adds octant query functions as a performance alternative to the existing cell functions.
E.g. when only a few cells for some specific octants are needed, e.g. inside some AABB bounds, and not all the cells of the entire GridMap which creates potentially a slow array with thousands of entries.
TypedArray[Vector3i] get_used_octants()Returns the octant coordinates as Vector3i of all octants that have at least 1 cell in use.
TypedArray[Vector3i] get_used_octants_by_item( p_item: int)Returns the used octant coordinates of all octants that have at least 1 cell with the specific cell item in use.
TypedArray[Vector3i] get_used_cells_in_octant(p_octant_coords: Vector3i)Returns the used cell coordinates of all the cells inside the specific octant coordinate.
TypedArray[Vector3i] get_used_cells_in_octant_by_item(p_octant_coords: Vector3i, p_item: int)Returns the used cell coordinates of all the cells inside the specific octant coordinate that have the specific cell item in use.
TypedArray[Vector3i] get_used_octants_in_bounds(p_bounds: AABB)Returns the used octant coordinates of all octants that have at least 1 cell used with the specific local bounds.
Vector3i get_octant_coords_from_cell_coords(p_cell_coords: Vector3i)Script helper to convert cell coordinate to octant coordinate for the octant related query functions.