@khr3/core 0.1.5 → 0.2.1

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.
Files changed (46) hide show
  1. package/README.md +3 -114
  2. package/dist/AssemblyRootBody.d.ts +2 -3
  3. package/dist/KhrAssembly.d.ts +3 -5
  4. package/dist/KhrCollider.d.ts +1 -1
  5. package/dist/KhrVehicle.d.ts +5 -7
  6. package/dist/PhysicsWorld.d.ts +2 -2
  7. package/dist/assemblyPlan.d.ts +10 -9
  8. package/dist/curves.d.ts +11 -32
  9. package/dist/curves.js +141 -139
  10. package/dist/curves.js.map +1 -0
  11. package/dist/index.d.ts +3 -2
  12. package/dist/index.js +1708 -1284
  13. package/dist/index.js.map +1 -0
  14. package/dist/jointDynamics.d.ts +21 -17
  15. package/dist/khrBundleFinalize.d.ts +14 -0
  16. package/dist/khrConfigTypes.d.ts +62 -0
  17. package/dist/khrExportEncoders.d.ts +8 -0
  18. package/dist/khrExporter.d.ts +2 -1
  19. package/dist/khrExtras.d.ts +3 -3
  20. package/dist/khrGlb.d.ts +18 -0
  21. package/dist/khrJointParser.d.ts +3 -0
  22. package/dist/khrLoader.d.ts +2 -1
  23. package/dist/khrParsers.d.ts +5 -9
  24. package/dist/khrPlugin.d.ts +2 -3
  25. package/dist/khrPluginHelpers.d.ts +4 -0
  26. package/dist/khrRotorDecoders.d.ts +4 -0
  27. package/dist/khrShapeParser.d.ts +8 -0
  28. package/dist/khrTypes.d.ts +11 -103
  29. package/dist/khrVehicleChassis.d.ts +9 -17
  30. package/dist/khrVehicleJointHelpers.d.ts +22 -0
  31. package/dist/khrVehicleJoints.d.ts +22 -0
  32. package/dist/khrVehicleRotors.d.ts +22 -0
  33. package/dist/khrVehicleSlots.d.ts +17 -15
  34. package/dist/khrVehicleTypes.d.ts +52 -0
  35. package/dist/pacejka.d.ts +1 -1
  36. package/dist/physicsEcs-9H-Do7eX.js +1060 -0
  37. package/dist/physicsEcs-9H-Do7eX.js.map +1 -0
  38. package/dist/physicsEcs.d.ts +9 -45
  39. package/dist/useKhrGlb.d.ts +2 -2
  40. package/dist/vehicle.d.ts +2 -2
  41. package/dist/vehicle.js +821 -454
  42. package/dist/vehicle.js.map +1 -0
  43. package/dist/wheelLoads.d.ts +4 -7
  44. package/docs/api-reference.md +208 -0
  45. package/package.json +8 -7
  46. package/dist/BundleSceneHost-CE3HPB8a.js +0 -556
package/README.md CHANGED
@@ -2,126 +2,15 @@
2
2
 
3
3
  `KHR_physics_rigid_bodies` + `KHR_implicit_shapes` runtime loader, binary `.glb` exporter, `@react-three/rapier` multi-body assembly synchronizer, and `@pinkaphant/ecctrl` vehicle rig + monotone Pacejka curve presets for React Three Fiber.
4
4
 
