Skip to content

Commit

Permalink
Add meshes list rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteinLTU committed Nov 15, 2023
1 parent dbc3eb5 commit 9707099
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 0 deletions.
Binary file removed roboscapesim-client/assets/ambulance.glb
Binary file not shown.
Binary file removed roboscapesim-client/assets/firetruck.glb
Binary file not shown.
Binary file removed roboscapesim-client/assets/garbageTruck.glb
Binary file not shown.
Binary file removed roboscapesim-client/assets/police.glb
Binary file not shown.
Binary file removed roboscapesim-client/assets/race.glb
Binary file not shown.
Binary file removed roboscapesim-client/assets/sedan.glb
Binary file not shown.
Binary file modified roboscapesim-client/assets/suv.glb
Binary file not shown.
Binary file modified roboscapesim-client/assets/taxi.glb
Binary file not shown.
Binary file removed roboscapesim-client/assets/truck.glb
Binary file not shown.
Binary file removed roboscapesim-client/assets/van.glb
Binary file not shown.
79 changes: 79 additions & 0 deletions roboscapesim-server/src/services/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,18 @@ pub fn create_world_service(id: &str) -> Service {
},
);

definition.methods.insert(
"listMeshes".to_owned(),
MethodDescription {
documentation: Some("List available meshes".to_owned()),
params: vec![],
returns: MethodReturns {
documentation: None,
r#type: vec!["string".to_owned(), "string".to_owned()],
},
},
);

definition.events.insert(
"reset".to_owned(),
EventDescription { params: vec![] },
Expand Down Expand Up @@ -668,6 +680,73 @@ pub fn handle_world_msg(room: &mut RoomData, msg: Request) -> HandleMessageResul
"wood".into(),
];
},
"listMeshes" => {
response = vec![
"cactus_short".into(),
"cactus_tall".into(),
"chest".into(),
"chest_opt".into(),
"fence_simple".into(),
"house_type01".into(),
"house_type02".into(),
"house_type03".into(),
"house_type04".into(),
"house_type05".into(),
"house_type06".into(),
"log".into(),
"log_large".into(),
"log_stack".into(),
"log_stackLarge".into(),
"mushroom_red".into(),
"mushroom_redGroup".into(),
"mushroom_redTall".into(),
"mushroom_tan".into(),
"mushroom_tanGroup".into(),
"mushroom_tanTall".into(),
"parallax_robot".into(),
"sign".into(),
"small_buildingA".into(),
"small_buildingB".into(),
"small_buildingC".into(),
"small_buildingD".into(),
"small_buildingE".into(),
"small_buildingF".into(),
"sphere".into(),
"stump_round".into(),
"stump_square".into(),
"tree_blocks".into(),
"tree_cone".into(),
"tree_default".into(),
"tree_detailed".into(),
"tree_fat".into(),
"tree_oak".into(),
"tree_palmDetailedShort".into(),
"tree_palmDetailedTall".into(),
"tree_pineDefaultA".into(),
"tree_pineDefaultB".into(),
"tree_pineGroundA".into(),
"tree_pineGroundB".into(),
"tree_pineRoundA".into(),
"tree_pineRoundB".into(),
"tree_pineRoundC".into(),
"tree_pineRoundD".into(),
"tree_pineRoundE".into(),
"tree_pineRoundF".into(),
"tree_pineSmallA".into(),
"tree_pineSmallB".into(),
"tree_pineSmallC".into(),
"tree_pineSmallD".into(),
"tree_pineTallA".into(),
"tree_pineTallB".into(),
"tree_pineTallC".into(),
"tree_pineTallD".into(),
"tree_plateau".into(),
"tree_simple".into(),
"tree_small".into(),
"tree_tall".into(),
"tree_thin".into(),
];
},
f => {
info!("Unrecognized function {}", f);
}
Expand Down

0 comments on commit 9707099

Please sign in to comment.