@adatechnology/game-vehicles-driving 0.2.11 → 0.2.12
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 +273 -7
- package/dist/index.global.js +275 -23
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +275 -23
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -242,6 +242,8 @@ interface SemiSimSpec {
|
|
|
242
242
|
centreHeight: number;
|
|
243
243
|
wheels: readonly SemiWheel[];
|
|
244
244
|
wheelRadius: number;
|
|
245
|
+
/** Radius of the bare rim, metres, when a wheel loses its tyre. Default `RIM_RADIUS_SHARE` of `wheelRadius`. */
|
|
246
|
+
rimRadius?: number;
|
|
245
247
|
fourWheelDrive: boolean;
|
|
246
248
|
/** Air drag: `0.5 * 1.2 * Cd * A`, in kg/m. */
|
|
247
249
|
drag: number;
|
|
@@ -288,6 +290,8 @@ interface SemiSimSpec {
|
|
|
288
290
|
interface VehicleCondition {
|
|
289
291
|
/** Health of each wheel in the order of `spec.wheels`. Under 0.2 the tyre is flat. */
|
|
290
292
|
tyres?: readonly number[];
|
|
293
|
+
/** Which wheels have lost their tyre, in the order of `spec.wheels`: the bare rim runs on the road (smaller, metal on asphalt). */
|
|
294
|
+
rims?: readonly boolean[];
|
|
291
295
|
engine?: number;
|
|
292
296
|
suspension?: number;
|
|
293
297
|
/** How much of the brake force is left, 0..1: worn or broken brakes, no brake fluid. */
|
|
@@ -296,6 +300,12 @@ interface VehicleCondition {
|
|
|
296
300
|
interface SemiInput extends DriveInput {
|
|
297
301
|
/** Forces a gear (1-based, 0 = neutral, -1 = reverse). Absent = automatic. */
|
|
298
302
|
gear?: number;
|
|
303
|
+
/** Clutch pedal, 0 released (engaged) to 1 pressed. Absent = no clutch (automatic). Released in gear at too low a speed without gas, the engine stalls. */
|
|
304
|
+
clutch?: number;
|
|
305
|
+
/** The starter turns this step. When given, it is the only way the engine starts again (no gas-pedal start). */
|
|
306
|
+
start?: boolean;
|
|
307
|
+
/** Share of the engine torque allowed this step, 0..1 (traction control cutting, an overheated engine in limp mode). Default 1. */
|
|
308
|
+
powerLimit?: number;
|
|
299
309
|
}
|
|
300
310
|
interface SemiGround {
|
|
301
311
|
/** Height of the ground under the point, metres. Default 0. */
|
|
@@ -403,12 +413,39 @@ interface BodyDimensions {
|
|
|
403
413
|
declare function semiSpecFromStats(stats: DesignStats, body: BodyDimensions, base?: Partial<SemiSimSpec>): SemiSimSpec;
|
|
404
414
|
|
|
405
415
|
/**
|
|
406
|
-
* The
|
|
407
|
-
*
|
|
408
|
-
*
|
|
416
|
+
* The driver aids the controls apply between the pedals and the engine: the drive profile (economy shifts early and softens the gas, sport holds the
|
|
417
|
+
* gears and sharpens it), traction control (cuts the torque while a driven wheel spins past its grip) and cruise control (holds the set speed with the
|
|
418
|
+
* gas; the brake or the clutch cancels it, the gas pedal overrides it while pressed). Pure functions over numbers, every threshold an option.
|
|
409
419
|
*/
|
|
420
|
+
type DriveProfile = 'eco' | 'normal' | 'sport';
|
|
421
|
+
interface ProfileTuning {
|
|
422
|
+
/** Multiplies the gas pedal. */
|
|
423
|
+
readonly throttle: number;
|
|
424
|
+
/** Upshift and downshift points, shares of the redline (the semi driver's `upshiftFraction` and `downshiftFraction`). */
|
|
425
|
+
readonly upshift: number;
|
|
426
|
+
readonly downshift: number;
|
|
427
|
+
}
|
|
428
|
+
declare const DRIVE_PROFILES: Readonly<Record<DriveProfile, ProfileTuning>>;
|
|
429
|
+
interface TractionOptions {
|
|
430
|
+
/** Grip in use of a driven wheel (1 = sliding) above which the torque is cut. */
|
|
431
|
+
readonly slip: number;
|
|
432
|
+
/** Torque left at full spin. */
|
|
433
|
+
readonly floor: number;
|
|
434
|
+
}
|
|
435
|
+
declare const DEFAULT_TRACTION: TractionOptions;
|
|
436
|
+
/** Share of the torque traction control lets through for the worst driven wheel's grip in use (1 = sliding). */
|
|
437
|
+
declare function tractionLimit(slips: readonly number[], options?: TractionOptions): number;
|
|
438
|
+
interface CruiseOptions {
|
|
439
|
+
/** Gas per m/s under the set speed. */
|
|
440
|
+
readonly gain: number;
|
|
441
|
+
/** Lowest speed it engages at, m/s (about 30 km/h). */
|
|
442
|
+
readonly minSpeed: number;
|
|
443
|
+
}
|
|
444
|
+
declare const DEFAULT_CRUISE: CruiseOptions;
|
|
445
|
+
/** Gas cruise control asks for to hold `target` at `speed` (m/s); none above the target, the car coasts down to it. */
|
|
446
|
+
declare function cruiseThrottle(target: number, speed: number, options?: CruiseOptions): number;
|
|
410
447
|
|
|
411
|
-
type ControlCommand = 'ignition' | 'gearbox' | 'gear_up' | 'gear_down' | 'parking_brake' | 'drive_mode' | 'lights' | 'high_beam' | 'fog_lights' | 'interior_light' | 'alarm' | 'radio' | 'radio_source' | 'exit' | 'indicator_left' | 'indicator_right' | 'hazard' | 'wipers' | 'seatbelt';
|
|
448
|
+
type ControlCommand = 'ignition' | 'gearbox' | 'gear_up' | 'gear_down' | 'parking_brake' | 'drive_mode' | 'lights' | 'high_beam' | 'fog_lights' | 'interior_light' | 'alarm' | 'radio' | 'radio_source' | 'radio_track' | 'exit' | 'indicator_left' | 'indicator_right' | 'hazard' | 'wipers' | 'seatbelt' | 'drive_profile' | 'traction_control' | 'abs' | 'cruise' | 'climate' | 'demist';
|
|
412
449
|
type ControlKeyMap = {
|
|
413
450
|
readonly throttle: readonly string[];
|
|
414
451
|
readonly brake: readonly string[];
|
|
@@ -416,6 +453,10 @@ type ControlKeyMap = {
|
|
|
416
453
|
readonly right: readonly string[];
|
|
417
454
|
readonly handbrake: readonly string[];
|
|
418
455
|
readonly horn: readonly string[];
|
|
456
|
+
readonly clutch: readonly string[];
|
|
457
|
+
/** Flashes the high beam while held. */
|
|
458
|
+
readonly flash: readonly string[];
|
|
459
|
+
readonly washer: readonly string[];
|
|
419
460
|
} & {
|
|
420
461
|
readonly [command in ControlCommand]: readonly string[];
|
|
421
462
|
};
|
|
@@ -427,7 +468,7 @@ type LampMode = 'off' | 'position' | 'low' | 'high';
|
|
|
427
468
|
type AlarmState = 'off' | 'armed' | 'ringing';
|
|
428
469
|
type RadioSource = 'radio' | 'tape';
|
|
429
470
|
type Indicator = 'off' | 'left' | 'right' | 'hazard';
|
|
430
|
-
type Wipers = 'off' | 'slow' | 'fast';
|
|
471
|
+
type Wipers = 'off' | 'intermittent' | 'slow' | 'fast';
|
|
431
472
|
interface ControlState {
|
|
432
473
|
ignition: boolean;
|
|
433
474
|
gearbox: Gearbox;
|
|
@@ -438,26 +479,48 @@ interface ControlState {
|
|
|
438
479
|
driveMode: DriveMode;
|
|
439
480
|
/** The front axle drives now (4x4, or automatic 4x4 that felt the rear slip). */
|
|
440
481
|
fourWheelEngaged: boolean;
|
|
482
|
+
/** `flash`: the high beam lit while the flash key is held, over any mode. */
|
|
441
483
|
lamps: {
|
|
442
484
|
mode: LampMode;
|
|
443
485
|
fog: boolean;
|
|
444
486
|
interior: boolean;
|
|
487
|
+
flash: boolean;
|
|
445
488
|
};
|
|
446
489
|
/** What the rear lamps show this step: brake (pedal or handbrake) and reversing. */
|
|
447
490
|
brakeLights: boolean;
|
|
448
491
|
reverseLights: boolean;
|
|
449
492
|
horn: boolean;
|
|
450
493
|
alarm: AlarmState;
|
|
494
|
+
/** `track`: the station or the song on the tape, 0-based (`radioTracks` of them). */
|
|
451
495
|
radio: {
|
|
452
496
|
on: boolean;
|
|
453
497
|
source: RadioSource;
|
|
498
|
+
track: number;
|
|
454
499
|
};
|
|
455
500
|
indicator: Indicator;
|
|
456
501
|
/** The indicator lamps are lit this instant (they blink at `blinkHz`); `tick` is true on the step the relay clicks. */
|
|
457
502
|
blinkOn: boolean;
|
|
458
503
|
tick: boolean;
|
|
459
504
|
wipers: Wipers;
|
|
505
|
+
/** The washer squirts while its key is held (the wipers sweep with it). */
|
|
506
|
+
washer: boolean;
|
|
460
507
|
seatbelt: boolean;
|
|
508
|
+
/** Clutch pedal, 0 up to 1 down (manual gearbox). */
|
|
509
|
+
clutch: number;
|
|
510
|
+
profile: DriveProfile;
|
|
511
|
+
tractionControl: boolean;
|
|
512
|
+
abs: boolean;
|
|
513
|
+
/** Cruise control: the speed it holds, m/s. */
|
|
514
|
+
cruise: {
|
|
515
|
+
on: boolean;
|
|
516
|
+
speed: number;
|
|
517
|
+
};
|
|
518
|
+
climate: {
|
|
519
|
+
on: boolean;
|
|
520
|
+
demist: boolean;
|
|
521
|
+
};
|
|
522
|
+
/** The starter turns this step. */
|
|
523
|
+
cranking: boolean;
|
|
461
524
|
}
|
|
462
525
|
type ControlEvent = {
|
|
463
526
|
type: 'command';
|
|
@@ -466,7 +529,9 @@ type ControlEvent = {
|
|
|
466
529
|
} | {
|
|
467
530
|
type: 'refused';
|
|
468
531
|
command: ControlCommand;
|
|
469
|
-
reason: 'no_four_wheel_drive' | 'no_fog_lamps' | 'ignition_off';
|
|
532
|
+
reason: 'no_four_wheel_drive' | 'no_fog_lamps' | 'ignition_off' | 'battery_flat' | 'too_slow';
|
|
533
|
+
} | {
|
|
534
|
+
type: 'cruise_cancelled';
|
|
470
535
|
};
|
|
471
536
|
interface VehicleControlOptions {
|
|
472
537
|
/** Forward gears of the gearbox. */
|
|
@@ -488,12 +553,28 @@ interface VehicleControlOptions {
|
|
|
488
553
|
blinkHz?: number;
|
|
489
554
|
/** The steering wheel coming back this far (0..1 of the lock) after a turn cancels the indicator, as the column does. Default 0.15. */
|
|
490
555
|
indicatorCancel?: number;
|
|
556
|
+
/** Stations or songs the radio steps through (`radio_track`). Default 3. */
|
|
557
|
+
radioTracks?: number;
|
|
558
|
+
/** The driver works the clutch (C) in manual: released in gear too slowly or without gas, the engine stalls. Default false (the clutch is automated). */
|
|
559
|
+
clutchPedal?: boolean;
|
|
560
|
+
/** The starter can turn the engine over (a battery with charge); asked at every crank. Default always. */
|
|
561
|
+
canCrank?: () => boolean;
|
|
562
|
+
/** A crank happened (takes the battery's energy). */
|
|
563
|
+
onCrank?: () => void;
|
|
564
|
+
/** Share of the torque the engine gives besides the aids (an overheated engine). Default 1. */
|
|
565
|
+
powerLimit?: () => number;
|
|
491
566
|
onEvent?: (event: ControlEvent) => void;
|
|
492
567
|
}
|
|
493
568
|
/** What the controls read of the driver each step, and the one thing they change on it (which axles drive). */
|
|
494
569
|
interface ControlledDriver {
|
|
495
570
|
readonly spec: {
|
|
496
571
|
fourWheelDrive: boolean;
|
|
572
|
+
abs?: boolean;
|
|
573
|
+
upshiftFraction?: number;
|
|
574
|
+
downshiftFraction?: number;
|
|
575
|
+
readonly wheels?: ReadonlyArray<{
|
|
576
|
+
drive?: boolean;
|
|
577
|
+
}>;
|
|
497
578
|
};
|
|
498
579
|
readonly state: {
|
|
499
580
|
u: number;
|
|
@@ -526,6 +607,8 @@ type DamagedTyre = {
|
|
|
526
607
|
readonly z: number;
|
|
527
608
|
/** 0 flat or gone, 1 whole. */
|
|
528
609
|
readonly health: number;
|
|
610
|
+
/** The tyre is gone and the rim is on the road. */
|
|
611
|
+
readonly rim?: boolean;
|
|
529
612
|
};
|
|
530
613
|
type DamageReport = {
|
|
531
614
|
readonly tyres: readonly DamagedTyre[];
|
|
@@ -535,4 +618,187 @@ type DamageReport = {
|
|
|
535
618
|
};
|
|
536
619
|
declare function conditionFromDamage(spec: Pick<SemiSimSpec, 'wheels'>, report: DamageReport): VehicleCondition;
|
|
537
620
|
|
|
538
|
-
|
|
621
|
+
/**
|
|
622
|
+
* What keeps a car running besides the engine: the 12 V battery (the lamps, radio, wipers and alarm draw from it, the alternator charges it while
|
|
623
|
+
* the engine turns, and below what the starter needs the car does not start), the coolant temperature (it climbs with the work of the engine, the air
|
|
624
|
+
* through the radiator and the fan take it away, and a damaged radiator boils it: past `limpC` the engine loses power, past `seizeC` it dies) and the
|
|
625
|
+
* spare tyre (one flat wheel can be swapped for it). It reads the driver and the controls and changes only what a real car would: the engine state,
|
|
626
|
+
* the power it gives and the tyres. Every number is an option.
|
|
627
|
+
*/
|
|
628
|
+
|
|
629
|
+
interface ElectricalLoads {
|
|
630
|
+
/** Watts of each consumer while on. */
|
|
631
|
+
readonly position: number;
|
|
632
|
+
readonly low: number;
|
|
633
|
+
readonly high: number;
|
|
634
|
+
readonly fog: number;
|
|
635
|
+
readonly interior: number;
|
|
636
|
+
readonly radio: number;
|
|
637
|
+
readonly wipers: number;
|
|
638
|
+
readonly indicators: number;
|
|
639
|
+
readonly horn: number;
|
|
640
|
+
readonly alarm: number;
|
|
641
|
+
readonly brakeLights: number;
|
|
642
|
+
readonly climate: number;
|
|
643
|
+
}
|
|
644
|
+
interface VehicleSystemsOptions {
|
|
645
|
+
/** Battery capacity, watt-hours (a 12 V 60 Ah battery holds 720). */
|
|
646
|
+
batteryWh?: number;
|
|
647
|
+
/** Charge at the start, 0..1. */
|
|
648
|
+
charge?: number;
|
|
649
|
+
/** Alternator output, watts, at idle and from 2000 rpm up. */
|
|
650
|
+
alternatorW?: {
|
|
651
|
+
idle: number;
|
|
652
|
+
full: number;
|
|
653
|
+
};
|
|
654
|
+
/** Below this charge the starter does not turn the engine over. */
|
|
655
|
+
crankCharge?: number;
|
|
656
|
+
/** Energy of one start, watt-hours. */
|
|
657
|
+
startWh?: number;
|
|
658
|
+
loads?: Partial<ElectricalLoads>;
|
|
659
|
+
/** Air temperature, °C. */
|
|
660
|
+
ambientC?: number;
|
|
661
|
+
/** The thermostat holds the coolant here once warm. */
|
|
662
|
+
thermostatC?: number;
|
|
663
|
+
/** Limp mode above this (power cut), engine seizes above `seizeC`. */
|
|
664
|
+
limpC?: number;
|
|
665
|
+
seizeC?: number;
|
|
666
|
+
/** Warming of the coolant, °C per second at full power; cooling share of the gap to the air per second, at a stop and at 100 km/h. */
|
|
667
|
+
heatPerSecond?: number;
|
|
668
|
+
cooling?: {
|
|
669
|
+
stopped: number;
|
|
670
|
+
fast: number;
|
|
671
|
+
};
|
|
672
|
+
/** Spare tyres carried. */
|
|
673
|
+
spares?: number;
|
|
674
|
+
}
|
|
675
|
+
declare const DEFAULT_LOADS: ElectricalLoads;
|
|
676
|
+
type SystemsEvent = {
|
|
677
|
+
type: 'battery_flat';
|
|
678
|
+
} | {
|
|
679
|
+
type: 'overheating';
|
|
680
|
+
} | {
|
|
681
|
+
type: 'seized';
|
|
682
|
+
} | {
|
|
683
|
+
type: 'spare_fitted';
|
|
684
|
+
wheel: number;
|
|
685
|
+
} | {
|
|
686
|
+
type: 'no_spare';
|
|
687
|
+
};
|
|
688
|
+
interface SystemsState {
|
|
689
|
+
/** 0..1. */
|
|
690
|
+
charge: number;
|
|
691
|
+
/** Coolant, °C. */
|
|
692
|
+
coolantC: number;
|
|
693
|
+
/** 0 cold (the air) to 1 (the seize point), for a gauge. */
|
|
694
|
+
temperature: number;
|
|
695
|
+
overheating: boolean;
|
|
696
|
+
seized: boolean;
|
|
697
|
+
spares: number;
|
|
698
|
+
/** Net watts on the battery this step: positive charging, negative draining. */
|
|
699
|
+
netW: number;
|
|
700
|
+
}
|
|
701
|
+
interface SystemsDriver {
|
|
702
|
+
readonly state: Pick<SemiState, 'engineOn' | 'rpm' | 'u'>;
|
|
703
|
+
condition: VehicleCondition;
|
|
704
|
+
}
|
|
705
|
+
interface SystemsStepParams {
|
|
706
|
+
driver: SystemsDriver;
|
|
707
|
+
controls: ControlState;
|
|
708
|
+
/** The gas the engine got this step, 0..1. */
|
|
709
|
+
throttle: number;
|
|
710
|
+
dt: number;
|
|
711
|
+
/** What is left of the radiator, 0..1. Default 1. */
|
|
712
|
+
radiator?: number;
|
|
713
|
+
/** The coolant temperature from a damage model that tracks it (the vehicle destructible's `runEngine`): it replaces this model's own. */
|
|
714
|
+
coolantC?: number;
|
|
715
|
+
}
|
|
716
|
+
interface VehicleSystems {
|
|
717
|
+
readonly state: SystemsState;
|
|
718
|
+
/** The starter can turn the engine over now. */
|
|
719
|
+
canCrank(): boolean;
|
|
720
|
+
/** Takes the energy of one start. */
|
|
721
|
+
crank(): void;
|
|
722
|
+
/** Share of the torque the engine gives now (limp mode when hot). */
|
|
723
|
+
powerLimit(): number;
|
|
724
|
+
/** Advances `dt` seconds; `throttle` is the gas the engine got, `controls` what is switched on. */
|
|
725
|
+
step(params: SystemsStepParams): SystemsEvent[];
|
|
726
|
+
/** Swaps the flat tyre of `wheel` for the spare. */
|
|
727
|
+
fitSpare(driver: SystemsDriver, wheel: number): SystemsEvent;
|
|
728
|
+
/** Fills the battery (a jump start or a charger), 0..1 of the capacity. */
|
|
729
|
+
charge(share: number): void;
|
|
730
|
+
}
|
|
731
|
+
declare function createVehicleSystems(options?: VehicleSystemsOptions): VehicleSystems;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Who leaves the car in a crash. An occupant without a belt keeps the speed the car had (inertia) while the car stops: in a frontal crash past
|
|
735
|
+
* about 30 km/h of change in speed the body goes through the windshield, in a hard side impact or a rollover through the side window on the side it
|
|
736
|
+
* is thrown to. A belted occupant stays in (a belt holds a person to the seat up to crashes far harder than a road car survives). The glass breaks
|
|
737
|
+
* first; the body flies with most of the car's speed before the crash and a little lift. Pure numbers, every threshold an option.
|
|
738
|
+
*/
|
|
739
|
+
type EjectionExit = 'windshield' | 'left_window' | 'right_window' | 'rear_window';
|
|
740
|
+
interface EjectionOptions {
|
|
741
|
+
/** Change of speed, m/s, past which an unbelted occupant goes through the windshield (about 30 km/h). */
|
|
742
|
+
frontal: number;
|
|
743
|
+
/** Sideways change of speed, m/s, past which an unbelted occupant goes out of a side window. */
|
|
744
|
+
side: number;
|
|
745
|
+
/** Share of the speed before the crash the body keeps on the way out (the glass and the dash take the rest). */
|
|
746
|
+
keep: number;
|
|
747
|
+
/** Upward speed of the body leaving, m/s (it rides up over the dash). */
|
|
748
|
+
lift: number;
|
|
749
|
+
}
|
|
750
|
+
declare const DEFAULT_EJECTION: EjectionOptions;
|
|
751
|
+
interface CrashPulse {
|
|
752
|
+
/** Body-frame speed before and after the crash, m/s: forward and to the right. */
|
|
753
|
+
readonly before: {
|
|
754
|
+
readonly u: number;
|
|
755
|
+
readonly w: number;
|
|
756
|
+
};
|
|
757
|
+
readonly after: {
|
|
758
|
+
readonly u: number;
|
|
759
|
+
readonly w: number;
|
|
760
|
+
};
|
|
761
|
+
/** The car rolled over in it. */
|
|
762
|
+
readonly rolled?: boolean;
|
|
763
|
+
}
|
|
764
|
+
interface Ejection {
|
|
765
|
+
readonly exit: EjectionExit;
|
|
766
|
+
/** Body-frame velocity of the body leaving, m/s: forward, to the right, up. */
|
|
767
|
+
readonly velocity: readonly [number, number, number];
|
|
768
|
+
/** Change of speed of the crash, m/s (what the injuries scale with). */
|
|
769
|
+
readonly deltaV: number;
|
|
770
|
+
}
|
|
771
|
+
/** The ejection of one occupant, or null when the occupant stays in. */
|
|
772
|
+
declare function ejectionOf(pulse: CrashPulse, belted: boolean, options?: EjectionOptions): Ejection | null;
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Parking sensors: the bumper's distance to the nearest obstacle in the way turns into the beep the cabin plays, slower far away, faster close,
|
|
776
|
+
* continuous at the last few centimetres. Pure numbers, the distances are options.
|
|
777
|
+
*/
|
|
778
|
+
interface ParkingSensorOptions {
|
|
779
|
+
/** Farther than this (metres) it stays quiet. */
|
|
780
|
+
readonly range: number;
|
|
781
|
+
/** Closer than this it beeps without pause. */
|
|
782
|
+
readonly solid: number;
|
|
783
|
+
/** Pause between beeps at the edge of the range and near `solid`, seconds. */
|
|
784
|
+
readonly slowest: number;
|
|
785
|
+
readonly fastest: number;
|
|
786
|
+
}
|
|
787
|
+
declare const DEFAULT_PARKING_SENSOR: ParkingSensorOptions;
|
|
788
|
+
/** Seconds between beeps for an obstacle `distance` metres from the bumper: null when quiet, 0 when continuous. */
|
|
789
|
+
declare function parkingBeepInterval(distance: number, options?: ParkingSensorOptions): number | null;
|
|
790
|
+
/**
|
|
791
|
+
* The bumper's distance to the nearest of `obstacles` (world x, z) in the vehicle's path: ahead when `forward`, behind otherwise. The vehicle is
|
|
792
|
+
* at (x, z) facing `heading` (unit x, z), `length` and `width` metres; obstacles off to the side of its width are not in the way.
|
|
793
|
+
*/
|
|
794
|
+
declare function bumperDistance(params: {
|
|
795
|
+
x: number;
|
|
796
|
+
z: number;
|
|
797
|
+
heading: readonly [number, number];
|
|
798
|
+
length: number;
|
|
799
|
+
width: number;
|
|
800
|
+
forward: boolean;
|
|
801
|
+
obstacles: ReadonlyArray<readonly [number, number]>;
|
|
802
|
+
}): number;
|
|
803
|
+
|
|
804
|
+
export { type AlarmState, type ArcadeOptions, type ArcadeSpec, type BodyDimensions, type ControlCommand, type ControlEvent, type ControlKeyMap, type ControlState, type ControlledDriver, type CrashPulse, type CrashRules, type CruiseOptions, DEFAULT_CONTROL_KEYS, DEFAULT_CRUISE, DEFAULT_EJECTION, DEFAULT_LOADS, DEFAULT_PARKING_SENSOR, DEFAULT_TRACTION, DRIVE_PROFILES, type DamageReport, type DamagedTyre, type DesignStats, type DriveInput, type DriveMode, type DriveProfile, type Driver, type DriverState, type DrivingBody, type DrivingEvent, type DrivingWorld, type Ejection, type EjectionExit, type EjectionOptions, type ElectricalLoads, type FuelModel, type Gearbox, type Indicator, type LampMode, type ParkingSensorOptions, type ProfileTuning, type RadioSource, type RunOverOutcome, type RunOverRules, type SemiDriver, type SemiEvent, type SemiGround, type SemiInput, type SemiSimOptions, type SemiSimSpec, type SemiState, type SemiWheel, type SemiWorld, type StepResult, type Surface, type SurfaceOptions, type SurfaceRegistry, type SystemsDriver, type SystemsEvent, type SystemsState, type SystemsStepParams, type TractionOptions, type VehicleCondition, type VehicleControlOptions, type VehicleControls, type VehicleSystems, type VehicleSystemsOptions, type Wipers, bodyDamage, bumperDistance, conditionFromDamage, createArcadeDriver, createSemiSimDriver, createSurfaces, createVehicleControls, createVehicleSystems, cruiseThrottle, defaultArcadeSpec, defaultFuelModel, defaultSemiSpec, defaultSurfaces, ejectionOf, fuelRate, impactEnergy, parkingBeepInterval, runOver, semiSpecFromStats, speedLoss, surfaceGrip, tractionLimit, vehicleCorners, vehicleDamageFromImpact };
|