@pinkaphant/kolmo 0.0.0-stage → 0.1.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/README.md +44 -2
- package/bin/kolmo.mjs +112 -0
- package/dist/engine/index.d.ts +8 -0
- package/dist/engine/index.js +3 -0
- package/dist/engine/kolmoActor.d.ts +6 -0
- package/dist/engine/kolmoIsland.d.ts +17 -0
- package/dist/engine/kolmoLongDrive.d.ts +13 -0
- package/dist/engine/kolmoRigs.d.ts +13 -0
- package/dist/engine/kolmoStore.d.ts +68 -0
- package/dist/engine/kolmoSurface.d.ts +18 -0
- package/dist/engine/kolmoVehicle.d.ts +32 -0
- package/dist/engine/kolmoWorld.d.ts +51 -0
- package/dist/engine/longDriveKit.d.ts +19 -0
- package/dist/engine/mainlandMacroCell.d.ts +19 -0
- package/dist/engine-BiMeAPAi.js +1717 -0
- package/dist/importer/ChopShopPanel.d.ts +44 -0
- package/dist/importer/DomainWorkshopPanel.d.ts +17 -0
- package/dist/importer/GateHudBar.d.ts +29 -0
- package/dist/importer/GlbImportGate.d.ts +7 -0
- package/dist/importer/ImperativeVehicleRig.d.ts +9 -0
- package/dist/importer/Step1CalibrationPlinth.d.ts +38 -0
- package/dist/importer/Step2UniversalPad.d.ts +18 -0
- package/dist/importer/VfxEmitterPool.d.ts +8 -0
- package/dist/importer/chopShopActions.d.ts +44 -0
- package/dist/importer/gateStore.d.ts +73 -0
- package/dist/importer/glbNormalizer.d.ts +22 -0
- package/dist/importer/importerWebMcp.d.ts +37 -0
- package/dist/importer/index.d.ts +17 -0
- package/dist/importer/index.js +3 -0
- package/dist/importer/khrCompiler.d.ts +23 -0
- package/dist/importer/launcherBake.d.ts +15 -0
- package/dist/importer/meshIslands.d.ts +59 -0
- package/dist/importer/surfaceCutter.d.ts +27 -0
- package/dist/importer/surfaceTopology.d.ts +40 -0
- package/dist/importer/universalGateBake.d.ts +41 -0
- package/dist/importer/usdToGlb.d.ts +11 -0
- package/dist/importer/useChopShopController.d.ts +94 -0
- package/dist/importer/vehiclePanelAnim.d.ts +25 -0
- package/dist/importer/wheelAxlePairing.d.ts +19 -0
- package/dist/importer-Cz5w0mnC.js +5005 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +14 -0
- package/dist/junk/DestructibleTarget.d.ts +18 -0
- package/dist/junk/KolmoJunk.d.ts +14 -0
- package/dist/junk/ShardPieces.d.ts +10 -0
- package/dist/junk/TargetDecals.d.ts +18 -0
- package/dist/junk/bvhShatter.d.ts +7 -0
- package/dist/junk/bvhTriCollector.d.ts +20 -0
- package/dist/junk/index.d.ts +12 -0
- package/dist/junk/index.js +1 -0
- package/dist/junk/junkGeometry.d.ts +34 -0
- package/dist/junk/junkImportSanitize.d.ts +6 -0
- package/dist/junk/junkImporter.d.ts +25 -0
- package/dist/junk/junkLabelCanvas.d.ts +7 -0
- package/dist/junk/junkLabels.d.ts +31 -0
- package/dist/junk/junkTypes.d.ts +48 -0
- package/dist/junk/targetHelpers.d.ts +56 -0
- package/dist/junk/targetHitLogic.d.ts +30 -0
- package/dist/junk/useTargetAssets.d.ts +24 -0
- package/dist/junk-B4bC1zAl.js +1049 -0
- package/dist/kolmoSurface-DTnrFXH0.js +558 -0
- package/dist/schema/kolmoSchema.d.ts +69 -0
- package/dist/shaders/celestialBackdrop.d.ts +22 -0
- package/dist/shaders/index.d.ts +6 -0
- package/dist/shaders/index.js +1 -0
- package/dist/shaders/plumeAndSparkle.d.ts +14 -0
- package/dist/shaders/ps2GlslShared.d.ts +20 -0
- package/dist/shaders/ps2MaterialsTSL.d.ts +23 -0
- package/dist/shaders/ps2MaterialsWebGL.d.ts +15 -0
- package/dist/shaders/ps2RoadWebGL.d.ts +7 -0
- package/dist/shaders/ps2TerrainWebGL.d.ts +8 -0
- package/dist/shaders/ps2Textures.d.ts +22 -0
- package/dist/shaders/retroPalettes.d.ts +24 -0
- package/dist/shaders/retroShader.d.ts +69 -0
- package/dist/shaders-GS71Ek1A.js +1383 -0
- package/dist/world/frontage.d.ts +26 -0
- package/dist/world/index.d.ts +9 -0
- package/dist/world/index.js +3 -0
- package/dist/world/infiniteWorld2D.d.ts +24 -0
- package/dist/world/island.d.ts +29 -0
- package/dist/world/macroCellSchema.d.ts +72 -0
- package/dist/world/macroKnightAStar.d.ts +11 -0
- package/dist/world/random.d.ts +23 -0
- package/dist/world/road.d.ts +37 -0
- package/dist/world/roadRibbon.d.ts +44 -0
- package/dist/world/terrain.d.ts +62 -0
- package/dist/world/worldTypes.d.ts +39 -0
- package/dist/world-PRWPYrlx.js +947 -0
- package/dist/worldTypes-Z0KfdCd0.js +226 -0
- package/package.json +100 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type ActiveChopRole, type ChopPartRole, type SurfaceSelectMode } from "./surfaceCutter.js";
|
|
3
|
+
import type { CarDriveMode, WheelVisualSource } from "./khrCompiler.js";
|
|
4
|
+
export interface ChopShopPanelProps {
|
|
5
|
+
readonly targetMeters: number;
|
|
6
|
+
readonly onChangeTargetMeters: (m: number) => void;
|
|
7
|
+
readonly activeRole: ActiveChopRole;
|
|
8
|
+
readonly onSelectRole: (r: ActiveChopRole) => void;
|
|
9
|
+
readonly surfaceMode: SurfaceSelectMode;
|
|
10
|
+
readonly onChangeSurfaceMode: (m: SurfaceSelectMode) => void;
|
|
11
|
+
readonly creaseDeg: number;
|
|
12
|
+
readonly onChangeCreaseDeg: (deg: number) => void;
|
|
13
|
+
readonly mirrorX: boolean;
|
|
14
|
+
readonly onToggleMirrorX: (on: boolean) => void;
|
|
15
|
+
readonly splitCoarse: boolean;
|
|
16
|
+
readonly onToggleSplitCoarse: (on: boolean) => void;
|
|
17
|
+
readonly selectedFaces: number;
|
|
18
|
+
readonly mirroredFaces: number;
|
|
19
|
+
readonly loopDotCount: number;
|
|
20
|
+
readonly undoCount: number;
|
|
21
|
+
readonly partPicks: Readonly<Record<number, ChopPartRole>>;
|
|
22
|
+
readonly wheelCount: number;
|
|
23
|
+
readonly wheelSource: WheelVisualSource;
|
|
24
|
+
readonly onChangeWheelSource: (src: WheelVisualSource) => void;
|
|
25
|
+
readonly driveType: CarDriveMode;
|
|
26
|
+
readonly onChangeDriveType: (d: CarDriveMode) => void;
|
|
27
|
+
readonly horsepower: number;
|
|
28
|
+
readonly onChangeHorsepower: (hp: number) => void;
|
|
29
|
+
readonly hingeScrub: number;
|
|
30
|
+
readonly onChangeHingeScrub: (v: number) => void;
|
|
31
|
+
readonly explodeAmount: number;
|
|
32
|
+
readonly onChangeExplodeAmount: (v: number) => void;
|
|
33
|
+
readonly statusNote: string | null;
|
|
34
|
+
readonly unlocked: boolean;
|
|
35
|
+
readonly busy: boolean;
|
|
36
|
+
readonly onCloseLoop: () => void;
|
|
37
|
+
readonly onPeel: () => void;
|
|
38
|
+
readonly onClearSelection: () => void;
|
|
39
|
+
readonly onUndoCut: () => void;
|
|
40
|
+
readonly onClearTags: () => void;
|
|
41
|
+
readonly onGoTestDrive: () => void;
|
|
42
|
+
readonly onSpawnWorld?: () => void;
|
|
43
|
+
}
|
|
44
|
+
export declare function ChopShopPanel(p: ChopShopPanelProps): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import type { GateDomain } from "./gateStore.js";
|
|
4
|
+
export interface DomainWorkshopPanelProps {
|
|
5
|
+
readonly domain: GateDomain;
|
|
6
|
+
readonly targetMeters: number;
|
|
7
|
+
readonly onChangeTargetMeters: (m: number) => void;
|
|
8
|
+
readonly onSnapC12: () => void;
|
|
9
|
+
readonly onLoadVaultUrl: (url: string, label: string) => void;
|
|
10
|
+
readonly onForgeLauncherRecipe?: (recipeId: string, scene: THREE.Group, lenM: number) => void;
|
|
11
|
+
readonly onAddSocketPatch: (name: string, pos: [number, number, number]) => void;
|
|
12
|
+
readonly workingScene: THREE.Group | null;
|
|
13
|
+
readonly onEnforceCrispyPerson: () => void;
|
|
14
|
+
readonly onUploadToVault?: (category: string, token: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function enforceRetroPersonMaterials(root: THREE.Object3D | null): number;
|
|
17
|
+
export declare function DomainWorkshopPanel({ domain, targetMeters, onChangeTargetMeters, onSnapC12, onLoadVaultUrl, onForgeLauncherRecipe, onAddSocketPatch, onEnforceCrispyPerson, onUploadToVault, }: DomainWorkshopPanelProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type GateDomain, type VehicleSubArchetype } from "./gateStore.js";
|
|
3
|
+
export type StampToolId = "none" | "plume" | "sparkle" | "brake_flare" | "headlight" | "seat" | "optic" | "muzzle";
|
|
4
|
+
export interface GateHudBarProps {
|
|
5
|
+
readonly hasCustomFile: boolean;
|
|
6
|
+
readonly assetName: string;
|
|
7
|
+
readonly usdInfo: string | null;
|
|
8
|
+
readonly busy: boolean;
|
|
9
|
+
readonly wheelCount: number;
|
|
10
|
+
readonly choppedCount: number;
|
|
11
|
+
readonly stampTool: StampToolId;
|
|
12
|
+
readonly patchCount: number;
|
|
13
|
+
readonly onChooseFile: () => void;
|
|
14
|
+
readonly onLoadStarterCar: (url: string, label: string) => void;
|
|
15
|
+
readonly onSelectDomain: (d: GateDomain) => void;
|
|
16
|
+
readonly onSelectVehicleSub: (sub: VehicleSubArchetype) => void;
|
|
17
|
+
readonly onBumpTurn: (axis: 0 | 1 | 2) => void;
|
|
18
|
+
readonly onAutoScaleSi: () => void;
|
|
19
|
+
readonly onSnapYZero: () => void;
|
|
20
|
+
readonly onSnapC12: () => void;
|
|
21
|
+
readonly onWrapProxy: () => void;
|
|
22
|
+
readonly onAutoPopWheels: () => void;
|
|
23
|
+
readonly onSelectStampTool: (tool: StampToolId) => void;
|
|
24
|
+
readonly onUndoPatch: () => void;
|
|
25
|
+
readonly onSwingPanelRole: (prefix: string) => void;
|
|
26
|
+
readonly onDownloadGlb: () => void;
|
|
27
|
+
readonly onSpawnWorld?: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function GateHudBar(p: GateHudBarProps): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { GateWorldPayload } from "./universalGateBake.js";
|
|
3
|
+
export interface GlbImportGateProps {
|
|
4
|
+
readonly onSpawnInWorld?: (asset: GateWorldPayload) => void;
|
|
5
|
+
readonly enableWebMcp?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function GlbImportGate({ onSpawnInWorld, enableWebMcp }: GlbImportGateProps): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PaperShellAssembly } from "@khr3/vehicles/paper-shell";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
export interface ImperativeVehicleRigProps {
|
|
5
|
+
readonly assembly: PaperShellAssembly;
|
|
6
|
+
readonly importedRoot: THREE.Object3D | null;
|
|
7
|
+
readonly chassisGroupRef: React.RefObject<THREE.Group | null>;
|
|
8
|
+
}
|
|
9
|
+
export declare function ImperativeVehicleRig({ assembly, importedRoot, chassisGroupRef }: ImperativeVehicleRigProps): React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PaperShellAssembly } from "@khr3/vehicles/paper-shell";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
import { type GateDomain } from "./gateStore.js";
|
|
5
|
+
import { type ChopPartRole, type CutVec3, type FaceSelection, type SurfaceSelectMode } from "./surfaceCutter.js";
|
|
6
|
+
import { type MeshIsland, type WheelAxle } from "./meshIslands.js";
|
|
7
|
+
import { type WheelVisualSource } from "./khrCompiler.js";
|
|
8
|
+
export declare function makeStarterDomainScene(domain: GateDomain): THREE.Group;
|
|
9
|
+
export interface Step1FaceHit {
|
|
10
|
+
readonly islandId: number;
|
|
11
|
+
readonly faceIndex: number;
|
|
12
|
+
readonly point: [number, number, number];
|
|
13
|
+
readonly erase: boolean;
|
|
14
|
+
readonly isDrag: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface Step1CalibrationPlinthProps {
|
|
17
|
+
readonly assembly: PaperShellAssembly;
|
|
18
|
+
readonly useProxy: boolean;
|
|
19
|
+
readonly previewScene: THREE.Group | null;
|
|
20
|
+
readonly islands: readonly MeshIsland[];
|
|
21
|
+
readonly axles: readonly WheelAxle[];
|
|
22
|
+
readonly wheelColors: ReadonlyMap<number, string>;
|
|
23
|
+
readonly partPicks: Readonly<Record<number, ChopPartRole>>;
|
|
24
|
+
readonly wheelSource: WheelVisualSource;
|
|
25
|
+
readonly surfaceMode: SurfaceSelectMode;
|
|
26
|
+
readonly activeRoleColor: string;
|
|
27
|
+
readonly faceSelection: FaceSelection | null;
|
|
28
|
+
readonly loopDots: {
|
|
29
|
+
readonly islandId: number;
|
|
30
|
+
readonly points: readonly CutVec3[];
|
|
31
|
+
} | null;
|
|
32
|
+
readonly hingeScrub: number;
|
|
33
|
+
readonly explodeAmount: number;
|
|
34
|
+
readonly onClickIsland: (id: number) => void;
|
|
35
|
+
readonly onPickFace: (hit: Step1FaceHit) => void;
|
|
36
|
+
readonly rootObjRef: React.RefObject<THREE.Group | null>;
|
|
37
|
+
}
|
|
38
|
+
export declare function Step1CalibrationPlinth(p: Step1CalibrationPlinthProps): React.JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ThreeEvent } from "@react-three/fiber";
|
|
2
|
+
import { type KhrAssetBundle } from "@khr3/core";
|
|
3
|
+
import type { PaperShellAssembly } from "@khr3/vehicles/paper-shell";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
import { type KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
7
|
+
import { type VehiclePanelAnimator } from "./khrCompiler.js";
|
|
8
|
+
export interface Step2UniversalPadProps {
|
|
9
|
+
readonly assembly: PaperShellAssembly;
|
|
10
|
+
readonly importedRoot: THREE.Object3D | null;
|
|
11
|
+
readonly rootObjRef: React.RefObject<THREE.Group | null>;
|
|
12
|
+
readonly liveBundle: KhrAssetBundle | null;
|
|
13
|
+
readonly patches: readonly KolmoAuthoredNodePatch[];
|
|
14
|
+
readonly stampActive: boolean;
|
|
15
|
+
readonly panelAnimRef: React.MutableRefObject<VehiclePanelAnimator | null>;
|
|
16
|
+
readonly onStampSurface: (e: ThreeEvent<MouseEvent>) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function Step2UniversalPad({ assembly, importedRoot, rootObjRef, liveBundle, patches, stampActive, panelAnimRef, onStampSurface, }: Step2UniversalPadProps): React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import type { VfxEmitterMount } from "@khr3/vehicles/paper-shell";
|
|
4
|
+
export interface VfxEmitterPoolProps {
|
|
5
|
+
readonly chassisObjRef: React.RefObject<THREE.Object3D | null>;
|
|
6
|
+
readonly emitters: readonly VfxEmitterMount[];
|
|
7
|
+
}
|
|
8
|
+
export declare function VfxEmitterPool({ chassisObjRef, emitters }: VfxEmitterPoolProps): React.JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ThreeEvent } from "@react-three/fiber";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import type { KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
4
|
+
import type { StampToolId } from "./GateHudBar.js";
|
|
5
|
+
import { type MeshIsland, type WheelAxle } from "./meshIslands.js";
|
|
6
|
+
import { type ActiveChopRole, type ChopPartRole, type CutVec3, type FaceSelection } from "./surfaceCutter.js";
|
|
7
|
+
export declare function executeCloseLoop(params: {
|
|
8
|
+
readonly workingScene: THREE.Object3D;
|
|
9
|
+
readonly islands: readonly MeshIsland[];
|
|
10
|
+
readonly loopDots: {
|
|
11
|
+
readonly islandId: number;
|
|
12
|
+
readonly points: readonly CutVec3[];
|
|
13
|
+
};
|
|
14
|
+
readonly splitCoarse: boolean;
|
|
15
|
+
readonly mirrorX: boolean;
|
|
16
|
+
readonly axles: readonly WheelAxle[];
|
|
17
|
+
}): {
|
|
18
|
+
selection: FaceSelection;
|
|
19
|
+
refinedUndo?: () => void;
|
|
20
|
+
nextAxles?: WheelAxle[];
|
|
21
|
+
};
|
|
22
|
+
export interface PeelTransactionResult {
|
|
23
|
+
readonly nextAxles: WheelAxle[];
|
|
24
|
+
readonly nextPicks: Record<number, ChopPartRole>;
|
|
25
|
+
readonly undo: () => void;
|
|
26
|
+
readonly status: string;
|
|
27
|
+
readonly bumpHinge: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function executePeelTransaction(params: {
|
|
30
|
+
readonly workingScene: THREE.Object3D;
|
|
31
|
+
readonly islands: readonly MeshIsland[];
|
|
32
|
+
readonly faceSelection: FaceSelection;
|
|
33
|
+
readonly activeRole: ActiveChopRole;
|
|
34
|
+
readonly cutName: string;
|
|
35
|
+
readonly prevAxles: readonly WheelAxle[];
|
|
36
|
+
readonly prevPicks: Readonly<Record<number, ChopPartRole>>;
|
|
37
|
+
readonly mode: "car" | "motorcycle";
|
|
38
|
+
}): PeelTransactionResult;
|
|
39
|
+
export declare function buildSurfaceStampPatch(e: ThreeEvent<MouseEvent>, stampTool: StampToolId, index: number): KolmoAuthoredNodePatch | null;
|
|
40
|
+
export declare function parseIngestedAssetFile(file: File): Promise<{
|
|
41
|
+
baseName: string;
|
|
42
|
+
scene: THREE.Group;
|
|
43
|
+
usdInfo: string | null;
|
|
44
|
+
}>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type PaperShellPresetId, type ShadingMode, type ShellPartId } from "@khr3/vehicles/paper-shell";
|
|
2
|
+
import type { CarDriveMode } from "./khrCompiler.js";
|
|
3
|
+
export type GateStep = 1 | 2;
|
|
4
|
+
export type GateDomain = "vehicle" | "c12" | "launcher" | "person" | "prop" | "junk";
|
|
5
|
+
export type VehicleSubArchetype = "car" | "motorcycle" | "starcraft";
|
|
6
|
+
export type EraMode = "dreamcast-60" | "psx-1-3";
|
|
7
|
+
export type FreqBucket = "TRUCK" | "STREET" | "SPORT";
|
|
8
|
+
export type DampBucket = "PLUSH" | "BALANCED" | "STIFF";
|
|
9
|
+
export type WrenchMode = "UNLATCH_200" | "RIP_1800";
|
|
10
|
+
export declare const FREQ_HZ: Readonly<Record<FreqBucket, number>>;
|
|
11
|
+
export declare const DAMP_ZETA: Readonly<Record<DampBucket, number>>;
|
|
12
|
+
export interface CalibrationMetrics {
|
|
13
|
+
readonly wheelbase: number;
|
|
14
|
+
readonly trackWidth: number;
|
|
15
|
+
readonly wheelRadii: readonly [number, number, number, number];
|
|
16
|
+
readonly minY: number;
|
|
17
|
+
readonly aabbSize: readonly [number, number, number];
|
|
18
|
+
readonly c12Ticks: readonly [number, number, number];
|
|
19
|
+
readonly c12Aligned: boolean;
|
|
20
|
+
readonly detectedAnchors: readonly string[];
|
|
21
|
+
readonly isSingleMeshProxy: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface DetachedDebrisItem {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly partId: ShellPartId;
|
|
26
|
+
readonly massKg: number;
|
|
27
|
+
readonly position: [number, number, number];
|
|
28
|
+
readonly quaternion: [number, number, number, number];
|
|
29
|
+
readonly linvel: [number, number, number];
|
|
30
|
+
readonly angvel: [number, number, number];
|
|
31
|
+
readonly aabbSize: [number, number, number];
|
|
32
|
+
readonly colorHex: number;
|
|
33
|
+
}
|
|
34
|
+
/** Mutable 60Hz telemetry updated inside Rapier / useFrame without triggering React re-renders. */
|
|
35
|
+
export declare const gateTelemetry: {
|
|
36
|
+
massKg: number;
|
|
37
|
+
com: [number, number, number];
|
|
38
|
+
frontSplit: number;
|
|
39
|
+
cornerK: [number, number];
|
|
40
|
+
speedKmh: number;
|
|
41
|
+
rpm: number;
|
|
42
|
+
sparkBurst: [number, number, number] | null;
|
|
43
|
+
massDirty: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare function isGateStep1Unlocked(cal: CalibrationMetrics, domain: GateDomain, vehicleArchetype: VehicleSubArchetype, usePaperShellProxy: boolean): boolean;
|
|
46
|
+
export interface GateState {
|
|
47
|
+
step: GateStep;
|
|
48
|
+
domain: GateDomain;
|
|
49
|
+
vehicleArchetype: VehicleSubArchetype;
|
|
50
|
+
usePaperShellProxy: boolean;
|
|
51
|
+
presetId: PaperShellPresetId;
|
|
52
|
+
shadingMode: ShadingMode;
|
|
53
|
+
eraMode: EraMode;
|
|
54
|
+
freqBucket: FreqBucket;
|
|
55
|
+
dampBucket: DampBucket;
|
|
56
|
+
wrenchMode: WrenchMode;
|
|
57
|
+
driveType: CarDriveMode;
|
|
58
|
+
staticProp: boolean;
|
|
59
|
+
massKg: number;
|
|
60
|
+
powerOrThrust: number;
|
|
61
|
+
attachedMask: number;
|
|
62
|
+
unlatchedMask: number;
|
|
63
|
+
fuelLiters: number;
|
|
64
|
+
dropTrigger: number;
|
|
65
|
+
chaseCam: boolean;
|
|
66
|
+
detachedDebris: readonly DetachedDebrisItem[];
|
|
67
|
+
calibration: CalibrationMetrics;
|
|
68
|
+
setField: <K extends keyof GateState>(key: K, value: GateState[K]) => void;
|
|
69
|
+
setCalibration: (cal: CalibrationMetrics) => void;
|
|
70
|
+
triggerDrop: () => void;
|
|
71
|
+
resetAllPanels: () => void;
|
|
72
|
+
}
|
|
73
|
+
export declare const useGateStore: import("zustand").UseBoundStore<import("zustand").StoreApi<GateState>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type PaperShellAssembly, type PaperShellPresetId, type ShadingMode } from "@khr3/vehicles/paper-shell";
|
|
3
|
+
import { type CalibrationMetrics, type GateDomain, type VehicleSubArchetype } from "./gateStore.js";
|
|
4
|
+
export declare const C12_TICK_M: number;
|
|
5
|
+
export declare const UNIFIED_ANCHOR_NAMES: readonly string[];
|
|
6
|
+
/** Convert KHR_implicit_shapes box.size (FULL [w, h, d] in meters) to Rapier CuboidCollider half-extents. */
|
|
7
|
+
export declare function khrBoxToRapierHalfExtents(fullSize: readonly [number, number, number]): [number, number, number];
|
|
8
|
+
export declare function snapMetersToC12(meters: number): number;
|
|
9
|
+
export declare function computeC12Metrics(size: readonly [number, number, number]): {
|
|
10
|
+
c12Ticks: [number, number, number];
|
|
11
|
+
c12Aligned: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function detectSceneAnchors(root: THREE.Object3D | null): string[];
|
|
14
|
+
export declare function defaultTargetMeters(domain: GateDomain, sub: VehicleSubArchetype): {
|
|
15
|
+
len: number;
|
|
16
|
+
massKg: number;
|
|
17
|
+
power: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function measureAssemblyCalibration(assembly: PaperShellAssembly, scaleFactor?: number, yOffset?: number, isProxy?: boolean, importedRoot?: THREE.Object3D | null): CalibrationMetrics;
|
|
20
|
+
export declare function measureNormalizedSceneCalibration(scene: THREE.Object3D, yOffset?: number): CalibrationMetrics;
|
|
21
|
+
/** Wrap an unsegmented single-mesh GLB import with a synchronized C0 paper-shell collider + breakaway lattice. */
|
|
22
|
+
export declare function wrapSingleMeshWithPaperShellProxy(importedRoot: THREE.Object3D | null, fallbackPreset?: PaperShellPresetId, shadingMode?: ShadingMode): PaperShellAssembly;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type GateDomain } from "./gateStore.js";
|
|
2
|
+
export interface WebMcpTool {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly description: string;
|
|
5
|
+
readonly inputSchema: Record<string, unknown>;
|
|
6
|
+
readonly annotations?: {
|
|
7
|
+
readonly readOnlyHint?: boolean;
|
|
8
|
+
};
|
|
9
|
+
readonly execute: (input: Record<string, unknown>) => unknown | Promise<unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface ModelContext {
|
|
12
|
+
registerTool(tool: WebMcpTool, options?: {
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}): unknown;
|
|
15
|
+
unregisterTool?(name: string): void;
|
|
16
|
+
}
|
|
17
|
+
export interface ImporterWebMcpHost {
|
|
18
|
+
readonly assetName: string;
|
|
19
|
+
readonly wheelCount: number;
|
|
20
|
+
readonly choppedCount: number;
|
|
21
|
+
readonly unlocked: boolean;
|
|
22
|
+
readonly targetMeters: number;
|
|
23
|
+
readonly setTargetMeters: (m: number) => void;
|
|
24
|
+
readonly bumpTurn: (axis: 0 | 1 | 2) => void;
|
|
25
|
+
readonly autoPopWheels: () => void;
|
|
26
|
+
readonly applyDomainDefaults: (d: GateDomain, sub: "car" | "motorcycle" | "starcraft", proxy: boolean) => void;
|
|
27
|
+
readonly loadStarterCar: (url: string, label: string) => void;
|
|
28
|
+
readonly addAnchorPoint: (name: string, pos: [number, number, number]) => void;
|
|
29
|
+
readonly sealAndExport: (spawnInWorld: boolean) => Promise<void>;
|
|
30
|
+
readonly captureDataUrl?: () => string | null;
|
|
31
|
+
}
|
|
32
|
+
export declare function getNavigatorModelContext(): ModelContext | null;
|
|
33
|
+
/**
|
|
34
|
+
* Registers W3C WebMCP tools onto `navigator.modelContext` using clean unprefixed `importer_*` names.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildImporterWebMcpTools(host: ImporterWebMcpHost): readonly WebMcpTool[];
|
|
37
|
+
export declare function useImporterWebMcp(host: ImporterWebMcpHost, enabled?: boolean): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { GlbImportGate, GlbImportGate as ImporterWorkbench, type GlbImportGateProps } from "./GlbImportGate.js";
|
|
2
|
+
export { GateHudBar, type GateHudBarProps, type StampToolId } from "./GateHudBar.js";
|
|
3
|
+
export { Step1CalibrationPlinth, makeStarterDomainScene, type Step1CalibrationPlinthProps } from "./Step1CalibrationPlinth.js";
|
|
4
|
+
export { ImperativeVehicleRig, type ImperativeVehicleRigProps } from "./ImperativeVehicleRig.js";
|
|
5
|
+
export { Step2UniversalPad, type Step2UniversalPadProps } from "./Step2UniversalPad.js";
|
|
6
|
+
export { VfxEmitterPool, type VfxEmitterPoolProps } from "./VfxEmitterPool.js";
|
|
7
|
+
export { DAMP_ZETA, FREQ_HZ, gateTelemetry, isGateStep1Unlocked, useGateStore, type CalibrationMetrics, type DampBucket, type DetachedDebrisItem, type EraMode, type FreqBucket, type GateDomain, type GateState, type GateStep, type VehicleSubArchetype, type WrenchMode, } from "./gateStore.js";
|
|
8
|
+
export { C12_TICK_M, UNIFIED_ANCHOR_NAMES, computeC12Metrics, defaultTargetMeters, detectSceneAnchors, khrBoxToRapierHalfExtents, measureAssemblyCalibration, measureNormalizedSceneCalibration, snapMetersToC12, wrapSingleMeshWithPaperShellProxy, } from "./glbNormalizer.js";
|
|
9
|
+
export { bakeUniversalGateGlb, type GateWorldPayload, type UniversalBakeInput, type WorldAssetKind, } from "./universalGateBake.js";
|
|
10
|
+
export { bakeArticulatedLauncherGlb, buildLauncherSceneFromPlan, } from "./launcherBake.js";
|
|
11
|
+
export { convertUsdToGlb, isUsdFileName } from "./usdToGlb.js";
|
|
12
|
+
export { ChopShopPanel, type ChopShopPanelProps } from "./ChopShopPanel.js";
|
|
13
|
+
export { DomainWorkshopPanel, enforceRetroPersonMaterials, type DomainWorkshopPanelProps } from "./DomainWorkshopPanel.js";
|
|
14
|
+
export { buildImporterWebMcpTools, getNavigatorModelContext, useImporterWebMcp, type ImporterWebMcpHost, type ModelContext, type WebMcpTool, } from "./importerWebMcp.js";
|
|
15
|
+
export * from "./surfaceCutter.js";
|
|
16
|
+
export * from "./meshIslands.js";
|
|
17
|
+
export * from "./khrCompiler.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as e, i as t, o as n, s as r } from "../kolmoSurface-DTnrFXH0.js";
|
|
2
|
+
import { $ as i, A as a, B as o, C as s, D as c, E as l, F as u, G as d, H as f, I as p, J as m, K as h, L as g, M as _, N as v, O as y, P as b, Q as x, R as S, S as C, T as w, U as T, V as E, W as D, X as O, Y as k, Z as ee, _ as A, a as j, b as M, c as N, d as P, et as F, f as I, g as L, h as R, i as z, j as B, k as V, l as H, m as U, n as W, nt as G, o as K, p as q, q as J, r as Y, s as X, t as Z, tt as Q, u as $, v as te, w as ne, x as re, y as ie, z as ae } from "../importer-Cz5w0mnC.js";
|
|
3
|
+
export { N as C12_TICK_M, D as CHOP_ROLES, v as ChopShopPanel, ne as DAMP_ZETA, V as DomainWorkshopPanel, w as FREQ_HZ, s as GateHudBar, Z as GlbImportGate, Z as ImporterWorkbench, X as ImperativeVehicleRig, te as Step1CalibrationPlinth, K as Step2UniversalPad, H as UNIFIED_ANCHOR_NAMES, j as VfxEmitterPool, B as bakeArticulatedLauncherGlb, W as bakeUniversalGateGlb, M as buildImporterWebMcpTools, _ as buildLauncherSceneFromPlan, t as buildPatchPreviewEmitters, u as buildSelectionOverlayGeometry, d as buildSurfaceTopology, b as compileKhrAssetGlb, $ as computeC12Metrics, e as computeChopPartHinge, Y as convertUsdToGlb, p as createFleet12GonWheelGroup, n as createVehiclePanelAnimator, P as defaultTargetMeters, I as detectSceneAnchors, a as enforceRetroPersonMaterials, k as extractMeshIslands, g as findMirrorIslandId, h as floodFillByCrease, l as gateTelemetry, J as getIslandTopology, re as getNavigatorModelContext, c as isGateStep1Unlocked, z as isUsdFileName, q as khrBoxToRapierHalfExtents, ie as makeStarterDomainScene, U as measureAssemblyCalibration, R as measureNormalizedSceneCalibration, i as measureSelection, m as mirrorTriangles, r as normalToMinusZQuaternion, O as normalizeSceneToSi, S as peelIslandSelection, ae as previewLoopPolyline, o as refineMeshAlongLoop, E as remapIslandIds, f as selectFacesByClick, T as selectFacesByLoop, ee as separateVehicleMeshes, x as sliceMeshTriangles, L as snapMetersToC12, F as suggestCarAxles, Q as suggestMotorcycleWheels, G as toggleIslandSelection, y as useGateStore, C as useImporterWebMcp, A as wrapSingleMeshWithPaperShellProxy };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
3
|
+
import { type ChopPartRole } from "./surfaceCutter.js";
|
|
4
|
+
import { type MeshIsland, type WheelAxle } from "./meshIslands.js";
|
|
5
|
+
import { buildPatchPreviewEmitters, computeChopPartHinge, createVehiclePanelAnimator, normalToMinusZQuaternion, type ChopHingeSpec, type VehiclePanelAnimator } from "./vehiclePanelAnim.js";
|
|
6
|
+
export { buildPatchPreviewEmitters, computeChopPartHinge, createVehiclePanelAnimator, normalToMinusZQuaternion, type ChopHingeSpec, type VehiclePanelAnimator, };
|
|
7
|
+
export type KolmoAssetArchetype = "car" | "motorcycle" | "starcraft" | "prop";
|
|
8
|
+
export type CarDriveMode = "RWD" | "FWD" | "AWD";
|
|
9
|
+
export type WheelVisualSource = "imported" | "fleet12";
|
|
10
|
+
export interface KolmoCompileOptions {
|
|
11
|
+
archetype: KolmoAssetArchetype;
|
|
12
|
+
massKg: number;
|
|
13
|
+
powerOrThrust: number;
|
|
14
|
+
driveType?: CarDriveMode;
|
|
15
|
+
wheelSource?: WheelVisualSource;
|
|
16
|
+
staticProp?: boolean;
|
|
17
|
+
axles?: readonly WheelAxle[];
|
|
18
|
+
islands?: readonly MeshIsland[];
|
|
19
|
+
partPicks?: Readonly<Record<number, ChopPartRole>>;
|
|
20
|
+
patches?: readonly KolmoAuthoredNodePatch[];
|
|
21
|
+
name?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function compileKhrAssetGlb(normalizedScene: THREE.Group, opts: KolmoCompileOptions): Promise<Uint8Array>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type KhrAssetBundle } from "@khr3/core";
|
|
3
|
+
import { KOLMOGOROV_CARBINE, KOLMOGOROV_PISTOL, KOLMOGOROV_SHOTGUN, LAUNCHER_RECIPES, type LauncherPlan, type LauncherRecipe } from "@khr3/launchers";
|
|
4
|
+
import { type KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
5
|
+
export { KOLMOGOROV_CARBINE, KOLMOGOROV_PISTOL, KOLMOGOROV_SHOTGUN, LAUNCHER_RECIPES };
|
|
6
|
+
/**
|
|
7
|
+
* Builds a Three.js scene graph matching `planLauncher(recipe)` node names & local transforms
|
|
8
|
+
* (attaching an optional imported visual mesh onto `Receiver_Root`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildLauncherSceneFromPlan(plan: LauncherPlan, visualOverlay?: THREE.Group | null): THREE.Group;
|
|
11
|
+
export declare function bakeArticulatedLauncherGlb(recipeOrId?: string | LauncherRecipe, visualOverlay?: THREE.Group | null, patches?: readonly KolmoAuthoredNodePatch[]): Promise<{
|
|
12
|
+
glbBytes: Uint8Array;
|
|
13
|
+
bundle: KhrAssetBundle;
|
|
14
|
+
plan: LauncherPlan;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
export type QuarterTurn = 0 | 1 | 2 | 3;
|
|
3
|
+
export type OrientTurns = readonly [QuarterTurn, QuarterTurn, QuarterTurn];
|
|
4
|
+
export type ScaleAxis = "lengthZ" | "heightY" | "widthX" | "maxSpan";
|
|
5
|
+
export interface NormalizedSiScene {
|
|
6
|
+
scene: THREE.Group;
|
|
7
|
+
sizeMeters: [number, number, number];
|
|
8
|
+
scaleApplied: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MeshIsland {
|
|
11
|
+
id: number;
|
|
12
|
+
mesh: THREE.Mesh;
|
|
13
|
+
geometry: THREE.BufferGeometry;
|
|
14
|
+
material: THREE.Material;
|
|
15
|
+
triangleIndices: Uint32Array;
|
|
16
|
+
min: [number, number, number];
|
|
17
|
+
max: [number, number, number];
|
|
18
|
+
center: [number, number, number];
|
|
19
|
+
size: [number, number, number];
|
|
20
|
+
}
|
|
21
|
+
export interface SeparatedWheelMesh {
|
|
22
|
+
nodeName: string;
|
|
23
|
+
center: [number, number, number];
|
|
24
|
+
group: THREE.Group;
|
|
25
|
+
}
|
|
26
|
+
export interface SeparatedPanelMesh {
|
|
27
|
+
nodeName: string;
|
|
28
|
+
anchor: [number, number, number];
|
|
29
|
+
center: [number, number, number];
|
|
30
|
+
size: [number, number, number];
|
|
31
|
+
group: THREE.Group;
|
|
32
|
+
}
|
|
33
|
+
export interface SeparatedVehicleMeshes {
|
|
34
|
+
wheels: SeparatedWheelMesh[];
|
|
35
|
+
panels: SeparatedPanelMesh[];
|
|
36
|
+
chassisGroup: THREE.Group;
|
|
37
|
+
fullBounds: {
|
|
38
|
+
min: [number, number, number];
|
|
39
|
+
max: [number, number, number];
|
|
40
|
+
center: [number, number, number];
|
|
41
|
+
size: [number, number, number];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export { measureSelection, suggestCarAxles, suggestMotorcycleWheels, toggleIslandSelection, type SelectionBounds, type WheelAxle } from "./wheelAxlePairing.js";
|
|
45
|
+
export declare function normalizeSceneToSi(sourceScene: THREE.Object3D, options: {
|
|
46
|
+
turns?: OrientTurns;
|
|
47
|
+
targetMeters: number;
|
|
48
|
+
axis?: ScaleAxis;
|
|
49
|
+
}): NormalizedSiScene;
|
|
50
|
+
export declare function sliceMeshTriangles(baked: THREE.BufferGeometry, tris: ArrayLike<number>, off?: readonly [number, number, number]): THREE.BufferGeometry;
|
|
51
|
+
export declare function extractMeshIslands(normalizedScene: THREE.Object3D, weldTolerance?: number): MeshIsland[];
|
|
52
|
+
export declare function separateVehicleMeshes(normalizedScene: THREE.Object3D, islands: readonly MeshIsland[], wheelGroups: ReadonlyArray<{
|
|
53
|
+
nodeName: string;
|
|
54
|
+
islandIds: readonly number[];
|
|
55
|
+
}>, panelGroups?: ReadonlyArray<{
|
|
56
|
+
nodeName: string;
|
|
57
|
+
islandIds: readonly number[];
|
|
58
|
+
anchor: [number, number, number];
|
|
59
|
+
}>): SeparatedVehicleMeshes;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type MeshIsland } from "./meshIslands.js";
|
|
3
|
+
import { CHOP_ROLES, buildSurfaceTopology, floodFillByCrease, getIslandTopology, mirrorTriangles, type ActiveChopRole, type ChopPartRole, type CutVec3, type FaceSelection, type SurfaceSelectMode, type SurfaceTopology } from "./surfaceTopology.js";
|
|
4
|
+
export { CHOP_ROLES, buildSurfaceTopology, floodFillByCrease, getIslandTopology, mirrorTriangles, type ActiveChopRole, type ChopPartRole, type CutVec3, type FaceSelection, type SurfaceSelectMode, type SurfaceTopology };
|
|
5
|
+
export declare function selectFacesByClick(island: MeshIsland, faceIndex: number, mode: Exclude<SurfaceSelectMode, "island" | "loop">, opts: {
|
|
6
|
+
creaseDeg: number;
|
|
7
|
+
mirrorX: boolean;
|
|
8
|
+
current: FaceSelection | null;
|
|
9
|
+
remove?: boolean;
|
|
10
|
+
}): FaceSelection;
|
|
11
|
+
export declare function previewLoopPolyline(island: MeshIsland, dots: readonly CutVec3[]): [number, number, number][];
|
|
12
|
+
export declare function selectFacesByLoop(island: MeshIsland, dots: readonly CutVec3[], opts: {
|
|
13
|
+
mirrorX: boolean;
|
|
14
|
+
exact?: boolean;
|
|
15
|
+
}): FaceSelection;
|
|
16
|
+
export declare function refineMeshAlongLoop(geometry: THREE.BufferGeometry, dots: readonly CutVec3[], depthM?: number): {
|
|
17
|
+
geometry: THREE.BufferGeometry;
|
|
18
|
+
added: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function peelIslandSelection(island: MeshIsland, selection: FaceSelection, baseName: string): {
|
|
21
|
+
mintedMeshes: THREE.Mesh[];
|
|
22
|
+
undo: () => void;
|
|
23
|
+
};
|
|
24
|
+
export declare function remapIslandIds(before: readonly MeshIsland[], after: readonly MeshIsland[]): Map<number, number | null>;
|
|
25
|
+
export declare function findMirrorIslandId(islands: readonly MeshIsland[], seedId: number, excludeIds?: ReadonlySet<number>): number | null;
|
|
26
|
+
export declare function buildSelectionOverlayGeometry(src: THREE.BufferGeometry, tris: readonly number[], liftM?: number): THREE.BufferGeometry;
|
|
27
|
+
export declare function createFleet12GonWheelGroup(radius: number, width: number, nodeName?: string): THREE.Group;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import type { MeshIsland } from "./meshIslands.js";
|
|
3
|
+
export type SurfaceSelectMode = "island" | "crease" | "loop" | "triangle";
|
|
4
|
+
export type ChopPartRole = "door" | "hood" | "trunk" | "fender" | "bumper";
|
|
5
|
+
export type ActiveChopRole = "wheel" | ChopPartRole;
|
|
6
|
+
export type CutVec3 = readonly [number, number, number];
|
|
7
|
+
export declare const CHOP_ROLES: ReadonlyArray<{
|
|
8
|
+
role: ActiveChopRole;
|
|
9
|
+
label: string;
|
|
10
|
+
color: string;
|
|
11
|
+
massKg: number;
|
|
12
|
+
}>;
|
|
13
|
+
export interface FaceSelection {
|
|
14
|
+
readonly islandId: number;
|
|
15
|
+
readonly triangles: number[];
|
|
16
|
+
readonly mirrored: number[];
|
|
17
|
+
}
|
|
18
|
+
export interface SurfaceTopology {
|
|
19
|
+
readonly geometry: THREE.BufferGeometry;
|
|
20
|
+
readonly triangleCount: number;
|
|
21
|
+
readonly vertexCount: number;
|
|
22
|
+
readonly corners: Uint32Array;
|
|
23
|
+
readonly points: Float32Array;
|
|
24
|
+
readonly normals: Float32Array;
|
|
25
|
+
readonly areas: Float32Array;
|
|
26
|
+
readonly edgeTriangles: Map<number, number[]>;
|
|
27
|
+
readonly neighbors: number[][];
|
|
28
|
+
}
|
|
29
|
+
export declare const MIRROR_OFF_CENTER_M = 0.08;
|
|
30
|
+
export declare const edgeKey: (a: number, b: number) => number;
|
|
31
|
+
export declare const weldKey: (x: number, y: number, z: number) => string;
|
|
32
|
+
export declare function getIslandTopology(island: MeshIsland): SurfaceTopology;
|
|
33
|
+
export declare function buildSurfaceTopology(geometry: THREE.BufferGeometry): SurfaceTopology;
|
|
34
|
+
export declare function floodTriangles(topo: SurfaceTopology, seed: number, mayCross: (edge: number, from: number, to: number) => boolean): number[];
|
|
35
|
+
export declare function floodFillByCrease(topo: SurfaceTopology, seed: number, maxCreaseDeg?: number): number[];
|
|
36
|
+
export declare function mirrorTriangles(topo: SurfaceTopology, triangles: Iterable<number>, tolerance?: number): number[];
|
|
37
|
+
export declare function edgeLength(topo: SurfaceTopology, a: number, b: number): number;
|
|
38
|
+
export declare function edgeWeight(topo: SurfaceTopology, a: number, b: number): number;
|
|
39
|
+
export declare function snapToVertex(topo: SurfaceTopology, pt: CutVec3): number;
|
|
40
|
+
export declare function shortestEdgePath(topo: SurfaceTopology, from: number, to: number, blocked?: ReadonlySet<number>, weight?: (tp: SurfaceTopology, a: number, b: number) => number): number[] | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type KhrAssetBundle } from "@khr3/core";
|
|
3
|
+
import { type PaperShellAssembly } from "@khr3/vehicles/paper-shell";
|
|
4
|
+
import { type KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
5
|
+
import type { GateDomain, VehicleSubArchetype } from "./gateStore.js";
|
|
6
|
+
import type { ChopPartRole } from "./surfaceCutter.js";
|
|
7
|
+
import type { MeshIsland, WheelAxle } from "./meshIslands.js";
|
|
8
|
+
import { type CarDriveMode, type KolmoAssetArchetype, type WheelVisualSource } from "./khrCompiler.js";
|
|
9
|
+
export type WorldAssetKind = KolmoAssetArchetype;
|
|
10
|
+
export interface GateWorldPayload {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly kind: WorldAssetKind;
|
|
14
|
+
readonly domain: GateDomain;
|
|
15
|
+
readonly glbBytes: Uint8Array;
|
|
16
|
+
readonly bundle: KhrAssetBundle;
|
|
17
|
+
}
|
|
18
|
+
export interface UniversalBakeInput {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly domain: GateDomain;
|
|
21
|
+
readonly vehicleArchetype: VehicleSubArchetype;
|
|
22
|
+
readonly usePaperShellProxy: boolean;
|
|
23
|
+
readonly assembly: PaperShellAssembly;
|
|
24
|
+
readonly attachedMask: number;
|
|
25
|
+
readonly fuelLiters: number;
|
|
26
|
+
readonly normalizedScene: THREE.Group | null;
|
|
27
|
+
readonly massKg: number;
|
|
28
|
+
readonly powerOrThrust: number;
|
|
29
|
+
readonly driveType: CarDriveMode;
|
|
30
|
+
readonly staticProp: boolean;
|
|
31
|
+
readonly axles: readonly WheelAxle[];
|
|
32
|
+
readonly islands: readonly MeshIsland[];
|
|
33
|
+
readonly partPicks?: Readonly<Record<number, ChopPartRole>>;
|
|
34
|
+
readonly wheelSource?: WheelVisualSource;
|
|
35
|
+
readonly patches: readonly KolmoAuthoredNodePatch[];
|
|
36
|
+
}
|
|
37
|
+
export declare function bakeUniversalGateGlb(input: UniversalBakeInput): Promise<{
|
|
38
|
+
glbBytes: Uint8Array;
|
|
39
|
+
bundle: KhrAssetBundle;
|
|
40
|
+
worldKind: WorldAssetKind;
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type KhrExportNodeSpec } from "@khr3/core";
|
|
3
|
+
export interface UsdConversionResult {
|
|
4
|
+
glb: Uint8Array;
|
|
5
|
+
scene: THREE.Group;
|
|
6
|
+
specs: KhrExportNodeSpec[];
|
|
7
|
+
}
|
|
8
|
+
export declare const isUsdFileName: (name: string) => boolean;
|
|
9
|
+
export declare function extractUsdaLayers(input: ArrayBuffer | Uint8Array | string): string[];
|
|
10
|
+
export declare function parseUsdPhysicsSpecs(usdaLayers: readonly string[], scene: THREE.Group, bakedScales?: ReadonlyMap<string, [number, number, number]>): KhrExportNodeSpec[];
|
|
11
|
+
export declare function convertUsdToGlb(input: ArrayBuffer | Uint8Array | string, sceneExtras?: Record<string, unknown>): Promise<UsdConversionResult>;
|