Generalization of the collision cone approach for motion safety in 3-D environments