| 7 | constexpr double VanillaStepsPerSecond = 60.0; |
| 8 | |
| 9 | InterpolationTracker::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 | |
| 27 | bool InterpolationTracker::interpolationEnabled() const { |
| 28 | return m_interpolationEnabled; |