Added call on the server side to retrieve the BBs

This commit is contained in:
doterop 2020-09-09 15:47:36 +02:00 committed by Marc Garcia Puig
parent 1855d34c56
commit 33700bd6e3
1 changed files with 13 additions and 1 deletions

View File

@ -275,7 +275,6 @@ void FCarlaServer::FPimpl::BindActions()
return Result;
};
BIND_SYNC(get_episode_settings) << [this]() -> R<cr::EpisodeSettings>
{
REQUIRE_CARLA_EPISODE();
@ -307,6 +306,19 @@ void FCarlaServer::FPimpl::BindActions()
return Episode->SerializeActor(ActorView);
};
BIND_SYNC(get_all_level_BBs) << [this]() -> R<std::vector<cg::BoundingBox>>
{
REQUIRE_CARLA_EPISODE();
TArray<FBoundingBox> Result;
ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(Episode->GetWorld());
if (!GameMode)
{
RESPOND_ERROR("unable to find CARLA game mode");
}
Result = GameMode->GetAllBBsOfLevel();
return MakeVectorFromTArray<cg::BoundingBox>(Result);
};
// ~~ Weather ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BIND_SYNC(get_weather_parameters) << [this]() -> R<cr::WeatherParameters>