5
- ## Stack Map (`@khr3/*` → `Kolmo`)
6
-
7
- All `@khr3/*` packages are **strictly `koota`-free** reusable building blocks; `Kolmo` owns the ECS, world generation, character body, and universal GLB intake gate:
8
-
9
- | Package | Role | `koota`? |
10
- | --- | --- | --- |
11
- | **`@khr3/core`** *(this package)* | `.glb` KHR physics loader/exporter, `<PhysicsWorld>`, `<KhrAssembly>`, `<KhrVehicle>`, `@khr3/core/curves` | No |
12
- | `@khr3/assets` | Cloudflare R2 `.glb` vault Worker/client + binary `inspectGlbBuffer` / `normalizeGlbBuffer` | No |
13
- | `@khr3/c12` | Exact architectural grid ($\mathbb{Z}[1/2, \sqrt{3}]$, `yaw12`), `3 m` socket snapping, `planSettlement` | No |
14
- | `@khr3/vehicles` | Multi-domain R2 vehicle catalog, multi-body `planCar` (`SEDAN_4DOOR`, `COUPE_2DOOR`), `@khr3/vehicles/paper-shell` | No |
15
- | `@khr3/launchers` | Moving-part launcher planner (`planLauncher`), rail/hand sockets, ammo catalog, `stepLauncher` | No |
16
- | `Kolmo` | Game engine & studio (`koota` ECS, `src/world/` roads & terrain, `src/body/`, Universal 2-Step GLB & USD Gate) | **Yes** |
17
-
18
- ## Install
19
-
20
- ```sh
21
- npm install @khr3/core @pinkaphant/ecctrl @dimforge/rapier3d-compat @react-three/fiber @react-three/rapier react react-dom three
22
- ```
23
-
24
- ### Peer Dependencies
25
-
26
- | Package | Version | Required By |
27
- | --- | --- | --- |
28
- | `@dimforge/rapier3d-compat` | `0.19.2` | `@khr3/core`, `@khr3/core/vehicle` |
29
- | `@pinkaphant/ecctrl` | `2.0.4-beta.2` | Optional (`@khr3/core/vehicle` only) |
30
- | `@react-three/fiber` | `^9.0.0` | `@khr3/core`, `@khr3/core/vehicle` |
31
- | `@react-three/rapier` | `^2.2.0` | `@khr3/core`, `@khr3/core/vehicle` |
32
- | `react` | `^19.0.0` | `@khr3/core`, `@khr3/core/vehicle` |
33
- | `react-dom` | `^19.0.0` | Optional (browser DOM apps) |
34
- | `three` | `>=0.159.0` | `@khr3/core`, `@khr3/core/vehicle` |
5
+ - Full API & configuration reference: [docs/api-reference.md](./docs/api-reference.md)
6
+ - Runnable example: [example/App.tsx](./example/App.tsx) & [example/headless.ts](./example/headless.ts)
35
7
 
36
8
  ## Subpath Exports
37
9
 
38
- `@khr3/core` ships strictly three ESM subpaths (`"sideEffects": false`, NodeNext `.d.ts` declarations):
39
-
40
10
  | Subpath | Exports |
41
11
  | --- | --- |
42
12
  | `@khr3/core` | `PhysicsWorld`, `createKhrGltfPlugin`, `useKhrGlb`, `loadKhrGlb`, `cloneKhrBundle`, `disposeKhrBundle`, `claimBundleMount`, `releaseBundleMount`, `exportKhrGlb`, `patchGlbJsonChunk`, `KhrCollider`, `KhrAssembly`, `JointRegistryContext`, `assertUnitScale`, `assertIdentityWorldScale`, `assertSceneIdentityWorldScale`, `KhrValidationError`, KHR & rotor tag types |
43
- | `@khr3/core/vehicle` | `KhrVehicle`, `solveWheelLoads`, `BENCH_GRAVITY`, `WHEEL_ASSEMBLY_DENSITY_KG_M3`, `KhrPropellerConfig`, `KhrVehicleProps`, `KhrWheelConfig`, `SolvedWheel` |
13
+ | `@khr3/core/vehicle` | `KhrVehicle`, `solveWheelLoads`, `KhrPropellerConfig`, `KhrVehicleJointsHandle`, `KhrVehicleProps`, `KhrWheelConfig`, `SolvedWheel` |
44
14
  | `@khr3/core/curves` | `compilePacejkaCurve`, `tireGripForSurface`, `engineHorsepowerForPeakTorque`, `TIRE_ARCHETYPES`, `TIRE_SLIP_CURVES`, `ENGINE_TORQUE_CURVES`, `STEER_SPEED_CURVES`, `TireArchetypePreset`, `CurveData`, `CurvePoint` |
45
15
 
