MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / InterpolationTracker

Method InterpolationTracker

source/game/StarInterpolationTracker.cpp:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7constexpr double VanillaStepsPerSecond = 60.0;
8
9InterpolationTracker::InterpolationTracker(Json config) {
10 if (config.isNull()) {
11 config = JsonObject();
12 } else if (config.type() == Json::Type::String) {
13 auto assets = Root::singleton().assets();
14 config = assets->json(config.toString());
15 }
16
17 m_interpolationEnabled = config.getBool("interpolationEnabled", false);
18 m_entityUpdateDelta = config.getDouble("entityUpdateDelta", 3) / VanillaStepsPerSecond;
19 m_timeLead = config.getDouble("stepLead", 0) / VanillaStepsPerSecond;
20 m_extrapolationHint = config.getUInt("extrapolationHint", 0);
21 m_timeTrackFactor = config.getDouble("stepTrackFactor", 1.0);
22 m_timeMaxDistance = config.getDouble("stepMaxDistance", 0.0) / VanillaStepsPerSecond;
23
24 m_currentTime = 0.0;
25}
26
27bool InterpolationTracker::interpolationEnabled() const {
28 return m_interpolationEnabled;

Callers

nothing calls this directly

Calls 9

singletonClass · 0.85
assetsMethod · 0.80
jsonMethod · 0.80
getBoolMethod · 0.80
getDoubleMethod · 0.80
getUIntMethod · 0.80
isNullMethod · 0.45
typeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected