@aura3d/physics 2.0.0 → 2.0.2
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/package.json +2 -2
- package/dist/CharacterController.d.ts +0 -135
- package/dist/CharacterController.d.ts.map +0 -1
- package/dist/CharacterController.js +0 -609
- package/dist/CharacterController.js.map +0 -1
- package/dist/ClothFixtures.d.ts +0 -87
- package/dist/ClothFixtures.d.ts.map +0 -1
- package/dist/ClothFixtures.js +0 -264
- package/dist/ClothFixtures.js.map +0 -1
- package/dist/Crowd.d.ts +0 -64
- package/dist/Crowd.d.ts.map +0 -1
- package/dist/Crowd.js +0 -209
- package/dist/Crowd.js.map +0 -1
- package/dist/FireSmokeFixtures.d.ts +0 -103
- package/dist/FireSmokeFixtures.d.ts.map +0 -1
- package/dist/FireSmokeFixtures.js +0 -271
- package/dist/FireSmokeFixtures.js.map +0 -1
- package/dist/FluidFixtures.d.ts +0 -75
- package/dist/FluidFixtures.d.ts.map +0 -1
- package/dist/FluidFixtures.js +0 -219
- package/dist/FluidFixtures.js.map +0 -1
- package/dist/FractureFixtures.d.ts +0 -68
- package/dist/FractureFixtures.d.ts.map +0 -1
- package/dist/FractureFixtures.js +0 -199
- package/dist/FractureFixtures.js.map +0 -1
- package/dist/NarrowPhase.d.ts +0 -11
- package/dist/NarrowPhase.d.ts.map +0 -1
- package/dist/NarrowPhase.js +0 -565
- package/dist/NarrowPhase.js.map +0 -1
- package/dist/Navigation.d.ts +0 -67
- package/dist/Navigation.d.ts.map +0 -1
- package/dist/Navigation.js +0 -261
- package/dist/Navigation.js.map +0 -1
- package/dist/PathFollowDriver.d.ts +0 -162
- package/dist/PathFollowDriver.d.ts.map +0 -1
- package/dist/PathFollowDriver.js +0 -163
- package/dist/PathFollowDriver.js.map +0 -1
- package/dist/PhysicsSandboxFixtures.d.ts +0 -53
- package/dist/PhysicsSandboxFixtures.d.ts.map +0 -1
- package/dist/PhysicsSandboxFixtures.js +0 -280
- package/dist/PhysicsSandboxFixtures.js.map +0 -1
- package/dist/PlatformerFixtures.d.ts +0 -70
- package/dist/PlatformerFixtures.d.ts.map +0 -1
- package/dist/PlatformerFixtures.js +0 -120
- package/dist/PlatformerFixtures.js.map +0 -1
- package/dist/RacingLineProfile.d.ts +0 -116
- package/dist/RacingLineProfile.d.ts.map +0 -1
- package/dist/RacingLineProfile.js +0 -181
- package/dist/RacingLineProfile.js.map +0 -1
- package/dist/SoftBodyFixtures.d.ts +0 -70
- package/dist/SoftBodyFixtures.d.ts.map +0 -1
- package/dist/SoftBodyFixtures.js +0 -272
- package/dist/SoftBodyFixtures.js.map +0 -1
- package/dist/Steering.d.ts +0 -161
- package/dist/Steering.d.ts.map +0 -1
- package/dist/Steering.js +0 -347
- package/dist/Steering.js.map +0 -1
- package/dist/VehicleDynamics.d.ts +0 -162
- package/dist/VehicleDynamics.d.ts.map +0 -1
- package/dist/VehicleDynamics.js +0 -363
- package/dist/VehicleDynamics.js.map +0 -1
- package/dist/VehicleMotion.d.ts +0 -125
- package/dist/VehicleMotion.d.ts.map +0 -1
- package/dist/VehicleMotion.js +0 -373
- package/dist/VehicleMotion.js.map +0 -1
- package/dist/solverless-entry.d.ts +0 -41
- package/dist/solverless-entry.d.ts.map +0 -1
- package/dist/solverless-entry.js +0 -40
- package/dist/solverless-entry.js.map +0 -1
- package/dist/world-entry.d.ts +0 -31
- package/dist/world-entry.d.ts.map +0 -1
- package/dist/world-entry.js +0 -30
- package/dist/world-entry.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
const platformSummaries = [
|
|
2
|
-
{ kind: "static", count: 6 },
|
|
3
|
-
{ kind: "moving", count: 1 },
|
|
4
|
-
{ kind: "rotating", count: 1 },
|
|
5
|
-
{ kind: "falling", count: 3 },
|
|
6
|
-
{ kind: "bouncy", count: 1 },
|
|
7
|
-
{ kind: "disappearing", count: 2 }
|
|
8
|
-
];
|
|
9
|
-
const collectibleSummaries = [
|
|
10
|
-
{ kind: "coin", count: 5, scoreValue: 100 },
|
|
11
|
-
{ kind: "gem", count: 2, scoreValue: 500 },
|
|
12
|
-
{ kind: "power-up", count: 1, scoreValue: 1000 }
|
|
13
|
-
];
|
|
14
|
-
export function samplePlatformerControllerFixture(options = {}) {
|
|
15
|
-
const seed = integer(options.seed ?? 0x3d2025, "seed");
|
|
16
|
-
const elapsedSeconds = finiteNonNegative(options.elapsedSeconds ?? 0.32, "elapsedSeconds");
|
|
17
|
-
const coyoteTimeSeconds = 0.15;
|
|
18
|
-
const jumpBufferSeconds = 0.1;
|
|
19
|
-
const timeSinceGrounded = 0.08 + hash01(seed, 1) * 0.03;
|
|
20
|
-
const timeSinceJumpPressed = 0.04 + hash01(seed, 2) * 0.02;
|
|
21
|
-
const coyoteJumpAccepted = timeSinceGrounded <= coyoteTimeSeconds;
|
|
22
|
-
const bufferedJumpAccepted = timeSinceJumpPressed <= jumpBufferSeconds;
|
|
23
|
-
const doubleJumpAccepted = coyoteJumpAccepted && bufferedJumpAccepted;
|
|
24
|
-
const wallJumpAccepted = hash01(seed, 3) > 0.25;
|
|
25
|
-
const horizontalSpeed = Number((5 + hash01(seed, 4) * 3).toFixed(4));
|
|
26
|
-
const verticalVelocity = Number((12 - elapsedSeconds * 9.8).toFixed(4));
|
|
27
|
-
const stateSequence = [
|
|
28
|
-
"idle",
|
|
29
|
-
horizontalSpeed > 6.5 ? "run" : "walk",
|
|
30
|
-
"jump",
|
|
31
|
-
doubleJumpAccepted ? "doubleJump" : "fall",
|
|
32
|
-
wallJumpAccepted ? "wallSlide" : "fall",
|
|
33
|
-
"land"
|
|
34
|
-
];
|
|
35
|
-
const totalPlatforms = platformSummaries.reduce((sum, entry) => sum + entry.count, 0);
|
|
36
|
-
const totalCollectibles = collectibleSummaries.reduce((sum, entry) => sum + entry.count, 0);
|
|
37
|
-
const totalScoreValue = collectibleSummaries.reduce((sum, entry) => sum + entry.count * entry.scoreValue, 0);
|
|
38
|
-
const startPosition = [0, 2, 0];
|
|
39
|
-
const goalPosition = [56, 9, 0];
|
|
40
|
-
const goalDistance = Number(Math.hypot(goalPosition[0] - startPosition[0], goalPosition[1] - startPosition[1], goalPosition[2] - startPosition[2]).toFixed(4));
|
|
41
|
-
return {
|
|
42
|
-
id: "external-parity-old-branch-platformer-controller-fixture",
|
|
43
|
-
source: "origin-master-platformer-controller-adapted",
|
|
44
|
-
config: {
|
|
45
|
-
walkSpeed: 5,
|
|
46
|
-
runSpeed: 8,
|
|
47
|
-
jumpForce: 12,
|
|
48
|
-
doubleJumpForce: 10,
|
|
49
|
-
wallJumpForce: 14,
|
|
50
|
-
airControl: 0.3,
|
|
51
|
-
coyoteTimeSeconds,
|
|
52
|
-
jumpBufferSeconds,
|
|
53
|
-
maxFallSpeed: 30
|
|
54
|
-
},
|
|
55
|
-
controller: {
|
|
56
|
-
grounded: false,
|
|
57
|
-
coyoteJumpAccepted,
|
|
58
|
-
bufferedJumpAccepted,
|
|
59
|
-
doubleJumpAccepted,
|
|
60
|
-
wallJumpAccepted,
|
|
61
|
-
horizontalSpeed,
|
|
62
|
-
verticalVelocity,
|
|
63
|
-
stateSequence,
|
|
64
|
-
finalState: "land"
|
|
65
|
-
},
|
|
66
|
-
camera: {
|
|
67
|
-
distance: 8,
|
|
68
|
-
minDistance: 3,
|
|
69
|
-
maxDistance: 15,
|
|
70
|
-
height: 2,
|
|
71
|
-
followSpeed: 8,
|
|
72
|
-
verticalAngle: Number((0.3 + hash01(seed, 5) * 0.1).toFixed(4)),
|
|
73
|
-
collisionAdjustedDistance: Number((8 - hash01(seed, 6) * 1.5).toFixed(4)),
|
|
74
|
-
shakeAmount: Number((0.18 * Math.pow(0.95, elapsedSeconds * 60)).toFixed(4)),
|
|
75
|
-
lockOnSupported: true
|
|
76
|
-
},
|
|
77
|
-
level: {
|
|
78
|
-
startPosition,
|
|
79
|
-
goalPosition,
|
|
80
|
-
platformSummaries,
|
|
81
|
-
collectibleSummaries,
|
|
82
|
-
checkpointCount: 2,
|
|
83
|
-
hazardCount: 3,
|
|
84
|
-
movingPlatformPathCount: 2,
|
|
85
|
-
totalPlatforms,
|
|
86
|
-
totalCollectibles,
|
|
87
|
-
totalScoreValue,
|
|
88
|
-
goalDistance
|
|
89
|
-
},
|
|
90
|
-
hash: hashPlatformer(seed, elapsedSeconds, horizontalSpeed, verticalVelocity, totalPlatforms, totalCollectibles, goalDistance),
|
|
91
|
-
claimBoundary: "Deterministic platformer controller, third-person camera, and level-layout telemetry adapted from the old platformer example; this is not a full character controller replacement, collision solver, camera occlusion system, or Unity/Unreal controller parity claim."
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function hashPlatformer(...values) {
|
|
95
|
-
let hash = 0x811c9dc5;
|
|
96
|
-
for (const value of values) {
|
|
97
|
-
const scaled = Math.round(value * 10_000);
|
|
98
|
-
hash ^= scaled & 0xff;
|
|
99
|
-
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
100
|
-
hash ^= (scaled >>> 8) & 0xff;
|
|
101
|
-
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
102
|
-
}
|
|
103
|
-
return hash.toString(16).padStart(8, "0");
|
|
104
|
-
}
|
|
105
|
-
function hash01(seed, salt) {
|
|
106
|
-
let value = Math.imul(seed + salt * 1013904223, 1664525) + 1013904223;
|
|
107
|
-
value = Math.imul(value ^ (value >>> 13), 1274126177);
|
|
108
|
-
return ((value ^ (value >>> 16)) >>> 0) / 4294967296;
|
|
109
|
-
}
|
|
110
|
-
function finiteNonNegative(value, label) {
|
|
111
|
-
if (!Number.isFinite(value) || value < 0)
|
|
112
|
-
throw new RangeError(`Platformer fixture ${label} must be finite and non-negative.`);
|
|
113
|
-
return value;
|
|
114
|
-
}
|
|
115
|
-
function integer(value, label) {
|
|
116
|
-
if (!Number.isInteger(value))
|
|
117
|
-
throw new RangeError(`Platformer fixture ${label} must be an integer.`);
|
|
118
|
-
return value;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=PlatformerFixtures.js.map
|
|
@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QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,IAAY;IACxC,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,UAAU,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC;IACtE,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;IACtD,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CAAC;AACvD,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa,EAAE,KAAa;IACrD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,sBAAsB,KAAK,mCAAmC,CAAC,CAAC;IAC/H,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,KAAa,EAAE,KAAa;IAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,sBAAsB,KAAK,sBAAsB,CAAC,CAAC;IACtG,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Grip-limited speed profile along a closed racing line.
|
|
3
|
-
*
|
|
4
|
-
* ## The gap this closes
|
|
5
|
-
*
|
|
6
|
-
* WS-3.8 was attempted twice and reverted twice. Both attempts swapped the racing kit's
|
|
7
|
-
* kinematic `heading += steer * steerRate * dt` for the WS-3.3 force model, and both times the
|
|
8
|
-
* car could not lap its own certified circuit. The diagnosis recorded in the PRD was that a
|
|
9
|
-
* certified route encodes a *kinematic* contract, so moving to forces invalidates its lap time.
|
|
10
|
-
*
|
|
11
|
-
* That diagnosis was one step short. The actual defect is narrower and fixable: the route's
|
|
12
|
-
* speed model is `routeLength / authoredLapSeconds`, a **single constant speed for the whole
|
|
13
|
-
* lap**. A kinematic car can hold a constant speed through any corner, because its heading is
|
|
14
|
-
* an input rather than a consequence. A real car cannot — cornering at speed `v` through radius
|
|
15
|
-
* `r` demands lateral acceleration `v^2 / r`, and no tyre supplies an unbounded amount.
|
|
16
|
-
*
|
|
17
|
-
* On Aura3D's own certified circuit the two contracts are irreconcilable *as stated*: the
|
|
18
|
-
* tightest corner has radius 0.77 units, and holding the certified 4x pace of 4.312 u/s through
|
|
19
|
-
* it demands 24.15 u/s^2. That is why every previous attempt failed at the same corner, and why
|
|
20
|
-
* no steering gain or sign convention rescued it — the request was geometrically impossible, so
|
|
21
|
-
* the controller was never the problem.
|
|
22
|
-
*
|
|
23
|
-
* A real driver does not hold one speed. They brake for the corner, hold the grip limit through
|
|
24
|
-
* the apex, and accelerate out. Once the target is a *profile* rather than a constant, the same
|
|
25
|
-
* circuit is comfortably drivable: at a physical 0.41 g the lap comes out at 11.29 s against
|
|
26
|
-
* 4.312 u/s of straight-line speed, versus the 24.15 u/s^2 a constant-speed lap demanded. The
|
|
27
|
-
* certified average speed is preserved as what it always physically meant — a lap average — and
|
|
28
|
-
* the force model then has a target it can actually track.
|
|
29
|
-
*
|
|
30
|
-
* ## What this module is
|
|
31
|
-
*
|
|
32
|
-
* The standard two-pass forward/backward solve used by every real racing-line generator:
|
|
33
|
-
*
|
|
34
|
-
* 1. **Cornering limit.** At each station, `v <= sqrt(lateralLimit * radius)`, the fastest speed
|
|
35
|
-
* the tyre can hold through that radius. Straights are bounded by `maxSpeed` instead.
|
|
36
|
-
* 2. **Forward pass.** Acceleration is finite, so a station's speed is also bounded by how fast
|
|
37
|
-
* the car could have got there from the previous one: `v[i+1]^2 <= v[i]^2 + 2*a*ds`.
|
|
38
|
-
* 3. **Backward pass.** Braking is finite, so a station's speed is bounded by the need to be
|
|
39
|
-
* slow enough for what is coming: `v[i]^2 <= v[i+1]^2 + 2*b*ds`.
|
|
40
|
-
*
|
|
41
|
-
* Passes 2 and 3 are interdependent — braking earlier changes what you can accelerate from — so
|
|
42
|
-
* they are iterated to a fixed point rather than run once. On a closed loop this matters more
|
|
43
|
-
* than on an open one: the profile must also join up with itself at the start/finish line.
|
|
44
|
-
*
|
|
45
|
-
* ## Why it lives in `packages/physics`
|
|
46
|
-
*
|
|
47
|
-
* It is a property of a path and a friction limit, not of any route, genre kit or app. Nothing
|
|
48
|
-
* here knows what a checkpoint is. The racing kit consumes it; so could a traffic simulation, an
|
|
49
|
-
* AI overtaking line, a camera dolly, or a drone following a spline.
|
|
50
|
-
*/
|
|
51
|
-
export interface RacingLineStation {
|
|
52
|
-
/** Distance along the line from the start, in world units. */
|
|
53
|
-
readonly distance: number;
|
|
54
|
-
/**
|
|
55
|
-
* Unsigned radius of curvature at this station, world units.
|
|
56
|
-
*
|
|
57
|
-
* Signed curvature is what a controller wants for steering direction; a speed limit only cares
|
|
58
|
-
* how tight the corner is, not which way it goes. Use `Math.abs(1 / curvature)`, or
|
|
59
|
-
* `Number.POSITIVE_INFINITY` for a straight.
|
|
60
|
-
*/
|
|
61
|
-
readonly radius: number;
|
|
62
|
-
}
|
|
63
|
-
export interface RacingLineProfileSpec {
|
|
64
|
-
/** Stations in increasing distance order. At least two. */
|
|
65
|
-
readonly stations: readonly RacingLineStation[];
|
|
66
|
-
/** Total path length. On a closed loop this includes the closing segment back to station 0. */
|
|
67
|
-
readonly length: number;
|
|
68
|
-
/**
|
|
69
|
-
* Lateral acceleration the tyres can sustain, world units per second squared.
|
|
70
|
-
*
|
|
71
|
-
* This is the grip limit, and it is the number that sets corner speeds. For a vehicle running
|
|
72
|
-
* `createVehicleMotion`, it is `grip * tyrePeakFriction * gravity` in the same units the route
|
|
73
|
-
* is authored in.
|
|
74
|
-
*/
|
|
75
|
-
readonly lateralLimit: number;
|
|
76
|
-
/** Longitudinal acceleration available on exit, world units per second squared. */
|
|
77
|
-
readonly acceleration: number;
|
|
78
|
-
/** Braking deceleration available on entry, world units per second squared. Positive. */
|
|
79
|
-
readonly braking: number;
|
|
80
|
-
/** Straight-line speed ceiling, world units per second. */
|
|
81
|
-
readonly maxSpeed: number;
|
|
82
|
-
/** True when the last station connects back to the first. Defaults to `true`. */
|
|
83
|
-
readonly closed?: boolean | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* Lowest speed the profile may demand, so a hairpin tighter than the grip limit can hold does
|
|
86
|
-
* not resolve to a dead stop the car can never leave. Defaults to 5% of `maxSpeed`.
|
|
87
|
-
*/
|
|
88
|
-
readonly minSpeed?: number | undefined;
|
|
89
|
-
}
|
|
90
|
-
export interface RacingLineProfile {
|
|
91
|
-
readonly kind: "aura-racing-line-profile";
|
|
92
|
-
/** Target speed at each station, index-aligned with the input stations. */
|
|
93
|
-
readonly speeds: readonly number[];
|
|
94
|
-
/** Lap time implied by the profile, seconds. */
|
|
95
|
-
readonly lapSeconds: number;
|
|
96
|
-
/** Distance-weighted mean speed, which is `length / lapSeconds`. */
|
|
97
|
-
readonly averageSpeed: number;
|
|
98
|
-
readonly minSpeed: number;
|
|
99
|
-
readonly maxSpeed: number;
|
|
100
|
-
/**
|
|
101
|
-
* Target speed at an arbitrary distance along the line, interpolated between stations.
|
|
102
|
-
*
|
|
103
|
-
* This is what a driver model calls each frame: it has a distance from the route's progress and
|
|
104
|
-
* needs to know what speed to be doing, without caring where the stations happen to sit.
|
|
105
|
-
*/
|
|
106
|
-
speedAt(distance: number): number;
|
|
107
|
-
/**
|
|
108
|
-
* The lateral acceleration the profile demands at its tightest point.
|
|
109
|
-
*
|
|
110
|
-
* Exposed because it is the number that proves the profile is inside the vehicle's capability.
|
|
111
|
-
* A caller can assert it against the tyre's actual limit rather than assuming the solve worked.
|
|
112
|
-
*/
|
|
113
|
-
readonly peakLateralDemand: number;
|
|
114
|
-
}
|
|
115
|
-
export declare function createRacingLineProfile(spec: RacingLineProfileSpec): RacingLineProfile;
|
|
116
|
-
//# sourceMappingURL=RacingLineProfile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RacingLineProfile.d.ts","sourceRoot":"","sources":["../../../../packages/physics/src/RacingLineProfile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC1C,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAMD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,iBAAiB,CAmItF"}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Grip-limited speed profile along a closed racing line.
|
|
3
|
-
*
|
|
4
|
-
* ## The gap this closes
|
|
5
|
-
*
|
|
6
|
-
* WS-3.8 was attempted twice and reverted twice. Both attempts swapped the racing kit's
|
|
7
|
-
* kinematic `heading += steer * steerRate * dt` for the WS-3.3 force model, and both times the
|
|
8
|
-
* car could not lap its own certified circuit. The diagnosis recorded in the PRD was that a
|
|
9
|
-
* certified route encodes a *kinematic* contract, so moving to forces invalidates its lap time.
|
|
10
|
-
*
|
|
11
|
-
* That diagnosis was one step short. The actual defect is narrower and fixable: the route's
|
|
12
|
-
* speed model is `routeLength / authoredLapSeconds`, a **single constant speed for the whole
|
|
13
|
-
* lap**. A kinematic car can hold a constant speed through any corner, because its heading is
|
|
14
|
-
* an input rather than a consequence. A real car cannot — cornering at speed `v` through radius
|
|
15
|
-
* `r` demands lateral acceleration `v^2 / r`, and no tyre supplies an unbounded amount.
|
|
16
|
-
*
|
|
17
|
-
* On Aura3D's own certified circuit the two contracts are irreconcilable *as stated*: the
|
|
18
|
-
* tightest corner has radius 0.77 units, and holding the certified 4x pace of 4.312 u/s through
|
|
19
|
-
* it demands 24.15 u/s^2. That is why every previous attempt failed at the same corner, and why
|
|
20
|
-
* no steering gain or sign convention rescued it — the request was geometrically impossible, so
|
|
21
|
-
* the controller was never the problem.
|
|
22
|
-
*
|
|
23
|
-
* A real driver does not hold one speed. They brake for the corner, hold the grip limit through
|
|
24
|
-
* the apex, and accelerate out. Once the target is a *profile* rather than a constant, the same
|
|
25
|
-
* circuit is comfortably drivable: at a physical 0.41 g the lap comes out at 11.29 s against
|
|
26
|
-
* 4.312 u/s of straight-line speed, versus the 24.15 u/s^2 a constant-speed lap demanded. The
|
|
27
|
-
* certified average speed is preserved as what it always physically meant — a lap average — and
|
|
28
|
-
* the force model then has a target it can actually track.
|
|
29
|
-
*
|
|
30
|
-
* ## What this module is
|
|
31
|
-
*
|
|
32
|
-
* The standard two-pass forward/backward solve used by every real racing-line generator:
|
|
33
|
-
*
|
|
34
|
-
* 1. **Cornering limit.** At each station, `v <= sqrt(lateralLimit * radius)`, the fastest speed
|
|
35
|
-
* the tyre can hold through that radius. Straights are bounded by `maxSpeed` instead.
|
|
36
|
-
* 2. **Forward pass.** Acceleration is finite, so a station's speed is also bounded by how fast
|
|
37
|
-
* the car could have got there from the previous one: `v[i+1]^2 <= v[i]^2 + 2*a*ds`.
|
|
38
|
-
* 3. **Backward pass.** Braking is finite, so a station's speed is bounded by the need to be
|
|
39
|
-
* slow enough for what is coming: `v[i]^2 <= v[i+1]^2 + 2*b*ds`.
|
|
40
|
-
*
|
|
41
|
-
* Passes 2 and 3 are interdependent — braking earlier changes what you can accelerate from — so
|
|
42
|
-
* they are iterated to a fixed point rather than run once. On a closed loop this matters more
|
|
43
|
-
* than on an open one: the profile must also join up with itself at the start/finish line.
|
|
44
|
-
*
|
|
45
|
-
* ## Why it lives in `packages/physics`
|
|
46
|
-
*
|
|
47
|
-
* It is a property of a path and a friction limit, not of any route, genre kit or app. Nothing
|
|
48
|
-
* here knows what a checkpoint is. The racing kit consumes it; so could a traffic simulation, an
|
|
49
|
-
* AI overtaking line, a camera dolly, or a drone following a spline.
|
|
50
|
-
*/
|
|
51
|
-
function finitePositive(value, fallback) {
|
|
52
|
-
return Number.isFinite(value) && value > 0 ? value : fallback;
|
|
53
|
-
}
|
|
54
|
-
export function createRacingLineProfile(spec) {
|
|
55
|
-
const stations = spec.stations;
|
|
56
|
-
if (stations.length < 2) {
|
|
57
|
-
throw new Error("createRacingLineProfile requires at least 2 stations.");
|
|
58
|
-
}
|
|
59
|
-
const closed = spec.closed !== false;
|
|
60
|
-
const length = finitePositive(spec.length, 1);
|
|
61
|
-
const lateralLimit = finitePositive(spec.lateralLimit, 8);
|
|
62
|
-
const acceleration = finitePositive(spec.acceleration, 4);
|
|
63
|
-
const braking = finitePositive(spec.braking, 6);
|
|
64
|
-
const maxSpeed = finitePositive(spec.maxSpeed, 10);
|
|
65
|
-
const minSpeed = Math.min(maxSpeed, finitePositive(spec.minSpeed ?? maxSpeed * 0.05, maxSpeed * 0.05));
|
|
66
|
-
const count = stations.length;
|
|
67
|
-
/*
|
|
68
|
-
* Segment length *out of* station i. On a closed loop the final segment wraps to station 0
|
|
69
|
-
* using the declared total length, which is why `length` is a required input rather than
|
|
70
|
-
* something derived: the closing segment is not represented by any pair of stations.
|
|
71
|
-
*/
|
|
72
|
-
const segment = new Array(count);
|
|
73
|
-
for (let index = 0; index < count; index += 1) {
|
|
74
|
-
const here = stations[index].distance;
|
|
75
|
-
const next = index + 1 < count ? stations[index + 1].distance : length;
|
|
76
|
-
segment[index] = Math.max(1e-6, next - here);
|
|
77
|
-
}
|
|
78
|
-
// Pass 1: the cornering limit at each station.
|
|
79
|
-
const speeds = new Array(count);
|
|
80
|
-
for (let index = 0; index < count; index += 1) {
|
|
81
|
-
const radius = stations[index].radius;
|
|
82
|
-
const corner = Number.isFinite(radius) && radius > 0 ? Math.sqrt(lateralLimit * radius) : maxSpeed;
|
|
83
|
-
speeds[index] = Math.max(minSpeed, Math.min(maxSpeed, corner));
|
|
84
|
-
}
|
|
85
|
-
/*
|
|
86
|
-
* Passes 2 and 3 to a fixed point.
|
|
87
|
-
*
|
|
88
|
-
* A single forward pass then a single backward pass is correct only for an open path. On a
|
|
89
|
-
* closed loop each pass changes the boundary condition the other one started from, so they are
|
|
90
|
-
* repeated until nothing moves. The iteration is monotonically decreasing and bounded below by
|
|
91
|
-
* `minSpeed`, so it converges; the cap and the epsilon are there to bound the work, not to
|
|
92
|
-
* decide the answer.
|
|
93
|
-
*/
|
|
94
|
-
for (let iteration = 0; iteration < 64; iteration += 1) {
|
|
95
|
-
let changed = false;
|
|
96
|
-
// Forward: limited by acceleration out of the previous station.
|
|
97
|
-
const forwardLast = closed ? count : count - 1;
|
|
98
|
-
for (let index = 0; index < forwardLast; index += 1) {
|
|
99
|
-
const next = (index + 1) % count;
|
|
100
|
-
const bound = Math.sqrt(speeds[index] * speeds[index] + 2 * acceleration * segment[index]);
|
|
101
|
-
if (bound < speeds[next] - 1e-9) {
|
|
102
|
-
speeds[next] = Math.max(minSpeed, bound);
|
|
103
|
-
changed = true;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// Backward: limited by the need to brake for the next station.
|
|
107
|
-
for (let index = forwardLast - 1; index >= 0; index -= 1) {
|
|
108
|
-
const next = (index + 1) % count;
|
|
109
|
-
const bound = Math.sqrt(speeds[next] * speeds[next] + 2 * braking * segment[index]);
|
|
110
|
-
if (bound < speeds[index] - 1e-9) {
|
|
111
|
-
speeds[index] = Math.max(minSpeed, bound);
|
|
112
|
-
changed = true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
if (!changed)
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
/*
|
|
119
|
-
* Lap time from the profile.
|
|
120
|
-
*
|
|
121
|
-
* Using the mean of the two endpoint speeds over each segment is the trapezoidal rule, which is
|
|
122
|
-
* exact for the constant-acceleration segments this solve produces and avoids the systematic
|
|
123
|
-
* underestimate that taking the entry speed alone would give.
|
|
124
|
-
*/
|
|
125
|
-
let lapSeconds = 0;
|
|
126
|
-
const segmentCount = closed ? count : count - 1;
|
|
127
|
-
for (let index = 0; index < segmentCount; index += 1) {
|
|
128
|
-
const next = (index + 1) % count;
|
|
129
|
-
const mean = Math.max(1e-6, (speeds[index] + speeds[next]) / 2);
|
|
130
|
-
lapSeconds += segment[index] / mean;
|
|
131
|
-
}
|
|
132
|
-
let peakLateralDemand = 0;
|
|
133
|
-
for (let index = 0; index < count; index += 1) {
|
|
134
|
-
const radius = stations[index].radius;
|
|
135
|
-
if (Number.isFinite(radius) && radius > 0) {
|
|
136
|
-
peakLateralDemand = Math.max(peakLateralDemand, (speeds[index] * speeds[index]) / radius);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
const observedMin = Math.min(...speeds);
|
|
140
|
-
const observedMax = Math.max(...speeds);
|
|
141
|
-
function speedAt(distance) {
|
|
142
|
-
if (!Number.isFinite(distance))
|
|
143
|
-
return observedMin;
|
|
144
|
-
let along = closed ? ((distance % length) + length) % length : Math.max(0, Math.min(length, distance));
|
|
145
|
-
// Locate the segment containing `along`. Stations are sorted, so a scan is adequate at the
|
|
146
|
-
// station counts a hand- or asset-authored route produces.
|
|
147
|
-
let index = 0;
|
|
148
|
-
for (let probe = 0; probe < count; probe += 1) {
|
|
149
|
-
const here = stations[probe].distance;
|
|
150
|
-
const next = probe + 1 < count ? stations[probe + 1].distance : length;
|
|
151
|
-
if (along >= here && along < next) {
|
|
152
|
-
index = probe;
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
if (probe === count - 1)
|
|
156
|
-
index = probe;
|
|
157
|
-
}
|
|
158
|
-
const here = stations[index].distance;
|
|
159
|
-
const t = Math.max(0, Math.min(1, (along - here) / segment[index]));
|
|
160
|
-
const next = (index + 1) % count;
|
|
161
|
-
/*
|
|
162
|
-
* Interpolating `v^2` rather than `v` is what makes this consistent with the solve: between
|
|
163
|
-
* two stations the car is under constant acceleration, so `v^2` is linear in distance and `v`
|
|
164
|
-
* is not. Lerping `v` directly would report speeds the profile never actually demanded.
|
|
165
|
-
*/
|
|
166
|
-
const a = speeds[index] * speeds[index];
|
|
167
|
-
const b = speeds[next] * speeds[next];
|
|
168
|
-
return Math.sqrt(Math.max(0, a + (b - a) * t));
|
|
169
|
-
}
|
|
170
|
-
return {
|
|
171
|
-
kind: "aura-racing-line-profile",
|
|
172
|
-
speeds,
|
|
173
|
-
lapSeconds,
|
|
174
|
-
averageSpeed: length / Math.max(1e-6, lapSeconds),
|
|
175
|
-
minSpeed: observedMin,
|
|
176
|
-
maxSpeed: observedMax,
|
|
177
|
-
speedAt,
|
|
178
|
-
peakLateralDemand
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
//# sourceMappingURL=RacingLineProfile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RacingLineProfile.js","sourceRoot":"","sources":["../../../../packages/physics/src/RacingLineProfile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAqEH,SAAS,cAAc,CAAC,KAAa,EAAE,QAAgB;IACrD,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,IAA2B;IACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC;IACrC,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAA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AAG,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;QACtC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpE,MAAM,IAAI,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACjC;;;;WAIG;QACH,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,MAAM;QACN,UAAU;QACV,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC;QACjD,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,OAAO;QACP,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export interface SoftBodyFixtureOptions {
|
|
2
|
-
readonly seed?: number;
|
|
3
|
-
readonly elapsedSeconds?: number;
|
|
4
|
-
readonly divisions?: number;
|
|
5
|
-
}
|
|
6
|
-
export interface SoftBodySampleVertex {
|
|
7
|
-
readonly index: number;
|
|
8
|
-
readonly grid: readonly [number, number, number];
|
|
9
|
-
readonly attached: boolean;
|
|
10
|
-
readonly rest: readonly [number, number, number];
|
|
11
|
-
readonly position: readonly [number, number, number];
|
|
12
|
-
readonly displacement: number;
|
|
13
|
-
}
|
|
14
|
-
export interface SoftBodyFixture {
|
|
15
|
-
readonly id: "external-parity-old-branch-soft-body-fixture";
|
|
16
|
-
readonly source: "origin-master-softbody-tet-pbd-adapted";
|
|
17
|
-
readonly sourceFiles: readonly [
|
|
18
|
-
"origin/master:src/simulation/softbody/SoftBody.ts",
|
|
19
|
-
"origin/master:src/simulation/softbody/SoftBodySolver.ts",
|
|
20
|
-
"origin/master:src/simulation/softbody/TetMeshGenerator.ts"
|
|
21
|
-
];
|
|
22
|
-
readonly config: {
|
|
23
|
-
readonly method: "bounded-pbd-telemetry";
|
|
24
|
-
readonly materialModel: "bounded-corotated-reference";
|
|
25
|
-
readonly divisions: number;
|
|
26
|
-
readonly damping: number;
|
|
27
|
-
readonly solverIterations: number;
|
|
28
|
-
readonly volumeStiffness: number;
|
|
29
|
-
readonly shapeMatchingStiffness: number;
|
|
30
|
-
readonly distanceStiffness: number;
|
|
31
|
-
readonly particleMass: number;
|
|
32
|
-
};
|
|
33
|
-
readonly mesh: {
|
|
34
|
-
readonly vertexCount: number;
|
|
35
|
-
readonly tetrahedronCount: number;
|
|
36
|
-
readonly surfaceTriangleEstimate: number;
|
|
37
|
-
readonly distanceConstraintCount: number;
|
|
38
|
-
readonly attachmentCount: number;
|
|
39
|
-
readonly sampleVertices: readonly SoftBodySampleVertex[];
|
|
40
|
-
};
|
|
41
|
-
readonly deformation: {
|
|
42
|
-
readonly centerOfMass: readonly [number, number, number];
|
|
43
|
-
readonly restCenterOfMass: readonly [number, number, number];
|
|
44
|
-
readonly maxDisplacement: number;
|
|
45
|
-
readonly averageDisplacement: number;
|
|
46
|
-
readonly volumeRatio: number;
|
|
47
|
-
readonly restVolume: number;
|
|
48
|
-
readonly currentVolume: number;
|
|
49
|
-
readonly shapeMatchingError: number;
|
|
50
|
-
};
|
|
51
|
-
readonly collision: {
|
|
52
|
-
readonly groundPlaneY: number;
|
|
53
|
-
readonly contactVertices: number;
|
|
54
|
-
readonly maxPenetrationBeforeResolve: number;
|
|
55
|
-
readonly resolvedVertices: number;
|
|
56
|
-
readonly restitution: number;
|
|
57
|
-
readonly friction: number;
|
|
58
|
-
};
|
|
59
|
-
readonly attachments: {
|
|
60
|
-
readonly rigidAttachmentCount: number;
|
|
61
|
-
readonly targetOffset: readonly [number, number, number];
|
|
62
|
-
readonly maxAttachmentError: number;
|
|
63
|
-
readonly averageAttachmentError: number;
|
|
64
|
-
};
|
|
65
|
-
readonly blockedClaims: readonly string[];
|
|
66
|
-
readonly hash: string;
|
|
67
|
-
readonly claimBoundary: string;
|
|
68
|
-
}
|
|
69
|
-
export declare function sampleSoftBodyFixture(options?: SoftBodyFixtureOptions): SoftBodyFixture;
|
|
70
|
-
//# sourceMappingURL=SoftBodyFixtures.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SoftBodyFixtures.d.ts","sourceRoot":"","sources":["../../../../packages/physics/src/SoftBodyFixtures.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B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