Skip to content

Commit

Permalink
Merge pull request #3 from AKCore/master
Browse files Browse the repository at this point in the history
add simulation frequency scaling on key
  • Loading branch information
ange-yaghi authored Aug 10, 2022
2 parents 0289c47 + 313a8aa commit ed6de76
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/engine_sim_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,16 @@ void EngineSimApplication::run() {

m_infoCluster->setLogMessage("[B] - Set high freq. noise to " + std::to_string(audioParams.InputSampleNoise));
}
else if (m_engine.IsKeyDown(ysKey::Code::N)) {
const double rate = fineControlMode
? 10.0
: 100.0;

m_simulator.setSimulationFrequency(m_simulator.getSimulationFrequency() + mouseWheelDelta * rate * dt);
fineControlInUse = true;

m_infoCluster->setLogMessage("[N] - Set simulation freq to " + std::to_string(m_simulator.getSimulationFrequency()));
}

const double prevTargetThrottle = targetThrottle;
targetThrottle = fineControlMode ? targetThrottle : 1.0;
Expand Down

0 comments on commit ed6de76

Please sign in to comment.