@khr3/core 0.2.6 → 0.2.7
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/README.md +169 -9
- package/dist/KhrAssembly.d.ts +1 -1
- package/dist/KhrCollider.d.ts +5 -1
- package/dist/curves-Cf8okB-M.js +542 -0
- package/dist/curves-Cf8okB-M.js.map +1 -0
- package/dist/curves.js +1 -542
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -1544
- package/dist/index.js.map +1 -1
- package/dist/jointDynamics.d.ts +7 -0
- package/dist/khrClone.d.ts +3 -3
- package/dist/khrInertia-DgCUCDTx.js +247 -0
- package/dist/khrInertia-DgCUCDTx.js.map +1 -0
- package/dist/khrVehicleJointHelpers.d.ts +16 -0
- package/dist/khrVehicleJoints.d.ts +2 -1
- package/dist/khrVehicleSlots.d.ts +11 -3
- package/dist/{physicsEcs-dBq4psbC.js → physicsEcs-C00N5zCh.js} +27 -251
- package/dist/physicsEcs-C00N5zCh.js.map +1 -0
- package/dist/sand3d/sand3dAssemblyHelpers.d.ts +30 -0
- package/dist/sand3d/sand3dCavityOps.d.ts +15 -0
- package/dist/sand3d/sand3dCompiler.d.ts +121 -0
- package/dist/sand3d/sand3dEvaluator.d.ts +80 -0
- package/dist/sand3d/sand3dFramesAndEdits.d.ts +30 -0
- package/dist/sand3d/sand3dHullAndSweep.d.ts +27 -0
- package/dist/sand3d/sand3dParser.d.ts +6 -0
- package/dist/sand3d/sand3dPrimitives.d.ts +50 -0
- package/dist/sand3d/sand3dProfiles.d.ts +32 -0
- package/dist/sand3d/sand3dRecipes.d.ts +5 -0
- package/dist/sand3d/sand3dShellOp.d.ts +8 -0
- package/dist/sand3d/sand3dSolids.d.ts +32 -0
- package/dist/sand3d/sand3dTokenizer.d.ts +8 -0
- package/dist/sand3d/sand3dTypes.d.ts +157 -0
- package/dist/sand3d-DQ8-OMlo.js +5045 -0
- package/dist/sand3d-DQ8-OMlo.js.map +1 -0
- package/dist/sand3d.d.ts +23 -0
- package/dist/sand3d.js +1 -0
- package/dist/vehicle.js +198 -21
- package/dist/vehicle.js.map +1 -1
- package/dist/wheelLoads.d.ts +3 -1
- package/docs/api-reference.md +332 -163
- package/package.json +5 -1
- package/dist/curves.js.map +0 -1
- package/dist/physicsEcs-dBq4psbC.js.map +0 -1
package/dist/curves.js
CHANGED
|
@@ -1,542 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var HALF_PI = Math.PI * .5;
|
|
3
|
-
var MIN_KNOT_SPACING = .01;
|
|
4
|
-
var MAX_TANGENT_SECANT_RATIO = 2.85;
|
|
5
|
-
var MAX_RAD = 1.54;
|
|
6
|
-
function clamp(v, lo, hi) {
|
|
7
|
-
return v < lo ? lo : v > hi ? hi : v;
|
|
8
|
-
}
|
|
9
|
-
function uVal(x, axis) {
|
|
10
|
-
return axis === "lat" ? Math.sin(HALF_PI * x) : x;
|
|
11
|
-
}
|
|
12
|
-
function duVal(x, axis) {
|
|
13
|
-
return axis === "lat" ? HALF_PI * Math.cos(HALF_PI * x) : 1;
|
|
14
|
-
}
|
|
15
|
-
function pacejkaPhi(u, B, E) {
|
|
16
|
-
const bu = B * u;
|
|
17
|
-
return bu - E * (bu - Math.atan(bu));
|
|
18
|
-
}
|
|
19
|
-
function pacejkaYRaw(u, B, C, E) {
|
|
20
|
-
return Math.sin(C * Math.atan(pacejkaPhi(u, B, E)));
|
|
21
|
-
}
|
|
22
|
-
function pacejkaSlopeX(x, B, C, E, axis) {
|
|
23
|
-
const u = uVal(x, axis);
|
|
24
|
-
const bu = B * u;
|
|
25
|
-
const phi = pacejkaPhi(u, B, E);
|
|
26
|
-
const dphiDu = B * (1 - E + E / (1 + bu * bu));
|
|
27
|
-
return C * Math.cos(C * Math.atan(phi)) / (1 + phi * phi) * dphiDu * duVal(x, axis);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Exact 8-knot Fritsch-Carlson monotone Pacejka Magic Formula compiler for `ecctrl/curves`.
|
|
31
|
-
* - `"lng"`: `u = x` matching `ShapeCastWheel` `lngSlipRatio = |w*R - vx| / |vx|`.
|
|
32
|
-
* - `"lat"`: `u = sin((pi/2) * x)` matching `ShapeCastWheel` `latSlipRatio = atan2(|vy|, |vx|) / (pi/2)`.
|
|
33
|
-
*/
|
|
34
|
-
function compilePacejkaCurve(B, C, E, samples = 100, axis = "lng") {
|
|
35
|
-
let xPeak = 1;
|
|
36
|
-
if (C > 1) {
|
|
37
|
-
const targetPhi = Math.tan(Math.PI / (2 * C));
|
|
38
|
-
if (pacejkaPhi(1, B, E) >= targetPhi) {
|
|
39
|
-
let lo = 0;
|
|
40
|
-
let hi = 1;
|
|
41
|
-
for (let iter = 0; iter < 48; iter++) {
|
|
42
|
-
const mid = .5 * (lo + hi);
|
|
43
|
-
if (pacejkaPhi(uVal(mid, axis), B, E) >= targetPhi) hi = mid;
|
|
44
|
-
else lo = mid;
|
|
45
|
-
}
|
|
46
|
-
xPeak = hi;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const yPeakRaw = pacejkaYRaw(uVal(xPeak, axis), B, C, E);
|
|
50
|
-
const invYMax = yPeakRaw > 1e-6 ? 1 / yPeakRaw : 1;
|
|
51
|
-
const rawKnots = [
|
|
52
|
-
0,
|
|
53
|
-
.32 * xPeak,
|
|
54
|
-
.68 * xPeak,
|
|
55
|
-
xPeak,
|
|
56
|
-
xPeak + .06 * (1 - xPeak),
|
|
57
|
-
xPeak + .18 * (1 - xPeak),
|
|
58
|
-
xPeak + .48 * (1 - xPeak),
|
|
59
|
-
1
|
|
60
|
-
];
|
|
61
|
-
const knots = [0];
|
|
62
|
-
for (let i = 1; i < rawKnots.length - 1; i++) {
|
|
63
|
-
const k = rawKnots[i];
|
|
64
|
-
if (k - knots[knots.length - 1] >= MIN_KNOT_SPACING && 1 - k >= MIN_KNOT_SPACING) knots.push(k);
|
|
65
|
-
}
|
|
66
|
-
knots.push(1);
|
|
67
|
-
const ys = knots.map((x) => {
|
|
68
|
-
if (x === xPeak && C > 1 && yPeakRaw > 1e-6 && pacejkaPhi(1, B, E) >= Math.tan(Math.PI / (2 * C))) return 1;
|
|
69
|
-
return pacejkaYRaw(uVal(x, axis), B, C, E) * invYMax;
|
|
70
|
-
});
|
|
71
|
-
const secants = [];
|
|
72
|
-
for (let i = 0; i < knots.length - 1; i++) secants.push((ys[i + 1] - ys[i]) / (knots[i + 1] - knots[i]));
|
|
73
|
-
const slopes = knots.map((x, i) => {
|
|
74
|
-
if (x === xPeak && x < 1) return 0;
|
|
75
|
-
const mRaw = pacejkaSlopeX(x, B, C, E, axis) * invYMax;
|
|
76
|
-
if (i === 0) {
|
|
77
|
-
const s = secants[0];
|
|
78
|
-
if (Math.abs(s) <= 1e-9) return 0;
|
|
79
|
-
return clamp(mRaw / s, 0, MAX_TANGENT_SECANT_RATIO) * s;
|
|
80
|
-
}
|
|
81
|
-
if (i === knots.length - 1) {
|
|
82
|
-
const s = secants[secants.length - 1];
|
|
83
|
-
if (Math.abs(s) <= 1e-9) return 0;
|
|
84
|
-
return clamp(mRaw / s, 0, MAX_TANGENT_SECANT_RATIO) * s;
|
|
85
|
-
}
|
|
86
|
-
const sL = secants[i - 1];
|
|
87
|
-
const sR = secants[i];
|
|
88
|
-
if (sL * sR <= 0 || Math.abs(sL) <= 1e-9 || Math.abs(sR) <= 1e-9) return 0;
|
|
89
|
-
const minS = Math.abs(sL) <= Math.abs(sR) ? sL : sR;
|
|
90
|
-
return clamp(mRaw / minS, 0, MAX_TANGENT_SECANT_RATIO) * minS;
|
|
91
|
-
});
|
|
92
|
-
return {
|
|
93
|
-
points: knots.map((x, i) => {
|
|
94
|
-
const ang = clamp(Math.atan(slopes[i]), -1.54, MAX_RAD);
|
|
95
|
-
const pt = {
|
|
96
|
-
x: Number(x.toFixed(6)),
|
|
97
|
-
y: Number(ys[i].toFixed(6))
|
|
98
|
-
};
|
|
99
|
-
if (i > 0) {
|
|
100
|
-
pt.r_in = Number(ang.toFixed(6));
|
|
101
|
-
pt.w_in = 1;
|
|
102
|
-
}
|
|
103
|
-
if (i < knots.length - 1) {
|
|
104
|
-
pt.r_out = Number(ang.toFixed(6));
|
|
105
|
-
pt.w_out = 1;
|
|
106
|
-
}
|
|
107
|
-
return pt;
|
|
108
|
-
}),
|
|
109
|
-
samples
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/** Inverts `ShapeCastWheel` `(rayHitFriction + tireGripFactor) * 0.5 = muPeak`. */
|
|
113
|
-
function tireGripForSurface(muPeakLng, groundColliderFriction = .5) {
|
|
114
|
-
return Number((2 * muPeakLng - groundColliderFriction).toFixed(4));
|
|
115
|
-
}
|
|
116
|
-
/** Converts physical peak engine torque (N*m) into `carConfig.engineHorsepower` (`T * RPM / 7022`). */
|
|
117
|
-
function engineHorsepowerForPeakTorque(peakTorqueNm, engineMaxRPM) {
|
|
118
|
-
return Number((peakTorqueNm * engineMaxRPM / 7022).toFixed(1));
|
|
119
|
-
}
|
|
120
|
-
// src/curves.ts
|
|
121
|
-
var TIRE_ARCHETYPES = {
|
|
122
|
-
hypercarDry: {
|
|
123
|
-
lng: compilePacejkaCurve(11.2, 1.54, -.45, 100, "lng"),
|
|
124
|
-
lat: compilePacejkaCurve(11.6, 1.5, -.4, 100, "lat"),
|
|
125
|
-
muPeakLng: 1.38,
|
|
126
|
-
latFrictionEllipseScale: .97,
|
|
127
|
-
relaxLngRate: .04,
|
|
128
|
-
relaxLatRate: .06
|
|
129
|
-
},
|
|
130
|
-
streetDrift90s: {
|
|
131
|
-
lng: compilePacejkaCurve(8.8, 1.5, -.15, 80, "lng"),
|
|
132
|
-
lat: compilePacejkaCurve(9.2, 1.44, -.12, 80, "lat"),
|
|
133
|
-
muPeakLng: 1.08,
|
|
134
|
-
latFrictionEllipseScale: .97,
|
|
135
|
-
relaxLngRate: .05,
|
|
136
|
-
relaxLatRate: .1
|
|
137
|
-
},
|
|
138
|
-
offroad6x6At: {
|
|
139
|
-
lng: compilePacejkaCurve(6.2, 1.48, -.35, 80, "lng"),
|
|
140
|
-
lat: compilePacejkaCurve(6.6, 1.48, -.3, 80, "lat"),
|
|
141
|
-
muPeakLng: .85,
|
|
142
|
-
latFrictionEllipseScale: .87,
|
|
143
|
-
relaxLngRate: .12,
|
|
144
|
-
relaxLatRate: .24
|
|
145
|
-
},
|
|
146
|
-
gravelRally: {
|
|
147
|
-
lng: compilePacejkaCurve(5.8, 1.26, -.45, 80, "lng"),
|
|
148
|
-
lat: compilePacejkaCurve(6.4, 1.28, -.4, 80, "lat"),
|
|
149
|
-
muPeakLng: .74,
|
|
150
|
-
latFrictionEllipseScale: .92,
|
|
151
|
-
relaxLngRate: .08,
|
|
152
|
-
relaxLatRate: .16
|
|
153
|
-
},
|
|
154
|
-
wetAsphalt: {
|
|
155
|
-
lng: compilePacejkaCurve(12.8, 1.66, -.6, 100, "lng"),
|
|
156
|
-
lat: compilePacejkaCurve(12.2, 1.62, -.55, 100, "lat"),
|
|
157
|
-
muPeakLng: .8,
|
|
158
|
-
latFrictionEllipseScale: .95,
|
|
159
|
-
relaxLngRate: .05,
|
|
160
|
-
relaxLatRate: .09
|
|
161
|
-
},
|
|
162
|
-
snowIce: {
|
|
163
|
-
lng: compilePacejkaCurve(17.5, 1.64, -1.15, 120, "lng"),
|
|
164
|
-
lat: compilePacejkaCurve(16.5, 1.61, -1.05, 120, "lat"),
|
|
165
|
-
muPeakLng: .28,
|
|
166
|
-
latFrictionEllipseScale: .93,
|
|
167
|
-
relaxLngRate: .06,
|
|
168
|
-
relaxLatRate: .12
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var TIRE_SLIP_CURVES = {
|
|
172
|
-
streetRadial: TIRE_ARCHETYPES.streetDrift90s.lng,
|
|
173
|
-
driftProgressive: TIRE_ARCHETYPES.streetDrift90s.lat,
|
|
174
|
-
offroadLug: TIRE_ARCHETYPES.offroad6x6At.lng
|
|
175
|
-
};
|
|
176
|
-
var ENGINE_TORQUE_CURVES = {
|
|
177
|
-
w16QuadTurbo: {
|
|
178
|
-
samples: 80,
|
|
179
|
-
points: [
|
|
180
|
-
{
|
|
181
|
-
x: 0,
|
|
182
|
-
y: .62,
|
|
183
|
-
r_out: .85,
|
|
184
|
-
w_out: 1
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
x: .15,
|
|
188
|
-
y: .84,
|
|
189
|
-
r_in: 1.05,
|
|
190
|
-
r_out: 1.05,
|
|
191
|
-
w_in: 1,
|
|
192
|
-
w_out: 1
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
x: .27,
|
|
196
|
-
y: 1,
|
|
197
|
-
r_in: 0,
|
|
198
|
-
r_out: 0,
|
|
199
|
-
w_in: 1,
|
|
200
|
-
w_out: 1
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
x: .84,
|
|
204
|
-
y: 1,
|
|
205
|
-
r_in: 0,
|
|
206
|
-
r_out: 0,
|
|
207
|
-
w_in: 1,
|
|
208
|
-
w_out: 1
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
x: .95,
|
|
212
|
-
y: .962,
|
|
213
|
-
r_in: -.68,
|
|
214
|
-
r_out: -.68,
|
|
215
|
-
w_in: 1,
|
|
216
|
-
w_out: 1
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
x: 1,
|
|
220
|
-
y: .82,
|
|
221
|
-
r_in: -1.32,
|
|
222
|
-
w_in: 1
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
naScreamer: {
|
|
227
|
-
samples: 80,
|
|
228
|
-
points: [
|
|
229
|
-
{
|
|
230
|
-
x: 0,
|
|
231
|
-
y: .56,
|
|
232
|
-
r_out: .58,
|
|
233
|
-
w_out: 1
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
x: .25,
|
|
237
|
-
y: .74,
|
|
238
|
-
r_in: .55,
|
|
239
|
-
r_out: .55,
|
|
240
|
-
w_in: 1,
|
|
241
|
-
w_out: 1
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
x: .45,
|
|
245
|
-
y: .84,
|
|
246
|
-
r_in: .62,
|
|
247
|
-
r_out: .62,
|
|
248
|
-
w_in: 1,
|
|
249
|
-
w_out: 1
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
x: .68,
|
|
253
|
-
y: 1,
|
|
254
|
-
r_in: 0,
|
|
255
|
-
r_out: 0,
|
|
256
|
-
w_in: 1,
|
|
257
|
-
w_out: 1
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
x: .93,
|
|
261
|
-
y: .915,
|
|
262
|
-
r_in: -.66,
|
|
263
|
-
r_out: -.66,
|
|
264
|
-
w_in: 1,
|
|
265
|
-
w_out: 1
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
x: 1,
|
|
269
|
-
y: .8,
|
|
270
|
-
r_in: -1.12,
|
|
271
|
-
w_in: 1
|
|
272
|
-
}
|
|
273
|
-
]
|
|
274
|
-
},
|
|
275
|
-
heavyTurboDiesel: {
|
|
276
|
-
samples: 80,
|
|
277
|
-
points: [
|
|
278
|
-
{
|
|
279
|
-
x: 0,
|
|
280
|
-
y: .64,
|
|
281
|
-
r_out: 1.05,
|
|
282
|
-
w_out: 1
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
x: .14,
|
|
286
|
-
y: .88,
|
|
287
|
-
r_in: .98,
|
|
288
|
-
r_out: .98,
|
|
289
|
-
w_in: 1,
|
|
290
|
-
w_out: 1
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
x: .28,
|
|
294
|
-
y: 1,
|
|
295
|
-
r_in: 0,
|
|
296
|
-
r_out: 0,
|
|
297
|
-
w_in: 1,
|
|
298
|
-
w_out: 1
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
x: .44,
|
|
302
|
-
y: .975,
|
|
303
|
-
r_in: -.32,
|
|
304
|
-
r_out: -.32,
|
|
305
|
-
w_in: 1,
|
|
306
|
-
w_out: 1
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
x: .72,
|
|
310
|
-
y: .73,
|
|
311
|
-
r_in: -.92,
|
|
312
|
-
r_out: -.92,
|
|
313
|
-
w_in: 1,
|
|
314
|
-
w_out: 1
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
x: 1,
|
|
318
|
-
y: .28,
|
|
319
|
-
r_in: -1.08,
|
|
320
|
-
w_in: 1
|
|
321
|
-
}
|
|
322
|
-
]
|
|
323
|
-
},
|
|
324
|
-
evDirectDrive: {
|
|
325
|
-
samples: 80,
|
|
326
|
-
points: [
|
|
327
|
-
{
|
|
328
|
-
x: 0,
|
|
329
|
-
y: 1,
|
|
330
|
-
r_out: 0,
|
|
331
|
-
w_out: 1
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
x: .32,
|
|
335
|
-
y: 1,
|
|
336
|
-
r_in: 0,
|
|
337
|
-
r_out: -1.2611,
|
|
338
|
-
w_in: 1,
|
|
339
|
-
w_out: 1
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
x: .44,
|
|
343
|
-
y: .7273,
|
|
344
|
-
r_in: -1.0267,
|
|
345
|
-
r_out: -1.0267,
|
|
346
|
-
w_in: 1,
|
|
347
|
-
w_out: 1
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
x: .6,
|
|
351
|
-
y: .5333,
|
|
352
|
-
r_in: -.7266,
|
|
353
|
-
r_out: -.7266,
|
|
354
|
-
w_in: 1,
|
|
355
|
-
w_out: 1
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
x: .78,
|
|
359
|
-
y: .4103,
|
|
360
|
-
r_in: -.4842,
|
|
361
|
-
r_out: -.4842,
|
|
362
|
-
w_in: 1,
|
|
363
|
-
w_out: 1
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
x: 1,
|
|
367
|
-
y: .32,
|
|
368
|
-
r_in: -.3097,
|
|
369
|
-
w_in: 1
|
|
370
|
-
}
|
|
371
|
-
]
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
var STEER_SPEED_CURVES = {
|
|
375
|
-
progressiveHighway: {
|
|
376
|
-
samples: 80,
|
|
377
|
-
points: [
|
|
378
|
-
{
|
|
379
|
-
x: 0,
|
|
380
|
-
y: 1,
|
|
381
|
-
r_out: 0,
|
|
382
|
-
w_out: 1
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
x: .2,
|
|
386
|
-
y: 1,
|
|
387
|
-
r_in: 0,
|
|
388
|
-
r_out: 0,
|
|
389
|
-
w_in: 1,
|
|
390
|
-
w_out: 1
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
x: .5,
|
|
394
|
-
y: .62,
|
|
395
|
-
r_in: -.82,
|
|
396
|
-
r_out: -.82,
|
|
397
|
-
w_in: 1,
|
|
398
|
-
w_out: 1
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
x: 1,
|
|
402
|
-
y: .3,
|
|
403
|
-
r_in: -.35,
|
|
404
|
-
w_in: 1
|
|
405
|
-
}
|
|
406
|
-
]
|
|
407
|
-
},
|
|
408
|
-
driftCountersteer: {
|
|
409
|
-
samples: 80,
|
|
410
|
-
points: [
|
|
411
|
-
{
|
|
412
|
-
x: 0,
|
|
413
|
-
y: 1,
|
|
414
|
-
r_out: 0,
|
|
415
|
-
w_out: 1
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
x: .14,
|
|
419
|
-
y: 1,
|
|
420
|
-
r_in: 0,
|
|
421
|
-
r_out: 0,
|
|
422
|
-
w_in: 1,
|
|
423
|
-
w_out: 1
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
x: .3,
|
|
427
|
-
y: .72,
|
|
428
|
-
r_in: -1.02,
|
|
429
|
-
r_out: -1.02,
|
|
430
|
-
w_in: 1,
|
|
431
|
-
w_out: 1
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
x: .5,
|
|
435
|
-
y: .48,
|
|
436
|
-
r_in: -.74,
|
|
437
|
-
r_out: -.74,
|
|
438
|
-
w_in: 1,
|
|
439
|
-
w_out: 1
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
x: .75,
|
|
443
|
-
y: .32,
|
|
444
|
-
r_in: -.44,
|
|
445
|
-
r_out: -.44,
|
|
446
|
-
w_in: 1,
|
|
447
|
-
w_out: 1
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
x: 1,
|
|
451
|
-
y: .24,
|
|
452
|
-
r_in: -.2,
|
|
453
|
-
w_in: 1
|
|
454
|
-
}
|
|
455
|
-
]
|
|
456
|
-
},
|
|
457
|
-
evSingleGearGt: {
|
|
458
|
-
samples: 80,
|
|
459
|
-
points: [
|
|
460
|
-
{
|
|
461
|
-
x: 0,
|
|
462
|
-
y: 1,
|
|
463
|
-
r_out: 0,
|
|
464
|
-
w_out: 1
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
x: .08,
|
|
468
|
-
y: 1,
|
|
469
|
-
r_in: 0,
|
|
470
|
-
r_out: 0,
|
|
471
|
-
w_in: 1,
|
|
472
|
-
w_out: 1
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
x: .2,
|
|
476
|
-
y: .28,
|
|
477
|
-
r_in: -1.1,
|
|
478
|
-
r_out: -1.1,
|
|
479
|
-
w_in: 1,
|
|
480
|
-
w_out: 1
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
x: .5,
|
|
484
|
-
y: .11,
|
|
485
|
-
r_in: -.25,
|
|
486
|
-
r_out: -.25,
|
|
487
|
-
w_in: 1,
|
|
488
|
-
w_out: 1
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
x: 1,
|
|
492
|
-
y: .07,
|
|
493
|
-
r_in: 0,
|
|
494
|
-
w_in: 1
|
|
495
|
-
}
|
|
496
|
-
]
|
|
497
|
-
},
|
|
498
|
-
heavy6x6AntiRollover: {
|
|
499
|
-
samples: 80,
|
|
500
|
-
points: [
|
|
501
|
-
{
|
|
502
|
-
x: 0,
|
|
503
|
-
y: 1,
|
|
504
|
-
r_out: 0,
|
|
505
|
-
w_out: 1
|
|
506
|
-
},
|
|
507
|
-
{
|
|
508
|
-
x: .1,
|
|
509
|
-
y: .94,
|
|
510
|
-
r_in: -.45,
|
|
511
|
-
r_out: -.95,
|
|
512
|
-
w_in: 1,
|
|
513
|
-
w_out: 1
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
x: .28,
|
|
517
|
-
y: .42,
|
|
518
|
-
r_in: -1.12,
|
|
519
|
-
r_out: -.85,
|
|
520
|
-
w_in: 1,
|
|
521
|
-
w_out: 1
|
|
522
|
-
},
|
|
523
|
-
{
|
|
524
|
-
x: .55,
|
|
525
|
-
y: .19,
|
|
526
|
-
r_in: -.42,
|
|
527
|
-
r_out: -.22,
|
|
528
|
-
w_in: 1,
|
|
529
|
-
w_out: 1
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
x: 1,
|
|
533
|
-
y: .11,
|
|
534
|
-
r_in: -.1,
|
|
535
|
-
w_in: 1
|
|
536
|
-
}
|
|
537
|
-
]
|
|
538
|
-
}
|
|
539
|
-
};
|
|
540
|
-
export { ENGINE_TORQUE_CURVES, STEER_SPEED_CURVES, TIRE_ARCHETYPES, TIRE_SLIP_CURVES, compilePacejkaCurve, engineHorsepowerForPeakTorque, tireGripForSurface };
|
|
541
|
-
|
|
542
|
-
//# sourceMappingURL=curves.js.map
|
|
1
|
+
export { t as ENGINE_TORQUE_CURVES, n as STEER_SPEED_CURVES, r as TIRE_ARCHETYPES, i as TIRE_SLIP_CURVES, a as compilePacejkaCurve, o as engineHorsepowerForPeakTorque, s as tireGripForSurface } from "./curves-Cf8okB-M.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { PhysicsWorld, type PhysicsWorldProps, type TimeControlValue } from "./PhysicsWorld.js";
|
|
2
|
-
export { KhrValidationError, createKhrGltfPlugin, loadKhrGlb, type EcctrlPropellerTag, type EcctrlWheelTag, type KhrAssetBundle, type KhrBodySpec, type KhrBreakawaySpec, type KhrCarConfig, type KhrColliderShape, type KhrColliderSpec, type KhrCombineMode, type KhrDroneConfig, type KhrExportNodeSpec, type KhrImplicitShape, type KhrJointDriveSpec, type KhrJointSpec, type KhrPluginOptions, type LoadKhrGlbOptions, type OmiVehicleWheelSpec, type UseKhrGlbOptions, } from "./khrLoader.js";
|
|
2
|
+
export { KhrValidationError, createKhrGltfPlugin, loadKhrGlb, type EcctrlPropellerTag, type EcctrlWheelTag, type KhrAssetBundle, type KhrBodySpec, type KhrBreakawaySpec, type KhrCarConfig, type KhrColliderShape, type KhrColliderSpec, type KhrCombineMode, type KhrCurveData, type KhrCurvePoint, type KhrDroneConfig, type KhrExportNodeSpec, type KhrImplicitShape, type KhrJointDriveSpec, type KhrJointSpec, type KhrPluginOptions, type LoadKhrGlbOptions, type OmiVehicleWheelSpec, type UseKhrGlbOptions, } from "./khrLoader.js";
|
|
3
3
|
export { exportKhrGlb, patchGlbJsonChunk } from "./khrExporter.js";
|
|
4
4
|
export type { MutableGltfJson, RawGltfJson } from "./khrGlb.js";
|
|
5
5
|
export { claimBundleMount, cloneKhrBundle, disposeKhrBundle, releaseBundleMount } from "./khrClone.js";
|
|
6
6
|
export { assertIdentityWorldScale, assertSceneIdentityWorldScale, assertUnitScale } from "./khrInertia.js";
|
|
7
|
-
export { KhrCollider } from "./KhrCollider.js";
|
|
7
|
+
export { KhrCollider, type KhrColliderProps } from "./KhrCollider.js";
|
|
8
8
|
export { KhrAssembly, type KhrAssemblyHandle, type KhrAssemblyProps } from "./KhrAssembly.js";
|
|
9
9
|
export { useKhrGlb } from "./useKhrGlb.js";
|
|
10
10
|
export { JointRegistryContext, type JointRegistry, type JointRuntime } from "./physicsEcs.js";
|
|
11
|
+
export { SAND3D_RECIPES, SAND3D_RECIPE_MAP, buildSand3dRecipe, compileSand3dAssembly, exportSand3dGlb, findSand3dRecipe, isSand3dFileName, loadSand3dBundle, parseSand3dSource, s3d, type CompiledSand3dAssembly, type Sand3dAssembly, type Sand3dCompileInput, type Sand3dFaceSelector, type Sand3dFrame, type Sand3dJointDef, type Sand3dPartSpec, type Sand3dProfile, type Sand3dRecipe, type Sand3dRecipeId, type Sand3dSocketDef, type Sand3dSolid, type Sand3dThrusterDef, type Sand3dUnits, type Sand3dWheelDef, } from "./sand3d.js";
|