Skip to content

Commit

Permalink
Merge pull request #2292 from madratman/PR/sim_pause_fix
Browse files Browse the repository at this point in the history
[simPause fix]pause unreal engine with SetGamePaused
  • Loading branch information
madratman authored Nov 4, 2019
2 parents c6f0729 + 210bac1 commit bf8c4ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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;
};

0 comments on commit bf8c4ae

Please sign in to comment.