@@ -183,20 +183,20 @@ fn setup_mujoco(
183183
184184 // This is a closure that can call itself recursively
185185 struct SpawnEntities < ' s > {
186- f : & ' s dyn Fn ( & SpawnEntities , BodyTree , & mut ChildBuilder , usize ) ,
186+ f : & ' s dyn Fn ( & SpawnEntities , BodyTree , & mut ChildSpawnerCommands , usize ) ,
187187 }
188188
189189 impl SpawnEntities < ' _ > {
190190 /// Spawn a bevy entity for MuJoCo body
191191 #[ allow( clippy:: too_many_arguments) ]
192192 fn spawn_body (
193193 & self ,
194- child_builder : & mut ChildBuilder ,
194+ child_builder : & mut ChildSpawnerCommands ,
195195 body : & Body ,
196196 geoms : & [ Geom ] ,
197197 meshes : & Rc < RefCell < ResMut < Assets < Mesh > > > > ,
198198 materials : & Rc < RefCell < ResMut < Assets < StandardMaterial > > > > ,
199- add_children : impl FnOnce ( & mut ChildBuilder ) ,
199+ add_children : impl FnOnce ( & mut ChildSpawnerCommands ) ,
200200 depth : usize ,
201201 ) {
202202 let geom = body. render_geom ( geoms) ;
@@ -225,19 +225,16 @@ fn setup_mujoco(
225225 root_body : depth == 0 ,
226226 } ,
227227 Name :: new ( format ! ( "MuJoCo::body_{}" , body. name) ) ,
228- SpatialBundle {
229- transform : body_transform,
230- ..default ( )
231- } ,
228+ Visibility :: default ( ) ,
229+ body_transform. clone ( ) ,
232230 ) ) ;
233231
234232 binding. with_children ( |children| {
235- let mut cmd = children. spawn ( PbrBundle {
236- mesh : Mesh3d ( meshes. add ( mesh) ) ,
237- material : MeshMaterial3d ( materials. add ( geom_material ( geom) ) ) ,
238- transform : geom_transform,
239- ..default ( )
240- } ) ;
233+ let mut cmd = children. spawn ( (
234+ Mesh3d ( meshes. add ( mesh) ) ,
235+ MeshMaterial3d ( materials. add ( geom_material ( geom) ) ) ,
236+ geom_transform,
237+ ) ) ;
241238
242239 cmd. insert ( Name :: new ( format ! ( "MuJoCo::mesh_{}" , body. name) ) ) ;
243240 if geom. geom_type == GeomType :: MESH {
@@ -260,7 +257,7 @@ fn setup_mujoco(
260257 f : & |func, body, child_builder, depth| {
261258 let root_leaf = body. data ( ) ;
262259
263- let add_children = |child_builder : & mut ChildBuilder | {
260+ let add_children = |child_builder : & mut ChildSpawnerCommands | {
264261 let mut body = body. clone ( ) ;
265262 loop {
266263 let leaf = body. pop_back ( ) ;
@@ -287,7 +284,11 @@ fn setup_mujoco(
287284 let body_tree = body_tree ( & bodies) ;
288285 // each mujoco body is defined as a tree
289286 commands
290- . spawn ( ( Name :: new ( "MuJoCo::world" ) , SpatialBundle :: default ( ) ) )
287+ . spawn ( (
288+ Name :: new ( "MuJoCo::world" ) ,
289+ Transform :: default ( ) ,
290+ Visibility :: default ( ) ,
291+ ) )
291292 . with_children ( |child_builder| {
292293 for body in body_tree {
293294 ( spawn_entities. f ) ( & spawn_entities, body, child_builder, 0 ) ;
0 commit comments