@pinkaphant/kolmo 0.1.0 → 0.1.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.
- package/bin/kolmo.mjs +47 -9
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.js +3 -3
- package/dist/engine/kolmoStore.d.ts +17 -11
- package/dist/{engine-BiMeAPAi.js → engine-BeKvBM8d.js} +452 -424
- package/dist/importer/ImporterPlinthUikitTags.d.ts +19 -0
- package/dist/importer/Step1CalibrationPlinth.d.ts +3 -3
- package/dist/importer/index.js +1 -1
- package/dist/{importer-Cz5w0mnC.js → importer-D9bdcGTh.js} +931 -823
- package/dist/index.js +14 -14
- package/package.json +14 -9
package/bin/kolmo.mjs
CHANGED
|
@@ -25,8 +25,9 @@ const pkgName = path.basename(targetDir).toLowerCase().replace(/[^a-z0-9-_]/g, "
|
|
|
25
25
|
|
|
26
26
|
const SINGLETON_DEDUPE = [
|
|
27
27
|
"react", "react-dom", "three", "@react-three/fiber",
|
|
28
|
-
"@react-three/drei", "@react-three/rapier", "@
|
|
29
|
-
"@
|
|
28
|
+
"@react-three/drei", "@react-three/rapier", "@react-three/uikit",
|
|
29
|
+
"@pmndrs/uikit", "@preact/signals-core", "@dimforge/rapier3d-compat",
|
|
30
|
+
"@pinkaphant/ecctrl", "koota", "zustand",
|
|
30
31
|
];
|
|
31
32
|
|
|
32
33
|
fs.writeFileSync(path.join(targetDir, "package.json"), JSON.stringify({
|
|
@@ -47,18 +48,23 @@ fs.writeFileSync(path.join(targetDir, "package.json"), JSON.stringify({
|
|
|
47
48
|
"@khr3/c12": "^0.3.0",
|
|
48
49
|
"@khr3/core": "^0.1.1",
|
|
49
50
|
"@khr3/launchers": "^0.2.1",
|
|
50
|
-
"@khr3/vehicles": "^0.1.
|
|
51
|
+
"@khr3/vehicles": "^0.1.2",
|
|
51
52
|
"@pinkaphant/ecctrl": "^2.0.4-beta.3",
|
|
52
|
-
"@pinkaphant/kolmo": "^0.1.
|
|
53
|
+
"@pinkaphant/kolmo": "^0.1.1",
|
|
54
|
+
"@pmndrs/uikit": "^1.0.78",
|
|
55
|
+
"@preact/signals-core": "^1.5.1",
|
|
53
56
|
"@react-three/drei": "^10.7.7",
|
|
54
57
|
"@react-three/fiber": "^9.6.1",
|
|
55
58
|
"@react-three/rapier": "^2.2.0",
|
|
59
|
+
"@react-three/uikit": "^1.0.78",
|
|
56
60
|
"koota": "^0.6.5",
|
|
57
61
|
"react": "^19.2.7",
|
|
58
62
|
"react-dom": "^19.2.7",
|
|
59
63
|
"three": "^0.184.0",
|
|
64
|
+
"zustand": "^5.0.14",
|
|
60
65
|
},
|
|
61
66
|
devDependencies: {
|
|
67
|
+
"@types/node": "^22.20.5",
|
|
62
68
|
"@types/react": "^19.2.16",
|
|
63
69
|
"@types/react-dom": "^19.2.3",
|
|
64
70
|
"@types/three": "^0.184.0",
|
|
@@ -69,14 +75,46 @@ fs.writeFileSync(path.join(targetDir, "package.json"), JSON.stringify({
|
|
|
69
75
|
},
|
|
70
76
|
}, null, 2));
|
|
71
77
|
|
|
72
|
-
fs.writeFileSync(path.join(targetDir, "vite.config.ts"), `import
|
|
73
|
-
import
|
|
78
|
+
fs.writeFileSync(path.join(targetDir, "vite.config.ts"), `import fs from "node:fs";
|
|
79
|
+
import path from "node:path";
|
|
80
|
+
import react from "@vitejs/plugin-react";
|
|
81
|
+
import { defineConfig, type Plugin } from "vite";
|
|
82
|
+
|
|
83
|
+
function externalizeRapierWasm(): Plugin {
|
|
84
|
+
return {
|
|
85
|
+
name: "kolmo-externalize-rapier-wasm",
|
|
86
|
+
apply: "build",
|
|
87
|
+
transform(code, id) {
|
|
88
|
+
if (!id.replace(/\\\\/g, "/").endsWith("/@dimforge/rapier3d-compat/rapier.mjs")) return null;
|
|
89
|
+
const wasmPath = path.join(path.dirname(id), "rapier_wasm3d_bg.wasm");
|
|
90
|
+
if (!fs.existsSync(wasmPath)) return null;
|
|
91
|
+
const refId = this.emitFile({ type: "asset", name: "rapier_wasm3d_bg.wasm", source: fs.readFileSync(wasmPath) });
|
|
92
|
+
return {
|
|
93
|
+
code: code.replace(/[\\w$]+\\.toByteArray\\(["']AGFzbQE[A-Za-z0-9+/=]+["']\\)\\.buffer/, \`import.meta.ROLLUP_FILE_URL_\${refId}\`),
|
|
94
|
+
map: null,
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
74
99
|
|
|
75
100
|
export default defineConfig({
|
|
76
|
-
plugins: [react()],
|
|
77
|
-
assetsInclude: ["**/*.wasm", "**/*.glb"],
|
|
101
|
+
plugins: [react(), externalizeRapierWasm()],
|
|
78
102
|
resolve: { dedupe: ${JSON.stringify(SINGLETON_DEDUPE)} },
|
|
79
|
-
|
|
103
|
+
build: {
|
|
104
|
+
chunkSizeWarningLimit: 1100,
|
|
105
|
+
rolldownOptions: {
|
|
106
|
+
output: {
|
|
107
|
+
codeSplitting: {
|
|
108
|
+
groups: [
|
|
109
|
+
{ name: "vendor-react", test: /[\\\\/]node_modules[\\\\/](react|react-dom|scheduler)[\\\\/]/, priority: 40 },
|
|
110
|
+
{ name: "vendor-three", test: /[\\\\/]node_modules[\\\\/](three|three-stdlib|maath|camera-controls)[\\\\/]/, priority: 30, includeDependenciesRecursively: false },
|
|
111
|
+
{ name: "vendor-physics", test: /[\\\\/]node_modules[\\\\/](@dimforge\\/rapier3d-compat|@react-three\\/rapier|@pinkaphant\\/ecctrl)[\\\\/]/, priority: 20, includeDependenciesRecursively: false },
|
|
112
|
+
{ name: "vendor-r3f", test: /[\\\\/]node_modules[\\\\/]/, priority: 10, includeDependenciesRecursively: false },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
80
118
|
});\n`);
|
|
81
119
|
|
|
82
120
|
fs.writeFileSync(path.join(targetDir, "tsconfig.json"), JSON.stringify({
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export { KolmoSurface, KolmoProp, togglePropJoint, type KolmoSurfaceProps, type
|
|
|
5
5
|
export { KolmoIsland, computeIslandSpawnPose, getCachedIslandPlan, type IslandSpawnPose, type KolmoIslandProps, } from "./kolmoIsland.js";
|
|
6
6
|
export { KolmoLongDrive, computeLongDriveBridgeheadSpawn, computeLongDriveMainlandSpawn, type KolmoLongDriveProps, } from "./kolmoLongDrive.js";
|
|
7
7
|
export { ShiftedFixedBody } from "./mainlandMacroCell.js";
|
|
8
|
-
export { kolmoWorld, kolmoActions, kolmoTelemetry, VehicleTrait, ActorTrait, InteractableTrait, FloatingBodyTrait, PilotLink, WorldSessionTrait, type KolmoControlMode, type KolmoTelemetryState, } from "./kolmoStore.js";
|
|
8
|
+
export { kolmoWorld, kolmoActions, kolmoTelemetry, useActiveKolmoWorld, ensureWorldSession, VehicleTrait, ActorTrait, InteractableTrait, FloatingBodyTrait, PilotLink, WorldSessionTrait, type KolmoControlMode, type KolmoTelemetryState, } from "./kolmoStore.js";
|
package/dist/engine/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as e,
|
|
2
|
-
import { n as
|
|
3
|
-
export {
|
|
1
|
+
import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "../engine-BeKvBM8d.js";
|
|
2
|
+
import { n as D, r as O, t as k } from "../kolmoSurface-DTnrFXH0.js";
|
|
3
|
+
export { h as ActorTrait, f as FloatingBodyTrait, d as InteractableTrait, S as KOLMO_KEY_MAP, c as KolmoActor, l as KolmoCanvas, u as KolmoGravityContext, o as KolmoIsland, x as KolmoLongDrive, k as KolmoProp, D as KolmoSurface, m as KolmoVehicle, v as KolmoWorld, a as PilotLink, i as RetroViewportSync, n as RoomEnvRig, t as ShadowSnapRig, p as ShiftedFixedBody, C as VehicleTrait, E as WorldSessionTrait, _ as computeIslandSpawnPose, g as computeLongDriveBridgeheadSpawn, y as computeLongDriveMainlandSpawn, s as ensureWorldSession, b as getCachedIslandPlan, T as kolmoActions, r as kolmoTelemetry, e as kolmoWorld, O as togglePropJoint, w as useActiveKolmoWorld };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type World } from "koota";
|
|
1
2
|
import type { EcctrlHandle } from "@pinkaphant/ecctrl";
|
|
2
3
|
import type { EcctrlVehicleHandle } from "@pinkaphant/ecctrl/vehicle";
|
|
3
4
|
import { type RetroPresetId } from "../shaders/index.js";
|
|
@@ -18,18 +19,16 @@ export interface ActorTraitData {
|
|
|
18
19
|
exitSpawnYaw: number;
|
|
19
20
|
exitLinVel: [number, number, number] | null;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
/** AoS trait holding live EcctrlVehicle handle & offsets. */
|
|
23
|
+
export declare const VehicleTrait: import("koota").Trait<() => VehicleTraitData>;
|
|
24
|
+
/** AoS trait holding live Ecctrl character handle & exit momentum. */
|
|
25
|
+
export declare const ActorTrait: import("koota").Trait<() => ActorTraitData>;
|
|
26
|
+
/** True SoA scalar schema trait (`trait({ ... })`) for fast proximity queries. */
|
|
27
|
+
export declare const InteractableTrait: import("koota").Trait<{
|
|
22
28
|
id: string;
|
|
23
29
|
radius: number;
|
|
24
30
|
kind: "vehicle" | "prop";
|
|
25
|
-
}
|
|
26
|
-
export interface WorldSessionData {
|
|
27
|
-
activeVehicleId: string | null;
|
|
28
|
-
activeRetroPreset: RetroPresetId;
|
|
29
|
-
}
|
|
30
|
-
export declare const VehicleTrait: import("koota").Trait<() => VehicleTraitData>;
|
|
31
|
-
export declare const ActorTrait: import("koota").Trait<() => ActorTraitData>;
|
|
32
|
-
export declare const InteractableTrait: import("koota").Trait<() => InteractableTraitData>;
|
|
31
|
+
}>;
|
|
33
32
|
export interface FloatingBodyTraitData {
|
|
34
33
|
id: string;
|
|
35
34
|
getBody: () => {
|
|
@@ -47,8 +46,15 @@ export interface FloatingBodyTraitData {
|
|
|
47
46
|
}
|
|
48
47
|
export declare const FloatingBodyTrait: import("koota").Trait<() => FloatingBodyTraitData>;
|
|
49
48
|
export declare const PilotLink: import("koota").Relation<import("koota").Trait<Record<string, never>>>;
|
|
50
|
-
|
|
51
|
-
export declare const
|
|
49
|
+
/** True SoA world trait attached automatically to any custom `world` passed to `<KolmoWorld>`. */
|
|
50
|
+
export declare const WorldSessionTrait: import("koota").Trait<{
|
|
51
|
+
activeVehicleId: string;
|
|
52
|
+
activeRetroPreset: RetroPresetId;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const kolmoWorld: World;
|
|
55
|
+
/** Safely resolves the active Koota `World` from `<WorldProvider>` (falling back to `kolmoWorld` when rendered standalone in tests). */
|
|
56
|
+
export declare function useActiveKolmoWorld(): World;
|
|
57
|
+
export declare function ensureWorldSession(w: World): void;
|
|
52
58
|
export interface KolmoTelemetryState {
|
|
53
59
|
speedKmh: number;
|
|
54
60
|
rpm: number;
|