Using RTree in collision detection