incanto 0.7.0 → 0.8.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.
Files changed (48) hide show
  1. package/bin/incanto-check.mjs +6 -4
  2. package/dist/2d.d.ts +93 -3
  3. package/dist/2d.js +4 -4
  4. package/dist/3d.d.ts +45 -4
  5. package/dist/3d.js +4 -4
  6. package/dist/{audio-player-VSjk_vG8.d.ts → audio-player-Dyjg5k92.d.ts} +1 -1
  7. package/dist/audit-C6rMyict.js +58 -0
  8. package/dist/{behavior-e3kAmPGC.d.ts → behavior-Bod1AyJS.d.ts} +211 -174
  9. package/dist/{create-game-CEFoFN8d.js → create-game-66c4iYJE.js} +76 -6
  10. package/dist/{create-game-X5iRu6pf.js → create-game-BNDSbhy-.js} +88 -6
  11. package/dist/debug.d.ts +1 -1
  12. package/dist/debug.js +3 -0
  13. package/dist/{errors-BMFaY68Q.d.ts → errors-1dXlIwoR.d.ts} +7 -1
  14. package/dist/{gameplay-CDFgSG6z.js → gameplay-DPMgZk9W.js} +108 -1
  15. package/dist/gameplay.d.ts +44 -3
  16. package/dist/gameplay.js +2 -2
  17. package/dist/index.d.ts +151 -9
  18. package/dist/index.js +189 -4
  19. package/dist/{loader-y_X4zYO0.d.ts → loader-BcUDfNHn.d.ts} +1 -1
  20. package/dist/net.d.ts +46 -2
  21. package/dist/net.js +54 -2
  22. package/dist/particle-sim-CyUU7HVU.js +281 -0
  23. package/dist/{physics-2d-DmQ540uR.js → physics-2d-q2N362ph.js} +45 -4
  24. package/dist/{physics-3d-CDjuhtt_.js → physics-3d-CvHr31d4.js} +1 -1
  25. package/dist/react.d.ts +1 -1
  26. package/dist/react.js +1 -1
  27. package/dist/{register-CscQqB7V.js → register-Cbs7QxoV.js} +139 -4
  28. package/dist/{register-ClKnoILk.js → register-Cqjxrfq0.js} +254 -4
  29. package/dist/{register-C35HDZpm.js → register-CxmuI9FL.js} +1 -1
  30. package/dist/{particle-sim-CrTE7c02.js → register-DRPIjrKG.js} +1185 -278
  31. package/dist/test.d.ts +4 -10
  32. package/dist/test.js +11 -16
  33. package/editor/assets/{agent8-1WJU-yXr.js → agent8-B8QnWCeP.js} +1 -1
  34. package/editor/assets/{index-DzYFgZbl.js → index-CVhnNkb3.js} +81 -81
  35. package/editor/index.html +1 -1
  36. package/package.json +1 -1
  37. package/schemas/scene.schema.json +427 -0
  38. package/skills/incanto-3d-character.md +14 -0
  39. package/skills/incanto-audio.md +23 -0
  40. package/skills/incanto-building-2d-games.md +31 -0
  41. package/skills/incanto-building-3d-games.md +21 -0
  42. package/skills/incanto-gameplay-behaviors.md +28 -0
  43. package/skills/incanto-hud.md +24 -0
  44. package/skills/incanto-multiplayer.md +27 -0
  45. package/skills/incanto-node-reference.md +73 -0
  46. package/skills/incanto-physics-and-input.md +9 -0
  47. package/skills/incanto-verifying-your-game.md +40 -0
  48. package/dist/register-Dl_ixIJe.js +0 -834
@@ -71,7 +71,7 @@ if (files.length === 0) {
71
71
  process.exit(1);
72
72
  }
73
73
 
74
- const { validateScene } = await import(pathToFileURL(join(DIST, 'test.js')).href);
74
+ const { auditScene, validateScene } = await import(pathToFileURL(join(DIST, 'test.js')).href);
75
75
 
