Skip to content

Commit

Permalink
Fixed minor bug with dyno torque algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
ange-yaghi committed Sep 30, 2022
1 parent 80a9075 commit 0e44057
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/main.mr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "engine_sim.mr"
import "themes/default.mr"
import "engines/atg-video-2/01_subaru_ej25_eh.mr"
import "../workspace/video-engines/motor-trend/01_X8.mr"

use_default_theme()
main()
2 changes: 1 addition & 1 deletion src/simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ bool Simulator::simulateStep() {
}

const int index =
static_cast<int>(std::floor(DynoTorqueSamples * outputShaft->getCycleAngle() / (4 * constants::pi)));
static_cast<int>(std::floor((DynoTorqueSamples - 1) * outputShaft->getCycleAngle() / (4 * constants::pi)));
const int step = m_engine->isSpinningCw() ? 1 : -1;
m_dynoTorqueSamples[index] = m_dyno.getTorque();

Expand Down

0 comments on commit 0e44057

Please sign in to comment.