46
- ## Quick Start
47
-
48
- ```tsx
49
- import { useRef } from "react";
50
- import { Canvas } from "@react-three/fiber";
51
- import type { EcctrlVehicleHandle } from "@pinkaphant/ecctrl/vehicle";
52
- import { KhrAssembly, PhysicsWorld, loadKhrGlb, type KhrAssemblyHandle } from "@khr3/core";
53
- import { KhrVehicle } from "@khr3/core/vehicle";
54
- import { ENGINE_TORQUE_CURVES, TIRE_ARCHETYPES, tireGripForSurface } from "@khr3/core/curves";
55
-
56
- const roadBundle = await loadKhrGlb(await fetch("/assets/city/R_Straight_6x6.glb").then((r) => r.arrayBuffer()));
57
- const doorBundle = await loadKhrGlb(await fetch("/assets/city/door_hinged_single_900x2100.glb").then((r) => r.arrayBuffer()));
58
- const carBundle = await loadKhrGlb(await fetch("/assets/cars/kolmogorov_hatchback.glb").then((r) => r.arrayBuffer()));
59
-
60
- export function Scene() {
61
- const doorRef = useRef<KhrAssemblyHandle>(null);
62
- const vehicleRef = useRef<EcctrlVehicleHandle>(null);
63
- const tire = TIRE_ARCHETYPES.streetDrift90s;
64
-
65
- return (
66
- <Canvas>
67
- <PhysicsWorld>
68
- <KhrAssembly bundle={roadBundle} fixedRoot />
69
- <KhrAssembly ref={doorRef} bundle={doorBundle} position={[3.6, 0.1, 0]} fixedRoot />
70
- <KhrVehicle
71
- ref={vehicleRef}
72
- bundle={carBundle}
73
- position={[0, 0.15, 0]}
74
- carConfig={{
75
- engineTorqueCurveData: ENGINE_TORQUE_CURVES.naScreamer,
76
- transmissionMode: "auto",
77
- gearRatios: [3.2, 2.1, 1.45, 1.0],
78
- shiftUpRPM: 5800,
79
- shiftDownRPM: 2600, // < 5800 * (1.0 / 1.45) = 4000 (hysteresis invariant)
80
- }}
81
- wheelConfig={{
82
- tireGripFactor: tireGripForSurface(tire.muPeakLng, 0.8),
83
- lngSlipRatioCurveData: tire.lng,
84
- latSlipRatioCurveData: tire.lat,
85
- latFrictionEllipseScale: tire.latFrictionEllipseScale,
86
- }}
87
- frontWheelConfig={{ driveTorqueWeight: 0.35 }}
88
- rearWheelConfig={{ driveTorqueWeight: 0.65 }}
89
- />
90
- </PhysicsWorld>
91
- </Canvas>
92
- );
93
- }
94
- ```
95
-
96
- ## Loading Assets
97
-
98
- ```tsx
99
- import { Suspense } from "react";
100
- import { KhrAssembly, useKhrGlb, disposeKhrBundle } from "@khr3/core";
101
-
102
- function Door() {
103
- const bundle = useKhrGlb("/assets/city/door_hinged_single_900x2100.glb"); // Suspense + cache, clones per call site
104
- return <KhrAssembly bundle={bundle} />;
105
- }
106
- ```
107
-
108
- - `useKhrGlb(url)` suspends, caches by URL, and returns a per-instance clone; `createKhrGltfPlugin()` registers the same decoder on any `GLTFLoader`; `loadKhrGlb(bytes)` is the headless/buffer path.
109
- - Call `disposeKhrBundle(template)` once when an asset is retired.
110
- - `<PhysicsWorld>` steps Rapier directly in `useFrame` with clamped `maxDelta` and `timeScale`; `@pinkaphant/ecctrl` is an optional peer required only by `@khr3/core/vehicle` (`@khr3/core/curves` is zero-dependency TypeScript math).
111
- - Peer range for `three` is `>=0.159.0`.
112
-
113
- ## Core Architecture & Invariants
114
-
115
- 1. **Bundle Ownership & Zero-Reparse Cloning (`cloneKhrBundle`)**: `loadKhrGlb(source)` constructs live `THREE.Object3D` nodes (`bundle.scene`, `w.object`, `p.object`). Mount each `KhrAssetBundle` in at most **one** `<KhrAssembly>` or `<KhrVehicle>` at a time; parse once with `loadKhrGlb(bytes)` and call `cloneKhrBundle(template)` per tiled road, prop, or vehicle instance (cloning only the lightweight `Object3D` hierarchy while sharing GPU `BufferGeometry`/`Material` buffers and Rapier `Float32Array` collider vertices). Sequential `mount -> unmount -> remount` of a single bundle is safe, and swapping the `bundle` prop cleanly remounts Rapier bodies and joints via `key={bundle.scene.uuid}`.
116
- 2. **CoM-Aligned Vehicle RigidBody (`body.translation() === body.worldCom()`)**: `<KhrVehicle>` offsets the underlying `<EcctrlVehicle>` Rapier `RigidBody` spawn to `position + R(spawnQuat) * chassisCom` and shifts local chassis colliders, `bundle.scene`, `children`, `<ShapeCastWheel>`, and `<ThrustPropeller>` mounts by `-chassisCom`. World-space visual and collider poses at `position` remain unchanged while `EcctrlVehicle` wheel lever arms (`rayOrigin - body.translation()`) act directly about the true center of mass, preserving authored CG height and parallel-axis inertia without artificial rollover or pitch coupling.
117
- 3. **glTF & Rapier Safety**:
118
- - `exportKhrGlb` emits `KHR_physics_rigid_bodies` and `KHR_implicit_shapes` strictly in `extensionsUsed` (never `extensionsRequired`).
119
- - `KhrCollider` sets `density: 0` (exact mass/CoM/inertia are applied once via `setAdditionalMassProperties`) and omits `collisionGroups` whenever `undefined` so Rapier WASM never coerces `undefined` to `0x00000000`.
120
- 4. **5 `@pinkaphant/ecctrl` v2 Curve & Grip Invariants**:
121
- - **Surface Grip Averaging**: `ShapeCastWheel` computes $\mu_{\text{eff}} = \frac{1}{2}(\mu_{\text{ground}} + \text{tireGripFactor})$. Use `tireGripForSurface(muPeak, muGround)` (`2 * muPeak - muGround`).
122
- - **Peak Torque Scaling**: `EcctrlVehicle` computes $T_{\max} = \frac{\text{engineHorsepower} \times 7022}{\text{engineMaxRPM}}$. Use `engineHorsepowerForPeakTorque(peakTorqueNm, engineMaxRPM)`.
123
- - **Slip Domains**: `lngSlipRatioCurveData` maps $x = \frac{|\omega R - v_x|}{\max(|v_x|, 10^{-4})} \in [0, 1]$; `latSlipRatioCurveData` maps slip angle linearly as $x = \frac{\operatorname{atan2}(|v_y|, |v_x|)}{\pi/2} \in [0, 1]$.
124
- - **Monotone Hermite Tangents**: `CurvePoint` `r_in`/`r_out` are **radian angles** (`slope = Math.tan(r)`). `compilePacejkaCurve` enforces Fritsch–Carlson clamping so `bakeCurveLUT` stays strictly in $[0, 1]$ with zero Hermite overshoot.
125
- - **Shift Hysteresis & Gear-Relative Steer Curve**: Auto transmission requires `shiftDownRPM < shiftUpRPM * min(g[i+1] / g[i])` to prevent shift oscillation; `steerAngleCurveData` evaluates at `v_fwd / (maxWheelAngVel * R)` relative to the **active gear's** redline wheel speed.
126
-
127
16
  See [docs/api-reference.md](./docs/api-reference.md) for the complete API, `.glb` KHR + `extras` schema, custom gravity, transmission, and curve reference.
