@pinkaphant/kolmo 0.1.3 → 0.2.0
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 +9 -7
- package/dist/body/HeldItem.js +5 -5
- package/dist/body/KhrBody.js +64 -72
- package/dist/body/bodySi.d.ts +0 -11
- package/dist/body/bodySi.js +13 -22
- package/dist/body/index.d.ts +1 -1
- package/dist/body/index.js +4 -4
- package/dist/engine/kolmoInput.d.ts +5 -0
- package/dist/engine/kolmoInput.js +20 -22
- package/dist/engine/kolmoVehicle.d.ts +1 -0
- package/dist/engine/kolmoVehicle.js +80 -74
- package/dist/engine/kolmoVehicleDriver.js +19 -28
- package/dist/engine/kolmoWorld.js +57 -54
- package/dist/index.js +22 -22
- package/package.json +2 -2
package/bin/kolmo.mjs
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
const kolmoPkg = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
6
|
+
|
|
5
7
|
const args = process.argv.slice(2);
|
|
6
8
|
const cmd = args[0];
|
|
7
9
|
if (cmd !== "create" && cmd !== "init") {
|
|
@@ -37,13 +39,13 @@ fs.writeFileSync(path.join(targetDir, "package.json"), JSON.stringify({
|
|
|
37
39
|
},
|
|
38
40
|
dependencies: {
|
|
39
41
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
40
|
-
"@khr3/assets":
|
|
41
|
-
"@khr3/c12":
|
|
42
|
-
"@khr3/core":
|
|
43
|
-
"@khr3/launchers":
|
|
44
|
-
"@khr3/vehicles":
|
|
45
|
-
"@pinkaphant/ecctrl":
|
|
46
|
-
"@pinkaphant/kolmo":
|
|
42
|
+
"@khr3/assets": kolmoPkg.dependencies["@khr3/assets"],
|
|
43
|
+
"@khr3/c12": kolmoPkg.dependencies["@khr3/c12"],
|
|
44
|
+
"@khr3/core": kolmoPkg.dependencies["@khr3/core"],
|
|
45
|
+
"@khr3/launchers": kolmoPkg.dependencies["@khr3/launchers"],
|
|
46
|
+
"@khr3/vehicles": kolmoPkg.dependencies["@khr3/vehicles"],
|
|
47
|
+
"@pinkaphant/ecctrl": kolmoPkg.peerDependencies["@pinkaphant/ecctrl"],
|
|
48
|
+
"@pinkaphant/kolmo": `^${kolmoPkg.version}`,
|
|
47
49
|
"@pmndrs/uikit": "^1.0.78",
|
|
48
50
|
"@preact/signals-core": "^1.14.5",
|
|
49
51
|
"@react-three/drei": "^10.7.7",
|
package/dist/body/HeldItem.js
CHANGED
|
@@ -53,9 +53,9 @@ function k({ ref: y, bundle: b, socket: x, bodyRef: k, parentSocketObject: A, us
|
|
|
53
53
|
invRoot: n,
|
|
54
54
|
colliderEntries: o
|
|
55
55
|
};
|
|
56
|
-
}, [b]), H = t(() => {
|
|
57
|
-
let
|
|
58
|
-
|
|
56
|
+
}, [b]), H = t((e) => {
|
|
57
|
+
let t = F.current, n = A ?? k?.current?.socket(x) ?? I.current;
|
|
58
|
+
t && n && (b.scene.parent !== n && n.add(b.scene), b.scene.updateWorldMatrix(!0, !1), S.multiplyMatrices(b.scene.matrixWorld, z), S.decompose(C, w, T), w.normalize(), e ? (t.setTranslation(C, !0), t.setRotation(w, !0), t.setNextKinematicTranslation(C), t.setNextKinematicRotation(w), M.propagateModifiedBodyPositionsToColliders()) : (t.setNextKinematicTranslation(C), t.setNextKinematicRotation(w)));
|
|
59
59
|
}, [
|
|
60
60
|
b,
|
|
61
61
|
z,
|
|
@@ -108,7 +108,7 @@ function k({ ref: y, bundle: b, socket: x, bodyRef: k, parentSocketObject: A, us
|
|
|
108
108
|
let t = o.get(e.nodeName);
|
|
109
109
|
t.parent = o.get(e.joint.connectedNodeName) ?? null, N?.add(t);
|
|
110
110
|
}
|
|
111
|
-
return L.current = o, H(), () => {
|
|
111
|
+
return L.current = o, H(!0), () => {
|
|
112
112
|
for (let e of o.values()) N?.delete(e), e.object.position.copy(e.restPosition), e.object.quaternion.copy(e.restQuaternion);
|
|
113
113
|
L.current = /* @__PURE__ */ new Map(), b.scene.parent && b.scene.parent.remove(b.scene), n && n.add(b.scene), b.scene.position.copy(e), b.scene.quaternion.copy(t), p(b);
|
|
114
114
|
};
|
|
@@ -123,7 +123,7 @@ function k({ ref: y, bundle: b, socket: x, bodyRef: k, parentSocketObject: A, us
|
|
|
123
123
|
V,
|
|
124
124
|
H
|
|
125
125
|
]), c(() => {
|
|
126
|
-
H();
|
|
126
|
+
H(!1);
|
|
127
127
|
}), r(y, () => {
|
|
128
128
|
let e = (e, t) => {
|
|
129
129
|
if (!e.drive || e.drive.stiffness === void 0) throw new d(`Joint "${e.nodeName}" has no authored drive stiffness; cannot set a position target`);
|
package/dist/body/KhrBody.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { useFrame as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { Ecctrl as
|
|
6
|
-
import { EcctrlCameraControls as
|
|
1
|
+
import { BODY_SI as e, BODY_SOCKET_IDS as t, bodyEyeOffsetY as n, bodyRestCenterY as r, stepCameraSync as i } from "./bodySi.js";
|
|
2
|
+
import { useEffect as a, useImperativeHandle as o, useMemo as s, useRef as c } from "react";
|
|
3
|
+
import { useFrame as l, useThree as u } from "@react-three/fiber";
|
|
4
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import { Ecctrl as m } from "@pinkaphant/ecctrl";
|
|
6
|
+
import { EcctrlCameraControls as h } from "@pinkaphant/ecctrl/camera";
|
|
7
7
|
// src/body/KhrBody.tsx
|
|
8
|
-
var
|
|
8
|
+
var g = Object.freeze({
|
|
9
9
|
Socket_Hand_R: [
|
|
10
10
|
.22,
|
|
11
11
|
-.18,
|
|
@@ -26,7 +26,7 @@ var _ = Object.freeze({
|
|
|
26
26
|
-.25,
|
|
27
27
|
.28
|
|
28
28
|
]
|
|
29
|
-
}),
|
|
29
|
+
}), _ = {
|
|
30
30
|
forward: !1,
|
|
31
31
|
backward: !1,
|
|
32
32
|
leftward: !1,
|
|
@@ -34,8 +34,8 @@ var _ = Object.freeze({
|
|
|
34
34
|
run: !1,
|
|
35
35
|
jump: !1
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
let n =
|
|
37
|
+
function v({ active: e, ecctrlRef: t }) {
|
|
38
|
+
let n = c({
|
|
39
39
|
w: !1,
|
|
40
40
|
s: !1,
|
|
41
41
|
a: !1,
|
|
@@ -43,8 +43,8 @@ function y({ active: e, ecctrlRef: t }) {
|
|
|
43
43
|
shift: !1,
|
|
44
44
|
space: !1,
|
|
45
45
|
dirty: !1
|
|
46
|
-
}), r =
|
|
47
|
-
return
|
|
46
|
+
}), r = c(e);
|
|
47
|
+
return a(() => {
|
|
48
48
|
if (!e || typeof window > "u" || typeof window.addEventListener != "function") return;
|
|
49
49
|
let t = (e) => (t) => {
|
|
50
50
|
let r = n.current;
|
|
@@ -56,33 +56,33 @@ function y({ active: e, ecctrlRef: t }) {
|
|
|
56
56
|
return window.addEventListener("keydown", i), window.addEventListener("keyup", a), window.addEventListener("blur", r), () => {
|
|
57
57
|
window.removeEventListener("keydown", i), window.removeEventListener("keyup", a), window.removeEventListener("blur", r);
|
|
58
58
|
};
|
|
59
|
-
}, [e]),
|
|
59
|
+
}, [e]), l(() => {
|
|
60
60
|
let i = t.current;
|
|
61
61
|
if (!i) return;
|
|
62
62
|
if (!e) {
|
|
63
63
|
if (r.current) {
|
|
64
64
|
let e = n.current;
|
|
65
|
-
e.w = !1, e.s = !1, e.a = !1, e.d = !1, e.shift = !1, e.space = !1, e.dirty = !1,
|
|
65
|
+
e.w = !1, e.s = !1, e.a = !1, e.d = !1, e.shift = !1, e.space = !1, e.dirty = !1, _.forward = !1, _.backward = !1, _.leftward = !1, _.rightward = !1, _.run = !1, _.jump = !1, i.setMovement(_), r.current = !1;
|
|
66
66
|
}
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
r.current = !0;
|
|
70
70
|
let a = n.current;
|
|
71
|
-
a.dirty && (a.dirty = !1,
|
|
71
|
+
a.dirty && (a.dirty = !1, _.forward = a.w, _.backward = a.s, _.leftward = a.a, _.rightward = a.d, _.run = a.shift, _.jump = a.space, i.setMovement(_));
|
|
72
72
|
}), null;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
let
|
|
74
|
+
function y({ ref: a, si: l = e, smoothCamera: _ = !1, makeDefaultCamera: y = !0, enableInput: x = !0, enable: S = !0, viewModelChildren: C, socketOffsets: w, children: T, userData: E, position: D, ...O }) {
|
|
75
|
+
let k = c(null), A = c(null), j = c(null), M = c({
|
|
76
76
|
Socket_Hand_R: null,
|
|
77
77
|
Socket_Hand_L: null,
|
|
78
78
|
Socket_Head: null,
|
|
79
79
|
Socket_Back: null
|
|
80
|
-
}),
|
|
80
|
+
}), N = s(() => n(l), [l]), P = s(() => [
|
|
81
81
|
0,
|
|
82
|
-
|
|
82
|
+
r(l),
|
|
83
83
|
0
|
|
84
|
-
], [
|
|
85
|
-
let e =
|
|
84
|
+
], [l]), F = u((e) => typeof e.gl?.domElement?.setAttribute == "function"), I = s(() => {
|
|
85
|
+
let e = E ?? {}, t = e.ecctrl ?? {};
|
|
86
86
|
return {
|
|
87
87
|
...e,
|
|
88
88
|
ecctrl: {
|
|
@@ -90,63 +90,55 @@ function b({ ref: o, si: u = t, smoothCamera: v = !1, makeDefaultCamera: b = !0,
|
|
|
90
90
|
...t
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
}, [
|
|
94
|
-
return
|
|
93
|
+
}, [E]);
|
|
94
|
+
return o(a, () => ({
|
|
95
95
|
get ecctrl() {
|
|
96
|
-
return
|
|
96
|
+
return k.current;
|
|
97
97
|
},
|
|
98
98
|
get cameraControls() {
|
|
99
|
-
return
|
|
99
|
+
return A.current;
|
|
100
100
|
},
|
|
101
101
|
socket(e) {
|
|
102
|
-
return
|
|
102
|
+
return M.current[e] ?? null;
|
|
103
103
|
},
|
|
104
104
|
syncCameraStep(e) {
|
|
105
|
-
|
|
105
|
+
i(A.current, e, N, _, k.current?.bodyYAxis);
|
|
106
106
|
}
|
|
107
|
-
}), [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
active: !!(
|
|
110
|
-
ecctrlRef:
|
|
107
|
+
}), [N, _]), /* @__PURE__ */ p(d, { children: [
|
|
108
|
+
/* @__PURE__ */ f(v, {
|
|
109
|
+
active: !!(S && x),
|
|
110
|
+
ecctrlRef: k
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
ref:
|
|
114
|
-
enable:
|
|
115
|
-
position:
|
|
116
|
-
capsuleHalfHeight:
|
|
117
|
-
capsuleRadius:
|
|
118
|
-
floatHeight:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
decDeltaTime: e.decDeltaTime,
|
|
123
|
-
slideGripFactor: e.slideGripFactor,
|
|
124
|
-
moveImpulsePointOffset: e.moveImpulsePointOffset,
|
|
125
|
-
airDragFactor: e.airDragFactor,
|
|
126
|
-
enableToggleRun: e.enableToggleRun,
|
|
127
|
-
...k,
|
|
128
|
-
userData: L,
|
|
129
|
-
children: E
|
|
112
|
+
/* @__PURE__ */ f(m, {
|
|
113
|
+
ref: k,
|
|
114
|
+
enable: S,
|
|
115
|
+
position: D ?? P,
|
|
116
|
+
capsuleHalfHeight: l.capsuleHalfHeight,
|
|
117
|
+
capsuleRadius: l.capsuleRadius,
|
|
118
|
+
floatHeight: l.floatHeight,
|
|
119
|
+
...O,
|
|
120
|
+
userData: I,
|
|
121
|
+
children: T
|
|
130
122
|
}),
|
|
131
|
-
|
|
132
|
-
ref:
|
|
133
|
-
makeDefault:
|
|
123
|
+
F ? /* @__PURE__ */ f(h, {
|
|
124
|
+
ref: A,
|
|
125
|
+
makeDefault: y
|
|
134
126
|
}) : null,
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
enable:
|
|
137
|
-
makeDefaultCamera:
|
|
138
|
-
ecctrlRef:
|
|
139
|
-
camControlsRef:
|
|
140
|
-
viewModelGroupRef:
|
|
141
|
-
eyeOffsetY:
|
|
142
|
-
smoothCamera:
|
|
127
|
+
/* @__PURE__ */ f(b, {
|
|
128
|
+
enable: S,
|
|
129
|
+
makeDefaultCamera: y,
|
|
130
|
+
ecctrlRef: k,
|
|
131
|
+
camControlsRef: A,
|
|
132
|
+
viewModelGroupRef: j,
|
|
133
|
+
eyeOffsetY: N,
|
|
134
|
+
smoothCamera: _
|
|
143
135
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
ref:
|
|
136
|
+
/* @__PURE__ */ p("group", {
|
|
137
|
+
ref: j,
|
|
146
138
|
name: "KhrBody_ViewModel",
|
|
147
|
-
children: [
|
|
148
|
-
let t =
|
|
149
|
-
return /* @__PURE__ */
|
|
139
|
+
children: [t.map((e) => {
|
|
140
|
+
let t = w?.[e] ?? g[e];
|
|
141
|
+
return /* @__PURE__ */ f("group", {
|
|
150
142
|
name: e,
|
|
151
143
|
position: [
|
|
152
144
|
t[0],
|
|
@@ -154,26 +146,26 @@ function b({ ref: o, si: u = t, smoothCamera: v = !1, makeDefaultCamera: b = !0,
|
|
|
154
146
|
t[2]
|
|
155
147
|
],
|
|
156
148
|
ref: (t) => {
|
|
157
|
-
|
|
149
|
+
M.current[e] = t;
|
|
158
150
|
}
|
|
159
151
|
}, e);
|
|
160
|
-
}),
|
|
152
|
+
}), C]
|
|
161
153
|
})
|
|
162
154
|
] });
|
|
163
155
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
156
|
+
function b({ enable: e, makeDefaultCamera: t, ecctrlRef: n, camControlsRef: r, viewModelGroupRef: a, eyeOffsetY: o, smoothCamera: s }) {
|
|
157
|
+
return l((c) => {
|
|
166
158
|
if (!e) return;
|
|
167
159
|
let l = n.current;
|
|
168
160
|
if (l) {
|
|
169
|
-
if (r.current)
|
|
161
|
+
if (r.current) i(r.current, l.currPos, o, s, l.bodyYAxis);
|
|
170
162
|
else if (t) {
|
|
171
163
|
let e = l.bodyYAxis;
|
|
172
164
|
c.camera.position.set(l.currPos.x + e.x * o, l.currPos.y + e.y * o, l.currPos.z + e.z * o);
|
|
173
165
|
}
|
|
174
166
|
}
|
|
175
|
-
let u =
|
|
167
|
+
let u = a.current;
|
|
176
168
|
u && (u.position.copy(c.camera.position), u.quaternion.copy(c.camera.quaternion));
|
|
177
169
|
}), null;
|
|
178
170
|
}
|
|
179
|
-
export {
|
|
171
|
+
export { y as KhrBody, i as stepCameraSync };
|
package/dist/body/bodySi.d.ts
CHANGED
|
@@ -18,17 +18,6 @@ export interface BodySiConstants {
|
|
|
18
18
|
}
|
|
19
19
|
/** 1.75 m standing adult: 2 * 0.50 + 2 * 0.30 + 0.15. */
|
|
20
20
|
export declare const BODY_SI: BodySiConstants;
|
|
21
|
-
/** Ecctrl movement tuning for the standing SI body. */
|
|
22
|
-
export declare const BODY_MOVE_TUNE: Readonly<{
|
|
23
|
-
readonly maxWalkVel: 2.5;
|
|
24
|
-
readonly maxRunVel: 9;
|
|
25
|
-
readonly accDeltaTime: 0.25;
|
|
26
|
-
readonly decDeltaTime: 0.25;
|
|
27
|
-
readonly slideGripFactor: 1;
|
|
28
|
-
readonly moveImpulsePointOffset: 0;
|
|
29
|
-
readonly airDragFactor: 0.85;
|
|
30
|
-
readonly enableToggleRun: false;
|
|
31
|
-
}>;
|
|
32
21
|
export type BodySocketId = "Socket_Hand_R" | "Socket_Hand_L" | "Socket_Head" | "Socket_Back";
|
|
33
22
|
export declare const BODY_SOCKET_IDS: readonly BodySocketId[];
|
|
34
23
|
/** Rigid-body centre height when standing at rest on flat ground. */
|
package/dist/body/bodySi.js
CHANGED
|
@@ -6,44 +6,35 @@ var e = Object.freeze({
|
|
|
6
6
|
eyeHeight: 1.62,
|
|
7
7
|
firstPersonDistance: .02,
|
|
8
8
|
thirdPersonDistance: 3.2
|
|
9
|
-
}), t = Object.freeze(
|
|
10
|
-
maxWalkVel: 2.5,
|
|
11
|
-
maxRunVel: 9,
|
|
12
|
-
accDeltaTime: .25,
|
|
13
|
-
decDeltaTime: .25,
|
|
14
|
-
slideGripFactor: 1,
|
|
15
|
-
moveImpulsePointOffset: 0,
|
|
16
|
-
airDragFactor: .85,
|
|
17
|
-
enableToggleRun: !1
|
|
18
|
-
}), n = Object.freeze([
|
|
9
|
+
}), t = Object.freeze([
|
|
19
10
|
"Socket_Hand_R",
|
|
20
11
|
"Socket_Hand_L",
|
|
21
12
|
"Socket_Head",
|
|
22
13
|
"Socket_Back"
|
|
23
14
|
]);
|
|
24
|
-
function
|
|
15
|
+
function n(e) {
|
|
25
16
|
for (let [t, n] of Object.entries(e)) if (!(typeof n == "number" && Number.isFinite(n) && n >= 0)) throw RangeError(`kolmo/body: ${t} must be a finite non-negative number, got ${String(n)}`);
|
|
26
17
|
if (!(e.capsuleRadius > 0)) throw RangeError("kolmo/body: capsuleRadius must be > 0");
|
|
27
18
|
}
|
|
19
|
+
function r(t = e) {
|
|
20
|
+
return n(t), t.floatHeight + t.capsuleRadius + t.capsuleHalfHeight;
|
|
21
|
+
}
|
|
28
22
|
function i(t = e) {
|
|
29
|
-
return r(t)
|
|
23
|
+
return r(t) + t.capsuleHalfHeight + t.capsuleRadius;
|
|
30
24
|
}
|
|
31
25
|
function a(t = e) {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
function o(t = e) {
|
|
35
|
-
let n = t.eyeHeight - i(t);
|
|
26
|
+
let n = t.eyeHeight - r(t);
|
|
36
27
|
if (!(n > 0)) throw RangeError("kolmo/body: eyeHeight must sit above the body centre");
|
|
37
28
|
return n;
|
|
38
29
|
}
|
|
39
|
-
function
|
|
30
|
+
function o(t, n, i, a = e) {
|
|
40
31
|
return [
|
|
41
32
|
t,
|
|
42
|
-
n +
|
|
43
|
-
|
|
33
|
+
n + r(a),
|
|
34
|
+
i
|
|
44
35
|
];
|
|
45
36
|
}
|
|
46
|
-
function
|
|
37
|
+
function s(e) {
|
|
47
38
|
let t = e?.ecctrl ?? {};
|
|
48
39
|
return {
|
|
49
40
|
...e ?? {},
|
|
@@ -53,9 +44,9 @@ function c(e) {
|
|
|
53
44
|
}
|
|
54
45
|
};
|
|
55
46
|
}
|
|
56
|
-
function
|
|
47
|
+
function c(e, t, n, r, i) {
|
|
57
48
|
if (!e) return;
|
|
58
49
|
let a = i ? t.x + i.x * n : t.x, o = i ? t.y + i.y * n : t.y + n, s = i ? t.z + i.z * n : t.z;
|
|
59
50
|
e.moveTo?.(a, o, s, r);
|
|
60
51
|
}
|
|
61
|
-
export {
|
|
52
|
+
export { e as BODY_SI, t as BODY_SOCKET_IDS, a as bodyEyeOffsetY, r as bodyRestCenterY, o as bodySpawnPosition, i as bodyStandingHeight, c as stepCameraSync, s as withExcludeCharacterRay };
|
package/dist/body/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BODY_SI, BODY_SOCKET_IDS, bodyEyeOffsetY, bodyRestCenterY, bodySpawnPosition, bodyStandingHeight, stepCameraSync, withExcludeCharacterRay, type BodySiConstants, type BodySocketId, } from "./bodySi.js";
|
|
2
2
|
export { KhrBody, type KhrBodyHandle, type KhrBodyProps } from "./KhrBody.js";
|
|
3
3
|
export { HeldItem, type HeldItemHandle, type HeldItemProps } from "./HeldItem.js";
|
package/dist/body/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { KhrBody as
|
|
3
|
-
import { HeldItem as
|
|
4
|
-
export { e as
|
|
1
|
+
import { BODY_SI as e, BODY_SOCKET_IDS as t, bodyEyeOffsetY as n, bodyRestCenterY as r, bodySpawnPosition as i, bodyStandingHeight as a, stepCameraSync as o, withExcludeCharacterRay as s } from "./bodySi.js";
|
|
2
|
+
import { KhrBody as c } from "./KhrBody.js";
|
|
3
|
+
import { HeldItem as l } from "./HeldItem.js";
|
|
4
|
+
export { e as BODY_SI, t as BODY_SOCKET_IDS, l as HeldItem, c as KhrBody, n as bodyEyeOffsetY, r as bodyRestCenterY, i as bodySpawnPosition, a as bodyStandingHeight, o as stepCameraSync, s as withExcludeCharacterRay };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
1
2
|
import { type KeyboardControlsEntry } from "@react-three/drei";
|
|
3
|
+
export declare const KolmoKeyboardContext: React.Context<(() => Record<string, boolean>) | null>;
|
|
4
|
+
export declare function KolmoKeyboardBridge({ children }: {
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
}): React.JSX.Element;
|
|
2
7
|
export type KolmoKeyAction = "forward" | "backward" | "left" | "right" | "brake" | "boost" | "interact" | "turnLeft" | "turnRight" | "descend" | "cameraView";
|
|
3
8
|
export type KolmoInputState = Record<KolmoKeyAction, boolean>;
|
|
4
9
|
export type KolmoInputGetter = () => Partial<KolmoInputState>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { useKeyboardControls as
|
|
1
|
+
import e, { createContext as t, useCallback as n, useContext as r, useRef as i } from "react";
|
|
2
|
+
import { useKeyboardControls as a } from "@react-three/drei";
|
|
3
3
|
// src/engine/kolmoInput.ts
|
|
4
|
-
var
|
|
4
|
+
var o = t(null);
|
|
5
|
+
function s({ children: t }) {
|
|
6
|
+
let [, n] = a();
|
|
7
|
+
return e.createElement(o.Provider, { value: n }, t);
|
|
8
|
+
}
|
|
9
|
+
var c = Object.freeze({
|
|
5
10
|
forward: !1,
|
|
6
11
|
backward: !1,
|
|
7
12
|
left: !1,
|
|
@@ -13,7 +18,7 @@ var r = Object.freeze({
|
|
|
13
18
|
turnRight: !1,
|
|
14
19
|
descend: !1,
|
|
15
20
|
cameraView: !1
|
|
16
|
-
}),
|
|
21
|
+
}), l = [
|
|
17
22
|
{
|
|
18
23
|
name: "forward",
|
|
19
24
|
keys: ["KeyW", "ArrowUp"]
|
|
@@ -59,22 +64,15 @@ var r = Object.freeze({
|
|
|
59
64
|
keys: ["KeyV"]
|
|
60
65
|
}
|
|
61
66
|
];
|
|
62
|
-
function
|
|
63
|
-
let a =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
let s = t({ ...r });
|
|
73
|
-
return e(() => {
|
|
74
|
-
let e = o.current?.();
|
|
75
|
-
if (!a && !e) return r;
|
|
76
|
-
let t = a ? a() : r, n = s.current;
|
|
77
|
-
return n.forward = !!(e?.forward ?? t.forward), n.backward = !!(e?.backward ?? t.backward), n.left = !!(e?.left ?? t.left), n.right = !!(e?.right ?? t.right), n.brake = !!(e?.brake ?? t.brake), n.boost = !!(e?.boost ?? t.boost), n.interact = !!(e?.interact ?? t.interact), n.turnLeft = !!(e?.turnLeft ?? t.turnLeft), n.turnRight = !!(e?.turnRight ?? t.turnRight), n.descend = !!(e?.descend ?? t.descend), n.cameraView = !!(e?.cameraView ?? t.cameraView), n;
|
|
78
|
-
}, [a]);
|
|
67
|
+
function u(e) {
|
|
68
|
+
let t = r(o), a = i(e);
|
|
69
|
+
a.current = e;
|
|
70
|
+
let s = i({ ...c });
|
|
71
|
+
return n(() => {
|
|
72
|
+
let e = a.current?.();
|
|
73
|
+
if (!t && !e) return c;
|
|
74
|
+
let n = t ? t() : c, r = s.current;
|
|
75
|
+
return r.forward = !!(e?.forward ?? n.forward), r.backward = !!(e?.backward ?? n.backward), r.left = !!(e?.left ?? n.left), r.right = !!(e?.right ?? n.right), r.brake = !!(e?.brake ?? n.brake), r.boost = !!(e?.boost ?? n.boost), r.interact = !!(e?.interact ?? n.interact), r.turnLeft = !!(e?.turnLeft ?? n.turnLeft), r.turnRight = !!(e?.turnRight ?? n.turnRight), r.descend = !!(e?.descend ?? n.descend), r.cameraView = !!(e?.cameraView ?? n.cameraView), r;
|
|
76
|
+
}, [t]);
|
|
79
77
|
}
|
|
80
|
-
export {
|
|
78
|
+
export { c as EMPTY_KOLMO_INPUT, l as KOLMO_KEY_MAP, s as KolmoKeyboardBridge, o as KolmoKeyboardContext, u as useKolmoInput };
|
|
@@ -22,6 +22,7 @@ export interface KolmoVehicleProps {
|
|
|
22
22
|
userData?: Record<string, unknown>;
|
|
23
23
|
onCollisionEnter?: (payload: CollisionEnterPayload) => void;
|
|
24
24
|
wheelConfig?: KhrVehicleProps["wheelConfig"];
|
|
25
|
+
propellerConfig?: KhrVehicleProps["propellerConfig"];
|
|
25
26
|
carConfig?: Record<string, unknown>;
|
|
26
27
|
droneConfig?: Partial<DroneConfigType>;
|
|
27
28
|
vehicleRef?: React.RefObject<EcctrlVehicleHandle | null>;
|
|
@@ -6,14 +6,14 @@ import { applySceneRetroMaterials as o } from "../shaders/retroShader.js";
|
|
|
6
6
|
import { useKolmoInput as ee } from "./kolmoInput.js";
|
|
7
7
|
import { InteractableTrait as te, VehicleTrait as s, WorldSessionTrait as c, ensureWorldSession as ne, kolmoActions as l, useActiveKolmoWorld as re, useWorldTrait as ie } from "./kolmoStore.js";
|
|
8
8
|
import { stepKolmoVehicleFrame as ae } from "./kolmoVehicleDriver.js";
|
|
9
|
-
import { useCallback as u, useContext as
|
|
10
|
-
import * as
|
|
11
|
-
import { useFrame as
|
|
12
|
-
import { cloneKhrBundle as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { KhrVehicle as
|
|
9
|
+
import { useCallback as u, useContext as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
10
|
+
import * as oe from "three";
|
|
11
|
+
import { useFrame as se } from "@react-three/fiber";
|
|
12
|
+
import { cloneKhrBundle as ce, loadKhrGlb as _, useKhrGlb as v } from "@khr3/core";
|
|
13
|
+
import { jsx as y, jsxs as le } from "react/jsx-runtime";
|
|
14
|
+
import { KhrVehicle as ue } from "@khr3/core/vehicle";
|
|
15
15
|
// src/engine/kolmoVehicle.tsx
|
|
16
|
-
function
|
|
16
|
+
function b(e) {
|
|
17
17
|
e.traverse((e) => {
|
|
18
18
|
let n = e.userData?.gltfExtensions?.[t];
|
|
19
19
|
n && !e.userData.KOLMO_emitter && (e.userData[t] = n);
|
|
@@ -38,35 +38,40 @@ function de(e) {
|
|
|
38
38
|
for (let e of t) e.dispose();
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function x({ id: t, sourceBundle: o, rawGlbBytes:
|
|
41
|
+
function x({ id: t, sourceBundle: o, rawGlbBytes: g, position: _ = [
|
|
42
42
|
0,
|
|
43
43
|
.35,
|
|
44
44
|
0
|
|
45
|
-
], rotation:
|
|
46
|
-
let L =
|
|
47
|
-
|
|
45
|
+
], rotation: v, piloted: x = !1, flightMode: S = !1, vehicleMode: C, enable: fe = !0, ccd: w, linearDamping: T, angularDamping: E, userData: D, onCollisionEnter: O, wheelConfig: k, propellerConfig: A, carConfig: j, droneConfig: M, vehicleRef: N, getInput: pe, driver: P, cameraController: F, children: I }) {
|
|
46
|
+
let L = d(e), R = re();
|
|
47
|
+
p(() => {
|
|
48
48
|
ne(R);
|
|
49
49
|
}, [R]);
|
|
50
|
-
let z = ie(R, c),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
...
|
|
54
|
-
...
|
|
55
|
-
]), [
|
|
56
|
-
let
|
|
50
|
+
let z = ie(R, c), me = ee(pe), B = m(() => ce(o), [o]), V = m(() => i(B), [B]), H = m(() => (b(B.scene), r(B.scene, g)), [B, g]);
|
|
51
|
+
p(() => de([
|
|
52
|
+
B.scene,
|
|
53
|
+
...B.wheels.map((e) => e.object),
|
|
54
|
+
...B.propellers.map((e) => e.object)
|
|
55
|
+
]), [B]);
|
|
56
|
+
let U = !!(C === "rocket" || S || C !== "drive" && B.propellers.length > 0), W = m(() => H.sockets.find((e) => e.role === "seat" || e.role === "optic")?.localPosition ?? [
|
|
57
57
|
0,
|
|
58
58
|
.65,
|
|
59
59
|
0
|
|
60
|
-
], [
|
|
60
|
+
], [H]), G = m(() => H.sockets.find((e) => e.role === "exit")?.localPosition ?? [
|
|
61
61
|
-1.55,
|
|
62
62
|
.45,
|
|
63
63
|
0
|
|
64
|
-
], [
|
|
65
|
-
if (
|
|
64
|
+
], [H]), K = m(() => {
|
|
65
|
+
if (k || C !== void 0) return {
|
|
66
66
|
...C === void 0 ? {} : { enable: C === "drive" },
|
|
67
|
+
...k ?? {}
|
|
68
|
+
};
|
|
69
|
+
}, [k, C]), q = m(() => {
|
|
70
|
+
if (A || C !== void 0) return {
|
|
71
|
+
...C === void 0 ? {} : { enable: C === "rocket" },
|
|
67
72
|
...A ?? {}
|
|
68
73
|
};
|
|
69
|
-
}, [A, C]), J =
|
|
74
|
+
}, [A, C]), J = m(() => U ? {
|
|
70
75
|
controlMode: "VELOCITY",
|
|
71
76
|
maxHorizSpeed: 46,
|
|
72
77
|
maxVertSpeed: 16,
|
|
@@ -74,21 +79,21 @@ function x({ id: t, sourceBundle: o, rawGlbBytes: h, position: g = [
|
|
|
74
79
|
maxTiltAngle: .52,
|
|
75
80
|
HORIZ_VEL_P: 1.8,
|
|
76
81
|
VERT_VEL_P: 2.8,
|
|
77
|
-
...
|
|
82
|
+
...B.droneTune ?? {},
|
|
78
83
|
...M ?? {}
|
|
79
84
|
} : M, [
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
U,
|
|
86
|
+
B.droneTune,
|
|
82
87
|
M
|
|
83
|
-
]), Y =
|
|
84
|
-
g[0],
|
|
85
|
-
g[1],
|
|
86
|
-
g[2]
|
|
87
|
-
]), X = m(_ ? [
|
|
88
|
+
]), Y = h(null), he = h([
|
|
88
89
|
_[0],
|
|
89
90
|
_[1],
|
|
90
91
|
_[2]
|
|
91
|
-
]
|
|
92
|
+
]), X = h(v ? [
|
|
93
|
+
v[0],
|
|
94
|
+
v[1],
|
|
95
|
+
v[2]
|
|
96
|
+
] : void 0), Z = h(n()), Q = h(new oe.Vector3()), ge = h({
|
|
92
97
|
camInit: !1,
|
|
93
98
|
cockpit: !1,
|
|
94
99
|
prevCam: !1,
|
|
@@ -96,7 +101,7 @@ function x({ id: t, sourceBundle: o, rawGlbBytes: h, position: g = [
|
|
|
96
101
|
prevR: !1,
|
|
97
102
|
turnL: !1,
|
|
98
103
|
turnR: !1
|
|
99
|
-
}),
|
|
104
|
+
}), _e = h({
|
|
100
105
|
forward: !1,
|
|
101
106
|
backward: !1,
|
|
102
107
|
steerLeft: !1,
|
|
@@ -121,14 +126,14 @@ function x({ id: t, sourceBundle: o, rawGlbBytes: h, position: g = [
|
|
|
121
126
|
}
|
|
122
127
|
}
|
|
123
128
|
}, []);
|
|
124
|
-
|
|
129
|
+
f(() => {
|
|
125
130
|
let e = R.spawn(s({
|
|
126
131
|
id: t,
|
|
127
132
|
handle: Y.current,
|
|
128
|
-
centerOfMass: [...
|
|
129
|
-
seatOffset:
|
|
130
|
-
exitOffset:
|
|
131
|
-
isFlight:
|
|
133
|
+
centerOfMass: [...B.centerOfMass],
|
|
134
|
+
seatOffset: W,
|
|
135
|
+
exitOffset: G,
|
|
136
|
+
isFlight: U,
|
|
132
137
|
onOriginShift: $
|
|
133
138
|
}), te({
|
|
134
139
|
id: t,
|
|
@@ -141,14 +146,14 @@ function x({ id: t, sourceBundle: o, rawGlbBytes: h, position: g = [
|
|
|
141
146
|
}, [
|
|
142
147
|
R,
|
|
143
148
|
t,
|
|
144
|
-
|
|
145
|
-
G,
|
|
146
|
-
K,
|
|
149
|
+
B,
|
|
147
150
|
W,
|
|
151
|
+
G,
|
|
152
|
+
U,
|
|
148
153
|
x,
|
|
149
154
|
$
|
|
150
155
|
]);
|
|
151
|
-
let
|
|
156
|
+
let ve = u((e) => {
|
|
152
157
|
Y.current = e, N && (N.current = e);
|
|
153
158
|
for (let n of R.query(s)) {
|
|
154
159
|
let r = n.get(s);
|
|
@@ -163,65 +168,66 @@ function x({ id: t, sourceBundle: o, rawGlbBytes: h, position: g = [
|
|
|
163
168
|
t,
|
|
164
169
|
N,
|
|
165
170
|
$
|
|
166
|
-
]),
|
|
167
|
-
return
|
|
171
|
+
]), ye = z?.activeVehicleId === t || x && !z?.activeVehicleId;
|
|
172
|
+
return se((e, n) => {
|
|
168
173
|
let r = Math.min(Math.max(n, 1e-4), .05);
|
|
169
|
-
|
|
174
|
+
V.step(r);
|
|
170
175
|
let i = Y.current;
|
|
171
176
|
i && i.body && (P ? (P(i, r, e), F && F(i, r, e)) : ae({
|
|
172
177
|
id: t,
|
|
173
178
|
veh: i,
|
|
174
|
-
keys:
|
|
175
|
-
cmd:
|
|
179
|
+
keys: me(),
|
|
180
|
+
cmd: _e.current,
|
|
176
181
|
sig: Z.current,
|
|
177
|
-
st:
|
|
182
|
+
st: ge.current,
|
|
178
183
|
camTarget: Q.current,
|
|
179
|
-
centerOfMass:
|
|
180
|
-
seatOffset:
|
|
181
|
-
isPiloted:
|
|
182
|
-
isFlight:
|
|
184
|
+
centerOfMass: B.centerOfMass,
|
|
185
|
+
seatOffset: W,
|
|
186
|
+
isPiloted: ye,
|
|
187
|
+
isFlight: U,
|
|
183
188
|
dt: r,
|
|
184
189
|
state: e,
|
|
185
190
|
cameraController: F
|
|
186
191
|
}));
|
|
187
|
-
}), /* @__PURE__ */
|
|
192
|
+
}), /* @__PURE__ */ y("group", {
|
|
188
193
|
onClick: (e) => {
|
|
189
|
-
e.delta <= 5 &&
|
|
194
|
+
e.delta <= 5 && V.toggleHitObject(e.object) && e.stopPropagation();
|
|
190
195
|
},
|
|
191
|
-
children: /* @__PURE__ */
|
|
192
|
-
ref:
|
|
193
|
-
bundle:
|
|
194
|
-
position:
|
|
195
|
-
enable:
|
|
196
|
+
children: /* @__PURE__ */ le(ue, {
|
|
197
|
+
ref: ve,
|
|
198
|
+
bundle: B,
|
|
199
|
+
position: he.current,
|
|
200
|
+
enable: fe,
|
|
196
201
|
enableCustomGravity: L,
|
|
197
202
|
...X.current === void 0 ? {} : { rotation: X.current },
|
|
198
|
-
...
|
|
199
|
-
...
|
|
200
|
-
...
|
|
201
|
-
...
|
|
202
|
-
...
|
|
203
|
-
...
|
|
203
|
+
...w === void 0 ? {} : { ccd: w },
|
|
204
|
+
...T === void 0 ? {} : { linearDamping: T },
|
|
205
|
+
...E === void 0 ? {} : { angularDamping: E },
|
|
206
|
+
...D === void 0 ? {} : { userData: D },
|
|
207
|
+
...O === void 0 ? {} : { onCollisionEnter: O },
|
|
208
|
+
...K === void 0 ? {} : { wheelConfig: K },
|
|
209
|
+
...q === void 0 ? {} : { propellerConfig: q },
|
|
204
210
|
...j === void 0 ? {} : { carConfig: j },
|
|
205
211
|
...J === void 0 ? {} : { droneConfig: J },
|
|
206
|
-
children: [/* @__PURE__ */
|
|
207
|
-
emitters:
|
|
212
|
+
children: [/* @__PURE__ */ y(a, {
|
|
213
|
+
emitters: H.emitters,
|
|
208
214
|
signalsRef: Z
|
|
209
215
|
}), I]
|
|
210
216
|
})
|
|
211
217
|
});
|
|
212
218
|
}
|
|
213
219
|
function S(e) {
|
|
214
|
-
return /* @__PURE__ */
|
|
220
|
+
return /* @__PURE__ */ y(x, {
|
|
215
221
|
...e,
|
|
216
|
-
sourceBundle:
|
|
222
|
+
sourceBundle: v(e.src)
|
|
217
223
|
});
|
|
218
224
|
}
|
|
219
225
|
function C(e) {
|
|
220
|
-
let [t, n] =
|
|
221
|
-
return
|
|
226
|
+
let [t, n] = g(null);
|
|
227
|
+
return f(() => {
|
|
222
228
|
if (e.bundle || e.src || !e.rawGlbBytes) return;
|
|
223
229
|
let t = !0;
|
|
224
|
-
return
|
|
230
|
+
return _(e.rawGlbBytes).then((e) => {
|
|
225
231
|
t && n(e);
|
|
226
232
|
}), () => {
|
|
227
233
|
t = !1;
|
|
@@ -230,13 +236,13 @@ function C(e) {
|
|
|
230
236
|
e.bundle,
|
|
231
237
|
e.src,
|
|
232
238
|
e.rawGlbBytes
|
|
233
|
-
]), e.bundle ? /* @__PURE__ */
|
|
239
|
+
]), e.bundle ? /* @__PURE__ */ y(x, {
|
|
234
240
|
...e,
|
|
235
241
|
sourceBundle: e.bundle
|
|
236
|
-
}) : e.src ? /* @__PURE__ */
|
|
242
|
+
}) : e.src ? /* @__PURE__ */ y(S, {
|
|
237
243
|
...e,
|
|
238
244
|
src: e.src
|
|
239
|
-
}) : t ? /* @__PURE__ */
|
|
245
|
+
}) : t ? /* @__PURE__ */ y(x, {
|
|
240
246
|
...e,
|
|
241
247
|
sourceBundle: t
|
|
242
248
|
}) : null;
|
|
@@ -2,37 +2,28 @@ import { kolmoTelemetry as e } from "./kolmoStore.js";
|
|
|
2
2
|
import * as t from "three";
|
|
3
3
|
import { easing as n } from "maath";
|
|
4
4
|
// src/engine/kolmoVehicleDriver.ts
|
|
5
|
-
var r = new t.Vector3(), i = new t.Vector3(), a = new t.Vector3(), o = new t.Vector3()
|
|
6
|
-
function
|
|
7
|
-
let { id:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
l.setMovement(d);
|
|
5
|
+
var r = new t.Vector3(), i = new t.Vector3(), a = new t.Vector3(), o = new t.Vector3();
|
|
6
|
+
function s(t) {
|
|
7
|
+
let { id: s, veh: c, keys: l, cmd: u, sig: d, st: f, camTarget: p, centerOfMass: m, seatOffset: h, isPiloted: g, isFlight: _, dt: v, state: y, cameraController: b } = t;
|
|
8
|
+
g && (l.cameraView && !f.prevCam && (f.cockpit = !f.cockpit), f.prevCam = l.cameraView, _ ? (u.pitchForward = l.forward, u.pitchBackward = l.backward, u.yawLeft = l.left, u.yawRight = l.right, u.rollLeft = l.turnLeft, u.rollRight = l.turnRight, u.throttleUp = l.brake, u.throttleDown = l.descend, u.forward = !1, u.backward = !1, u.steerLeft = !1, u.steerRight = !1, u.brake = !1) : (l.turnLeft && !f.prevL && (f.turnL = !f.turnL, f.turnR = !1), l.turnRight && !f.prevR && (f.turnR = !f.turnR, f.turnL = !1), f.prevL = l.turnLeft, f.prevR = l.turnRight, u.forward = l.forward, u.backward = l.backward, u.steerLeft = l.left, u.steerRight = l.right, u.brake = l.brake, u.pitchForward = !1, u.pitchBackward = !1, u.throttleUp = !1, u.throttleDown = !1, u.yawLeft = !1, u.yawRight = !1, u.rollLeft = !1, u.rollRight = !1), c.setMovement(u));
|
|
9
|
+
let x = 0, S = 0;
|
|
10
|
+
for (let e of c.wheelsInfo.values()) e.current.rayHit && e.current.slipStrength > x && (x = e.current.slipStrength);
|
|
11
|
+
if (c.propellersInfo.size > 0) {
|
|
12
|
+
for (let e of c.propellersInfo.values()) S += e.current.finalThrottle;
|
|
13
|
+
S /= c.propellersInfo.size;
|
|
17
14
|
}
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
if (l.
|
|
21
|
-
|
|
22
|
-
C /= l.propellersInfo.size;
|
|
23
|
-
}
|
|
24
|
-
let w = l.currLinVel.dot(l.bodyZAxis);
|
|
25
|
-
if (f.throttle = _ ? v ? u.forward || u.brake ? 1 : Math.max(.22, C) : +!!u.forward : 0, f.boost = _ ? v ? u.boost ? 1 : u.forward ? .58 : .16 : u.boost && u.forward ? 1 : 0 : 0, f.brake = _ && !v && (u.brake || u.backward && w > 1) ? 1 : 0, f.reverse = _ && !v && u.backward && w <= 1 ? 1 : 0, f.slip = Math.min(1, S), f.turn_l = +!!p.turnL, f.turn_r = +!!p.turnR, f.headlight = 1, f.always = 1, !_) return;
|
|
26
|
-
if (e.speedKmh = l.currLinVel.length() * 3.6, e.rpm = Math.round(v ? 1800 + f.throttle * 6200 + f.boost * 4200 : l.engineRPM), e.gear = v ? u.boost ? 2 : 1 : l.gearIndex + 1, e.throttle = f.throttle, e.boost = f.boost, e.mode = v ? "flight" : "car", e.activeVehicleId = c, x) {
|
|
27
|
-
x(l, y, b);
|
|
15
|
+
let C = c.currLinVel.dot(c.bodyZAxis);
|
|
16
|
+
if (d.throttle = g ? _ ? l.forward || l.brake ? 1 : Math.max(.22, S) : +!!l.forward : 0, d.boost = g ? _ ? l.boost ? 1 : l.forward ? .58 : .16 : l.boost && l.forward ? 1 : 0 : 0, d.brake = g && !_ && (l.brake || l.backward && C > 1) ? 1 : 0, d.reverse = g && !_ && l.backward && C <= 1 ? 1 : 0, d.slip = Math.min(1, x), d.turn_l = +!!f.turnL, d.turn_r = +!!f.turnR, d.headlight = 1, d.always = 1, !g) return;
|
|
17
|
+
if (e.speedKmh = c.currLinVel.length() * 3.6, e.rpm = Math.round(_ ? 1800 + d.throttle * 6200 + d.boost * 4200 : c.engineRPM), e.gear = _ ? l.boost ? 2 : 1 : c.gearIndex + 1, e.throttle = d.throttle, e.boost = d.boost, e.mode = _ ? "flight" : "car", e.activeVehicleId = s, b) {
|
|
18
|
+
b(c, v, y);
|
|
28
19
|
return;
|
|
29
20
|
}
|
|
30
|
-
if (r.copy(
|
|
31
|
-
a.set(
|
|
21
|
+
if (r.copy(c.upAxis), r.lengthSq() < 1e-6 && r.copy(c.bodyYAxis), f.cockpit) {
|
|
22
|
+
a.set(h[0] - m[0], h[1] - m[1] + .32, h[2] - m[2]).applyQuaternion(c.currQuat).add(c.currPos), o.copy(a).addScaledVector(c.bodyZAxis, 24), n.damp3(y.camera.position, a, .04, v), n.damp3(y.camera.up, c.bodyYAxis, .08, v), y.camera.lookAt(o);
|
|
32
23
|
return;
|
|
33
24
|
}
|
|
34
|
-
i.copy(
|
|
35
|
-
let
|
|
36
|
-
a.copy(
|
|
25
|
+
i.copy(c.bodyZAxis), _ || i.projectOnPlane(r).normalize(), i.lengthSq() < 1e-6 && i.copy(c.bodyZAxis);
|
|
26
|
+
let w = _ ? 11.2 : 6.8, T = _ ? 3.1 : 2.15;
|
|
27
|
+
a.copy(c.currPos).addScaledVector(i, -w).addScaledVector(r, T), o.copy(c.currPos).addScaledVector(i, _ ? 7.5 : 3.6).addScaledVector(r, .65), f.camInit ||= (y.camera.position.copy(a), p.copy(o), !0), n.damp3(y.camera.position, a, .14, v), n.damp3(p, o, .08, v), n.damp3(y.camera.up, r, .16, v), y.camera.lookAt(p);
|
|
37
28
|
}
|
|
38
|
-
export {
|
|
29
|
+
export { s as stepKolmoVehicleFrame };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { KolmoGravityContext as e, KolmoPhysics as t, useIsKolmoCustomGravity as n, useOptionalKootaWorld as r } from "../physics/index.js";
|
|
2
2
|
import { KolmoSkybox as i } from "../shaders/celestialBackdrop.js";
|
|
3
3
|
import { syncRetroUniforms as a } from "../shaders/retroShader.js";
|
|
4
|
-
import { EMPTY_KOLMO_INPUT as o, KOLMO_KEY_MAP as s,
|
|
5
|
-
import { RetroViewportSync as
|
|
6
|
-
import { WorldSessionTrait as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import * as
|
|
9
|
-
import { Canvas as
|
|
10
|
-
import { KeyboardControls as
|
|
11
|
-
import { WorldProvider as
|
|
12
|
-
import { Fragment as
|
|
4
|
+
import { EMPTY_KOLMO_INPUT as o, KOLMO_KEY_MAP as s, KolmoKeyboardBridge as c, KolmoKeyboardContext as l, useKolmoInput as u } from "./kolmoInput.js";
|
|
5
|
+
import { RetroViewportSync as d, RoomEnvRig as f, ShadowSnapRig as p } from "./kolmoRigs.js";
|
|
6
|
+
import { WorldSessionTrait as m, ensureWorldSession as h, kolmoActions as g, kolmoWorld as _, useWorldTrait as v } from "./kolmoStore.js";
|
|
7
|
+
import { useEffect as y, useLayoutEffect as b } from "react";
|
|
8
|
+
import * as x from "three";
|
|
9
|
+
import { Canvas as S } from "@react-three/fiber";
|
|
10
|
+
import { KeyboardControls as C } from "@react-three/drei";
|
|
11
|
+
import { WorldProvider as w } from "koota/react";
|
|
12
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
13
13
|
// src/engine/kolmoWorld.tsx
|
|
14
|
-
function
|
|
14
|
+
function O({ children: e, className: t, style: n, fov: r = 56, near: i = .15, far: a = 6500, cameraPosition: o = [
|
|
15
15
|
0,
|
|
16
16
|
3.2,
|
|
17
17
|
-8.5
|
|
18
|
-
], dpr: s = [1, 1.5], frameloop: c = "always", shadows: l = "basic", toneMapping:
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
], dpr: s = [1, 1.5], frameloop: c = "always", shadows: l = "basic", toneMapping: u, onCanvasReady: d, onContextLost: p, roomEnv: m = !1 }) {
|
|
19
|
+
return /* @__PURE__ */ D(S, {
|
|
20
20
|
className: t,
|
|
21
21
|
style: n ?? {
|
|
22
22
|
width: "100%",
|
|
@@ -29,7 +29,7 @@ function E({ children: e, className: t, style: n, fov: r = 56, near: i = .15, fa
|
|
|
29
29
|
gl: {
|
|
30
30
|
antialias: !1,
|
|
31
31
|
powerPreference: "high-performance",
|
|
32
|
-
...
|
|
32
|
+
...u === void 0 ? {} : { toneMapping: u }
|
|
33
33
|
},
|
|
34
34
|
camera: {
|
|
35
35
|
fov: r,
|
|
@@ -38,44 +38,44 @@ function E({ children: e, className: t, style: n, fov: r = 56, near: i = .15, fa
|
|
|
38
38
|
position: o
|
|
39
39
|
},
|
|
40
40
|
onCreated: ({ gl: e }) => {
|
|
41
|
-
e.outputColorSpace =
|
|
41
|
+
e.outputColorSpace = x.SRGBColorSpace;
|
|
42
42
|
let t = e.domElement;
|
|
43
|
-
|
|
43
|
+
d?.(t), p && (t.addEventListener("webglcontextlost", (e) => {
|
|
44
44
|
e.preventDefault(), p(!0);
|
|
45
45
|
}), t.addEventListener("webglcontextrestored", () => p(!1)));
|
|
46
46
|
},
|
|
47
|
-
children: [m !== !1 && /* @__PURE__ */
|
|
47
|
+
children: [m !== !1 && /* @__PURE__ */ E(f, { intensity: typeof m == "number" ? m : .65 }), e]
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
e &&
|
|
50
|
+
function k({ world: e, retroPreset: t }) {
|
|
51
|
+
b(() => {
|
|
52
|
+
e && h(e);
|
|
53
53
|
}, [e]);
|
|
54
|
-
let n =
|
|
55
|
-
return
|
|
56
|
-
e ? t ?
|
|
54
|
+
let n = v(e, m);
|
|
55
|
+
return y(() => {
|
|
56
|
+
e ? t ? g(e).setRetroPreset(t) : n?.activeRetroPreset && a(n.activeRetroPreset) : t && a(t);
|
|
57
57
|
}, [
|
|
58
58
|
e,
|
|
59
59
|
t,
|
|
60
60
|
n?.activeRetroPreset
|
|
61
61
|
]), null;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
let
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
world:
|
|
71
|
-
retroPreset:
|
|
63
|
+
function A({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta: o, physicsDebug: u = !1, retroPreset: d, skybox: f = "nebula", lighting: m = "default", fogExp2: g, sunLightRef: v, shadowSnap: y = !1, world: x = _, keyboardMap: S = s, children: O }) {
|
|
64
|
+
let A = r(), j = x === null ? A : x;
|
|
65
|
+
b(() => {
|
|
66
|
+
j && h(j);
|
|
67
|
+
}, [j]);
|
|
68
|
+
let M = /* @__PURE__ */ D(T, { children: [
|
|
69
|
+
/* @__PURE__ */ E(k, {
|
|
70
|
+
world: j,
|
|
71
|
+
retroPreset: d
|
|
72
72
|
}),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
y && v && /* @__PURE__ */ E(p, { sunLightRef: v }),
|
|
74
|
+
f === "nebula" && /* @__PURE__ */ E(i, {}),
|
|
75
|
+
f === "day" && /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("color", {
|
|
76
76
|
attach: "background",
|
|
77
77
|
args: ["#6ba6d6"]
|
|
78
|
-
}), !
|
|
78
|
+
}), !g && /* @__PURE__ */ E("fog", {
|
|
79
79
|
attach: "fog",
|
|
80
80
|
args: [
|
|
81
81
|
"#9dc4e2",
|
|
@@ -83,18 +83,18 @@ function O({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta:
|
|
|
83
83
|
520
|
|
84
84
|
]
|
|
85
85
|
})] }),
|
|
86
|
-
|
|
86
|
+
g && /* @__PURE__ */ E("fogExp2", {
|
|
87
87
|
attach: "fog",
|
|
88
|
-
args:
|
|
88
|
+
args: g
|
|
89
89
|
}),
|
|
90
|
-
|
|
91
|
-
/* @__PURE__ */
|
|
90
|
+
m === "default" && /* @__PURE__ */ D(T, { children: [
|
|
91
|
+
/* @__PURE__ */ E("hemisphereLight", { args: [
|
|
92
92
|
"#b8dcff",
|
|
93
93
|
"#241d30",
|
|
94
94
|
.8
|
|
95
95
|
] }),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
ref:
|
|
96
|
+
/* @__PURE__ */ E("directionalLight", {
|
|
97
|
+
ref: v,
|
|
98
98
|
position: [
|
|
99
99
|
48,
|
|
100
100
|
76,
|
|
@@ -105,7 +105,7 @@ function O({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta:
|
|
|
105
105
|
castShadow: !0,
|
|
106
106
|
"shadow-mapSize": [1024, 1024]
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ E("directionalLight", {
|
|
109
109
|
position: [
|
|
110
110
|
-42,
|
|
111
111
|
28,
|
|
@@ -115,22 +115,25 @@ function O({ gravity: e = "planar", paused: n = !1, timeScale: a = 1, maxDelta:
|
|
|
115
115
|
color: "#68a8ff"
|
|
116
116
|
})
|
|
117
117
|
] }),
|
|
118
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ E(t, {
|
|
119
119
|
gravity: e,
|
|
120
120
|
paused: n,
|
|
121
121
|
timeScale: a,
|
|
122
122
|
maxDelta: o,
|
|
123
|
-
physicsDebug:
|
|
123
|
+
physicsDebug: u,
|
|
124
124
|
world: null,
|
|
125
|
-
children:
|
|
125
|
+
children: O
|
|
126
126
|
})
|
|
127
|
-
] }),
|
|
128
|
-
map:
|
|
129
|
-
children:
|
|
130
|
-
}) :
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
] }), N = S ? /* @__PURE__ */ E(C, {
|
|
128
|
+
map: S,
|
|
129
|
+
children: /* @__PURE__ */ E(c, { children: M })
|
|
130
|
+
}) : /* @__PURE__ */ E(l.Provider, {
|
|
131
|
+
value: null,
|
|
132
|
+
children: M
|
|
133
|
+
});
|
|
134
|
+
return x !== null && x !== A ? /* @__PURE__ */ E(w, {
|
|
135
|
+
world: x,
|
|
136
|
+
children: N
|
|
137
|
+
}) : N;
|
|
135
138
|
}
|
|
136
|
-
export { o as EMPTY_KOLMO_INPUT, s as KOLMO_KEY_MAP,
|
|
139
|
+
export { o as EMPTY_KOLMO_INPUT, s as KOLMO_KEY_MAP, O as KolmoCanvas, e as KolmoGravityContext, t as KolmoPhysics, A as KolmoWorld, d as RetroViewportSync, f as RoomEnvRig, p as ShadowSnapRig, n as useIsKolmoCustomGravity, u as useKolmoInput, r as useOptionalKootaWorld };
|
package/dist/index.js
CHANGED
|
@@ -44,26 +44,26 @@ import { extractMeshIslands as Rt, normalizeSceneToSi as zt, separateVehicleMesh
|
|
|
44
44
|
import { CHOP_ROLES as Ht, buildSurfaceTopology as Ut, floodFillByCrease as Wt, getIslandTopology as Gt, mirrorTriangles as Kt } from "./importer/surfaceTopology.js";
|
|
45
45
|
import { buildSelectionOverlayGeometry as qt, createFleet12GonWheelGroup as Jt, findMirrorIslandId as Yt, peelIslandSelection as Xt, previewLoopPolyline as Zt, refineMeshAlongLoop as Qt, remapIslandIds as $t, selectFacesByClick as en, selectFacesByLoop as tn } from "./importer/surfaceCutter.js";
|
|
46
46
|
import { ChopShopPanel as nn } from "./importer/ChopShopPanel.js";
|
|
47
|
-
import {
|
|
48
|
-
import { KhrBody as
|
|
49
|
-
import { HeldItem as
|
|
50
|
-
import { bakeArticulatedLauncherGlb as
|
|
51
|
-
import { DomainWorkshopPanel as
|
|
52
|
-
import { DAMP_ZETA as
|
|
53
|
-
import { GateHudBar as
|
|
54
|
-
import { buildImporterWebMcpTools as
|
|
55
|
-
import { makeStarterDomainScene as
|
|
56
|
-
import { compileKhrAssetGlb as
|
|
57
|
-
import { Step1CalibrationPlinth as
|
|
58
|
-
import { C12_TICK_M as
|
|
59
|
-
import { ImperativeVehicleRig as
|
|
60
|
-
import { Step2UniversalPad as
|
|
61
|
-
import { VfxEmitterPool as
|
|
62
|
-
import { convertUsdToGlb as
|
|
63
|
-
import { bakeUniversalGateGlb as
|
|
47
|
+
import { BODY_SI as rn, BODY_SOCKET_IDS as an, bodyEyeOffsetY as on, bodyRestCenterY as sn, bodySpawnPosition as cn, bodyStandingHeight as ln, stepCameraSync as un, withExcludeCharacterRay as dn } from "./body/bodySi.js";
|
|
48
|
+
import { KhrBody as fn } from "./body/KhrBody.js";
|
|
49
|
+
import { HeldItem as pn } from "./body/HeldItem.js";
|
|
50
|
+
import { bakeArticulatedLauncherGlb as mn, buildLauncherSceneFromPlan as hn } from "./importer/launcherBake.js";
|
|
51
|
+
import { DomainWorkshopPanel as gn, enforceRetroPersonMaterials as _n } from "./importer/DomainWorkshopPanel.js";
|
|
52
|
+
import { DAMP_ZETA as vn, FREQ_HZ as yn, gateTelemetry as bn, isGateStep1Unlocked as xn, useGateStore as Sn } from "./importer/gateStore.js";
|
|
53
|
+
import { GateHudBar as Cn } from "./importer/GateHudBar.js";
|
|
54
|
+
import { buildImporterWebMcpTools as wn, getNavigatorModelContext as Tn, useImporterWebMcp as En } from "./importer/importerWebMcp.js";
|
|
55
|
+
import { makeStarterDomainScene as Dn } from "./importer/ImporterPlinthUikitTags.js";
|
|
56
|
+
import { compileKhrAssetGlb as On } from "./importer/khrCompiler.js";
|
|
57
|
+
import { Step1CalibrationPlinth as kn } from "./importer/Step1CalibrationPlinth.js";
|
|
58
|
+
import { C12_TICK_M as An, UNIFIED_ANCHOR_NAMES as jn, computeC12Metrics as Mn, defaultTargetMeters as Nn, detectSceneAnchors as Pn, khrBoxToRapierHalfExtents as Fn, measureAssemblyCalibration as In, measureNormalizedSceneCalibration as Ln, snapMetersToC12 as Rn, wrapSingleMeshWithPaperShellProxy as zn } from "./importer/glbNormalizer.js";
|
|
59
|
+
import { ImperativeVehicleRig as Bn } from "./importer/ImperativeVehicleRig.js";
|
|
60
|
+
import { Step2UniversalPad as Vn } from "./importer/Step2UniversalPad.js";
|
|
61
|
+
import { VfxEmitterPool as Hn } from "./importer/VfxEmitterPool.js";
|
|
62
|
+
import { convertUsdToGlb as Un, isUsdFileName as Wn } from "./importer/usdToGlb.js";
|
|
63
|
+
import { bakeUniversalGateGlb as Gn } from "./importer/universalGateBake.js";
|
|
64
64
|
import { GlbImportGate as $ } from "./importer/GlbImportGate.js";
|
|
65
|
-
import { DOOR_HINGE_SPEC as
|
|
66
|
-
import { DEFAULT_VAULT_URL as
|
|
67
|
-
import { CARBINE_556 as
|
|
68
|
-
import { COUPE_2DOOR as
|
|
69
|
-
export { qe as ATMO_FRAG, Je as ATMO_VERT, z as Actor, w as ActorTrait, rn as
|
|
65
|
+
import { DOOR_HINGE_SPEC as Kn, Ex as qn, ROOT3 as Jn, buildFootprint as Yn, canPlace as Xn, instanceBatches as Zn, latticePose as Qn, planSettlement as $n, poseEq as er, poseFromJSON as tr, poseToFloat as nr, poseToJSON as rr, snapPose as ir, socketFor as ar, triangleCorners as or, vToFloat as sr, worldSockets as cr } from "@khr3/c12";
|
|
66
|
+
import { DEFAULT_VAULT_URL as lr, KOLMO_ASSETS_URL as ur, VAULT_CARS as dr, VAULT_CATALOG as fr, VAULT_CITY as pr, VAULT_WEAPONS as mr, createAssetVault as hr, inspectGlbBuffer as gr, normalizeGlbBuffer as _r, vaultAssetUrl as vr } from "@khr3/assets";
|
|
67
|
+
import { CARBINE_556 as yr, LAUNCHER_RECIPES as br, PISTOL_9MM as xr, SHOTGUN_12G as Sr, attachModule as Cr, createLauncherState as wr, detachModule as Tr, findLauncherRecipe as Er, planLauncher as Dr, stepLauncher as Or } from "@khr3/launchers";
|
|
68
|
+
import { COUPE_2DOOR as kr, FLEET as Ar, SEDAN_4DOOR as jr, VEHICLE_DOMAINS as Mr, VEHICLE_DOMAIN_SPECS as Nr, carUrl as Pr, findCar as Fr, fleetByDomain as Ir, planCar as Lr } from "@khr3/vehicles";
|
|
69
|
+
export { qe as ATMO_FRAG, Je as ATMO_VERT, z as Actor, w as ActorTrait, rn as BODY_SI, an as BODY_SOCKET_IDS, rt as BOTTLE_HEIGHT, Fe as C12TileKind, An as C12_TICK_M, Ie as C12_TILE_M, it as CAN_LOD_THRESHOLD_M, yr as CARBINE_556, Ht as CHOP_ROLES, kr as COUPE_2DOOR, e as Canvas, nn as ChopShopPanel, vn as DAMP_ZETA, lr as DEFAULT_VAULT_URL, Kn as DOOR_HINGE_SPEC, Tt as DestructibleTarget, gn as DomainWorkshopPanel, v as EMPTY_KOLMO_INPUT, X as EmitterRig, qn as Ex, J as Exoplanet, Ar as FLEET, Le as FLOATING_ORIGIN_STEP_M, yn as FREQ_HZ, T as FloatingBodyTrait, ie as GLSL_BAYER_RGB555, ae as GLSL_RETRO_QUANTIZE, Cn as GateHudBar, $ as GlbImportGate, pn as HeldItem, Bn as ImperativeVehicleRig, $ as ImporterWorkbench, Ve as InfiniteLongDrivePlanner, E as InteractableTrait, K as Island, Q as Junk, Ye as KEY_SUN_DIRECTION, ur as KOLMO_ASSETS_URL, At as KOLMO_EXTENSION_NAME, y as KOLMO_KEY_MAP, fn as KhrBody, z as KolmoActor, e as KolmoCanvas, X as KolmoEmitterRig, J as KolmoExoplanet, m as KolmoGravityContext, K as KolmoIsland, Q as KolmoJunk, q as KolmoLongDrive, h as KolmoPhysics, W as KolmoProp, Y as KolmoSkybox, G as KolmoSurface, R as KolmoVehicle, t as KolmoWorld, br as LAUNCHER_RECIPES, q as LongDrive, Re as MACRO_SIZE_M, n as PALETTE_CRUNCHY_16, r as PALETTE_CRUNCHY_64, Et as PARTICLE_FRAG, Dt as PARTICLE_VERT, xr as PISTOL_9MM, Ot as PLUME_FRAG, kt as PLUME_VERT, oe as PS1_SNAP_RESOLUTION, h as Physics, D as PilotLink, W as Prop, i as RETRO_COLOR_MODES, se as RETRO_PRESETS, ce as RETRO_UNIFORMS, Xe as RING_MOONLET_COUNT, Jn as ROOT3, x as RetroViewportSync, S as RoomEnvRig, jr as SEDAN_4DOOR, Sr as SHOTGUN_12G, Ce as SHOULDER_K, Qe as SPLAT_LAYER, ke as SeededSimplex2D, C as ShadowSnapRig, ht as ShardPieces, Ke as ShiftedFixedBody, Y as Skybox, Ae as SplitMix32, kn as Step1CalibrationPlinth, Vn as Step2UniversalPad, G as Surface, ze as TILES_PER_MACRO, at as TIN_CAN_HEIGHT, ot as TIN_CAN_RADIUS, gt as TargetDecals, jn as UNIFIED_ANCHOR_NAMES, dr as VAULT_CARS, fr as VAULT_CATALOG, pr as VAULT_CITY, mr as VAULT_WEAPONS, Mr as VEHICLE_DOMAINS, Nr as VEHICLE_DOMAIN_SPECS, R as Vehicle, O as VehicleTrait, Hn as VfxEmitterPool, t as World, k as WorldSessionTrait, s as applyPs1Material, a as applyRetroFilteringToMaterial, c as applyRetroMaterial, o as applyRetroTextureFiltering, l as applySceneRetroMaterials, bt as applySegmentsToImportedRoot, Cr as attachModule, mn as bakeArticulatedLauncherGlb, Gn as bakeUniversalGateGlb, je as bakeWorldSplatMaps, on as bodyEyeOffsetY, sn as bodyRestCenterY, cn as bodySpawnPosition, ln as bodyStandingHeight, He as buildCarvedTerrainGeometry, Ne as buildDodecagonalCivicHub, Yn as buildFootprint, st as buildGlassBottleGeometry, Ue as buildHighwayAsphaltTexture, wn as buildImporterWebMcpTools, hn as buildLauncherSceneFromPlan, ee as buildPaletteLutData, B as buildPatchPreviewEmitters, We as buildRoadRibbonGeometry, qt as buildSelectionOverlayGeometry, Ut as buildSurfaceTopology, ct as buildTinCanGeometry, Xn as canPlace, Pr as carUrl, me as childSeed, ye as closedRoadFromPoints, pt as collectValidTris, On as compileKhrAssetGlb, Mn as computeC12Metrics, V as computeChopPartHinge, ue as computeIslandSpawnPose, fe as computeLongDriveBridgeheadSpawn, pe as computeLongDriveMainlandSpawn, te as computeRetroDpr, Un as convertUsdToGlb, lt as countGeometryTriangles, hr as createAssetVault, Z as createDefaultSignals, Jt as createFleet12GonWheelGroup, ut as createGlassBottleMaterial, wr as createLauncherState, tt as createPS2RoadMaterialWebGL, nt as createPS2TerrainMaterialWebGL, $e as createPS2WorldTextures, dt as createTinCanMaterials, H as createVehiclePanelAnimator, jt as decodeKolmoRig, Nn as defaultTargetMeters, Tr as detachModule, Pn as detectSceneAnchors, vt as disposeImportedRoot, _n as enforceRetroPersonMaterials, yt as ensureMeshAttributes, A as ensureWorldSession, Rt as extractMeshIslands, he as fbm2, Fr as findCar, Er as findLauncherRecipe, Yt as findMirrorIslandId, Ir as fleetByDomain, Wt as floodFillByCrease, Ee as frontage, bn as gateTelemetry, et as generatePS2DetailSlices, _t as getBulletHoleTexture, de as getCachedIslandPlan, ne as getColorQuantVector, Gt as getIslandTopology, Tn as getNavigatorModelContext, re as getPaletteLutTexture, Ct as getProceduralLabelTexture, u as getRetroPreset, d as getRetroShaderUniforms, be as growRoad, Me as hashSeed, Mt as inferKolmoSocketRole, gr as inspectGlbBuffer, Zn as instanceBatches, xn as isGateStep1Unlocked, Wn as isUsdFileName, Fn as khrBoxToRapierHalfExtents, j as kolmoActions, M as kolmoTelemetry, N as kolmoWorld, Qn as latticePose, wt as loadCustomLabelTexture, xt as loadImportedGlbUrl, De as makeIslandHeightfn, Dn as makeStarterDomainScene, we as makeTerrain, xe as maxGrade, In as measureAssemblyCalibration, Ln as measureNormalizedSceneCalibration, Ft as measureSelection, Kt as mirrorTriangles, Pt as mountPS2WorldMeshes, ge as mulberry32, U as normalToMinusZQuaternion, _r as normalizeGlbBuffer, zt as normalizeSceneToSi, St as parseImportedGlbBuffer, Xt as peelIslandSelection, Lr as planCar, Ge as planDirtSpurs, Oe as planIslandWorld, Dr as planLauncher, $n as planSettlement, Ze as populateMoonletMatrices, er as poseEq, tr as poseFromJSON, nr as poseToFloat, rr as poseToJSON, Zt as previewLoopPolyline, Be as quantizeFloatingOrigin192, P as readFloatingOriginAnchorXZ, Qt as refineMeshAlongLoop, $t as remapIslandIds, Se as roadFromPoints, Pe as routeMacroKnightAStar, Te as sampleHeightfield, _e as seedFrom, ft as selectCanLod, en as selectFacesByClick, tn as selectFacesByLoop, Bt as separateVehicleMeshes, F as shiftFloatingOriginEntities, Vt as sliceMeshTriangles, Rn as snapMetersToC12, ir as snapPose, ar as socketFor, mt as splitObjectIntoShards, Nt as stampKolmoNodesIntoGlb, un as stepCameraSync, Or as stepLauncher, It as suggestCarAxles, f as syncRetroUniforms, p as syncRetroViewport, Lt as toggleIslandSelection, le as togglePropJoint, or as triangleCorners, I as useActiveKolmoWorld, Sn as useGateStore, En as useImporterWebMcp, g as useIsKolmoCustomGravity, b as useKolmoInput, _ as useOptionalKootaWorld, L as useWorldTrait, sr as vToFloat, ve as valueNoise2, vr as vaultAssetUrl, dn as withExcludeCharacterRay, cr as worldSockets, zn as wrapSingleMeshWithPaperShellProxy };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinkaphant/kolmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@khr3/assets": "^0.2.2",
|
|
92
92
|
"@khr3/c12": "^0.3.1",
|
|
93
|
-
"@khr3/core": "^0.1.
|
|
93
|
+
"@khr3/core": "^0.1.3",
|
|
94
94
|
"@khr3/launchers": "^0.2.2",
|
|
95
95
|
"@khr3/vehicles": "^0.1.3",
|
|
96
96
|
"@pmndrs/uikit": "^1.0.78",
|