jaspermittelmeijer / vr

0 stars 0 forks source link

Implement octree distance detection #20

Open jaspermittelmeijer opened 8 years ago

jaspermittelmeijer commented 8 years ago

Create a class to organise the total space into smaller cubes, tracking which agents are in which cube. So: pass agent data to update, return agents for a cube, return agents within a range.

jaspermittelmeijer commented 8 years ago

The idea is you put everything into octs. Then to check for collisions etc you first run a bounding box check to see if a specific oct should be considered. Then you run checks on the objects in that oct.

jaspermittelmeijer commented 8 years ago

The boids will have to update in which oct they are. Simplest way is probably to throw them in at the top when they pass a divider. (The same code as when initialising).