76
76
  const results = files.map((file) => {
77
77
  let json;
@@ -84,7 +84,7 @@ const results = files.map((file) => {
84
84
  strictBehaviors: args.strict,
85
85
  resolveScene: (p) => JSON.parse(readFileSync(resolve(dirname(file), p), 'utf-8')),
86
86
  });
87
- if (res.ok) return { file, ok: true };
87
+ if (res.ok) return { file, ok: true, warnings: auditScene(json) };
88
88
  return {
89
89
  file,
90
90
  ok: false,
@@ -99,8 +99,10 @@ if (args.json) {
99
99
  console.log(JSON.stringify({ ok: failed.length === 0, results }, null, 2));
100
100
  } else {
101
101
  for (const r of results) {
102
- if (r.ok) console.log(` ok ${r.file}`);
103
- else console.log(`FAIL ${r.file}\n [${r.code}] ${r.message}`);
102
+ if (r.ok) {
103
+ console.log(` ok ${r.file}`);
104
+ for (const w of r.warnings ?? []) console.log(` warn: ${w}`);
105
+ } else console.log(`FAIL ${r.file}\n [${r.code}] ${r.message}`);
104
106
  }
105
107
  console.log(`\n${results.length - failed.length}/${results.length} scene(s) valid`);
106
108
  }
package/dist/2d.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { s as JsonObject } from "./schema-CcoWb32N.js";
2
- import { C as RendererStats, S as GameStats, T as Node, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-e3kAmPGC.js";
3
- import { t as LoadSceneOptions } from "./loader-y_X4zYO0.js";
2
+ import { $ as Node, C as RendererStats, S as GameStats, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-Bod1AyJS.js";
3
+ import { t as LoadSceneOptions } from "./loader-BcUDfNHn.js";
4
4
  import { t as ParticleSim } from "./particle-sim-CwJ5rI_P.js";
5
5
  import { Group, Mesh, Object3D, Scene, Texture } from "three";
6
6
  import * as RapierNs from "@dimforge/rapier2d-compat";
@@ -559,6 +559,66 @@ declare class Particles2D extends Node2D {
559
559
  override _syncObject2D(assets: AssetStore2D | null): void;
560
560
  }
561
561
  //#endregion
562
+ //#region src/2d/nodes/tile-map-2d.d.ts
563
+ /**
564
+ * A whole tile level as ONE node — grid render in a single draw call plus
565
+ * greedy-merged static colliders. Author the level as rows of characters:
566
+ *
567
+ * { "name": "Level", "type": "TileMap2D", "props": {
568
+ * "texture": "$tiles", "tileSize": 32,
569
+ * "cells": [
570
+ * "..................",
571
+ * "......111.........",
572
+ * "000000000000000000"
573
+ * ],
574
+ * "solid": [0, 1] } }
575
+ *
576
+ * `.` / space = empty, digits 0-9 = atlas tile index, other chars map through
577
+ * `legend` (e.g. `{"G": 12}`). The atlas is read left-to-right, top-to-bottom
578
+ * in `tileSize` squares. Tiles listed in `solid` become static colliders,
579
+ * greedy-merged into a few rectangles (hundreds of cells → a handful of
580
+ * bodies). Cell (0,0) renders with its TOP-LEFT on this node's origin.
581
+ */
582
+ declare class TileMap2D extends Node2D {
583
+ static override readonly typeName: string;
584
+ static override readonly props: PropSchema;
585
+ texture: string;
586
+ tileSize: number;
587
+ columns: number;
588
+ private _cells;
589
+ private _legend;
590
+ private _solid;
591
+ /** Rebuild flags — raised when the map-shaping props are REPLACED. */
592
+ private geometryDirty;
593
+ private collidersDirty;
594
+ /** Replace the whole array to change the map (mutations are not watched). */
595
+ get cells(): (string | number[])[];
596
+ set cells(value: (string | number[])[]);
597
+ get legend(): Record<string, number>;
598
+ set legend(value: Record<string, number>);
599
+ get solid(): number[];
600
+ set solid(value: number[]);
601
+ opacity: number;
602
+ private tileMesh;
603
+ private builtColumns;
604
+ private builtRows;
605
+ /** Loader hook: bad cells fail at LOAD (unknown chars), not at render. */
606
+ static validateJson(node: Node): void;
607
+ /** The parsed index grid (test/tooling hook). */
608
+ grid(): number[][];
609
+ override onReady(): void;
610
+ override update(_dt: number): void;
611
+ private rebuildColliders;
612
+ /** @internal The drawable mesh (lazily created under the backing object). */
613
+ _mesh(): Mesh;
614
+ override _syncObject2D(assets: AssetStore2D | null): void;
615
+ /** One quad per visible tile, atlas UVs — a single draw call for the level. */
616
+ private buildGeometry;
617
+ /** Test hook: rendered tile count (quads in the built geometry). */
618
+ get renderedTileCount(): number;
619
+ override free(): void;
620
+ }
621
+ //#endregion
562
622
  //#region src/2d/nodes/ui-layer.d.ts
563
623
  declare const ANCHORS: readonly ["top-left", "top", "top-right", "left", "center", "right", "bottom-left", "bottom", "bottom-right"];
564
624
  type UIAnchor = (typeof ANCHORS)[number];
@@ -655,6 +715,8 @@ declare class Renderer2D {
655
715
  private readonly canvas;
656
716
  constructor(opts: Renderer2DOptions);
657
717
  private readonly debugLines;
718
+ private readonly selectionLines;
719
+ private syncSelectionOutline;
658
720
  private syncDebugLines;
659
721
  private render;
660
722
  private lastViewport;
@@ -718,4 +780,32 @@ declare function syncTree2D(root: Node, world: Scene, ui: Scene, assets: AssetSt
718
780
  ignoreStatic?: boolean;
719
781
  }): Sync2DResult;
720
782
  //#endregion
721
- export { AnimatedSprite2D, type AnimationDef, Area2D, type AssetStatus, AssetStore2D, Camera2D, CharacterBody2D, CharacterController2D, ColorRect2D, type CreateGame2DOptions, type Game2D, Joint2D, type JointType2D, Label, Node2D, Particles2D, Physics2D, type Physics2DOptions, PhysicsBody2D, Renderer2D, type Renderer2DOptions, type ResolvedSpriteTexture, RigidBody2D, type SheetInfo, Sprite2D, type SpriteFromLibraryResult, StaticBody2D, type Sync2DResult, type TextureLoadCallbacks, type UIAnchor, UILayer, createGame2D, enablePhysics2D, registerNodes2D, spriteFromLibraryMeta, syncTree2D };
783
+ //#region src/2d/tilemap-grid.d.ts
784
+ /**
785
+ * Pure tile-grid logic for TileMap2D — no three, unit-testable in node.
786
+ * Grids are `number[][]` of atlas tile indices, `-1` = empty.
787
+ */
788
+ interface TileRect {
789
+ /** Cell coords (col, row) of the rect's top-left. */
790
+ x: number;
791
+ y: number;
792
+ /** Size in cells. */
793
+ w: number;
794
+ h: number;
795
+ }
796
+ /**
797
+ * Normalize the `cells` prop into an index grid. Two author formats:
798
+ * - string rows: `"." `/`" "` = empty, digits `0-9` = tile index, anything
799
+ * else must be in `legend` (char → index). Unknown chars HARD-fail.
800
+ * - number rows: passed through (`-1` = empty).
801
+ * Ragged rows are right-padded with empty.
802
+ */
803
+ declare function parseCells(cells: readonly (string | readonly number[])[], legend: Record<string, number>): number[][];
804
+ /**
805
+ * Greedy rectangle merge over the solid cells: maximal horizontal runs,
806
+ * extended downward while the identical run repeats. A platform level's
807
+ * hundreds of solid tiles collapse to a handful of colliders.
808
+ */
809
+ declare function mergeSolidRects(grid: readonly (readonly number[])[], solid: Set<number>): TileRect[];
810
+ //#endregion
811
+ export { AnimatedSprite2D, type AnimationDef, Area2D, type AssetStatus, AssetStore2D, Camera2D, CharacterBody2D, CharacterController2D, ColorRect2D, type CreateGame2DOptions, type Game2D, Joint2D, type JointType2D, Label, Node2D, Particles2D, Physics2D, type Physics2DOptions, PhysicsBody2D, Renderer2D, type Renderer2DOptions, type ResolvedSpriteTexture, RigidBody2D, type SheetInfo, Sprite2D, type SpriteFromLibraryResult, StaticBody2D, type Sync2DResult, type TextureLoadCallbacks, TileMap2D, type TileRect, type UIAnchor, UILayer, createGame2D, enablePhysics2D, mergeSolidRects, parseCells, registerNodes2D, spriteFromLibraryMeta, syncTree2D };
package/dist/2d.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as IncantoError } from "./errors-BpWbnbb_.js";
2
- import { a as AssetStore2D, i as syncTree2D, r as Renderer2D, t as createGame2D } from "./create-game-X5iRu6pf.js";
3
- import { a as ColorRect2D, c as AnimatedSprite2D, d as Area2D, f as CharacterBody2D, g as Node2D, h as StaticBody2D, i as Label, l as Sprite2D, m as RigidBody2D, n as UILayer, o as CharacterController2D, p as PhysicsBody2D, r as Particles2D, s as Camera2D, t as registerNodes2D, u as Joint2D } from "./register-ClKnoILk.js";
4
- import { n as enablePhysics2D, t as Physics2D } from "./physics-2d-DmQ540uR.js";
2
+ import { a as AssetStore2D, i as syncTree2D, r as Renderer2D, t as createGame2D } from "./create-game-BNDSbhy-.js";
3
+ import { _ as RigidBody2D, a as parseCells, c as ColorRect2D, d as AnimatedSprite2D, f as Sprite2D, g as PhysicsBody2D, h as CharacterBody2D, i as mergeSolidRects, l as CharacterController2D, m as Area2D, n as UILayer, o as Particles2D, p as Joint2D, r as TileMap2D, s as Label, t as registerNodes2D, u as Camera2D, v as StaticBody2D, y as Node2D } from "./register-Cqjxrfq0.js";
4
+ import { n as enablePhysics2D, t as Physics2D } from "./physics-2d-q2N362ph.js";
5
5
  //#region src/2d/library-sprite.ts
6
6
  /**
7
7
  * Turn a library sprite-animation JSON into a scene-ready spritesheet asset
@@ -41,4 +41,4 @@ function spriteFromLibraryMeta(meta, opts) {
41
41
  };
42
42
  }
43
43
  //#endregion
44
- export { AnimatedSprite2D, Area2D, AssetStore2D, Camera2D, CharacterBody2D, CharacterController2D, ColorRect2D, Joint2D, Label, Node2D, Particles2D, Physics2D, PhysicsBody2D, Renderer2D, RigidBody2D, Sprite2D, StaticBody2D, UILayer, createGame2D, enablePhysics2D, registerNodes2D, spriteFromLibraryMeta, syncTree2D };
44
+ export { AnimatedSprite2D, Area2D, AssetStore2D, Camera2D, CharacterBody2D, CharacterController2D, ColorRect2D, Joint2D, Label, Node2D, Particles2D, Physics2D, PhysicsBody2D, Renderer2D, RigidBody2D, Sprite2D, StaticBody2D, TileMap2D, UILayer, createGame2D, enablePhysics2D, mergeSolidRects, parseCells, registerNodes2D, spriteFromLibraryMeta, syncTree2D };
package/dist/3d.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { s as JsonObject } from "./schema-CcoWb32N.js";
2
- import { C as RendererStats, S as GameStats, T as Node, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-e3kAmPGC.js";
3
- import { t as LoadSceneOptions } from "./loader-y_X4zYO0.js";
2
+ import { $ as Node, C as RendererStats, S as GameStats, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-Bod1AyJS.js";
3
+ import { t as LoadSceneOptions } from "./loader-BcUDfNHn.js";
4
4
  import { t as ParticleSim } from "./particle-sim-CwJ5rI_P.js";
5
- import { r as SpatialPose } from "./audio-player-VSjk_vG8.js";
5
+ import { r as SpatialPose } from "./audio-player-Dyjg5k92.js";
6
6
  import { AnimationClip, BufferGeometry, Color, DirectionalLight, InstancedMesh, MeshPhysicalMaterial, Object3D, PerspectiveCamera, Scene, Vector3, WebGLRenderer } from "three";
7
7
  import { VRM } from "@pixiv/three-vrm";
8
8
  import { Sky } from "three/examples/jsm/objects/Sky.js";
@@ -696,6 +696,13 @@ declare class CharacterController3D extends Node3D {
696
696
  * character facing away from the camera until it first moves).
697
697
  */
698
698
  skinYawOffset: number;
699
+ /**
700
+ * Movement-state → animation asset map, applied to the `skinPath` model
701
+ * directly — no CharacterAnimator behavior needed:
702
+ * "animations": { "idle": "$idle", "run": "$run", "fastRun": "$sprint",
703
+ * "walk": "$walk", "airborne": "$jump" }
704
+ */
705
+ animations: Record<string, string>;
699
706
  /** Camera yaw/pitch in radians (mouse look mutates these). */
700
707
  yaw: number;
701
708
  pitch: number;
@@ -1547,6 +1554,38 @@ declare class Terrain3D extends Node3D {
1547
1554
  override free(): void;
1548
1555
  }
1549
1556
  //#endregion
1557
+ //#region src/3d/nodes/trail-3d.d.ts
1558
+ /**
1559
+ * A fading ribbon behind whatever this node is parented to — wingtip trails,
1560
+ * sword arcs, tyre streaks. Records the node's world position over `seconds`
1561
+ * and renders a camera-facing strip that tapers and fades to the tail.
1562
+ *
1563
+ * { "name": "WingTrail", "type": "Trail3D",
1564
+ * "props": { "width": 0.4, "color": "#dddddd", "seconds": 0.8 } }
1565
+ *
1566
+ * `emitting: false` stops laying new ribbon (the old tail still fades out).
1567
+ */
1568
+ declare class Trail3D extends Node3D {
1569
+ static override readonly typeName: string;
1570
+ static override readonly props: PropSchema;
1571
+ width: number;
1572
+ color: string;
1573
+ opacity: number;
1574
+ seconds: number;
1575
+ emitting: boolean;
1576
+ additive: boolean;
1577
+ minDistance: number;
1578
+ private readonly points;
1579
+ private clock;
1580
+ private mesh;
1581
+ private lastColor;
1582
+ protected override _createObject3D(): Object3D;
1583
+ override update(dt: number): void;
1584
+ _onRender3D(ctx: RenderContext3D): void;
1585
+ /** Test hook: recorded point count. */
1586
+ get pointCount(): number;
1587
+ }
1588
+ //#endregion
1550
1589
  //#region src/3d/vegetation/tree-blueprint.d.ts
1551
1590
  /**
1552
1591
  * Tree3D construction recipes — the pure half of the procedural trees.
@@ -1969,6 +2008,8 @@ declare class Renderer3D {
1969
2008
  private bloomCompositeUniforms;
1970
2009
  constructor(opts: Renderer3DOptions);
1971
2010
  private readonly debugLines;
2011
+ private readonly selectionLines;
2012
+ private syncSelectionOutline;
1972
2013
  private syncDebugLines;
1973
2014
  private render;
1974
2015
  /**
@@ -2114,4 +2155,4 @@ interface WalkState {
2114
2155
  ignoreStatic: boolean;
2115
2156
  }
2116
2157
  //#endregion
2117
- export { Area3D, AssetStore3D, Billboard3D, type BillboardGroupMode, Camera3D, CharacterBody3D, CharacterController3D, type CreateGame3DOptions, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, Environment3D, type Environment3DConfig, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, type FlowerVariety, Flowers3D, type FogEnvironment, Foliage3D, type FoliageKind, type FoliageStyle, type Game3D, type Heightmap, type HeightmapOptions, Joint3D, type JointType3D, LoftMesh3D, type LoftSection, MeshInstance3D, type MeshKind, type MeshMaterialProps, type ModelEntry, ModelInstance3D, Node3D, OmniLight3D, Particles3D, Physics3D, type Physics3DOptions, PhysicsBody3D, QUARTER_PITCH, type RenderContext3D, type RenderHook3D, Renderer3D, type Renderer3DOptions, type RigView, RigidBody3D, type Ripple, type ShadowsEnvironment, type SkyEnvironment, StaticBody3D, type SunConsumer3D, type SyncOptions, type SyncResult, TERRAIN_THEMES, Terrain3D, type TerrainLayer, type TerrainTheme, Tree3D, type TreeTier, type TreeType, VOXEL_PALETTE, type VoxelBlock, VoxelGrid3D, WATER_MAX_RIPPLES, Water3D, buildHeightmap, cameraRelative, createGame3D, enablePhysics3D, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, registerNodes3D, resolveFlowerDensity, rigPose, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers };
2158
+ export { Area3D, AssetStore3D, Billboard3D, type BillboardGroupMode, Camera3D, CharacterBody3D, CharacterController3D, type CreateGame3DOptions, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, Environment3D, type Environment3DConfig, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, type FlowerVariety, Flowers3D, type FogEnvironment, Foliage3D, type FoliageKind, type FoliageStyle, type Game3D, type Heightmap, type HeightmapOptions, Joint3D, type JointType3D, LoftMesh3D, type LoftSection, MeshInstance3D, type MeshKind, type MeshMaterialProps, type ModelEntry, ModelInstance3D, Node3D, OmniLight3D, Particles3D, Physics3D, type Physics3DOptions, PhysicsBody3D, QUARTER_PITCH, type RenderContext3D, type RenderHook3D, Renderer3D, type Renderer3DOptions, type RigView, RigidBody3D, type Ripple, type ShadowsEnvironment, type SkyEnvironment, StaticBody3D, type SunConsumer3D, type SyncOptions, type SyncResult, TERRAIN_THEMES, Terrain3D, type TerrainLayer, type TerrainTheme, Trail3D, Tree3D, type TreeTier, type TreeType, VOXEL_PALETTE, type VoxelBlock, VoxelGrid3D, WATER_MAX_RIPPLES, Water3D, buildHeightmap, cameraRelative, createGame3D, enablePhysics3D, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, registerNodes3D, resolveFlowerDensity, rigPose, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers };
package/dist/3d.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as Environment3D, c as sunDirectionFromElevationAzimuth, i as syncTree, l as sunDirectionFromSky, o as horizonColorFromSky, r as Renderer3D, s as parseEnvironment3D, t as createGame3D, u as AssetStore3D } from "./create-game-CEFoFN8d.js";
2
- import { A as StaticBody3D, C as TERRAIN_THEMES, D as CharacterBody3D, E as Area3D, F as keyboardIntensity, I as movementState, L as rigPose, N as QUARTER_PITCH, O as PhysicsBody3D, P as cameraRelative, S as DEFAULT_TERRAIN_TEXTURE_BASE, T as Joint3D, _ as FLOWER_VARIETIES, a as VoxelGrid3D, b as Billboard3D, c as ModelInstance3D, d as DirectionalLight3D, f as OmniLight3D, g as resolveFlowerDensity, h as Flowers3D, i as VOXEL_PALETTE, j as Node3D, k as RigidBody3D, l as LoftMesh3D, m as DENSITY_PRESETS, n as Water3D, o as Tree3D, p as Foliage3D, r as WATER_MAX_RIPPLES, s as Particles3D, t as registerNodes3D, u as MeshInstance3D, v as CharacterController3D, w as terrainThemeLayers, x as Terrain3D, y as Camera3D } from "./register-CscQqB7V.js";
1
+ import { a as Environment3D, c as sunDirectionFromElevationAzimuth, i as syncTree, l as sunDirectionFromSky, o as horizonColorFromSky, r as Renderer3D, s as parseEnvironment3D, t as createGame3D, u as AssetStore3D } from "./create-game-66c4iYJE.js";
2
+ import { A as RigidBody3D, C as DEFAULT_TERRAIN_TEXTURE_BASE, D as Area3D, E as Joint3D, F as cameraRelative, I as keyboardIntensity, L as movementState, M as Node3D, O as CharacterBody3D, P as QUARTER_PITCH, R as rigPose, S as Terrain3D, T as terrainThemeLayers, _ as resolveFlowerDensity, a as VoxelGrid3D, b as Camera3D, c as Particles3D, d as MeshInstance3D, f as DirectionalLight3D, g as Flowers3D, h as DENSITY_PRESETS, i as VOXEL_PALETTE, j as StaticBody3D, k as PhysicsBody3D, l as ModelInstance3D, m as Foliage3D, n as Water3D, o as Tree3D, p as OmniLight3D, r as WATER_MAX_RIPPLES, s as Trail3D, t as registerNodes3D, u as LoftMesh3D, v as FLOWER_VARIETIES, w as TERRAIN_THEMES, x as Billboard3D, y as CharacterController3D } from "./register-Cbs7QxoV.js";
3
3
  import { n as splatWeights, t as buildHeightmap } from "./heightmap-CroQPEER.js";
4
- import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-CDjuhtt_.js";
5
- export { Area3D, AssetStore3D, Billboard3D, Camera3D, CharacterBody3D, CharacterController3D, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, Environment3D, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, Flowers3D, Foliage3D, Joint3D, LoftMesh3D, MeshInstance3D, ModelInstance3D, Node3D, OmniLight3D, Particles3D, Physics3D, PhysicsBody3D, QUARTER_PITCH, Renderer3D, RigidBody3D, StaticBody3D, TERRAIN_THEMES, Terrain3D, Tree3D, VOXEL_PALETTE, VoxelGrid3D, WATER_MAX_RIPPLES, Water3D, buildHeightmap, cameraRelative, createGame3D, enablePhysics3D, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, registerNodes3D, resolveFlowerDensity, rigPose, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers };
4
+ import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-CvHr31d4.js";
5
+ export { Area3D, AssetStore3D, Billboard3D, Camera3D, CharacterBody3D, CharacterController3D, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, Environment3D, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, Flowers3D, Foliage3D, Joint3D, LoftMesh3D, MeshInstance3D, ModelInstance3D, Node3D, OmniLight3D, Particles3D, Physics3D, PhysicsBody3D, QUARTER_PITCH, Renderer3D, RigidBody3D, StaticBody3D, TERRAIN_THEMES, Terrain3D, Trail3D, Tree3D, VOXEL_PALETTE, VoxelGrid3D, WATER_MAX_RIPPLES, Water3D, buildHeightmap, cameraRelative, createGame3D, enablePhysics3D, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, registerNodes3D, resolveFlowerDensity, rigPose, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers };
@@ -1,4 +1,4 @@
1
- import { F as Listener, T as Node, l as PropSchema } from "./behavior-e3kAmPGC.js";
1
+ import { $ as Node, P as Listener, l as PropSchema } from "./behavior-Bod1AyJS.js";
2
2
 
3
3
  //#region src/core/nodes/audio-player.d.ts
4
4
  /**
@@ -0,0 +1,58 @@
1
+ //#region src/core/audit.ts
2
+ const ANIMATED_TYPES = new Set([
3
+ "Particles2D",
4
+ "Particles3D",
5
+ "Water3D",
6
+ "AnimatedSprite2D",
7
+ "AnimatedSprite3D",
8
+ "Camera2D",
9
+ "Camera3D"
10
+ ]);
11
+ const BODY_TYPES = new Set([
12
+ "StaticBody2D",
13
+ "RigidBody2D",
14
+ "Area2D",
15
+ "CharacterBody2D",
16
+ "StaticBody3D",
17
+ "RigidBody3D",
18
+ "Area3D",
19
+ "CharacterBody3D"
20
+ ]);
21
+ const HUD_WIDGETS = new Set([
22
+ "UiText",
23
+ "UiBar",
24
+ "UiBanner",
25
+ "UiButton",
26
+ "UiDialogue"
27
+ ]);
28
+ /** Human-readable warnings (empty = clean). Pure JSON walk, no registry. */
29
+ function auditScene(scene) {
30
+ const warnings = [];
31
+ const root = scene.root;
32
+ if (!root) return warnings;
33
+ let currentCameras = 0;
34
+ let cameras = 0;
35
+ const walk = (node, path, insideHud, staticRoot) => {
36
+ const type = node.type ?? "";
37
+ const props = node.props ?? {};
38
+ if (type === "Camera2D" || type === "Camera3D") {
39
+ cameras += 1;
40
+ if (props.current === true) currentCameras += 1;
41
+ }
42
+ if (BODY_TYPES.has(type)) {
43
+ const collider = props.collider;
44
+ if (!collider || collider.shape === void 0) warnings.push(`${path}: ${type} has no collider — physics will skip it (add "collider": { "shape": ... }).`);
45
+ }
46
+ if (HUD_WIDGETS.has(type) && !insideHud) warnings.push(`${path}: ${type} works only as a descendant of a HudLayer — it will not render.`);
47
+ if (staticRoot && ANIMATED_TYPES.has(type)) warnings.push(`${path}: ${type} is frozen inside static subtree '${staticRoot}' — it will not animate/update on screen.`);
48
+ const nextStatic = staticRoot ?? (props.static === true ? node.name ?? path : null);
49
+ const nextHud = insideHud || type === "HudLayer";
50
+ for (const child of node.children ?? []) walk(child, `${path}/${child.name ?? "?"}`, nextHud, nextStatic);
51
+ };
52
+ walk(root, root.name ?? "root", false, root.props?.static === true ? root.name ?? "root" : null);
53
+ if (cameras > 0 && currentCameras === 0) warnings.push("no camera has \"current\": true — the screen renders from a default view, probably not what you framed.");
54
+ if (currentCameras > 1) warnings.push(`${currentCameras} cameras claim "current": true — only the first found wins.`);
55
+ return warnings;
56
+ }
57
+ //#endregion
58
+ export { auditScene as t };