Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should an octree be rebuilt every frame?

Tags:

c++

algorithm

When using an octree for collision detection in a game, should the tree be rebuilt every frame or is there a better way assuming half the objects move in a frame?

like image 341
jmasterx Avatar asked Dec 01 '10 13:12

jmasterx


2 Answers

If you have a lot of static geometry in your scenes, consider building separate octrees. You could also express the same idea by having more complicated leaf nodes that differentiate between static and non-static geometry.

Bottom line: only regenerate what you have to.

like image 109
luke Avatar answered Oct 27 '22 15:10

luke


If the scene changes with every frame, then you have to redo the tree.

like image 25
duffymo Avatar answered Oct 27 '22 17:10

duffymo