I wrote the code for checking intersection of ray and meshes on scene. It consist of two parts - broad phase and narrow phase. In broad phase I build an oriented bounding box around each mesh and check intersection of ray with boxes. In narrow phase I check intersection of ray and each triangle of the meshes from broad phase using Möller-Trumbore algorithm. In general it works well. Now my task is to optimize broad phase using Octree. Octree as data structure is well-described and trivial enough. However, I have no idea how to apply it for raytracing and I can't find nothing about it. Could you please give me a hint?