Skip to content
Open
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
1 change: 1 addition & 0 deletions AirLib/include/api/RpcLibClientBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace airlib
int getMinRequiredClientVersion() const;

bool simIsPaused() const;
float getSimClockRate() const;
void simPause(bool is_paused);
void simContinueForTime(double seconds);
void simContinueForFrames(uint32_t frames);
Expand Down
5 changes: 5 additions & 0 deletions AirLib/src/api/RpcLibClientBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ __pragma(warning(disable : 4239))
return pimpl_->client.call("simIsPaused").as<bool>();
}

float RpcLibClientBase::getSimClockRate() const
{
return pimpl_->client.call("getSimClockRate").as<float>();
}

void RpcLibClientBase::simPause(bool is_paused)
{
pimpl_->client.call("simPause", is_paused);
Expand Down
4 changes: 4 additions & 0 deletions AirLib/src/api/RpcLibServerBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ namespace airlib
return getWorldSimApi()->isPaused();
});

pimpl_->server.bind("getSimClockRate", [&]() -> float {
return ClockFactory::get()->getTrueScaleWrtWallClock();
});

pimpl_->server.bind("simContinueForTime", [&](double seconds) -> void {
getWorldSimApi()->continueForTime(seconds);
});
Expand Down