Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[simPause fix]pause unreal engine with SetGamePaused #2292

Merged
merged 1 commit into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void ASimModeWorldBase::startAsyncUpdator()
{
physics_world_->startAsyncUpdator();
}

void ASimModeWorldBase::stopAsyncUpdator()
{
physics_world_->stopAsyncUpdator();
Expand Down Expand Up @@ -78,12 +79,12 @@ bool ASimModeWorldBase::isPaused() const
void ASimModeWorldBase::pause(bool is_paused)
{
physics_world_->pause(is_paused);
UGameplayStatics::SetGamePaused(this->GetWorld(), is_paused);
}

void ASimModeWorldBase::continueForTime(double seconds)
{
physics_world_->continueForTime(seconds);

}

void ASimModeWorldBase::updateDebugReport(msr::airlib::StateReporterWrapper& debug_reporter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,14 @@ msr::airlib::VehicleApiBase* ASimModeComputerVision::getVehicleApi(const PawnSim
{
//we don't have real vehicle so no vehicle API
return nullptr;
}

bool ASimModeComputerVision::isPaused() const
{
return UGameplayStatics::IsGamePaused(this->GetWorld());
}

void ASimModeComputerVision::pause(bool is_paused)
{
UGameplayStatics::SetGamePaused(this->GetWorld(), is_paused);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ class AIRSIM_API ASimModeComputerVision : public ASimModeBase
const PawnSimApi::Params& pawn_sim_api_params) const override;
virtual msr::airlib::VehicleApiBase* getVehicleApi(const PawnSimApi::Params& pawn_sim_api_params,
const PawnSimApi* sim_api) const override;
virtual bool isPaused() const override;
virtual void pause(bool is_paused) override;
};