-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSafeCrowdDomain.cpp
More file actions
43 lines (33 loc) · 905 Bytes
/
SafeCrowdDomain.cpp
File metadata and controls
43 lines (33 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "domain/SafeCrowdDomain.h"
namespace safecrowd::domain {
SafeCrowdDomain::SafeCrowdDomain(engine::EngineRuntime& runtime)
: runtime_(runtime) {
}
void SafeCrowdDomain::start() {
runtime_.play();
}
void SafeCrowdDomain::pause() {
runtime_.pause();
}
void SafeCrowdDomain::stop() {
runtime_.stop();
}
void SafeCrowdDomain::update(double deltaSeconds) {
runtime_.stepFrame(deltaSeconds);
}
SimulationSummary SafeCrowdDomain::summary() const {
const auto& stats = runtime_.stats();
return {
.state = stats.state,
.frameIndex = stats.frameIndex,
.fixedStepIndex = stats.fixedStepIndex,
.alpha = stats.alpha,
};
}
engine::EngineRuntime& SafeCrowdDomain::runtime() noexcept {
return runtime_;
}
const engine::EngineRuntime& SafeCrowdDomain::runtime() const noexcept {
return runtime_;
}
} // namespace safecrowd::domain