@@ -5,13 +5,12 @@ import { type JointRuntime } from "./physicsEcs.js";
5
5
  export type AssemblyRigidBodyProps = Omit<RigidBodyProps, "type" | "position" | "rotation" | "quaternion" | "colliders" | "children" | "ref">;
6
6
  export interface AssemblyRootBodyProps {
7
7
  plan: RootPlan;
8
- assemblyId: number;
9
8
  position: [number, number, number];
10
9
  quaternion: [number, number, number, number];
11
10
  fixedRoot: boolean;
12
11
  rigidBodyProps?: AssemblyRigidBodyProps;
13
- onBody: (rootName: string, rb: React.RefObject<RapierRigidBody | null> | null) => void;
12
+ onBody: (nodeName: string, rb: React.RefObject<RapierRigidBody | null> | null) => void;
14
13
  onJoints: (rootName: string, joints: Map<string, JointRuntime> | null) => void;
15
14
  children?: React.ReactNode;
16
15
  }
17
- export declare function AssemblyRootBody({ plan, assemblyId, position, quaternion, fixedRoot, rigidBodyProps, onBody, onJoints, children, }: AssemblyRootBodyProps): React.JSX.Element;
16
+ export declare function AssemblyRootBody({ plan, position, quaternion, fixedRoot, rigidBodyProps, onBody, onJoints, children, }: AssemblyRootBodyProps): React.JSX.Element;
@@ -4,11 +4,11 @@ import type { RapierRigidBody } from "@react-three/rapier";
4
4
  import { type AssemblyRigidBodyProps } from "./AssemblyRootBody.js";
