@jgengine/core 0.18.1 → 0.19.0
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/CHANGELOG.md +158 -7
- package/dist/ai/decisionGraph.d.ts +48 -4
- package/dist/ai/decisionGraph.js +153 -23
- package/dist/ai/groupAssist.d.ts +10 -0
- package/dist/ai/groupAssist.js +11 -0
- package/dist/ai/pursuit.d.ts +1 -1
- package/dist/ai/pursuit.js +1 -1
- package/dist/ai/threat.d.ts +8 -0
- package/dist/ai/threat.js +10 -0
- package/dist/anim/animGraph.d.ts +11 -0
- package/dist/anim/animGraph.js +128 -0
- package/dist/anim/boneTexture.d.ts +55 -0
- package/dist/anim/boneTexture.js +43 -0
- package/dist/anim/footPlacement.d.ts +57 -0
- package/dist/anim/footPlacement.js +67 -0
- package/dist/anim/locomotionGraph.d.ts +9 -0
- package/dist/anim/locomotionGraph.js +29 -0
- package/dist/audio/audioFalloff.d.ts +2 -0
- package/dist/audio/doppler.d.ts +21 -0
- package/dist/audio/doppler.js +32 -0
- package/dist/audio/engineLayers.d.ts +83 -0
- package/dist/audio/engineLayers.js +115 -0
- package/dist/combat/abilityKit.d.ts +1 -0
- package/dist/combat/abilityKit.js +1 -0
- package/dist/combat/death.d.ts +7 -0
- package/dist/combat/shotOrigin.d.ts +6 -0
- package/dist/combat/shotOrigin.js +6 -0
- package/dist/combat/weaponFeedback.d.ts +36 -0
- package/dist/combat/weaponFeedback.js +42 -0
- package/dist/combat/weaponHandling.d.ts +161 -0
- package/dist/combat/weaponHandling.js +202 -0
- package/dist/combat/weaponPresentation.d.ts +115 -0
- package/dist/combat/weaponPresentation.js +96 -0
- package/dist/devtools/warnOnce.d.ts +8 -0
- package/dist/devtools/warnOnce.js +18 -0
- package/dist/editor/document.js +3 -1
- package/dist/editor/environment.js +8 -0
- package/dist/editor/types.d.ts +4 -0
- package/dist/faction/reputation.d.ts +6 -0
- package/dist/faction/reputation.js +11 -0
- package/dist/game/cameraConfig.d.ts +51 -1
- package/dist/game/events.d.ts +6 -0
- package/dist/game/lootTable.d.ts +4 -0
- package/dist/game/lootTable.js +16 -0
- package/dist/game/playableGame.d.ts +84 -17
- package/dist/game/toasts.d.ts +8 -0
- package/dist/game/toasts.js +7 -0
- package/dist/game/vfxInstance.d.ts +9 -0
- package/dist/game/vfxInstance.js +12 -1
- package/dist/game/viewports.d.ts +43 -0
- package/dist/game/viewports.js +46 -0
- package/dist/game/worldItem.d.ts +5 -1
- package/dist/game/worldItem.js +0 -1
- package/dist/input/actionBindings.d.ts +15 -1
- package/dist/input/actionBindings.js +14 -3
- package/dist/input/actionContexts.d.ts +25 -1
- package/dist/input/actionContexts.js +82 -25
- package/dist/input/axisInput.d.ts +4 -0
- package/dist/input/axisInput.js +4 -0
- package/dist/input/axisShaper.d.ts +73 -0
- package/dist/input/axisShaper.js +105 -0
- package/dist/input/gamepadModel.d.ts +36 -2
- package/dist/input/gamepadModel.js +69 -30
- package/dist/input/haptics.d.ts +50 -0
- package/dist/input/haptics.js +74 -0
- package/dist/input/inputBuffer.d.ts +40 -0
- package/dist/input/inputBuffer.js +59 -0
- package/dist/input/lookChannel.d.ts +10 -0
- package/dist/input/lookChannel.js +6 -0
- package/dist/input/pointer.d.ts +2 -0
- package/dist/input/pointer.js +4 -0
- package/dist/item/affix.d.ts +6 -0
- package/dist/item/affix.js +6 -0
- package/dist/meta/changelog.d.ts +1 -1
- package/dist/meta/changelog.js +112 -1
- package/dist/movement/glideModel.d.ts +3 -0
- package/dist/movement/glideModel.js +6 -0
- package/dist/movement/grappleSwing.d.ts +2 -0
- package/dist/movement/grappleSwing.js +5 -1
- package/dist/movement/movementModel.d.ts +39 -0
- package/dist/movement/movementModel.js +62 -19
- package/dist/movement/movementProbe.d.ts +51 -0
- package/dist/movement/movementProbe.js +119 -0
- package/dist/movement/playerMovement.d.ts +21 -2
- package/dist/movement/playerMovement.js +89 -6
- package/dist/movement/solidObstacles.d.ts +9 -1
- package/dist/movement/solidObstacles.js +44 -2
- package/dist/movement/voxelController.js +7 -7
- package/dist/nav/navFromEnvironment.d.ts +9 -3
- package/dist/nav/navFromEnvironment.js +18 -12
- package/dist/nav/navMesh.d.ts +43 -2
- package/dist/nav/navMesh.js +534 -128
- package/dist/physics/aircraftDynamics.d.ts +390 -0
- package/dist/physics/aircraftDynamics.js +704 -0
- package/dist/physics/boatDynamics.d.ts +116 -0
- package/dist/physics/boatDynamics.js +160 -0
- package/dist/physics/drivableVehicle.d.ts +22 -8
- package/dist/physics/drivableVehicle.js +4 -2
- package/dist/physics/flightDynamics.d.ts +21 -4
- package/dist/physics/flightDynamics.js +28 -5
- package/dist/physics/handlingProbe.d.ts +249 -0
- package/dist/physics/handlingProbe.js +606 -0
- package/dist/physics/kinematicVehicle.d.ts +32 -2
- package/dist/physics/kinematicVehicle.js +15 -0
- package/dist/physics/physicsBackend.d.ts +12 -0
- package/dist/physics/physicsBackendConformance.js +34 -0
- package/dist/physics/physicsWorldBackend.d.ts +1 -0
- package/dist/physics/physicsWorldBackend.js +33 -0
- package/dist/physics/vehicleBackendLink.d.ts +49 -0
- package/dist/physics/vehicleBackendLink.js +102 -0
- package/dist/physics/vehicleDynamics.d.ts +374 -0
- package/dist/physics/vehicleDynamics.js +737 -0
- package/dist/physics/worldColliders.d.ts +1 -1
- package/dist/physics/worldColliders.js +35 -3
- package/dist/puzzle/cellGrid.d.ts +15 -9
- package/dist/puzzle/cellGrid.js +13 -9
- package/dist/render/lookPreset.d.ts +9 -2
- package/dist/render/lookPreset.js +29 -2
- package/dist/render/postProcessing.d.ts +30 -0
- package/dist/render/postProcessing.js +1 -1
- package/dist/runtime/cameraDirector.d.ts +17 -3
- package/dist/runtime/cameraDirector.js +25 -0
- package/dist/runtime/commandInput.d.ts +37 -0
- package/dist/runtime/commandInput.js +58 -0
- package/dist/runtime/commandRunner.d.ts +27 -0
- package/dist/runtime/commandRunner.js +31 -3
- package/dist/runtime/context/combat.d.ts +1 -0
- package/dist/runtime/context/combat.js +2 -1
- package/dist/runtime/context/deathLoot.d.ts +2 -0
- package/dist/runtime/context/deathLoot.js +1 -0
- package/dist/runtime/gameContext.js +7 -0
- package/dist/runtime/gameContextTypes.d.ts +19 -3
- package/dist/runtime/gameRuntime.d.ts +3 -1
- package/dist/runtime/gameRuntime.js +4 -0
- package/dist/runtime/inputSnapshot.d.ts +6 -0
- package/dist/runtime/inputSnapshot.js +10 -0
- package/dist/runtime/localPlayers.d.ts +73 -0
- package/dist/runtime/localPlayers.js +119 -0
- package/dist/runtime/transport.d.ts +9 -0
- package/dist/runtime/transport.js +7 -1
- package/dist/scene/behaviorRuntime.d.ts +12 -2
- package/dist/scene/behaviorRuntime.js +30 -14
- package/dist/scene/behaviors.d.ts +5 -1
- package/dist/scene/sceneKinds.d.ts +9 -0
- package/dist/scene/vehicleSeat.d.ts +5 -1
- package/dist/scene/vehicleSeat.js +5 -1
- package/dist/sensor/concealment.d.ts +6 -0
- package/dist/sensor/concealment.js +8 -0
- package/dist/sensor/freezeMonitor.d.ts +6 -0
- package/dist/sensor/freezeMonitor.js +8 -0
- package/dist/sensor/perception.d.ts +11 -1
- package/dist/sensor/perception.js +57 -10
- package/dist/sensor/recordingBuffer.d.ts +3 -0
- package/dist/sensor/recordingBuffer.js +8 -0
- package/dist/session/roundState.d.ts +4 -0
- package/dist/session/roundState.js +11 -0
- package/dist/settings/frameRateLimit.d.ts +16 -0
- package/dist/settings/frameRateLimit.js +37 -0
- package/dist/settings/graphicsProfile.d.ts +2 -0
- package/dist/settings/graphicsProfile.js +12 -0
- package/dist/settings/graphicsSettings.d.ts +40 -0
- package/dist/settings/graphicsSettings.js +81 -0
- package/dist/settings/settingsModel.d.ts +9 -1
- package/dist/settings/settingsModel.js +10 -0
- package/dist/stats/eventMeter.d.ts +1 -1
- package/dist/stats/eventMeter.js +1 -1
- package/dist/vfx/feedbackMixer.d.ts +61 -0
- package/dist/vfx/feedbackMixer.js +106 -0
- package/dist/visibility/simulationCulling.d.ts +8 -1
- package/dist/visibility/simulationCulling.js +7 -0
- package/dist/visibility/spatialIndex.d.ts +21 -0
- package/dist/visibility/spatialIndex.js +16 -0
- package/dist/world/authoredSolids.d.ts +46 -0
- package/dist/world/authoredSolids.js +75 -0
- package/dist/world/buildingGenerator.js +2 -2
- package/dist/world/buildingKit.d.ts +3 -1
- package/dist/world/buildings.d.ts +34 -2
- package/dist/world/buildings.js +11 -1
- package/dist/world/cityKind.d.ts +7 -0
- package/dist/world/cityKind.js +52 -1
- package/dist/world/features.d.ts +29 -2
- package/dist/world/features.js +6 -0
- package/dist/world/footprintGrid.d.ts +7 -0
- package/dist/world/footprintGrid.js +16 -0
- package/dist/world/interiors.d.ts +1 -0
- package/dist/world/interiors.js +5 -3
- package/dist/world/lod.d.ts +6 -0
- package/dist/world/lod.js +8 -0
- package/dist/world/terraform.d.ts +8 -0
- package/dist/world/terraform.js +7 -0
- package/dist/world/walls.d.ts +7 -0
- package/dist/world/walls.js +7 -0
- package/dist/world/worldSolids.d.ts +84 -0
- package/dist/world/worldSolids.js +240 -0
- package/dist/world.d.ts +2 -2
- package/dist/world.js +1 -1
- package/package.json +1 -1
- package/skills/ce-handoff/SKILL.md +1 -1
- package/skills/game-design/SKILL.md +2 -2
- package/skills/jgengine/SKILL.md +7 -5
- package/skills/jgengine/api.md +118 -89
- package/skills/jgengine/capabilities.md +28 -0
- package/skills/jgengine/recipes/minimal-game.md +3 -0
- package/skills/jgengine-combat/SKILL.md +5 -0
- package/skills/jgengine-combat/api.md +138 -103
- package/skills/jgengine-combat/capabilities.md +29 -1
- package/skills/jgengine-combat/recipes/weapon-feel.md +50 -0
- package/skills/jgengine-gameplay/api.md +462 -436
- package/skills/jgengine-gameplay/capabilities.md +24 -0
- package/skills/jgengine-gameplay/reference-systems.md +4 -0
- package/skills/jgengine-world/SKILL.md +15 -3
- package/skills/jgengine-world/api.md +873 -626
- package/skills/jgengine-world/capabilities.md +130 -6
- package/skills/jgengine-world/recipes/character-animation.md +39 -0
- package/skills/jgengine-world/recipes/controls.md +44 -0
- package/skills/jgengine-world/recipes/flight-feel.md +76 -0
- package/skills/jgengine-world/recipes/npc-senses.md +43 -0
- package/skills/jgengine-world/recipes/vehicle-feel.md +85 -0
- package/skills/jgengine-world/reference.md +31 -2
- package/skills/jgengine-world/visibility.md +112 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type { AxisInput } from "../input/axisInput.js";
|
|
2
|
+
import type { AircraftVector, RigidAircraft } from "./aircraftDynamics.js";
|
|
3
|
+
/** The slice of a vehicle sim {@link measureHandling} drives: `VehicleDynamics` and `KinematicVehicle` both fit. */
|
|
4
|
+
export interface HandlingSubject {
|
|
5
|
+
tick(dt: number, input: AxisInput): {
|
|
6
|
+
forwardSpeed: number;
|
|
7
|
+
lateralSpeed: number;
|
|
8
|
+
yawRate: number;
|
|
9
|
+
};
|
|
10
|
+
velocity(): readonly [number, number];
|
|
11
|
+
}
|
|
12
|
+
/** Scenario settings for {@link measureHandling}; every field has a default. */
|
|
13
|
+
export interface HandlingProbeOptions {
|
|
14
|
+
/** Fixed tick, s (default `1/60`). */
|
|
15
|
+
dt?: number;
|
|
16
|
+
/** Entry speed for the step-steer, lift-off and handbrake tests, m/s (default `25`). */
|
|
17
|
+
cornerSpeed?: number;
|
|
18
|
+
/** Steer input for the step-steer test (default `1`: a held keyboard key, the harshest common case). */
|
|
19
|
+
stepSteer?: number;
|
|
20
|
+
/** Steer input held through the lift-off test (default `0.3`). */
|
|
21
|
+
liftOffSteer?: number;
|
|
22
|
+
}
|
|
23
|
+
/** Deterministic feel metrics, in the units drivers and reviewers use. `Infinity` means the target was never reached. */
|
|
24
|
+
export interface HandlingReport {
|
|
25
|
+
/** Standing start to 100 km/h, s. */
|
|
26
|
+
zeroTo100: number;
|
|
27
|
+
/** Speed after 40 s of full throttle, m/s. */
|
|
28
|
+
topSpeed: number;
|
|
29
|
+
/** Full brake from 100 km/h to rest, m. */
|
|
30
|
+
brake100To0: number;
|
|
31
|
+
/** Peak lateral acceleration (perpendicular to travel) on a slow steer ramp at 20 m/s while sideslip stays under 12°, g. */
|
|
32
|
+
maxLateralG: number;
|
|
33
|
+
/** Seconds from a step steer until yaw rate first reaches 90% of its peak — turn-in latency. */
|
|
34
|
+
turnIn: number;
|
|
35
|
+
/** Peak |sideslip| during the step steer, degrees. */
|
|
36
|
+
stepPeakSideslipDeg: number;
|
|
37
|
+
/** Yaw rate at the end of the 3 s step steer, rad/s. */
|
|
38
|
+
stepSteadyYawRate: number;
|
|
39
|
+
/** Share of entry speed left after the 3 s step steer. */
|
|
40
|
+
stepSpeedRetained: number;
|
|
41
|
+
/** The step steer ended with sideslip over 60°: the car spun. */
|
|
42
|
+
spun: boolean;
|
|
43
|
+
/** Yaw rate 0.5 s after lifting off mid-corner divided by the yaw rate before: `>1` tucks in, `<1` pushes wide. */
|
|
44
|
+
liftOffYawGain: number;
|
|
45
|
+
/** Peak |sideslip| from a 0.6 s steer-plus-handbrake pull, degrees. */
|
|
46
|
+
handbrakePeakSideslipDeg: number;
|
|
47
|
+
/** Seconds after releasing that pull, with no input, until sideslip stays under 5° for 0.3 s; `Infinity` if it never does within 3 s. */
|
|
48
|
+
handbrakeRecoverySeconds: number;
|
|
49
|
+
/** Peak |sideslip| holding full throttle and full steer for 2 s from 12 m/s — the keyboard player's corner, degrees. */
|
|
50
|
+
powerSteerPeakSideslipDeg: number;
|
|
51
|
+
/** The full-throttle full-steer hold ended with sideslip over 60°. */
|
|
52
|
+
powerSteerSpun: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Drives fresh instances from `create` through fixed scenarios (launch, top speed, braking, a slow steer
|
|
56
|
+
* ramp, a step steer, a mid-corner lift-off, a handbrake pull, full throttle with full steer) and reports the feel metrics a test can
|
|
57
|
+
* assert. Deterministic: the same subject and options always produce the same report, so a tuning change
|
|
58
|
+
* shows up as a number moving, not an opinion.
|
|
59
|
+
* @capability handling-metrics measure a vehicle's feel as numbers — 0–100, braking, lateral g, turn-in, sideslip, spin
|
|
60
|
+
*/
|
|
61
|
+
export declare function measureHandling(create: () => HandlingSubject, options?: HandlingProbeOptions): HandlingReport;
|
|
62
|
+
/** The slice of a sprung vehicle sim {@link measureRide} drives; a `VehicleDynamics` with `suspension` fits. */
|
|
63
|
+
export interface RideSubject {
|
|
64
|
+
tick(dt: number, input: AxisInput): {
|
|
65
|
+
position: readonly [number, number, number];
|
|
66
|
+
forwardSpeed: number;
|
|
67
|
+
bodyPitch: number;
|
|
68
|
+
bodyRoll: number;
|
|
69
|
+
lateralAccel: number;
|
|
70
|
+
airborne: boolean;
|
|
71
|
+
};
|
|
72
|
+
applyImpulse(dvx: number, dvz: number, dvy?: number): void;
|
|
73
|
+
}
|
|
74
|
+
/** Deterministic ride metrics for a sprung vehicle. */
|
|
75
|
+
export interface RideReport {
|
|
76
|
+
/** Seconds after a 1 m/s upward kick until the body stays within 5 mm of its rest height. */
|
|
77
|
+
settleSeconds: number;
|
|
78
|
+
/** Largest drop below rest height after that kick, divided by the largest rise above it. */
|
|
79
|
+
heaveOvershoot: number;
|
|
80
|
+
/** Peak nose-down pitch under full braking from 25 m/s, degrees. */
|
|
81
|
+
brakeDiveDeg: number;
|
|
82
|
+
/** Body roll per g of lateral acceleration in a steady half-lock corner at 20 m/s, degrees/g. */
|
|
83
|
+
rollGradient: number;
|
|
84
|
+
/** Times the car leaves the ground again after landing from a 4 m/s vertical launch. */
|
|
85
|
+
landingBounces: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Drives fresh sprung vehicles from `create` through a vertical kick, a hard stop, a steady corner and a
|
|
89
|
+
* launch-and-land, and reports how the body moves: how fast it settles, how much it dives and rolls, and
|
|
90
|
+
* whether a landing bounces.
|
|
91
|
+
* @capability ride-metrics measure a sprung vehicle's ride — settle time, dive, roll per g, landing bounce
|
|
92
|
+
*/
|
|
93
|
+
export declare function measureRide(create: () => RideSubject, options?: {
|
|
94
|
+
dt?: number;
|
|
95
|
+
}): RideReport;
|
|
96
|
+
/** The slice of a jumping vehicle sim {@link measureAir} drives; a `VehicleDynamics` with `suspension`, `jump` and `air` fits. */
|
|
97
|
+
export interface AirSubject {
|
|
98
|
+
tick(dt: number, input: AxisInput, modifiers?: {
|
|
99
|
+
air?: {
|
|
100
|
+
pitch: number;
|
|
101
|
+
yaw: number;
|
|
102
|
+
roll: number;
|
|
103
|
+
};
|
|
104
|
+
}): {
|
|
105
|
+
position: readonly [number, number, number];
|
|
106
|
+
airborne: boolean;
|
|
107
|
+
};
|
|
108
|
+
jump(): boolean;
|
|
109
|
+
snapshot(): {
|
|
110
|
+
pitchRate: number;
|
|
111
|
+
yawRate: number;
|
|
112
|
+
rollRate: number;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** Deterministic jump and air-control metrics. */
|
|
116
|
+
export interface AirReport {
|
|
117
|
+
/** Peak height above the resting height after one standing jump, m. */
|
|
118
|
+
jumpApexHeight: number;
|
|
119
|
+
/** Seconds from the jump to that peak. */
|
|
120
|
+
jumpApexTime: number;
|
|
121
|
+
/** Peak height with a second jump pressed at the first jump's apex, m (equals `jumpApexHeight` without a double jump). */
|
|
122
|
+
doubleJumpApexHeight: number;
|
|
123
|
+
/** Angular rate reached after 0.4 s of full input in the air, rad/s, per axis. */
|
|
124
|
+
airPitchRate: number;
|
|
125
|
+
airYawRate: number;
|
|
126
|
+
airRollRate: number;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Jumps a fresh vehicle from rest and holds full air input on each axis, reporting jump height and timing,
|
|
130
|
+
* double-jump height, and how fast the body rotates in the air.
|
|
131
|
+
* @capability air-metrics measure a vehicle's jumps and air control — apex height and time, double jump, air rotation rates
|
|
132
|
+
*/
|
|
133
|
+
export declare function measureAir(create: () => AirSubject, options?: {
|
|
134
|
+
dt?: number;
|
|
135
|
+
}): AirReport;
|
|
136
|
+
/** A vehicle sim {@link measureCourse} can drive along a line: a {@link HandlingSubject} that also reports its pose and front-wheel angle. */
|
|
137
|
+
export interface CourseSubject {
|
|
138
|
+
tick(dt: number, input: AxisInput): {
|
|
139
|
+
forwardSpeed: number;
|
|
140
|
+
lateralSpeed: number;
|
|
141
|
+
yawRate: number;
|
|
142
|
+
steerAngle: number;
|
|
143
|
+
};
|
|
144
|
+
velocity(): readonly [number, number];
|
|
145
|
+
pose(): {
|
|
146
|
+
position: readonly [number, number, number];
|
|
147
|
+
heading: number;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** Settings for {@link measureCourse}; every field but `wheelbase` has a default. */
|
|
151
|
+
export interface CourseProbeOptions {
|
|
152
|
+
/** Wheelbase, m — needed to separate geometric steer from understeer. */
|
|
153
|
+
wheelbase: number;
|
|
154
|
+
dt?: number;
|
|
155
|
+
/** Skidpad radius, m (default `30`). */
|
|
156
|
+
skidpadRadius?: number;
|
|
157
|
+
/** Distance between slalom cones, m (default `18`). */
|
|
158
|
+
slalomSpacing?: number;
|
|
159
|
+
/** How far the weaving line swings either side of the cones, m (default `3.5`). */
|
|
160
|
+
slalomOffset?: number;
|
|
161
|
+
}
|
|
162
|
+
/** Deterministic driven-course metrics. */
|
|
163
|
+
export interface CourseReport {
|
|
164
|
+
/**
|
|
165
|
+
* Understeer gradient, degrees of extra front-wheel angle per g of lateral acceleration, from a slow steer
|
|
166
|
+
* ramp at 20 m/s between 0.1 and 0.4 g. Positive understeers, negative oversteers, near 0 is neutral.
|
|
167
|
+
*/
|
|
168
|
+
understeerGradient: number;
|
|
169
|
+
/** Highest lateral acceleration held on a circle of `skidpadRadius`, g. */
|
|
170
|
+
skidpadG: number;
|
|
171
|
+
/**
|
|
172
|
+
* Fastest entry speed at which a pure-pursuit driver weaves 8 centre-line cones, passing each on the
|
|
173
|
+
* correct side with at least 1.2 m of clearance and without sliding past 30°, m/s (`0` if none).
|
|
174
|
+
*/
|
|
175
|
+
slalomSpeed: number;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Drives a fresh vehicle from `create` through a steer ramp, a skidpad and a slalom with simple
|
|
179
|
+
* deterministic drivers, and reports understeer gradient, skidpad g and the fastest clean slalom.
|
|
180
|
+
* @capability course-metrics measure a vehicle on driven tests — understeer gradient, skidpad g, slalom speed
|
|
181
|
+
*/
|
|
182
|
+
export declare function measureCourse(create: () => CourseSubject, options: CourseProbeOptions): CourseReport;
|
|
183
|
+
/** The slice of a single-track sim {@link measureLean} drives; a `VehicleDynamics` with a `lean` block fits. */
|
|
184
|
+
export interface LeanSubject {
|
|
185
|
+
tick(dt: number, input: AxisInput): {
|
|
186
|
+
forwardSpeed: number;
|
|
187
|
+
lean: number;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/** Deterministic lean metrics for a motorcycle or bicycle. */
|
|
191
|
+
export interface LeanReport {
|
|
192
|
+
/** Lean held after 2 s of full steer at `speed`, degrees. */
|
|
193
|
+
steadyLeanDeg: number;
|
|
194
|
+
/** Seconds from full steer until the lean first reaches 90% of that steady lean. */
|
|
195
|
+
timeToLean: number;
|
|
196
|
+
/** Largest lean the wrong way in the first 0.4 s — the countersteer tip-in, degrees (`0` if none). */
|
|
197
|
+
counterLeanDeg: number;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Brings a fresh bike to `speed` and holds full steer, reporting how far and how fast it leans and how much it
|
|
201
|
+
* tips the other way first.
|
|
202
|
+
* @capability lean-metrics measure a motorcycle's lean — steady lean, time to lean, countersteer tip-in
|
|
203
|
+
*/
|
|
204
|
+
export declare function measureLean(create: () => LeanSubject, options?: {
|
|
205
|
+
dt?: number;
|
|
206
|
+
speed?: number;
|
|
207
|
+
}): LeanReport;
|
|
208
|
+
/** Where {@link measureFlight} spawns each fresh aircraft: level, heading `0` (forward `+z`). */
|
|
209
|
+
export interface FlightSpawn {
|
|
210
|
+
position: AircraftVector;
|
|
211
|
+
velocity: AircraftVector;
|
|
212
|
+
}
|
|
213
|
+
/** Scenario settings for {@link measureFlight}. */
|
|
214
|
+
export interface FlightProbeOptions {
|
|
215
|
+
/** Fixed tick, s (default `1/60`). */
|
|
216
|
+
dt?: number;
|
|
217
|
+
/** Entry airspeed for the fixed-wing tests, m/s (default `60`). */
|
|
218
|
+
cruiseSpeed?: number;
|
|
219
|
+
/** Spawn altitude, m (default `1000`, or `50` for a rotorcraft). */
|
|
220
|
+
altitude?: number;
|
|
221
|
+
/** Collective that hovers a rotorcraft (default weight over rotor `maxThrust`). */
|
|
222
|
+
hoverCollective?: number;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Deterministic flight metrics. Fields that don't apply to the aircraft are `NaN`: turn and stall need wings,
|
|
226
|
+
* hover drift needs a rotor.
|
|
227
|
+
*/
|
|
228
|
+
export interface FlightReport {
|
|
229
|
+
/** Peak roll rate under full roll input from cruise (or a hover), deg/s. */
|
|
230
|
+
rollRateDeg: number;
|
|
231
|
+
/** Best turn rate held at full throttle without losing altitude or speed, deg/s. */
|
|
232
|
+
sustainedTurnRateDeg: number;
|
|
233
|
+
/** Slowest airspeed that still holds altitude at idle, wings level, m/s. */
|
|
234
|
+
stallSpeed: number;
|
|
235
|
+
/** Steady climb at full throttle holding cruise speed (full collective from a hover for a rotorcraft), m/s. */
|
|
236
|
+
climbRate: number;
|
|
237
|
+
/** Seconds from idle to 90% of full thrust after the throttle (and collective) go to full. */
|
|
238
|
+
throttleResponse: number;
|
|
239
|
+
/** Horizontal drift after 10 s hands-off at hover collective, m. */
|
|
240
|
+
hoverDriftMeters: number;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Flies fresh aircraft from `create` through fixed scenarios with simple deterministic autopilots: a full-aileron
|
|
244
|
+
* roll, banked turns at full throttle, an idle deceleration holding altitude, a full-throttle climb at cruise
|
|
245
|
+
* speed, a throttle step from idle, and a hands-off hover. `create` gets a spawn to pass straight into
|
|
246
|
+
* `createRigidAircraft`. Deterministic, so a tuning change shows up as a number moving.
|
|
247
|
+
* @capability flight-metrics measure an aircraft's feel as numbers — roll rate, sustained turn, stall speed, climb, throttle response, hover drift
|
|
248
|
+
*/
|
|
249
|
+
export declare function measureFlight(create: (spawn: FlightSpawn) => RigidAircraft, options?: FlightProbeOptions): FlightReport;
|