incanto 0.34.0 → 0.35.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/dist/2d.d.ts +5 -5
- package/dist/2d.js +3 -3
- package/dist/3d.d.ts +122 -14
- package/dist/3d.js +5 -5
- package/dist/{audit-C4kmDK0o.js → audit-C5oZGAru.js} +37 -0
- package/dist/{behavior-CtPScDMo.d.ts → behavior-CGSCWOHB.d.ts} +310 -22
- package/dist/{create-game-CFNqoqOX.js → create-game-B0Wfhi2-.js} +6 -5
- package/dist/{create-game-QTfghzwM.js → create-game-BUD89Kqh.js} +20 -6
- package/dist/debug.d.ts +1 -1
- package/dist/{duplicate-DlOvknDO.js → duplicate-C716f-97.js} +1 -1
- package/dist/{editor-switch-BJb-CWfA.d.ts → editor-switch-DyXEtH36.d.ts} +1 -1
- package/dist/editor.js +1739 -1312
- package/dist/env.d.ts +1 -1
- package/dist/{environment-presets-B6WiUsaO.js → environment-presets-TAGvmM3z.js} +240 -74
- package/dist/{errors-1dXlIwoR.d.ts → errors-BY2kL0hv.d.ts} +1 -1
- package/dist/{gameplay-BxFtmfSe.js → gameplay-BvhcQbfJ.js} +75 -11
- package/dist/gameplay.d.ts +12 -5
- package/dist/gameplay.js +1 -1
- package/dist/index.d.ts +22 -7
- package/dist/index.js +6 -6
- package/dist/{loader-DmXfj6Uv.d.ts → loader-CUcj00M8.d.ts} +19 -2
- package/dist/{loader-BwR0DxeM.js → loader-Mig5fY4n.js} +97 -18
- package/dist/net.d.ts +2 -2
- package/dist/net.js +3 -3
- package/dist/{particle-sim-CwJ5rI_P.d.ts → particle-sim-B-vZBF5R.d.ts} +1 -1
- package/dist/{pathfinding-DRCe89SI.d.ts → pathfinding-DgOo2KNF.d.ts} +1 -1
- package/dist/{physics-2d-BuyAwsW5.js → physics-2d-DqAclql-.js} +22 -9
- package/dist/{physics-3d-C8Kn_Nyb.js → physics-3d-DxBH4sIF.js} +27 -11
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/{register-G3edsjJ2.js → register-BFLg0-_i.js} +490 -12
- package/dist/{register-OodmuUMK.js → register-BjbPMA5B.js} +2 -2
- package/dist/{register-BLPC10Mj.js → register-DSmIRAf7.js} +11 -5
- package/dist/{schema-CcoWb32N.d.ts → schema-3ywbdlrv.d.ts} +10 -0
- package/dist/{test-C4B5znap.js → test-9EokzbRd.js} +10 -10
- package/dist/test.d.ts +4 -4
- package/dist/test.js +2 -2
- package/dist/vite.js +1 -1
- package/editor/assets/{agent8-BTODHtdM.js → agent8-D3_GWeuh.js} +1 -1
- package/editor/assets/{debug-CJEz4EwC.js → debug-CX0LDd1r.js} +1 -1
- package/editor/assets/index-CMlKFT0C.js +10773 -0
- package/editor/index.html +1 -1
- package/package.json +1 -1
- package/schemas/scene.schema.json +109 -0
- package/skills/incanto-assets.md +21 -0
- package/skills/incanto-behaviors-and-scripts.md +16 -0
- package/skills/incanto-editor.md +17 -1
- package/skills/incanto-gameplay-behaviors.md +6 -0
- package/skills/incanto-hud.md +16 -0
- package/skills/incanto-localization.md +132 -0
- package/skills/incanto-node-reference.md +33 -18
- package/skills/incanto-save-slots.md +152 -0
- package/templates-app/beacon-isle-3d/package.json +1 -1
- package/templates-app/tps-3d/package.json +1 -1
- package/templates-app/village-quest-3d/PROJECT/Context.md +16 -0
- package/templates-app/village-quest-3d/package.json +1 -1
- package/templates-app/village-quest-3d/src/village.scene.json +25 -3
- package/editor/assets/index-BYCso8Bf.js +0 -10696
package/dist/2d.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as DiagnosticSink, t as EditorSwitchOptions } from "./editor-switch-
|
|
3
|
-
import { i as SceneJson, s as JsonObject } from "./schema-
|
|
4
|
-
import { t as LoadSceneOptions } from "./loader-
|
|
5
|
-
import { t as ParticleSim } from "./particle-sim-
|
|
1
|
+
import { N as Scene$1, S as Scheduler, T as RendererStats, b as Engine, bt as Node, d as PropSchema, n as BehaviorCtor, w as GameStats } from "./behavior-CGSCWOHB.js";
|
|
2
|
+
import { n as DiagnosticSink, t as EditorSwitchOptions } from "./editor-switch-DyXEtH36.js";
|
|
3
|
+
import { i as SceneJson, s as JsonObject } from "./schema-3ywbdlrv.js";
|
|
4
|
+
import { t as LoadSceneOptions } from "./loader-CUcj00M8.js";
|
|
5
|
+
import { t as ParticleSim } from "./particle-sim-B-vZBF5R.js";
|
|
6
6
|
import { Group, Mesh, Object3D, Scene, Texture } from "three";
|
|
7
7
|
import * as RapierNs from "@dimforge/rapier2d-compat";
|
|
8
8
|
|
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-
|
|
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-
|
|
4
|
-
import { n as enablePhysics2D, t as Physics2D } from "./physics-2d-
|
|
2
|
+
import { a as AssetStore2D, i as syncTree2D, r as Renderer2D, t as createGame2D } from "./create-game-B0Wfhi2-.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-DSmIRAf7.js";
|
|
4
|
+
import { n as enablePhysics2D, t as Physics2D } from "./physics-2d-DqAclql-.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
|
package/dist/3d.d.ts
CHANGED
|
@@ -1,14 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as DiagnosticSink, t as EditorSwitchOptions } from "./editor-switch-
|
|
3
|
-
import { i as SceneJson, s as JsonObject } from "./schema-
|
|
4
|
-
import { t as LoadSceneOptions } from "./loader-
|
|
5
|
-
import { t as ParticleSim } from "./particle-sim-
|
|
6
|
-
import { n as PathGrid, s as SpatialPose } from "./pathfinding-
|
|
7
|
-
import { AnimationClip, AnimationMixer, BufferGeometry, Color, DirectionalLight, Group, InstancedMesh, Mesh, MeshPhysicalMaterial, Object3D, PerspectiveCamera, Scene, ShaderMaterial, Vector3, WebGLRenderer } from "three";
|
|
1
|
+
import { N as Scene$1, S as Scheduler, T as RendererStats, b as Engine, bt as Node, d as PropSchema, n as BehaviorCtor, w as GameStats } from "./behavior-CGSCWOHB.js";
|
|
2
|
+
import { n as DiagnosticSink, t as EditorSwitchOptions } from "./editor-switch-DyXEtH36.js";
|
|
3
|
+
import { i as SceneJson, s as JsonObject } from "./schema-3ywbdlrv.js";
|
|
4
|
+
import { t as LoadSceneOptions } from "./loader-CUcj00M8.js";
|
|
5
|
+
import { t as ParticleSim } from "./particle-sim-B-vZBF5R.js";
|
|
6
|
+
import { n as PathGrid, s as SpatialPose } from "./pathfinding-DgOo2KNF.js";
|
|
7
|
+
import { AnimationClip, AnimationMixer, BufferGeometry, Color, DirectionalLight, Group, InstancedMesh, Mesh, MeshPhysicalMaterial, Object3D, PerspectiveCamera, Scene, ShaderMaterial, Texture, Vector3, WebGLRenderer } from "three";
|
|
8
8
|
import { VRM } from "@pixiv/three-vrm";
|
|
9
9
|
import { Sky } from "three/examples/jsm/objects/Sky.js";
|
|
10
10
|
import * as RapierNs from "@dimforge/rapier3d-compat";
|
|
11
11
|
|
|
12
|
+
//#region src/3d/textures.d.ts
|
|
13
|
+
/** Where a diagnostic goes when a texture fails to load. */
|
|
14
|
+
interface TextureDiagnostics {
|
|
15
|
+
warn(...parts: unknown[]): void;
|
|
16
|
+
}
|
|
17
|
+
interface TextureSpec {
|
|
18
|
+
/** sRGB for anything the eye reads as colour; linear for data maps. */
|
|
19
|
+
colorSpace?: "srgb" | "linear";
|
|
20
|
+
/** `nearest` also turns mipmaps OFF — pixel art mipmapped is mud. */
|
|
21
|
+
filter?: "linear" | "nearest";
|
|
22
|
+
wrap?: "clamp" | "repeat";
|
|
23
|
+
anisotropy?: number;
|
|
24
|
+
/**
|
|
25
|
+
* A one-shot rewrite of the decoded image, applied to the MASTER once.
|
|
26
|
+
*
|
|
27
|
+
* `Tree3D`'s green-matte pass is the only user: it is deterministic per URL,
|
|
28
|
+
* so it belongs on the shared image rather than being redone per node. The
|
|
29
|
+
* `id` is part of the cache key, so the same URL with and without a process
|
|
30
|
+
* are two different entries.
|
|
31
|
+
*/
|
|
32
|
+
process?: {
|
|
33
|
+
id: string;
|
|
34
|
+
run(texture: Texture): void;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** The loader seam, so a node-environment test can count real load calls. */
|
|
38
|
+
type TextureLoad3D = (url: string, onError: (error: unknown) => void) => Texture;
|
|
39
|
+
declare class TextureCache3D {
|
|
40
|
+
private readonly entries;
|
|
41
|
+
private readonly load;
|
|
42
|
+
private readonly diagnostics;
|
|
43
|
+
constructor(opts?: {
|
|
44
|
+
loader?: TextureLoad3D;
|
|
45
|
+
diagnostics?: TextureDiagnostics | null;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* The SHARED texture for this url+spec, or null with no DOM to decode in.
|
|
49
|
+
*
|
|
50
|
+
* Callers must NOT mutate `offset`/`repeat`/`center`/`rotation` on it — that
|
|
51
|
+
* is what `acquireOwn` is for — and must not dispose it; the store owns it.
|
|
52
|
+
*/
|
|
53
|
+
acquire(url: string, spec?: TextureSpec): Texture | null;
|
|
54
|
+
/**
|
|
55
|
+
* A private CLONE, for a node that writes its own UV window.
|
|
56
|
+
*
|
|
57
|
+
* The caller owns it and disposes it in `free()`. That is safe: three
|
|
58
|
+
* refcounts the GPU texture per `source`, so disposing one clone does not
|
|
59
|
+
* pull the image out from under the others.
|
|
60
|
+
*/
|
|
61
|
+
acquireOwn(url: string, spec?: TextureSpec): Texture | null;
|
|
62
|
+
/**
|
|
63
|
+
* What 404'd, by URL — reported raw, never by cache key, because an agent
|
|
64
|
+
* greps this against the URL it wrote.
|
|
65
|
+
*/
|
|
66
|
+
errors(): {
|
|
67
|
+
url: string;
|
|
68
|
+
error: string;
|
|
69
|
+
}[];
|
|
70
|
+
/** How many distinct images this store has decoded — the point, measurable. */
|
|
71
|
+
size(): number;
|
|
72
|
+
dispose(): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The one call a node makes: shared texture through the store, or an uncached
|
|
76
|
+
* load when there is no store (a detached probe, a headless test).
|
|
77
|
+
*
|
|
78
|
+
* The fallback is deliberately silent and deliberately uncached — a node that
|
|
79
|
+
* renders outside a renderer walk is a legitimate case (`Tree3D._trunk()` builds
|
|
80
|
+
* detached), and failing there would be worse than doing the work twice.
|
|
81
|
+
*/
|
|
82
|
+
declare function acquireTexture(assets: {
|
|
83
|
+
textures: TextureCache3D;
|
|
84
|
+
} | null, url: string, spec?: TextureSpec): Texture | null;
|
|
85
|
+
/** As `acquireTexture`, but a private clone for a node with its own UV window. */
|
|
86
|
+
declare function acquireOwnTexture(assets: {
|
|
87
|
+
textures: TextureCache3D;
|
|
88
|
+
} | null, url: string, spec?: TextureSpec): Texture | null;
|
|
89
|
+
//#endregion
|
|
12
90
|
//#region src/3d/assets.d.ts
|
|
13
91
|
interface ModelEntry {
|
|
14
92
|
status: "loading" | "ready" | "error";
|
|
@@ -51,6 +129,12 @@ declare class AssetStore3D {
|
|
|
51
129
|
private readonly animationKeys;
|
|
52
130
|
private readonly loader;
|
|
53
131
|
/**
|
|
132
|
+
* Shared textures, store-scoped like everything else here. Instance state, not
|
|
133
|
+
* a module map: two games on one page must not share a decode cache, and the
|
|
134
|
+
* repo has one rule about module-level engine state.
|
|
135
|
+
*/
|
|
136
|
+
readonly textures: TextureCache3D;
|
|
137
|
+
/**
|
|
54
138
|
* `engine` is optional only so a bare store still constructs in tests. Give it
|
|
55
139
|
* one and every load failure lands in `engine.log` — where the debug overlay,
|
|
56
140
|
* `runScript()` and any agent tool can see it. Without it a 404'd GLB was a
|
|
@@ -214,8 +298,15 @@ declare class Node3D extends Node {
|
|
|
214
298
|
protected _createObject3D(): Object3D;
|
|
215
299
|
/** @internal Push JSON props onto the backing object. Called every frame.
|
|
216
300
|
* `alpha` (0..1) interpolates a physics body between its last two fixed-step
|
|
217
|
-
* positions; non-physics nodes ignore it and render `position` directly.
|
|
218
|
-
|
|
301
|
+
* positions; non-physics nodes ignore it and render `position` directly.
|
|
302
|
+
*
|
|
303
|
+
* `assets` is the renderer's store, the only route a node has to shared
|
|
304
|
+
* textures — mirroring `_syncObject2D(assets)`, which has always taken it. It
|
|
305
|
+
* is a PARAMETER rather than a field so a node that forgets it is a type
|
|
306
|
+
* error rather than a silent per-node decode; overrides that do not need it
|
|
307
|
+
* simply keep the one-argument signature. Null in a headless test or a
|
|
308
|
+
* detached probe, where the node falls back to loading uncached. */
|
|
309
|
+
_syncObject3D(alpha?: number, _assets?: AssetStore3D | null): void;
|
|
219
310
|
override free(): void;
|
|
220
311
|
}
|
|
221
312
|
//#endregion
|
|
@@ -1415,12 +1506,31 @@ declare class MeshInstance3D extends Node3D {
|
|
|
1415
1506
|
private textureKey;
|
|
1416
1507
|
private loadedTextures;
|
|
1417
1508
|
protected override _createObject3D(): Object3D;
|
|
1418
|
-
override _syncObject3D(): void;
|
|
1509
|
+
override _syncObject3D(alpha?: number, assets?: AssetStore3D | null): void;
|
|
1419
1510
|
/** Lazy texture dressing — same headless guard as Tree3D bark: without a
|
|
1420
1511
|
* DOM there is no Image decode, so geometry/colors apply and the maps are
|
|
1421
1512
|
* skipped. Re-loads only when a texture-shaping key changes. */
|
|
1422
1513
|
private syncTextures;
|
|
1514
|
+
/**
|
|
1515
|
+
* A private CLONE: `repeat` is per-node here (a 1x1 crate and a 8x8 floor
|
|
1516
|
+
* share one tile image), and that is the one field a shared master cannot
|
|
1517
|
+
* carry. The clone shares `texture.source`, so the fetch and the decode are
|
|
1518
|
+
* still done once per url for the whole scene.
|
|
1519
|
+
*/
|
|
1423
1520
|
private loadTexture;
|
|
1521
|
+
/**
|
|
1522
|
+
* Give the GPU back everything this node OWNS.
|
|
1523
|
+
*
|
|
1524
|
+
* It used to dispose textures and nothing else, so every freed mesh leaked its
|
|
1525
|
+
* geometry and its material — a wave spawner that kills and respawns fifty
|
|
1526
|
+
* enemies a minute leaks fifty of each, forever, and nothing in the game says
|
|
1527
|
+
* so. Both are built here (`_createObject3D` news them, `_syncObject3D`
|
|
1528
|
+
* rebuilds the geometry on a shape change), so both are ours to release.
|
|
1529
|
+
*
|
|
1530
|
+
* The textures are NOT: since the shared texture cache they belong to the
|
|
1531
|
+
* asset store, except the per-node clones this node asked for, which are what
|
|
1532
|
+
* `loadedTextures` holds.
|
|
1533
|
+
*/
|
|
1424
1534
|
override free(): void;
|
|
1425
1535
|
}
|
|
1426
1536
|
//#endregion
|
|
@@ -2419,7 +2529,6 @@ declare class Terrain3D extends Node3D {
|
|
|
2419
2529
|
private heightmap;
|
|
2420
2530
|
private heightmapKey;
|
|
2421
2531
|
private builtKey;
|
|
2422
|
-
private loadedTextures;
|
|
2423
2532
|
protected override _createObject3D(): Object3D;
|
|
2424
2533
|
/**
|
|
2425
2534
|
* Terrain surface height (world y) at WORLD x/z — works headless, before
|
|
@@ -2442,14 +2551,13 @@ declare class Terrain3D extends Node3D {
|
|
|
2442
2551
|
private rememberShape;
|
|
2443
2552
|
/** The splat layers in effect — theme preset, or `layers` for 'custom'. */
|
|
2444
2553
|
resolvedLayers(): TerrainLayer[];
|
|
2445
|
-
override _syncObject3D(): void;
|
|
2554
|
+
override _syncObject3D(alpha?: number, assets?: AssetStore3D | null): void;
|
|
2446
2555
|
private effectiveIslandEdge;
|
|
2447
2556
|
private segments;
|
|
2448
2557
|
/** Rebuild geometry+material only when a terrain-shaping prop changed. */
|
|
2449
2558
|
private rebuildIfNeeded;
|
|
2450
2559
|
private buildGeometry;
|
|
2451
2560
|
private buildMaterial;
|
|
2452
|
-
private disposeTextures;
|
|
2453
2561
|
override free(): void;
|
|
2454
2562
|
}
|
|
2455
2563
|
//#endregion
|
|
@@ -3344,4 +3452,4 @@ declare function createNavDebugNode(nav: TerrainNav, opts?: {
|
|
|
3344
3452
|
name?: string;
|
|
3345
3453
|
}): InstancedMesh3D;
|
|
3346
3454
|
//#endregion
|
|
3347
|
-
export { Area3D, AssetStore3D, type BedSampler, Billboard3D, type BillboardGroupMode, BoneAttachment3D, BoneLookAt3D, Camera3D, CharacterBody3D, CharacterController3D, type CreateGame3DOptions, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, type DownhillTraceOptions, Environment3D, type Environment3DConfig, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, type FlowerVariety, Flowers3D, type FogEnvironment, Foliage3D, type FoliageKind, type FoliageStyle, type Game3D, type HeightSampler, type Heightmap, type HeightmapOptions, InstancedMesh3D, 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, River3D, type RiverCarveOptions, type RiverCoverageGap, type RiverHit, type RiverRing, type RiverRingOptions, type ShadowsEnvironment, type SkyEnvironment, StaticBody3D, type SunConsumer3D, type SyncOptions, type SyncResult, TERRAIN_THEMES, Terrain3D, type TerrainLayer, type TerrainNav, type TerrainNavOptions, type TerrainTheme, Trail3D, Tree3D, type TreeTier, type TreeType, VOXEL_PALETTE, type VoxelBlock, VoxelGrid3D, WATER_CUTOUT_MAX, WATER_MAX_RIPPLES, Water3D, WaterCutout3D, buildHeightmap, buildRiverRings, buildTerrainNav, cameraRelative, createGame3D, createNavDebugNode, enablePhysics3D, findRiverCoverageGaps, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, projectToRiver, registerNodes3D, resolveFlowerDensity, rigPose, riverCarveChannels, riverStepFor, setEnvironment3D, smoothCourse, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers, traceDownhillPath };
|
|
3455
|
+
export { Area3D, AssetStore3D, type BedSampler, Billboard3D, type BillboardGroupMode, BoneAttachment3D, BoneLookAt3D, Camera3D, CharacterBody3D, CharacterController3D, type CreateGame3DOptions, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, type DownhillTraceOptions, Environment3D, type Environment3DConfig, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, type FlowerVariety, Flowers3D, type FogEnvironment, Foliage3D, type FoliageKind, type FoliageStyle, type Game3D, type HeightSampler, type Heightmap, type HeightmapOptions, InstancedMesh3D, 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, River3D, type RiverCarveOptions, type RiverCoverageGap, type RiverHit, type RiverRing, type RiverRingOptions, type ShadowsEnvironment, type SkyEnvironment, StaticBody3D, type SunConsumer3D, type SyncOptions, type SyncResult, TERRAIN_THEMES, Terrain3D, type TerrainLayer, type TerrainNav, type TerrainNavOptions, type TerrainTheme, TextureCache3D, type TextureSpec, Trail3D, Tree3D, type TreeTier, type TreeType, VOXEL_PALETTE, type VoxelBlock, VoxelGrid3D, WATER_CUTOUT_MAX, WATER_MAX_RIPPLES, Water3D, WaterCutout3D, acquireOwnTexture, acquireTexture, buildHeightmap, buildRiverRings, buildTerrainNav, cameraRelative, createGame3D, createNavDebugNode, enablePhysics3D, findRiverCoverageGaps, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, projectToRiver, registerNodes3D, resolveFlowerDensity, rigPose, riverCarveChannels, riverStepFor, setEnvironment3D, smoothCourse, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers, traceDownhillPath };
|
package/dist/3d.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
2
|
-
import { A as Water3D, F as PhysicsBody3D, I as RigidBody3D, L as StaticBody3D, M as WaterCutout3D, N as Area3D, P as CharacterBody3D, R as Node3D, V as WATER_MAX_RIPPLES, j as WATER_CUTOUT_MAX } from "./gameplay-
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
2
|
+
import { A as Water3D, F as PhysicsBody3D, I as RigidBody3D, L as StaticBody3D, M as WaterCutout3D, N as Area3D, P as CharacterBody3D, R as Node3D, V as WATER_MAX_RIPPLES, j as WATER_CUTOUT_MAX } from "./gameplay-BvhcQbfJ.js";
|
|
3
|
+
import { A as Terrain3D, B as keyboardIntensity, C as resolveFlowerDensity, D as BoneLookAt3D, E as Camera3D, F as InstancedMesh3D, G as acquireTexture, H as rigPose, I as MeshInstance3D, M as TERRAIN_THEMES, N as terrainThemeLayers, O as BoneAttachment3D, P as Joint3D, R as QUARTER_PITCH, S as Flowers3D, T as CharacterController3D, U as TextureCache3D, V as movementState, W as acquireOwnTexture, _ as LoftMesh3D, a as Tree3D, b as Foliage3D, c as buildRiverRings, d as riverCarveChannels, f as riverStepFor, g as ModelInstance3D, h as Particles3D, i as VoxelGrid3D, j as DEFAULT_TERRAIN_TEXTURE_BASE, k as Billboard3D, l as findRiverCoverageGaps, m as traceDownhillPath, n as registerNodes3D, o as Trail3D, p as smoothCourse, r as VOXEL_PALETTE, s as River3D, u as projectToRiver, v as DirectionalLight3D, w as FLOWER_VARIETIES, x as DENSITY_PRESETS, y as OmniLight3D, z as cameraRelative } from "./environment-presets-TAGvmM3z.js";
|
|
4
|
+
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-BUD89Kqh.js";
|
|
5
5
|
import { n as splatWeights, t as buildHeightmap } from "./heightmap-CRK0M4jT.js";
|
|
6
|
-
import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-
|
|
6
|
+
import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-DxBH4sIF.js";
|
|
7
7
|
//#region src/3d/environment-runtime.ts
|
|
8
8
|
/**
|
|
9
9
|
* Live environment editing — the renderer re-applies `scene.environment`
|
|
@@ -142,4 +142,4 @@ function createNavDebugNode(nav, opts) {
|
|
|
142
142
|
return node;
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
|
-
export { Area3D, AssetStore3D, Billboard3D, BoneAttachment3D, BoneLookAt3D, Camera3D, CharacterBody3D, CharacterController3D, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, Environment3D, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, Flowers3D, Foliage3D, InstancedMesh3D, Joint3D, LoftMesh3D, MeshInstance3D, ModelInstance3D, Node3D, OmniLight3D, Particles3D, Physics3D, PhysicsBody3D, QUARTER_PITCH, Renderer3D, RigidBody3D, River3D, StaticBody3D, TERRAIN_THEMES, Terrain3D, Trail3D, Tree3D, VOXEL_PALETTE, VoxelGrid3D, WATER_CUTOUT_MAX, WATER_MAX_RIPPLES, Water3D, WaterCutout3D, buildHeightmap, buildRiverRings, buildTerrainNav, cameraRelative, createGame3D, createNavDebugNode, enablePhysics3D, findRiverCoverageGaps, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, projectToRiver, registerNodes3D, resolveFlowerDensity, rigPose, riverCarveChannels, riverStepFor, setEnvironment3D, smoothCourse, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers, traceDownhillPath };
|
|
145
|
+
export { Area3D, AssetStore3D, Billboard3D, BoneAttachment3D, BoneLookAt3D, Camera3D, CharacterBody3D, CharacterController3D, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, Environment3D, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, Flowers3D, Foliage3D, InstancedMesh3D, Joint3D, LoftMesh3D, MeshInstance3D, ModelInstance3D, Node3D, OmniLight3D, Particles3D, Physics3D, PhysicsBody3D, QUARTER_PITCH, Renderer3D, RigidBody3D, River3D, StaticBody3D, TERRAIN_THEMES, Terrain3D, TextureCache3D, Trail3D, Tree3D, VOXEL_PALETTE, VoxelGrid3D, WATER_CUTOUT_MAX, WATER_MAX_RIPPLES, Water3D, WaterCutout3D, acquireOwnTexture, acquireTexture, buildHeightmap, buildRiverRings, buildTerrainNav, cameraRelative, createGame3D, createNavDebugNode, enablePhysics3D, findRiverCoverageGaps, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, projectToRiver, registerNodes3D, resolveFlowerDensity, rigPose, riverCarveChannels, riverStepFor, setEnvironment3D, smoothCourse, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers, traceDownhillPath };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A as translationKey } from "./register-BFLg0-_i.js";
|
|
1
2
|
//#region src/core/audit.ts
|
|
2
3
|
const ANIMATED_TYPES = new Set([
|
|
3
4
|
"Particles2D",
|
|
@@ -68,7 +69,43 @@ function auditScene(scene) {
|
|
|
68
69
|
if (cameras > 0 && currentCameras === 0) warnings.push("no camera has \"current\": true — the screen renders from a default view, probably not what you framed.");
|
|
69
70
|
if (currentCameras > 1) warnings.push(`${currentCameras} cameras claim "current": true — only the first found wins.`);
|
|
70
71
|
if (scene.dimension === "3d" && lights === 0 && !isLit(scene.environment)) warnings.push("nothing lights this 3D scene — no light node, no environment sky/hdri, and no ambient intensity. It will render black. Add a DirectionalLight3D, or an \"environment\": { \"sky\": { \"type\": \"atmosphere\" } } / { \"preset\": \"...\" }.");
|
|
72
|
+
for (const warning of auditStrings(scene)) warnings.push(warning);
|
|
71
73
|
return warnings;
|
|
72
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Translation keys nothing declares — the ONE localization mistake worth
|
|
77
|
+
* reporting.
|
|
78
|
+
*
|
|
79
|
+
* A key present in `en` and missing from `ko` is not a mistake: falling back to
|
|
80
|
+
* the English is the intended outcome whenever the English term is the more
|
|
81
|
+
* precise one, or the translation would not fit. That case is silent by design
|
|
82
|
+
* (see core/localization.ts).
|
|
83
|
+
*
|
|
84
|
+
* A key missing from EVERY locale is a typo, and the player sees the raw key on
|
|
85
|
+
* screen. Reported here — at author time, where it can still be fixed — rather
|
|
86
|
+
* than at runtime in front of someone playing.
|
|
87
|
+
*/
|
|
88
|
+
function auditStrings(scene) {
|
|
89
|
+
const tables = scene.strings;
|
|
90
|
+
const declared = /* @__PURE__ */ new Set();
|
|
91
|
+
for (const entries of Object.values(tables ?? {})) for (const key of Object.keys(entries)) declared.add(key);
|
|
92
|
+
const missing = /* @__PURE__ */ new Set();
|
|
93
|
+
const walk = (value) => {
|
|
94
|
+
if (typeof value === "string") {
|
|
95
|
+
const key = translationKey(value);
|
|
96
|
+
if (key !== null && !declared.has(key)) missing.add(key);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (Array.isArray(value)) {
|
|
100
|
+
for (const item of value) walk(item);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (value !== null && typeof value === "object") for (const item of Object.values(value)) walk(item);
|
|
104
|
+
};
|
|
105
|
+
walk(scene.root);
|
|
106
|
+
if (missing.size === 0) return [];
|
|
107
|
+
const listed = [...missing].sort();
|
|
108
|
+
return [`${listed.length} translation key${listed.length === 1 ? "" : "s"} nothing declares: ${listed.join(", ")}. The key itself renders on screen. Add them under "strings": { "en": { ... } } — other locales may omit any of them and fall back to English.`];
|
|
109
|
+
}
|
|
73
110
|
//#endregion
|
|
74
111
|
export { auditScene as t };
|