Closed jonathanplatzer closed 2 months ago
Hello, first and foremost I would like to apologize for taking so long with this PR and the implementation in general and hope that my contribution is still of value to the project and not too byzantine in terms of code quality or the name of things.
This is now what I would consider near feature complete in terms of the reusable ode solver code, but not so much in terms of the code of the 3D Motion Simulation Experiment, which is kind of a mess, and could be simplified. I started working on simplifying it, as can be seen in the ParameterLoader
and MotionCalculation
classes, but I think this is out of scope for this pull request and I am not sure if the modification of the experiment here to just use the reusable solver is already to much and should be done in another pull request.
I think this is it, this PR is at a point where it can be reviewed and (hopefully) merged.
First the reusable ODE solver is finished, maybe only the names need some work, but this is trivial, I don't expect any changes to the way the solver fundamentally works and is structured.
Second the 3D Motion Simulation experiment uses the ODE solver for calculations now and has been improved quite a bit, including:
LineRenderer
for trajectories, rendering the axes right from the start, updating the simulation when the input parameters were editedexprs
json field, a working example of this is the new Rocket Launch
preset, which includes a custom implementation of the Heaviside Step Function
https://github.com/GameLabGraz/Maroon/blob/25dd09a2f6c66188bb175f69a262185be4d61d79/unity/Assets/Maroon/scenes/experiments/3DMotionSimulation/Resources/RocketLaunch.json#L11-L13Rocket Launch
and Coupled Oscillators
, which were copied nearly verbatim from Peter Hadleys ODE solver, so #467 could be closedOk, this is rather weird, before merging develop only the playmode tests were failing, but now after the fact also the WebGL build fails... Also the error log is rather unhelpful, I searched for errors that my code could have caused, but haven't found anything that seems related
edit: Ok, seems like the WebGL build had just some hiccup, i re-run it and it passed. Also some good news, I figured out which test case failed, and of course it is caused by my code. Turns out searching for "error" in the log is not that helpful, but when while looking through all occurrences of "failed" i found the error. It seems like while restructuring the 3D Motion Experiment I inadvertently left out/removed some NullReferenceException handling.
Implementation of a reusable solver for ODEs describing motion in 3D. Closes #465