@adatechnology/game-vehicles-proving 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.global.js +5 -0
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -100,6 +100,8 @@ interface ProvingRun {
|
|
|
100
100
|
/** [seconds, sample] of the run so far. */
|
|
101
101
|
readonly trace: ReadonlyArray<[number, number]>;
|
|
102
102
|
readonly memo: ProvingMemo;
|
|
103
|
+
/** What the procedure asked of the controls on the last step (all zero before the first): a host plays the brakes and the engine from it. */
|
|
104
|
+
readonly input: SemiInput;
|
|
103
105
|
step(dt: number): void;
|
|
104
106
|
/** The result so far; pending while the run has not ended. */
|
|
105
107
|
result(): ProvingResult;
|
package/dist/index.global.js
CHANGED
|
@@ -572,8 +572,10 @@ var GameVehiclesProving = (() => {
|
|
|
572
572
|
let done = false;
|
|
573
573
|
let nextSample = 0;
|
|
574
574
|
let carry = 0;
|
|
575
|
+
let last = { throttle: 0, brake: 0, steer: 0, handbrake: false };
|
|
575
576
|
const tick = (h) => {
|
|
576
577
|
const input = procedure.input(driver.state, time, memo);
|
|
578
|
+
last = input;
|
|
577
579
|
driver.step(input, h, world);
|
|
578
580
|
time += h;
|
|
579
581
|
if (time >= nextSample) {
|
|
@@ -597,6 +599,9 @@ var GameVehiclesProving = (() => {
|
|
|
597
599
|
get trace() {
|
|
598
600
|
return trace;
|
|
599
601
|
},
|
|
602
|
+
get input() {
|
|
603
|
+
return last;
|
|
604
|
+
},
|
|
600
605
|
step(dt) {
|
|
601
606
|
carry += dt;
|
|
602
607
|
while (!done && carry >= fixed) {
|