@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,94 @@
|
|
|
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 * as THREE from "three";
|
|
5
|
+
import type { KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
6
|
+
import type { StampToolId } from "./GateHudBar.js";
|
|
7
|
+
import { type Step1FaceHit } from "./Step1CalibrationPlinth.js";
|
|
8
|
+
import { type GateDomain, type VehicleSubArchetype } from "./gateStore.js";
|
|
9
|
+
import type { VehiclePanelAnimator, WheelVisualSource } from "./khrCompiler.js";
|
|
10
|
+
import { type MeshIsland, type OrientTurns, type WheelAxle } from "./meshIslands.js";
|
|
11
|
+
import { type ActiveChopRole, type ChopPartRole, type CutVec3, type FaceSelection, type SurfaceSelectMode } from "./surfaceCutter.js";
|
|
12
|
+
import { type GateWorldPayload } from "./universalGateBake.js";
|
|
13
|
+
interface CutUndoEntry {
|
|
14
|
+
readonly undo: () => void;
|
|
15
|
+
readonly axles: WheelAxle[];
|
|
16
|
+
readonly picks: Record<number, ChopPartRole>;
|
|
17
|
+
}
|
|
18
|
+
export declare function useChopShopController(onSpawnInWorld?: (asset: GateWorldPayload) => void): {
|
|
19
|
+
st: import("./gateStore.js").GateState;
|
|
20
|
+
assetName: string;
|
|
21
|
+
hasCustomFile: boolean;
|
|
22
|
+
usdInfo: string | null;
|
|
23
|
+
targetMeters: number;
|
|
24
|
+
setTargetMeters: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
25
|
+
setYOffset: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
26
|
+
setTurns: import("react").Dispatch<import("react").SetStateAction<OrientTurns>>;
|
|
27
|
+
axles: WheelAxle[];
|
|
28
|
+
setAxles: import("react").Dispatch<import("react").SetStateAction<WheelAxle[]>>;
|
|
29
|
+
partPicks: Record<number, ChopPartRole>;
|
|
30
|
+
setPartPicks: import("react").Dispatch<import("react").SetStateAction<Record<number, ChopPartRole>>>;
|
|
31
|
+
wheelSource: WheelVisualSource;
|
|
32
|
+
setWheelSource: import("react").Dispatch<import("react").SetStateAction<WheelVisualSource>>;
|
|
33
|
+
activeRole: ActiveChopRole;
|
|
34
|
+
setActiveRole: import("react").Dispatch<import("react").SetStateAction<ActiveChopRole>>;
|
|
35
|
+
surfaceMode: SurfaceSelectMode;
|
|
36
|
+
setSurfaceMode: import("react").Dispatch<import("react").SetStateAction<SurfaceSelectMode>>;
|
|
37
|
+
creaseDeg: number;
|
|
38
|
+
setCreaseDeg: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
39
|
+
mirrorX: boolean;
|
|
40
|
+
setMirrorX: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
41
|
+
splitCoarse: boolean;
|
|
42
|
+
setSplitCoarse: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
43
|
+
faceSelection: FaceSelection | null;
|
|
44
|
+
setFaceSelection: import("react").Dispatch<import("react").SetStateAction<FaceSelection | null>>;
|
|
45
|
+
loopDots: {
|
|
46
|
+
islandId: number;
|
|
47
|
+
points: CutVec3[];
|
|
48
|
+
} | null;
|
|
49
|
+
setLoopDots: import("react").Dispatch<import("react").SetStateAction<{
|
|
50
|
+
islandId: number;
|
|
51
|
+
points: CutVec3[];
|
|
52
|
+
} | null>>;
|
|
53
|
+
hingeScrub: number;
|
|
54
|
+
setHingeScrub: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
55
|
+
explodeAmount: number;
|
|
56
|
+
setExplodeAmount: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
57
|
+
undoStack: CutUndoEntry[];
|
|
58
|
+
statusNote: string | null;
|
|
59
|
+
stampTool: StampToolId;
|
|
60
|
+
setStampTool: import("react").Dispatch<import("react").SetStateAction<StampToolId>>;
|
|
61
|
+
patches: KolmoAuthoredNodePatch[];
|
|
62
|
+
setPatches: import("react").Dispatch<import("react").SetStateAction<KolmoAuthoredNodePatch[]>>;
|
|
63
|
+
liveBundle: KhrAssetBundle | null;
|
|
64
|
+
busy: boolean;
|
|
65
|
+
fileRef: import("react").RefObject<HTMLInputElement | null>;
|
|
66
|
+
rootObjRef: import("react").RefObject<THREE.Group<THREE.Object3DEventMap> | null>;
|
|
67
|
+
panelAnimRef: import("react").RefObject<VehiclePanelAnimator | null>;
|
|
68
|
+
workingScene: THREE.Group<THREE.Object3DEventMap> | null;
|
|
69
|
+
assembly: PaperShellAssembly;
|
|
70
|
+
setProxyAssembly: import("react").Dispatch<import("react").SetStateAction<PaperShellAssembly | null>>;
|
|
71
|
+
islands: MeshIsland[];
|
|
72
|
+
wheelColors: Map<number, string>;
|
|
73
|
+
loadStarterCar: (url: string, label: string) => void;
|
|
74
|
+
ingestFile: (file: File) => Promise<void>;
|
|
75
|
+
applyDomainDefaults: (d: GateDomain, sub: VehicleSubArchetype, proxy: boolean) => void;
|
|
76
|
+
handleBucketIsland: (id: number) => void;
|
|
77
|
+
handlePickFace: (hit: Step1FaceHit) => void;
|
|
78
|
+
forgeScene: (label: string, sc: THREE.Group, lenM: number) => void;
|
|
79
|
+
handleCloseLoop: () => void;
|
|
80
|
+
handlePeelSelection: () => void;
|
|
81
|
+
handleUndoCut: () => void;
|
|
82
|
+
handleStampSurface: (e: ThreeEvent<MouseEvent>) => void;
|
|
83
|
+
sealAndExport: (spawnInWorld: boolean) => Promise<void>;
|
|
84
|
+
wheelCount: number;
|
|
85
|
+
choppedCount: number;
|
|
86
|
+
unlocked: boolean;
|
|
87
|
+
activeRoleColor: string;
|
|
88
|
+
bumpTurn: (ax: 0 | 1 | 2) => void;
|
|
89
|
+
wrapProxy: () => void;
|
|
90
|
+
autoPopWheels: () => void;
|
|
91
|
+
autoScaleSi: () => void;
|
|
92
|
+
snapC12: () => void;
|
|
93
|
+
};
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import type { KhrAssetBundle } from "@khr3/core";
|
|
3
|
+
import type { DecodedKolmoEmitter, KolmoAuthoredNodePatch } from "../schema/kolmoSchema.js";
|
|
4
|
+
import type { SelectionBounds } from "./meshIslands.js";
|
|
5
|
+
import type { ChopPartRole } from "./surfaceTopology.js";
|
|
6
|
+
export interface ChopHingeSpec {
|
|
7
|
+
readonly anchor: [number, number, number];
|
|
8
|
+
readonly axis: [number, number, number];
|
|
9
|
+
readonly limits: [number, number];
|
|
10
|
+
readonly openAngle: number;
|
|
11
|
+
readonly explodeDir: [number, number, number];
|
|
12
|
+
}
|
|
13
|
+
export interface VehiclePanelAnimator {
|
|
14
|
+
readonly hasPanels: boolean;
|
|
15
|
+
readonly panelNames: readonly string[];
|
|
16
|
+
toggleHitObject: (hit: THREE.Object3D | null) => boolean;
|
|
17
|
+
toggleRolePrefix: (prefix: string) => void;
|
|
18
|
+
toggleAll: () => void;
|
|
19
|
+
step: (dt: number) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function normalToMinusZQuaternion(outwardNormal: THREE.Vector3): [number, number, number, number];
|
|
22
|
+
export declare function buildPatchPreviewEmitters(patches: readonly KolmoAuthoredNodePatch[]): DecodedKolmoEmitter[];
|
|
23
|
+
/** Exact SI car-frame (`+Y` up, `+Z` forward, `+X` left) hinge anchor & Rodrigues-verified limits. */
|
|
24
|
+
export declare function computeChopPartHinge(b: Pick<SelectionBounds, "min" | "max" | "center">, role: ChopPartRole): ChopHingeSpec;
|
|
25
|
+
export declare function createVehiclePanelAnimator(bundle: KhrAssetBundle): VehiclePanelAnimator;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MeshIsland } from "./meshIslands.js";
|
|
2
|
+
export interface WheelAxle {
|
|
3
|
+
left: number[];
|
|
4
|
+
right: number[];
|
|
5
|
+
steered?: boolean;
|
|
6
|
+
driven?: boolean;
|
|
7
|
+
brake?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SelectionBounds {
|
|
10
|
+
center: [number, number, number];
|
|
11
|
+
min: [number, number, number];
|
|
12
|
+
max: [number, number, number];
|
|
13
|
+
radius: number;
|
|
14
|
+
halfWidth: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function measureSelection(islands: readonly Pick<MeshIsland, "id" | "min" | "max">[], ids: readonly number[]): SelectionBounds;
|
|
17
|
+
export declare function suggestCarAxles(islands: readonly MeshIsland[]): WheelAxle[];
|
|
18
|
+
export declare function suggestMotorcycleWheels(islands: readonly MeshIsland[]): WheelAxle[];
|
|
19
|
+
export declare function toggleIslandSelection(islands: readonly MeshIsland[], axles: readonly WheelAxle[], clickedId: number, mode: "car" | "motorcycle"): WheelAxle[];
|