@helix3/helix-cli 0.1.22-helix3.418 → 0.1.22-helix3.419
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 +1 -1
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_abs.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_audio.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_engine.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_expression.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_jbeam.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_materials.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/test_beamng_engine.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/vendor/vehicle-package-v2.mjs +79 -9
- package/vendor/vehicle-package-v2.mjs +79 -9
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Generated dependency-free bundle of the HELIX engine Vehicle Package validator.
|
|
2
2
|
// Bridge JSON/schema preflight is deliberately separate below.
|
|
3
|
-
// Source commit:
|
|
3
|
+
// Source commit: f4facb0d466674ff5be1ac0c14c161add3ed0a9c
|
|
4
4
|
// Regenerate with scripts/vendor-vehicle-package-v2.mjs; do not edit by hand.
|
|
5
5
|
|
|
6
6
|
export const VEHICLE_PACKAGE_V2_SOURCE = Object.freeze({
|
|
7
|
-
"commit": "
|
|
7
|
+
"commit": "f4facb0d466674ff5be1ac0c14c161add3ed0a9c",
|
|
8
8
|
"path": "systems/humanoid-character/src/core/vehicle/package/format.ts",
|
|
9
9
|
"entries": [
|
|
10
10
|
"systems/humanoid-character/src/core/vehicle/package/format.ts",
|
|
@@ -14,7 +14,7 @@ export const VEHICLE_PACKAGE_V2_SOURCE = Object.freeze({
|
|
|
14
14
|
"systems/humanoid-character/src/core/vehicle/seats.ts",
|
|
15
15
|
"systems/humanoid-character/src/core/components/protocol.ts"
|
|
16
16
|
],
|
|
17
|
-
"closureSha256": "
|
|
17
|
+
"closureSha256": "6e317e16cf405cb37752387cb83a00dc57adcdc08bd60a7b522f8624c70c821b",
|
|
18
18
|
"files": {
|
|
19
19
|
"systems/humanoid-character/src/core/components/chain.ts": "b3e8c8783428321b41b17ac10785b0eb3028e4da754dc917456c2b8cc23b5212",
|
|
20
20
|
"systems/humanoid-character/src/core/components/protocol.ts": "8fd2fd613a813e6e6febe5518a7b8ef409aab4f4a1bc415d75546cd7547d64a7",
|
|
@@ -38,9 +38,9 @@ export const VEHICLE_PACKAGE_V2_SOURCE = Object.freeze({
|
|
|
38
38
|
"systems/humanoid-character/src/core/vehicle/specialty.ts": "dee622eb91f9feb6b7878ed625bee9880df12efa55389057ddd98751478833a0",
|
|
39
39
|
"systems/humanoid-character/src/core/vehicle/tuning.ts": "bd9124be7aa52123e1f60171ed0e8c3518c95a9748ac2c1b3f4720fd3030793f",
|
|
40
40
|
"systems/humanoid-character/src/core/vehicle/units.ts": "375973f504533cbcbc4e7dcb9a583b509cf79936ff366754588ad1d1a7bb9662",
|
|
41
|
-
"systems/humanoid-character/src/core/vehicle/v2/differential.ts": "
|
|
42
|
-
"systems/humanoid-character/src/core/vehicle/v2/driveline.ts": "
|
|
43
|
-
"systems/humanoid-character/src/core/vehicle/v2/solver.ts": "
|
|
41
|
+
"systems/humanoid-character/src/core/vehicle/v2/differential.ts": "9fac359097eb5edbaf5227bea0cf734ff4e7c6e71121ee7890761b1def27de51",
|
|
42
|
+
"systems/humanoid-character/src/core/vehicle/v2/driveline.ts": "fb012c5860284cebb3e715cec9f7d6a2f99ee39daa57cf41425c6f6c7d1a6a76",
|
|
43
|
+
"systems/humanoid-character/src/core/vehicle/v2/solver.ts": "c29e0214b8ae9af666d7fe14afdde5bf01c85100484d43a12e9694566f016fcc",
|
|
44
44
|
"systems/humanoid-character/src/core/vehicle/v2/turbine.ts": "15f19ebdf55112420c2e3fd638894619be40f1d1d779f86c260df44da72556c6",
|
|
45
45
|
"systems/humanoid-character/src/core/vehicle/v2/tyre.ts": "fe552d504237b5e44ec284ae0c2d3586e1fca1b39f36ba2158b36eef4229c60e",
|
|
46
46
|
"systems/humanoid-character/src/core/vehicle/vmath.ts": "d0717698413050a9a15a2cd22e61d95e339ab6cf48392c0c4820249099c64c6c",
|
|
@@ -4911,11 +4911,26 @@ const __defs = {
|
|
|
4911
4911
|
"use strict";
|
|
4912
4912
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4913
4913
|
exports.DIFF_STICK_DAMPING = exports.OMEGA_STICK = void 0;
|
|
4914
|
+
exports.slipMeteredFrontShare = slipMeteredFrontShare;
|
|
4914
4915
|
exports.openDifferential = openDifferential;
|
|
4915
4916
|
exports.differentialCapacity = differentialCapacity;
|
|
4916
4917
|
exports.splitDifferential = splitDifferential;
|
|
4917
4918
|
exports.reflectInertia = reflectInertia;
|
|
4918
4919
|
const vmath_js_1 = require("../vmath.js");
|
|
4920
|
+
function slipMeteredFrontShare(d, metered, omegaFront, omegaRear) {
|
|
4921
|
+
const base = (0, vmath_js_1.clamp)(d.torqueSplit, 0, 1);
|
|
4922
|
+
const gain = Math.max(0, metered.transferGain);
|
|
4923
|
+
const dOmega = omegaRear - omegaFront;
|
|
4924
|
+
if (dOmega > 0) {
|
|
4925
|
+
const room = (0, vmath_js_1.clamp)(metered.maxFrontShare ?? base, base, 1) - base;
|
|
4926
|
+
return room > 0 ? base + room * Math.tanh((gain * dOmega) / room) : base;
|
|
4927
|
+
}
|
|
4928
|
+
if (dOmega < 0) {
|
|
4929
|
+
const room = base - (0, vmath_js_1.clamp)(metered.minFrontShare ?? base, 0, base);
|
|
4930
|
+
return room > 0 ? base - room * Math.tanh((gain * -dOmega) / room) : base;
|
|
4931
|
+
}
|
|
4932
|
+
return base;
|
|
4933
|
+
}
|
|
4919
4934
|
exports.OMEGA_STICK = 0.5;
|
|
4920
4935
|
exports.DIFF_STICK_DAMPING = 0.5;
|
|
4921
4936
|
function openDifferential(torqueSplit = 0.5, gearRatio = 1) {
|
|
@@ -4939,13 +4954,13 @@ const __defs = {
|
|
|
4939
4954
|
}
|
|
4940
4955
|
}
|
|
4941
4956
|
}
|
|
4942
|
-
function splitDifferential(d, inputTorque, omegaA, omegaB, maxGain = Infinity) {
|
|
4957
|
+
function splitDifferential(d, inputTorque, omegaA, omegaB, maxGain = Infinity, shareA) {
|
|
4943
4958
|
const out = inputTorque * d.gearRatio;
|
|
4944
4959
|
const dOmega = omegaA - omegaB;
|
|
4945
4960
|
const capacity = differentialCapacity(d, out, dOmega);
|
|
4946
4961
|
const band = Math.max(exports.OMEGA_STICK, Number.isFinite(maxGain) && maxGain > 0 ? capacity / maxGain : 0);
|
|
4947
4962
|
const locking = capacity * Math.tanh(dOmega / band);
|
|
4948
|
-
const split = (0, vmath_js_1.clamp)(d.torqueSplit, 0, 1);
|
|
4963
|
+
const split = (0, vmath_js_1.clamp)(shareA ?? d.torqueSplit, 0, 1);
|
|
4949
4964
|
const carrierOmega = (omegaA + omegaB) / 2;
|
|
4950
4965
|
const loss = (d.friction + d.dynamicFriction * Math.abs(carrierOmega)) * Math.tanh(carrierOmega / exports.OMEGA_STICK);
|
|
4951
4966
|
const net = out - loss;
|
|
@@ -5134,7 +5149,10 @@ const __defs = {
|
|
|
5134
5149
|
if (spec.centre && spec.front && spec.rear) {
|
|
5135
5150
|
const iF = (2 * axleInertia(0)) / (spec.front.gearRatio * spec.front.gearRatio);
|
|
5136
5151
|
const iR = (2 * axleInertia(1)) / (spec.rear.gearRatio * spec.rear.gearRatio);
|
|
5137
|
-
const
|
|
5152
|
+
const metered = spec.centre.slipMetered;
|
|
5153
|
+
const c = metered === undefined
|
|
5154
|
+
? (0, differential_js_1.splitDifferential)(spec.centre, gearboxOut, frontCarrier, rearCarrier, gainFor(iF, iR))
|
|
5155
|
+
: (0, differential_js_1.splitDifferential)(spec.centre, gearboxOut, frontCarrier, rearCarrier, gainFor(iF, iR), (0, differential_js_1.slipMeteredFrontShare)(spec.centre, metered, frontCarrier, rearCarrier));
|
|
5138
5156
|
frontIn = c.a;
|
|
5139
5157
|
rearIn = c.b;
|
|
5140
5158
|
locking.centre = c.locking;
|
|
@@ -5338,6 +5356,49 @@ const __defs = {
|
|
|
5338
5356
|
issues.push({ path: `${path}.minTorque`, message: 'must be a number in [0, 1) — the least torque fraction the controller leaves' });
|
|
5339
5357
|
}
|
|
5340
5358
|
}
|
|
5359
|
+
const SLIP_METERED_MAX_GAIN = 5;
|
|
5360
|
+
function validateSlipMetered(centre, bothAxlesDriven, issues) {
|
|
5361
|
+
const path = 'driveline.centre.slipMetered';
|
|
5362
|
+
const metered = centre.slipMetered;
|
|
5363
|
+
if (!(0, paths_js_1.isPlainObject)(metered)) {
|
|
5364
|
+
issues.push({ path, message: 'must be an object { transferGain, maxFrontShare?, minFrontShare? }' });
|
|
5365
|
+
return;
|
|
5366
|
+
}
|
|
5367
|
+
if (!bothAxlesDriven)
|
|
5368
|
+
issues.push({ path, message: 'needs both a front and a rear differential (an AWD driveline)' });
|
|
5369
|
+
for (const key of Object.keys(metered)) {
|
|
5370
|
+
if (key !== 'transferGain' && key !== 'maxFrontShare' && key !== 'minFrontShare') {
|
|
5371
|
+
issues.push({ path: `${path}.${key}`, message: 'is not a slip-metered field (transferGain, maxFrontShare, minFrontShare)' });
|
|
5372
|
+
}
|
|
5373
|
+
}
|
|
5374
|
+
const gain = metered.transferGain;
|
|
5375
|
+
if (typeof gain !== 'number' || !Number.isFinite(gain) || gain <= 0 || gain > SLIP_METERED_MAX_GAIN) {
|
|
5376
|
+
issues.push({ path: `${path}.transferGain`, message: `must be a number in (0, ${SLIP_METERED_MAX_GAIN}] — front share moved per rad/s of axle-speed difference` });
|
|
5377
|
+
}
|
|
5378
|
+
const split = typeof centre.torqueSplit === 'number' ? centre.torqueSplit : NaN;
|
|
5379
|
+
const bound = (key) => {
|
|
5380
|
+
const v = metered[key];
|
|
5381
|
+
if (v === undefined)
|
|
5382
|
+
return undefined;
|
|
5383
|
+
if (typeof v !== 'number' || !Number.isFinite(v) || v < 0 || v > 1) {
|
|
5384
|
+
issues.push({ path: `${path}.${key}`, message: 'must be a share in [0, 1]' });
|
|
5385
|
+
return undefined;
|
|
5386
|
+
}
|
|
5387
|
+
return v;
|
|
5388
|
+
};
|
|
5389
|
+
const max = bound('maxFrontShare');
|
|
5390
|
+
const min = bound('minFrontShare');
|
|
5391
|
+
if (max !== undefined && Number.isFinite(split) && max < split) {
|
|
5392
|
+
issues.push({ path: `${path}.maxFrontShare`, message: `must be at least the centre's torqueSplit (${split}) — it is where the share goes when the rear slips` });
|
|
5393
|
+
}
|
|
5394
|
+
if (min !== undefined && Number.isFinite(split) && min > split) {
|
|
5395
|
+
issues.push({ path: `${path}.minFrontShare`, message: `must be at most the centre's torqueSplit (${split}) — it is where the share goes when the front slips` });
|
|
5396
|
+
}
|
|
5397
|
+
const moves = (max !== undefined && max !== split) || (min !== undefined && min !== split);
|
|
5398
|
+
if (!moves) {
|
|
5399
|
+
issues.push({ path, message: 'transfers nothing: set maxFrontShare above, or minFrontShare below, the centre torqueSplit' });
|
|
5400
|
+
}
|
|
5401
|
+
}
|
|
5341
5402
|
function validateLandSolverV2Authoring(value) {
|
|
5342
5403
|
const issues = [];
|
|
5343
5404
|
if (!(0, paths_js_1.isPlainObject)(value))
|
|
@@ -5363,6 +5424,15 @@ const __defs = {
|
|
|
5363
5424
|
if (!(0, paths_js_1.isPlainObject)(gearbox) || !Array.isArray(gearbox.ratios) || gearbox.ratios.length === 0) {
|
|
5364
5425
|
issues.push({ path: 'driveline.gearbox.ratios', message: 'needs at least one forward gear' });
|
|
5365
5426
|
}
|
|
5427
|
+
for (const axle of ['front', 'rear']) {
|
|
5428
|
+
const diff = driveline[axle];
|
|
5429
|
+
if ((0, paths_js_1.isPlainObject)(diff) && diff.slipMetered !== undefined) {
|
|
5430
|
+
issues.push({ path: `driveline.${axle}.slipMetered`, message: 'only the centre differential can be slip-metered' });
|
|
5431
|
+
}
|
|
5432
|
+
}
|
|
5433
|
+
if ((0, paths_js_1.isPlainObject)(driveline.centre) && driveline.centre.slipMetered !== undefined) {
|
|
5434
|
+
validateSlipMetered(driveline.centre, (0, paths_js_1.isPlainObject)(driveline.front) && (0, paths_js_1.isPlainObject)(driveline.rear), issues);
|
|
5435
|
+
}
|
|
5366
5436
|
if ((0, paths_js_1.isPlainObject)(driveline.turbine)) {
|
|
5367
5437
|
validatePointLut(driveline.turbine.pressureMap, 'driveline.turbine.pressureMap', issues);
|
|
5368
5438
|
validatePointLut(driveline.turbine.exhaustFactor, 'driveline.turbine.exhaustFactor', issues);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Generated dependency-free bundle of the HELIX engine Vehicle Package validator.
|
|
2
2
|
// Bridge JSON/schema preflight is deliberately separate below.
|
|
3
|
-
// Source commit:
|
|
3
|
+
// Source commit: f4facb0d466674ff5be1ac0c14c161add3ed0a9c
|
|
4
4
|
// Regenerate with scripts/vendor-vehicle-package-v2.mjs; do not edit by hand.
|
|
5
5
|
|
|
6
6
|
export const VEHICLE_PACKAGE_V2_SOURCE = Object.freeze({
|
|
7
|
-
"commit": "
|
|
7
|
+
"commit": "f4facb0d466674ff5be1ac0c14c161add3ed0a9c",
|
|
8
8
|
"path": "systems/humanoid-character/src/core/vehicle/package/format.ts",
|
|
9
9
|
"entries": [
|
|
10
10
|
"systems/humanoid-character/src/core/vehicle/package/format.ts",
|
|
@@ -14,7 +14,7 @@ export const VEHICLE_PACKAGE_V2_SOURCE = Object.freeze({
|
|
|
14
14
|
"systems/humanoid-character/src/core/vehicle/seats.ts",
|
|
15
15
|
"systems/humanoid-character/src/core/components/protocol.ts"
|
|
16
16
|
],
|
|
17
|
-
"closureSha256": "
|
|
17
|
+
"closureSha256": "6e317e16cf405cb37752387cb83a00dc57adcdc08bd60a7b522f8624c70c821b",
|
|
18
18
|
"files": {
|
|
19
19
|
"systems/humanoid-character/src/core/components/chain.ts": "b3e8c8783428321b41b17ac10785b0eb3028e4da754dc917456c2b8cc23b5212",
|
|
20
20
|
"systems/humanoid-character/src/core/components/protocol.ts": "8fd2fd613a813e6e6febe5518a7b8ef409aab4f4a1bc415d75546cd7547d64a7",
|
|
@@ -38,9 +38,9 @@ export const VEHICLE_PACKAGE_V2_SOURCE = Object.freeze({
|
|
|
38
38
|
"systems/humanoid-character/src/core/vehicle/specialty.ts": "dee622eb91f9feb6b7878ed625bee9880df12efa55389057ddd98751478833a0",
|
|
39
39
|
"systems/humanoid-character/src/core/vehicle/tuning.ts": "bd9124be7aa52123e1f60171ed0e8c3518c95a9748ac2c1b3f4720fd3030793f",
|
|
40
40
|
"systems/humanoid-character/src/core/vehicle/units.ts": "375973f504533cbcbc4e7dcb9a583b509cf79936ff366754588ad1d1a7bb9662",
|
|
41
|
-
"systems/humanoid-character/src/core/vehicle/v2/differential.ts": "
|
|
42
|
-
"systems/humanoid-character/src/core/vehicle/v2/driveline.ts": "
|
|
43
|
-
"systems/humanoid-character/src/core/vehicle/v2/solver.ts": "
|
|
41
|
+
"systems/humanoid-character/src/core/vehicle/v2/differential.ts": "9fac359097eb5edbaf5227bea0cf734ff4e7c6e71121ee7890761b1def27de51",
|
|
42
|
+
"systems/humanoid-character/src/core/vehicle/v2/driveline.ts": "fb012c5860284cebb3e715cec9f7d6a2f99ee39daa57cf41425c6f6c7d1a6a76",
|
|
43
|
+
"systems/humanoid-character/src/core/vehicle/v2/solver.ts": "c29e0214b8ae9af666d7fe14afdde5bf01c85100484d43a12e9694566f016fcc",
|
|
44
44
|
"systems/humanoid-character/src/core/vehicle/v2/turbine.ts": "15f19ebdf55112420c2e3fd638894619be40f1d1d779f86c260df44da72556c6",
|
|
45
45
|
"systems/humanoid-character/src/core/vehicle/v2/tyre.ts": "fe552d504237b5e44ec284ae0c2d3586e1fca1b39f36ba2158b36eef4229c60e",
|
|
46
46
|
"systems/humanoid-character/src/core/vehicle/vmath.ts": "d0717698413050a9a15a2cd22e61d95e339ab6cf48392c0c4820249099c64c6c",
|
|
@@ -4911,11 +4911,26 @@ const __defs = {
|
|
|
4911
4911
|
"use strict";
|
|
4912
4912
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4913
4913
|
exports.DIFF_STICK_DAMPING = exports.OMEGA_STICK = void 0;
|
|
4914
|
+
exports.slipMeteredFrontShare = slipMeteredFrontShare;
|
|
4914
4915
|
exports.openDifferential = openDifferential;
|
|
4915
4916
|
exports.differentialCapacity = differentialCapacity;
|
|
4916
4917
|
exports.splitDifferential = splitDifferential;
|
|
4917
4918
|
exports.reflectInertia = reflectInertia;
|
|
4918
4919
|
const vmath_js_1 = require("../vmath.js");
|
|
4920
|
+
function slipMeteredFrontShare(d, metered, omegaFront, omegaRear) {
|
|
4921
|
+
const base = (0, vmath_js_1.clamp)(d.torqueSplit, 0, 1);
|
|
4922
|
+
const gain = Math.max(0, metered.transferGain);
|
|
4923
|
+
const dOmega = omegaRear - omegaFront;
|
|
4924
|
+
if (dOmega > 0) {
|
|
4925
|
+
const room = (0, vmath_js_1.clamp)(metered.maxFrontShare ?? base, base, 1) - base;
|
|
4926
|
+
return room > 0 ? base + room * Math.tanh((gain * dOmega) / room) : base;
|
|
4927
|
+
}
|
|
4928
|
+
if (dOmega < 0) {
|
|
4929
|
+
const room = base - (0, vmath_js_1.clamp)(metered.minFrontShare ?? base, 0, base);
|
|
4930
|
+
return room > 0 ? base - room * Math.tanh((gain * -dOmega) / room) : base;
|
|
4931
|
+
}
|
|
4932
|
+
return base;
|
|
4933
|
+
}
|
|
4919
4934
|
exports.OMEGA_STICK = 0.5;
|
|
4920
4935
|
exports.DIFF_STICK_DAMPING = 0.5;
|
|
4921
4936
|
function openDifferential(torqueSplit = 0.5, gearRatio = 1) {
|
|
@@ -4939,13 +4954,13 @@ const __defs = {
|
|
|
4939
4954
|
}
|
|
4940
4955
|
}
|
|
4941
4956
|
}
|
|
4942
|
-
function splitDifferential(d, inputTorque, omegaA, omegaB, maxGain = Infinity) {
|
|
4957
|
+
function splitDifferential(d, inputTorque, omegaA, omegaB, maxGain = Infinity, shareA) {
|
|
4943
4958
|
const out = inputTorque * d.gearRatio;
|
|
4944
4959
|
const dOmega = omegaA - omegaB;
|
|
4945
4960
|
const capacity = differentialCapacity(d, out, dOmega);
|
|
4946
4961
|
const band = Math.max(exports.OMEGA_STICK, Number.isFinite(maxGain) && maxGain > 0 ? capacity / maxGain : 0);
|
|
4947
4962
|
const locking = capacity * Math.tanh(dOmega / band);
|
|
4948
|
-
const split = (0, vmath_js_1.clamp)(d.torqueSplit, 0, 1);
|
|
4963
|
+
const split = (0, vmath_js_1.clamp)(shareA ?? d.torqueSplit, 0, 1);
|
|
4949
4964
|
const carrierOmega = (omegaA + omegaB) / 2;
|
|
4950
4965
|
const loss = (d.friction + d.dynamicFriction * Math.abs(carrierOmega)) * Math.tanh(carrierOmega / exports.OMEGA_STICK);
|
|
4951
4966
|
const net = out - loss;
|
|
@@ -5134,7 +5149,10 @@ const __defs = {
|
|
|
5134
5149
|
if (spec.centre && spec.front && spec.rear) {
|
|
5135
5150
|
const iF = (2 * axleInertia(0)) / (spec.front.gearRatio * spec.front.gearRatio);
|
|
5136
5151
|
const iR = (2 * axleInertia(1)) / (spec.rear.gearRatio * spec.rear.gearRatio);
|
|
5137
|
-
const
|
|
5152
|
+
const metered = spec.centre.slipMetered;
|
|
5153
|
+
const c = metered === undefined
|
|
5154
|
+
? (0, differential_js_1.splitDifferential)(spec.centre, gearboxOut, frontCarrier, rearCarrier, gainFor(iF, iR))
|
|
5155
|
+
: (0, differential_js_1.splitDifferential)(spec.centre, gearboxOut, frontCarrier, rearCarrier, gainFor(iF, iR), (0, differential_js_1.slipMeteredFrontShare)(spec.centre, metered, frontCarrier, rearCarrier));
|
|
5138
5156
|
frontIn = c.a;
|
|
5139
5157
|
rearIn = c.b;
|
|
5140
5158
|
locking.centre = c.locking;
|
|
@@ -5338,6 +5356,49 @@ const __defs = {
|
|
|
5338
5356
|
issues.push({ path: `${path}.minTorque`, message: 'must be a number in [0, 1) — the least torque fraction the controller leaves' });
|
|
5339
5357
|
}
|
|
5340
5358
|
}
|
|
5359
|
+
const SLIP_METERED_MAX_GAIN = 5;
|
|
5360
|
+
function validateSlipMetered(centre, bothAxlesDriven, issues) {
|
|
5361
|
+
const path = 'driveline.centre.slipMetered';
|
|
5362
|
+
const metered = centre.slipMetered;
|
|
5363
|
+
if (!(0, paths_js_1.isPlainObject)(metered)) {
|
|
5364
|
+
issues.push({ path, message: 'must be an object { transferGain, maxFrontShare?, minFrontShare? }' });
|
|
5365
|
+
return;
|
|
5366
|
+
}
|
|
5367
|
+
if (!bothAxlesDriven)
|
|
5368
|
+
issues.push({ path, message: 'needs both a front and a rear differential (an AWD driveline)' });
|
|
5369
|
+
for (const key of Object.keys(metered)) {
|
|
5370
|
+
if (key !== 'transferGain' && key !== 'maxFrontShare' && key !== 'minFrontShare') {
|
|
5371
|
+
issues.push({ path: `${path}.${key}`, message: 'is not a slip-metered field (transferGain, maxFrontShare, minFrontShare)' });
|
|
5372
|
+
}
|
|
5373
|
+
}
|
|
5374
|
+
const gain = metered.transferGain;
|
|
5375
|
+
if (typeof gain !== 'number' || !Number.isFinite(gain) || gain <= 0 || gain > SLIP_METERED_MAX_GAIN) {
|
|
5376
|
+
issues.push({ path: `${path}.transferGain`, message: `must be a number in (0, ${SLIP_METERED_MAX_GAIN}] — front share moved per rad/s of axle-speed difference` });
|
|
5377
|
+
}
|
|
5378
|
+
const split = typeof centre.torqueSplit === 'number' ? centre.torqueSplit : NaN;
|
|
5379
|
+
const bound = (key) => {
|
|
5380
|
+
const v = metered[key];
|
|
5381
|
+
if (v === undefined)
|
|
5382
|
+
return undefined;
|
|
5383
|
+
if (typeof v !== 'number' || !Number.isFinite(v) || v < 0 || v > 1) {
|
|
5384
|
+
issues.push({ path: `${path}.${key}`, message: 'must be a share in [0, 1]' });
|
|
5385
|
+
return undefined;
|
|
5386
|
+
}
|
|
5387
|
+
return v;
|
|
5388
|
+
};
|
|
5389
|
+
const max = bound('maxFrontShare');
|
|
5390
|
+
const min = bound('minFrontShare');
|
|
5391
|
+
if (max !== undefined && Number.isFinite(split) && max < split) {
|
|
5392
|
+
issues.push({ path: `${path}.maxFrontShare`, message: `must be at least the centre's torqueSplit (${split}) — it is where the share goes when the rear slips` });
|
|
5393
|
+
}
|
|
5394
|
+
if (min !== undefined && Number.isFinite(split) && min > split) {
|
|
5395
|
+
issues.push({ path: `${path}.minFrontShare`, message: `must be at most the centre's torqueSplit (${split}) — it is where the share goes when the front slips` });
|
|
5396
|
+
}
|
|
5397
|
+
const moves = (max !== undefined && max !== split) || (min !== undefined && min !== split);
|
|
5398
|
+
if (!moves) {
|
|
5399
|
+
issues.push({ path, message: 'transfers nothing: set maxFrontShare above, or minFrontShare below, the centre torqueSplit' });
|
|
5400
|
+
}
|
|
5401
|
+
}
|
|
5341
5402
|
function validateLandSolverV2Authoring(value) {
|
|
5342
5403
|
const issues = [];
|
|
5343
5404
|
if (!(0, paths_js_1.isPlainObject)(value))
|
|
@@ -5363,6 +5424,15 @@ const __defs = {
|
|
|
5363
5424
|
if (!(0, paths_js_1.isPlainObject)(gearbox) || !Array.isArray(gearbox.ratios) || gearbox.ratios.length === 0) {
|
|
5364
5425
|
issues.push({ path: 'driveline.gearbox.ratios', message: 'needs at least one forward gear' });
|
|
5365
5426
|
}
|
|
5427
|
+
for (const axle of ['front', 'rear']) {
|
|
5428
|
+
const diff = driveline[axle];
|
|
5429
|
+
if ((0, paths_js_1.isPlainObject)(diff) && diff.slipMetered !== undefined) {
|
|
5430
|
+
issues.push({ path: `driveline.${axle}.slipMetered`, message: 'only the centre differential can be slip-metered' });
|
|
5431
|
+
}
|
|
5432
|
+
}
|
|
5433
|
+
if ((0, paths_js_1.isPlainObject)(driveline.centre) && driveline.centre.slipMetered !== undefined) {
|
|
5434
|
+
validateSlipMetered(driveline.centre, (0, paths_js_1.isPlainObject)(driveline.front) && (0, paths_js_1.isPlainObject)(driveline.rear), issues);
|
|
5435
|
+
}
|
|
5366
5436
|
if ((0, paths_js_1.isPlainObject)(driveline.turbine)) {
|
|
5367
5437
|
validatePointLut(driveline.turbine.pressureMap, 'driveline.turbine.pressureMap', issues);
|
|
5368
5438
|
validatePointLut(driveline.turbine.exhaustFactor, 'driveline.turbine.exhaustFactor', issues);
|