Simple octree logic implementation.