66
77from .geometry import BoundingBox , BoundingBoxCollection
88from .variables import SpatialVariables
9- from .views import MultiBodyView
109from .world import World
11- from .world_entity import View
10+ from .world_entity import View , EnvironmentView
1211
1312logger = logging .getLogger (__name__ )
1413
@@ -225,8 +224,7 @@ def obstacles_of_world(cls, world: World, search_space: Optional[BoundingBoxColl
225224
226225 :return: An event representing the obstacles in the search space.
227226 """
228- world_view = MultiBodyView ()
229- [world_view .add_body (body ) for body in world .bodies ]
227+ world_view = EnvironmentView (root = world .root )
230228 return cls .obstacles_from_views (world_view , search_space = search_space , bloat_obstacles = bloat_obstacles )
231229
232230
@@ -360,8 +358,7 @@ def free_space_from_world(cls, world: World, tolerance=.001, search_space: Optio
360358 :return: The connectivity graph.
361359 """
362360
363- view = MultiBodyView ()
364- [view .add_body (body ) for body in world .bodies ]
361+ view = EnvironmentView (root = world .root , _world = world )
365362
366363 return cls .free_space_from_view (view , tolerance = tolerance , search_space = search_space ,
367364 bloat_obstacles = bloat_obstacles )
@@ -437,8 +434,7 @@ def navigation_map_from_world(cls, world: World, tolerance=.001,
437434 :return: The connectivity graph.
438435 """
439436
440- view = MultiBodyView ()
441- [view .add_body (body ) for body in world .bodies ]
437+ view = EnvironmentView (root = world .root , _world = world )
442438
443439 return cls .navigation_map_from_view (view , tolerance = tolerance , search_space = search_space ,
444440 bloat_obstacles = bloat_obstacles )
0 commit comments