5
5
  import { type KhrAssetBundle } from "./khrTypes.js";
6
6
  export interface KhrAssemblyHandle {
7
- /** RigidBody carrying `nodeName` (the root body for articulated compound parts), or null if no KHR body has that name. */
7
+ /** RigidBody owning `nodeName`, or null if no KHR body has that name. */
8
8
  getBody: (nodeName: string) => RapierRigidBody | null;
9
- /** Sets the authored drive's position target on one articulated node. */
9
+ /** Sets the authored Rapier motor position target on one articulated node. */
10
10
  setJointTarget: (nodeName: string, target: number) => void;
11
- /** Sets the position target on every articulated node whose `extras.role` matches. */
11
+ /** Sets the motor position target on every articulated node whose `extras.role` matches. */
12
12
  setRoleTarget: (role: string, target: number) => void;
13
13
  }
14
14
  type GroupProps = Omit<ThreeElements["group"], "ref" | "position" | "rotation" | "quaternion" | "scale" | "children">;
@@ -18,9 +18,7 @@ export interface KhrAssemblyProps extends GroupProps {
18
18
  position?: [number, number, number];
19
19
  rotation?: [number, number, number];
20
20
  quaternion?: [number, number, number, number];
21
- /** Must be 1: assets are baked to identity scale by the importer gate. */
22
21
  scale?: ThreeElements["group"]["scale"];
23
- /** Kinematic roots become `fixed` bodies instead of `kinematicPosition`. */
24
22
  fixedRoot?: boolean;
25
23
  rigidBodyProps?: AssemblyRigidBodyProps;
26
24
  children?: React.ReactNode;
@@ -7,7 +7,7 @@ export interface KhrColliderProps {
7
7
  /** Pose override in the parent RigidBody frame; defaults to the authored KHR collider offset. */
8
8
  position?: [number, number, number];
9
9
  quaternion?: [number, number, number, number];
10
- /** Authored body mass carried by this collider. Without it the collider is massless (density 0). */
10
+ /** Authored body mass carried declaratively by this collider (`density: 0` when omitted). */
11
11
  massProperties?: ColliderMass;
12
12
  ref?: React.Ref<RapierCollider>;
13
13
  }
@@ -1,22 +1,20 @@
1
1
  import React from "react";
2
2
  import { type EcctrlVehicleHandle, type EcctrlVehicleProps } from "@pinkaphant/ecctrl/vehicle";
3
3
  import { type KhrAssetBundle, type KhrCarConfig, type KhrDroneConfig } from "./khrTypes.js";
4
- import { type KhrPropellerConfig, type KhrPropellerConfigSelector, type KhrWheelConfig, type KhrWheelConfigSelector } from "./khrVehicleChassis.js";
5
- export { solveWheelLoads, type SolvedWheel } from "./wheelLoads.js";
6
- export type { KhrPropellerConfig, KhrPropellerConfigSelector, KhrWheelConfig, KhrWheelConfigSelector };
7
- /** Default wheel + tire assembly density (kg/m^3) when `.glb` omits `ecctrlWheel.wheelDensity`. */
8
- export declare const WHEEL_ASSEMBLY_DENSITY_KG_M3 = 220;
4
+ import { type KhrVehicleJointsHandle } from "./khrVehicleJoints.js";
5
+ import { type KhrPropellerConfig, type KhrWheelConfig } from "./khrVehicleRotors.js";
6
+ import { solveWheelLoads, type SolvedWheel } from "./wheelLoads.js";
7
+ export { solveWheelLoads, type KhrPropellerConfig, type KhrVehicleJointsHandle, type KhrWheelConfig, type SolvedWheel, };
9
8
  export interface KhrVehicleProps extends Omit<EcctrlVehicleProps, "ref" | "carConfig" | "droneConfig"> {
10
9
  ref?: React.Ref<EcctrlVehicleHandle>;
11
10
  bundle: KhrAssetBundle;
12
11
  vehicleRef?: React.RefObject<EcctrlVehicleHandle | null>;
12
+ jointsRef?: React.Ref<KhrVehicleJointsHandle>;
13
13
  carConfig?: Partial<KhrCarConfig>;
14
14
  droneConfig?: Partial<KhrDroneConfig>;
15
15
  wheelConfig?: KhrWheelConfig;
16
16
  frontWheelConfig?: KhrWheelConfig;
17
17
  rearWheelConfig?: KhrWheelConfig;
18
- wheelConfigs?: KhrWheelConfigSelector;
19
18
  propellerConfig?: KhrPropellerConfig;
20
- propellerConfigs?: KhrPropellerConfigSelector;
21
19
  }
22
20
  export declare function KhrVehicle({ scale, colliders, bundle, ...rest }: KhrVehicleProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type ReactNode, type RefObject } from "react";
1
+ import React, { type ReactNode, type RefObject } from "react";
2
2
  import { type PhysicsProps } from "@react-three/rapier";
3
3
  export type TimeControlValue = number | RefObject<number>;
4
4
  export interface PhysicsWorldProps extends Omit<PhysicsProps, "paused" | "timeStep" | "gravity" | "children"> {
@@ -8,4 +8,4 @@ export interface PhysicsWorldProps extends Omit<PhysicsProps, "paused" | "timeSt
8
8
  gravity?: [number, number, number];
9
9
  children: ReactNode;
10
10
  }
11
- export declare function PhysicsWorld({ paused, timeScale, maxDelta, gravity, children, ...physicsProps }: PhysicsWorldProps): import("react").JSX.Element;
11
+ export declare function PhysicsWorld({ paused, timeScale, maxDelta, gravity, children, ...physicsProps }: PhysicsWorldProps): React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import * as THREE from "three";
2
+ import { type LumpedMassProps } from "./khrMassProps.js";
2
3
  import { type KhrAssetBundle, type KhrBodySpec, type KhrColliderSpec, type KhrJointSpec } from "./khrTypes.js";
3
4
  type Vec3 = [number, number, number];
4
5
  type Quat = [number, number, number, number];
@@ -23,38 +24,38 @@ export interface ColliderMass {
23
24
  }
24
25
  export interface PlannedCollider {
25
26
  spec: KhrColliderSpec;
26
- /** Pose in the owning body's local frame. */
27
27
  local: THREE.Matrix4;
28
- /** Rest pose in the root body frame. */
29
28
  position: Vec3;
30
29
  quaternion: Quat;
31
- /** Composite mass properties carried by the stationary root's first collider; moving child colliders stay massless. */
32
30
  massProperties?: ColliderMass;
33
31
  }
34
32
  export interface PartPlan {
35
33
  spec: KhrBodySpec;
36
34
  joint: KhrJointSpec;
37
35
  parent: PartPlan | null;
38
- restRelParent: THREE.Matrix4;
36
+ restRelParentPos: Vec3;
37
+ restRelParentQuat: Quat;
38
+ restRelRootPos: Vec3;
39
+ restRelRootQuat: Quat;
40
+ axisParent: Vec3;
41
+ axisChild: Vec3;
39
42
  inertia: number;
43
+ partMass?: ColliderMass;
40
44
  colliders: PlannedCollider[];
41
45
  }
42
46
  export interface RootPlan {
43
47
  spec: KhrBodySpec;
44
- /** Pose of `bundle.scene` in this root body's local frame (used when `plans.length === 1`). */
45
48
  sceneInRootPos: Vec3;
46
49
  sceneInRootQuat: Quat;
47
- /** Disjoint glTF subtree root that rides on this body when `plans.length > 1`. */
48
50
  mountNode: THREE.Object3D;
49
51
  mountInRoot: THREE.Matrix4;
50
52
  mountPosition: Vec3;
51
53
  mountQuaternion: Quat;
52
- /** Composite mass properties in the root RigidBody frame when `colliders` is empty on a dynamic root. */
53
54
  rootMass?: ColliderMass;
54
55
  colliders: PlannedCollider[];
55
- /** Parent-first order. */
56
56
  parts: PartPlan[];
57
57
  }
58
- /** Splits a bundle into one rigid body per jointless root; jointed bodies become articulated compound parts of their root. */
58
+ export declare function toColliderMass(lumped: LumpedMassProps, colMat?: THREE.Matrix4, colQuat?: THREE.Quaternion): ColliderMass;
59
+ /** Plans independent Rapier bodies for roots and jointed dynamic children connected by Rapier ImpulseJoints. */
59
60
  export declare function planAssembly(bundle: KhrAssetBundle): RootPlan[];
60
61
  export {};
package/dist/curves.d.ts CHANGED
@@ -97,13 +97,13 @@ export declare const ENGINE_TORQUE_CURVES: {
97
97
  readonly x: 0.95;
98
98
  readonly y: 0.962;
99
99
  readonly r_in: -0.68;
100
- readonly r_out: -1.45;
100
+ readonly r_out: -0.68;
101
101
  readonly w_in: 1;
102
102
  readonly w_out: 1;
103
103
  }, {
104
104
  readonly x: 1;
105
- readonly y: 0;
106
- readonly r_in: 0;
105
+ readonly y: 0.82;
106
+ readonly r_in: -1.32;
107
107
  readonly w_in: 1;
108
108
  }];
