Skip to content

A reasonably fast library to handle collisions between rectangles in 2d-space.

License

Notifications You must be signed in to change notification settings

Lamakaio/kdtree-collisions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kdtree-collisions

A Rust library to handle collisions between rectangles in a 2d space efficiently using a kind of KD-tree.

The tree structure is mutable. The access, insertion and removal should be O(log(n)) on average, with reasonable constant overhead and cache-friendlyness, but it can grow to O(n) if the space only grows in one direction.

It is not super-optimised, but should be reasonably fast for accesses. Insertions and removals are a little less efficient.

I made this to replace Rapier's broad-phase collision detection in the "imapirate" project. The time used to do broad-phase collision detection went from "most of the time in the frame" to "negligible time" so I did not bother to optimize it further.

About

A reasonably fast library to handle collisions between rectangles in 2d-space.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages