I create a level editor in Unity. I must detect when an object crosses one, because I do not want to allow the user to place it when it collides with something else.
In the lower diagame, there is a piece of corner road and a tree. The red dashed line represents the boundaries of the mesh of the road and the blue dotted line represents the boundaries of the mesh of the tree.
My current approach is to use
mesh.bounds. In the diagram, visually, it is clear that the tree does not ride the road. However, the boundaries overlap, so I can not place the tree there.
What is the best way to check if they actually collide effectively? The level editor can potentially hold thousands of objects.