109
109
  };
@@ -142,17 +142,10 @@ export declare const ENGINE_TORQUE_CURVES: {
142
142
  readonly r_out: -0.66;
143
143
  readonly w_in: 1;
144
144
  readonly w_out: 1;
145
- }, {
146
- readonly x: 0.96;
147
- readonly y: 0.86;
148
- readonly r_in: -1.05;
149
- readonly r_out: -1.45;
150
- readonly w_in: 1;
151
- readonly w_out: 1;
152
145
  }, {
153
146
  readonly x: 1;
154
- readonly y: 0;
155
- readonly r_in: 0;
147
+ readonly y: 0.8;
148
+ readonly r_in: -1.12;
156
149
  readonly w_in: 1;
157
150
  }];
158
151
  };
@@ -191,17 +184,10 @@ export declare const ENGINE_TORQUE_CURVES: {
191
184
  readonly r_out: -0.92;
192
185
  readonly w_in: 1;
193
186
  readonly w_out: 1;
194
- }, {
195
- readonly x: 0.94;
196
- readonly y: 0.36;
197
- readonly r_in: -1.02;
198
- readonly r_out: -1.35;
199
- readonly w_in: 1;
200
- readonly w_out: 1;
201
187
  }, {
202
188
  readonly x: 1;
203
- readonly y: 0;
204
- readonly r_in: 0;
189
+ readonly y: 0.28;
190
+ readonly r_in: -1.08;
205
191
  readonly w_in: 1;
206
192
  }];
