# Third-party material

## Engine Simulator

DCT Shift Lab's crank-angle engine model, its engine library and its engine sound use material from
[Engine Simulator](https://github.com/ange-yaghi/engine-sim) by AngeTheGreat (Ange Yaghi):

- **Physics port.** `src/sim/engine/crank/` reimplements in TypeScript the gas-system, combustion-chamber,
  fuel, intake, exhaust, camshaft and ignition models of the upstream C++ source, and
  `src/sim/engine/script.ts` (used by `tools/mr2json.js` and the engine catalog) reproduces its flow-unit
  conversions and harmonic cam-lobe generator.
- **Interactive bench.** `src/sim/bench.ts` and the live bench controls follow the upstream
  application's key bindings, dynamometer and starter-motor behaviour.
- **Engine editor.** `src/sim/engine/builder.ts` uses the parameters of the upstream engine scripts and
  reproduces its harmonic cam-lobe generator and flow-unit conversions.
- **Engine data.** `src/data/engines.data.json` is generated from the engine scripts (`*.mr`) shipped with
  Engine Simulator v0.1.14a.
- **Script library.** `src/data/es-library.data.json` embeds the `es/` script library shipped with Engine
  Simulator v0.1.14a, so the engine catalog can convert engine scripts in the browser.
- **Test fixture.** `tests/fixtures/01_honda_trx520.mr` is an engine script shipped with Engine Simulator v0.1.14a.
- **Impulse responses.** `src/data/irs.data.json` embeds the impulse-response recordings of the sound library shipped with Engine
  Simulator v0.1.14a.

Engine Simulator is distributed under the MIT licence:

```
Copyright 2022 AngeTheGreat (Ange Yaghi)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```

The Engine Simulator binary release itself (`engine-sim-v0.1.14a/`) is not part of this repository;
`tools/mr2json.js` reads it from a local path.