207
193
  };
@@ -240,17 +226,10 @@ export declare const ENGINE_TORQUE_CURVES: {
240
226
  readonly r_out: -0.4842;
241
227
  readonly w_in: 1;
242
228
  readonly w_out: 1;
243
- }, {
244
- readonly x: 0.95;
245
- readonly y: 0.3368;
246
- readonly r_in: -0.3408;
247
- readonly r_out: -1.35;
248
- readonly w_in: 1;
249
- readonly w_out: 1;
250
229
  }, {
251
230
  readonly x: 1;
252
- readonly y: 0;
253
- readonly r_in: 0;
231
+ readonly y: 0.32;
232
+ readonly r_in: -0.3097;
254
233
  readonly w_in: 1;
255
234
  }];
256
235
  };
@@ -344,14 +323,14 @@ export declare const STEER_SPEED_CURVES: {
344
323
  readonly x: 0.2;
345
324
  readonly y: 0.28;
346
325
  readonly r_in: -1.1;
347
- readonly r_out: -0.96;
326
+ readonly r_out: -1.1;
348
327
  readonly w_in: 1;
349
328
  readonly w_out: 1;
350
329
  }, {
351
330
  readonly x: 0.5;
352
331
  readonly y: 0.11;
353
332
  readonly r_in: -0.25;
354
- readonly r_out: -0.2;
333
+ readonly r_out: -0.25;
355
334
  readonly w_in: 1;
356
335
  readonly w_out: 1;
357
336
  }, {