incanto 0.57.0 → 0.59.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 +6 -4
- package/bin/incanto-check.mjs +27 -0
- package/bin/incanto-multiplay.mjs +170 -0
- package/bin/incanto-new.mjs +29 -7
- package/bin/incanto-playtest.mjs +28 -2
- package/bin/incanto-verify.mjs +155 -19
- package/bin/incanto.mjs +107 -0
- package/dist/2d.d.ts +8 -2
- package/dist/2d.js +3 -3
- package/dist/3d.d.ts +9 -3
- package/dist/3d.js +4 -4
- package/dist/{behavior-l08AEbq9.d.ts → behavior-DWKTUzKI.d.ts} +10 -0
- package/dist/{create-game-C5jQYPah.js → create-game-BiW8Men_.js} +61 -13
- package/dist/{create-game-DpbUrMOQ.js → create-game-CHDLDQsQ.js} +6 -6
- package/dist/debug.d.ts +1 -1
- package/dist/debug.js +2 -2
- package/dist/{duplicate-BPLZDZpd.js → duplicate-DJQd44CD.js} +1 -1
- package/dist/{environment-presets-CvvQr_bJ.js → environment-presets-DRAz5EV9.js} +12 -10
- package/dist/{gameplay-BVphcxmE.js → gameplay-BBEjPFsR.js} +62 -34
- package/dist/gameplay.d.ts +1 -1
- package/dist/gameplay.js +1 -1
- package/dist/index.d.ts +36 -8
- package/dist/index.js +8 -8
- package/dist/{json-BLk7H2Qa.js → json-CwwhxQgb.js} +7 -1
- package/dist/{loader-BcrRSjxB.js → loader-D8n7TU8W.js} +142 -5
- package/dist/{loader-BbEMTuWg.d.ts → loader-TvkRFbyL.d.ts} +1 -1
- package/dist/net.d.ts +2 -2
- package/dist/net.js +1 -1
- package/dist/{pathfinding-mEN4V1CU.d.ts → pathfinding-BqWBb0kh.d.ts} +1 -1
- package/dist/{physics-2d-BLcvEFDR.js → physics-2d-BaRSRrrZ.js} +14 -3
- package/dist/{physics-3d-QBrfIT2Y.js → physics-3d-CYxjh-HW.js} +15 -4
- package/dist/quiet-rapier-BAJ4K94N.js +46 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/dist/{register-C6ZBFRjd.js → register-BpFcgdcL.js} +57 -27
- package/dist/{register-Ch70uByv.js → register-CDrAQqPp.js} +90 -41
- package/dist/{registry-C7u42TID.js → registry-WWcQcfMr.js} +1 -1
- package/dist/{replay-s7I2GstT.js → replay-CEPyQtF_.js} +31 -7
- package/dist/{replay-Dw6gMlYA.d.ts → replay-O-yAGM76.d.ts} +1 -1
- package/dist/{split-screen-B0baBwxI.d.ts → split-screen-BQ3tAsf-.d.ts} +38 -1
- package/dist/{split-screen-DLsUrleX.js → split-screen-DDMZutQ6.js} +56 -13
- package/dist/{sprite-animation-C0wXLBZJ.js → sprite-animation-CY-mrr1L.js} +1 -1
- package/dist/{src-CGjmPw65.js → src-CY21B462.js} +1 -1
- package/dist/{teardown-Cs113S9F.js → teardown-RApWnM1G.js} +1 -1
- package/dist/{test-it1VekWs.js → test-DHYuFyAu.js} +292 -31
- package/dist/test.d.ts +104 -6
- package/dist/test.js +3 -3
- package/dist/vite.js +2 -2
- package/editor/assets/{agent8-CGT7r3Mb.js → agent8-BoRGtVxK.js} +1 -1
- package/editor/assets/{debug-BxWSIHG3.js → debug-CzdyCg75.js} +1 -1
- package/editor/assets/{index-CV1m-aX5.js → index-VesuVEhe.js} +91 -91
- package/editor/index.html +1 -1
- package/package.json +3 -1
- package/schemas/scene.schema.json +1174 -70
- package/skills/incanto-building-2d-games.md +13 -0
- package/skills/incanto-building-3d-games.md +3 -3
- package/skills/incanto-localization.md +40 -8
- package/skills/incanto-multiplayer.md +57 -4
- package/skills/incanto-node-reference.md +18 -0
- package/skills/incanto-physics-and-input.md +26 -0
- package/skills/incanto-playtesting.md +19 -5
- package/skills/incanto-verifying-your-game.md +33 -4
- package/templates-app/beacon-isle-3d/package.json +1 -1
- package/templates-app/beacon-isle-3d/src/game.scene.json +7 -6
- package/templates-app/platformer-2d/PROJECT/Context.md +70 -0
- package/templates-app/platformer-2d/PROJECT/Requirements.md +63 -0
- package/templates-app/platformer-2d/PROJECT/Status.md +60 -0
- package/templates-app/platformer-2d/PROJECT/Structure.md +77 -0
- package/templates-app/platformer-2d/docs/project-2d-rules.md +61 -0
- package/templates-app/platformer-2d/index.html +99 -0
- package/templates-app/platformer-2d/package.json +23 -0
- package/templates-app/platformer-2d/src/behaviors.ts +541 -0
- package/templates-app/platformer-2d/src/game.scene.json +2061 -0
- package/templates-app/platformer-2d/src/main.ts +68 -0
- package/templates-app/platformer-2d/tsconfig.json +13 -0
- package/templates-app/platformer-2d/verify.ts +275 -0
- package/templates-app/platformer-2d/vite.config.ts +12 -0
- package/templates-app/star-survivor/PROJECT/Context.md +55 -0
- package/templates-app/star-survivor/PROJECT/Requirements.md +47 -0
- package/templates-app/star-survivor/PROJECT/Status.md +44 -0
- package/templates-app/star-survivor/PROJECT/Structure.md +63 -0
- package/templates-app/star-survivor/docs/project-2d-rules.md +53 -0
- package/templates-app/star-survivor/index.html +232 -0
- package/templates-app/star-survivor/package.json +23 -0
- package/templates-app/star-survivor/src/behaviors.ts +624 -0
- package/templates-app/star-survivor/src/game.scene.json +464 -0
- package/templates-app/star-survivor/src/main.ts +49 -0
- package/templates-app/star-survivor/tsconfig.json +13 -0
- package/templates-app/star-survivor/verify.ts +193 -0
- package/templates-app/star-survivor/vite.config.ts +12 -0
- package/templates-app/tps-3d/package.json +1 -1
- package/templates-app/tps-3d/src/game.scene.json +6 -3
- package/templates-app/tps-3d/verify.ts +17 -1
- package/templates-app/village-quest-3d/package.json +1 -1
- package/templates-app/village-quest-3d/src/grove.scene.json +14 -13
- package/templates-app/village-quest-3d/src/village.scene.json +5 -5
package/bin/incanto.mjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* incanto — the front door.
|
|
4
|
+
*
|
|
5
|
+
* bunx incanto new my-game scaffold a game (no install needed first)
|
|
6
|
+
* bunx incanto check src validate scene JSON
|
|
7
|
+
* bunx incanto verify the whole verification ladder
|
|
8
|
+
*
|
|
9
|
+
* WHY THIS EXISTS. Every doc used to open with `bunx incanto-new my-game`, and
|
|
10
|
+
* that command 404s for the one person it is written for. `bunx <name>` fetches
|
|
11
|
+
* the PACKAGE called `<name>`; it does not search the registry for a package
|
|
12
|
+
* that happens to ship a bin by that name. There is no `incanto-new` package,
|
|
13
|
+
* so a brand-new reader's very first command failed — while every existing
|
|
14
|
+
* consumer ran it happily, because with `incanto` already in `node_modules` the
|
|
15
|
+
* same words resolve to the local bin. The funnel was the one path nobody
|
|
16
|
+
* walked.
|
|
17
|
+
*
|
|
18
|
+
* `bunx incanto <subcommand>` works from nothing, because `incanto` IS the
|
|
19
|
+
* package name. The `incanto-*` bins all still exist and are unchanged — inside
|
|
20
|
+
* a project they are the shorter thing to type.
|
|
21
|
+
*
|
|
22
|
+
* Dispatch is an in-process import, not a spawn: the child bin then runs under
|
|
23
|
+
* the SAME runtime that started this one, which matters because `--behaviors`
|
|
24
|
+
* loads your TypeScript and bun and node disagree about what they can import.
|
|
25
|
+
*/
|
|
26
|
+
import { readFileSync } from 'node:fs';
|
|
27
|
+
import { dirname, join } from 'node:path';
|
|
28
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
29
|
+
|
|
30
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
31
|
+
|
|
32
|
+
/** Subcommand → bin file, in the order the help should list them. */
|
|
33
|
+
const COMMANDS = {
|
|
34
|
+
new: ['incanto-new.mjs', 'scaffold a ready-to-run game from a template'],
|
|
35
|
+
check: ['incanto-check.mjs', 'validate scene JSON and the assets it names'],
|
|
36
|
+
verify: ['incanto-verify.mjs', 'the whole ladder: loads · plays · feels · draws · says'],
|
|
37
|
+
playtest: ['incanto-playtest.mjs', 'drive the game headlessly and report what happened'],
|
|
38
|
+
multiplay: ['incanto-multiplay.mjs', 'run a real match and check the clients agree'],
|
|
39
|
+
play: ['incanto-play.mjs', 'run a scene headlessly for a fixed span'],
|
|
40
|
+
feel: ['incanto-feel.mjs', 'measure jump height, run speed, facing'],
|
|
41
|
+
frame: ['incanto-frame.mjs', 'what the running page is drawing right now'],
|
|
42
|
+
logs: ['incanto-logs.mjs', 'what the running page has been saying'],
|
|
43
|
+
editor: ['incanto-editor.mjs', 'the visual scene composer'],
|
|
44
|
+
model: ['incanto-model.mjs', "a GLB's real bounds, animations and rig"],
|
|
45
|
+
assets: ['incanto-assets.mjs', 'the built-in art and audio catalog'],
|
|
46
|
+
env: ['incanto-env.mjs', 'generate a 3D environment'],
|
|
47
|
+
skills: ['incanto-skills.mjs', 'install the agent skills for this engine version'],
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function version() {
|
|
51
|
+
try {
|
|
52
|
+
const pkg = JSON.parse(readFileSync(join(HERE, '..', 'package.json'), 'utf-8'));
|
|
53
|
+
return pkg.version ?? 'unknown';
|
|
54
|
+
} catch {
|
|
55
|
+
return 'unknown';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function help() {
|
|
60
|
+
const width = Math.max(...Object.keys(COMMANDS).map((k) => k.length));
|
|
61
|
+
const lines = Object.entries(COMMANDS).map(
|
|
62
|
+
([name, [, blurb]]) => ` ${name.padEnd(width)} ${blurb}`,
|
|
63
|
+
);
|
|
64
|
+
return [
|
|
65
|
+
`incanto ${version()} — a vibe-coding-first web game engine`,
|
|
66
|
+
'',
|
|
67
|
+
'Usage: bunx incanto <command> [options]',
|
|
68
|
+
'',
|
|
69
|
+
...lines,
|
|
70
|
+
'',
|
|
71
|
+
'Start a game: bunx incanto new my-game',
|
|
72
|
+
'See the templates: bunx incanto new --list',
|
|
73
|
+
'',
|
|
74
|
+
'Each command also ships as its own bin (`incanto-new`, `incanto-check`, …),',
|
|
75
|
+
'which is what to type once the package is installed in your project.',
|
|
76
|
+
].join('\n');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
80
|
+
|
|
81
|
+
if (!command || command === '--help' || command === '-h' || command === 'help') {
|
|
82
|
+
console.log(help());
|
|
83
|
+
process.exit(0);
|
|
84
|
+
}
|
|
85
|
+
if (command === '--version' || command === '-v') {
|
|
86
|
+
console.log(version());
|
|
87
|
+
process.exit(0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const entry = COMMANDS[command];
|
|
91
|
+
if (!entry) {
|
|
92
|
+
const near = Object.keys(COMMANDS).filter((k) => k.startsWith(command[0] ?? ''));
|
|
93
|
+
console.error(
|
|
94
|
+
`incanto: unknown command '${command}'.` +
|
|
95
|
+
(near.length ? ` Did you mean: ${near.join(', ')}?` : '') +
|
|
96
|
+
'\n\n' +
|
|
97
|
+
help(),
|
|
98
|
+
);
|
|
99
|
+
process.exit(2);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const target = join(HERE, entry[0]);
|
|
103
|
+
// The child reads `process.argv.slice(2)`, so hand it an argv that looks like
|
|
104
|
+
// it was invoked directly. Importing rather than spawning keeps one process
|
|
105
|
+
// and, more importantly, one runtime.
|
|
106
|
+
process.argv = [process.argv[0], target, ...rest];
|
|
107
|
+
await import(pathToFileURL(target).href);
|
package/dist/2d.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { At as Node, P as Scene$1, S as Scheduler, T as RendererStats, b as Engine, d as PropSchema, n as BehaviorCtor, w as GameStats } from "./behavior-
|
|
1
|
+
import { At as Node, P as Scene$1, S as Scheduler, T as RendererStats, b as Engine, d as PropSchema, n as BehaviorCtor, w as GameStats } from "./behavior-DWKTUzKI.js";
|
|
2
2
|
import { n as DiagnosticSink, t as EditorSwitchOptions } from "./editor-switch-DAvWQeld.js";
|
|
3
3
|
import { i as SceneJson, s as JsonObject } from "./schema-CFeioQRE.js";
|
|
4
4
|
import { r as FrameStats } from "./frame-report-DCnHFmto.js";
|
|
5
|
-
import { t as LoadSceneOptions } from "./loader-
|
|
5
|
+
import { t as LoadSceneOptions } from "./loader-TvkRFbyL.js";
|
|
6
6
|
import { n as AnimationEntry } from "./sprite-animation-CMr6f1K2.js";
|
|
7
7
|
import { r as ParticleView, t as ParticleSim } from "./particle-sim-C5OfBbmU.js";
|
|
8
8
|
import { Group, Mesh, Object3D, Scene, Texture } from "three";
|
|
@@ -107,6 +107,9 @@ declare class PhysicsBody2D extends Node2D {
|
|
|
107
107
|
private _collider;
|
|
108
108
|
/** @internal Physics resync flag — raised when `collider` is REPLACED. */
|
|
109
109
|
_colliderChanged: boolean;
|
|
110
|
+
private _enabled;
|
|
111
|
+
/** @internal Physics resync flag — raised when `enabled` is written. */
|
|
112
|
+
_enabledChanged: boolean;
|
|
110
113
|
/**
|
|
111
114
|
* Collider shape prop. Change it by REPLACING the object
|
|
112
115
|
* (`body.collider = { shape: 'box', size: [...] }`) — physics rebuilds the
|
|
@@ -114,6 +117,9 @@ declare class PhysicsBody2D extends Node2D {
|
|
|
114
117
|
*/
|
|
115
118
|
get collider(): JsonObject;
|
|
116
119
|
set collider(value: JsonObject);
|
|
120
|
+
/** See the `enabled` prop. Writing it arms or disarms the existing collider. */
|
|
121
|
+
get enabled(): boolean;
|
|
122
|
+
set enabled(value: boolean);
|
|
117
123
|
/** Loader hook: bad collider shapes fail at LOAD, not at physics start. */
|
|
118
124
|
static validateJson(node: Node): void;
|
|
119
125
|
/** @internal Set by Physics2D when the body is created. */
|
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-CHDLDQsQ.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-BpFcgdcL.js";
|
|
4
|
+
import { n as enablePhysics2D, t as Physics2D } from "./physics-2d-BaRSRrrZ.js";
|
|
5
5
|
//#region src/2d/library-sprite.ts
|
|
6
6
|
/**
|
|
7
7
|
* What a `CharacterController2D`/`3D` will ask a skin to play, and the clip in
|
package/dist/3d.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { At as Node, D as QualityCaps, P as Scene$1, S as Scheduler, T as RendererStats, b as Engine, d as PropSchema, n as BehaviorCtor, w as GameStats } from "./behavior-
|
|
1
|
+
import { At as Node, D as QualityCaps, P as Scene$1, S as Scheduler, T as RendererStats, b as Engine, d as PropSchema, n as BehaviorCtor, w as GameStats } from "./behavior-DWKTUzKI.js";
|
|
2
2
|
import { n as DiagnosticSink, t as EditorSwitchOptions } from "./editor-switch-DAvWQeld.js";
|
|
3
3
|
import { i as SceneJson$1, s as JsonObject } from "./schema-CFeioQRE.js";
|
|
4
4
|
import { a as GridCell, c as diffText, d as frameText, i as FrameStatsOptions, l as frameSignature, n as FrameSignature, o as SIGNATURE_GRID, r as FrameStats, s as diffSignatures, t as FrameDiff, u as frameStats } from "./frame-report-DCnHFmto.js";
|
|
5
|
-
import { t as LoadSceneOptions } from "./loader-
|
|
5
|
+
import { t as LoadSceneOptions } from "./loader-TvkRFbyL.js";
|
|
6
6
|
import { r as ParticleView, t as ParticleSim } from "./particle-sim-C5OfBbmU.js";
|
|
7
|
-
import { n as PathGrid, s as SpatialPose } from "./pathfinding-
|
|
7
|
+
import { n as PathGrid, s as SpatialPose } from "./pathfinding-BqWBb0kh.js";
|
|
8
8
|
import { AnimationClip, AnimationMixer, BufferGeometry, Color, DirectionalLight, Group, InstancedMesh, Mesh, MeshPhysicalMaterial, Object3D, PerspectiveCamera, Scene, ShaderMaterial, Texture, Vector3, WebGLRenderer } from "three";
|
|
9
9
|
import { VRM } from "@pixiv/three-vrm";
|
|
10
10
|
import { Sky } from "three/examples/jsm/objects/Sky.js";
|
|
@@ -333,6 +333,9 @@ declare class PhysicsBody3D extends Node3D {
|
|
|
333
333
|
private _collider;
|
|
334
334
|
/** @internal Physics resync flag — raised when `collider` is REPLACED. */
|
|
335
335
|
_colliderChanged: boolean;
|
|
336
|
+
private _enabled;
|
|
337
|
+
/** @internal Physics resync flag — raised when `enabled` is written. */
|
|
338
|
+
_enabledChanged: boolean;
|
|
336
339
|
/**
|
|
337
340
|
* Collider shape prop. Change it by REPLACING the object
|
|
338
341
|
* (`body.collider = { shape: 'box', size: [...] }`) — physics rebuilds the
|
|
@@ -340,6 +343,9 @@ declare class PhysicsBody3D extends Node3D {
|
|
|
340
343
|
*/
|
|
341
344
|
get collider(): JsonObject;
|
|
342
345
|
set collider(value: JsonObject);
|
|
346
|
+
/** See the `enabled` prop. Writing it arms or disarms the existing collider. */
|
|
347
|
+
get enabled(): boolean;
|
|
348
|
+
set enabled(value: boolean);
|
|
343
349
|
/** Loader hook: bad collider shapes fail at LOAD, not at physics start. */
|
|
344
350
|
static validateJson(node: Node): void;
|
|
345
351
|
/** @internal Set by Physics3D when the body is created. */
|
package/dist/3d.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as frameSignature, n as diffSignatures, o as frameStats, r as diffText, s as frameText, t as SIGNATURE_GRID } from "./frame-report-BSMny7oe.js";
|
|
2
|
-
import { B as StaticBody3D, F as WaterCutout3D, I as Area3D, L as CharacterBody3D, N as Water3D, P as WATER_CUTOUT_MAX, R as PhysicsBody3D, V as Node3D, W as WATER_MAX_RIPPLES, z as RigidBody3D } from "./gameplay-
|
|
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-
|
|
4
|
-
import { a as Environment3D, c as parseEnvironment3D, d as AssetStore3D, i as syncTree, l as sunDirectionFromElevationAzimuth, o as setEnvironment3D, r as Renderer3D, s as horizonColorFromSky, t as createGame3D, u as sunDirectionFromSky } from "./create-game-
|
|
2
|
+
import { B as StaticBody3D, F as WaterCutout3D, I as Area3D, L as CharacterBody3D, N as Water3D, P as WATER_CUTOUT_MAX, R as PhysicsBody3D, V as Node3D, W as WATER_MAX_RIPPLES, z as RigidBody3D } from "./gameplay-BBEjPFsR.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-DRAz5EV9.js";
|
|
4
|
+
import { a as Environment3D, c as parseEnvironment3D, d as AssetStore3D, i as syncTree, l as sunDirectionFromElevationAzimuth, o as setEnvironment3D, r as Renderer3D, s as horizonColorFromSky, t as createGame3D, u as sunDirectionFromSky } from "./create-game-BiW8Men_.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-CYxjh-HW.js";
|
|
7
7
|
//#region src/3d/model-verdict.ts
|
|
8
8
|
/** Mixamo exports every bone as `mixamorigX`; the retargeter binds by that name. */
|
|
9
9
|
const MIXAMO = /^mixamorig[:_]?/i;
|
|
@@ -1033,6 +1033,16 @@ declare class Localization {
|
|
|
1033
1033
|
* `startsWith` per widget per frame and nothing else.
|
|
1034
1034
|
*/
|
|
1035
1035
|
resolve(value: string, params?: Record<string, JsonValue>): string;
|
|
1036
|
+
/**
|
|
1037
|
+
* Whether the ACTIVE locale or the base declares this key.
|
|
1038
|
+
*
|
|
1039
|
+
* This is the runtime question, and it is not the same as `has`: a key only
|
|
1040
|
+
* `ko` declares is "declared", and an English player still gets the raw key
|
|
1041
|
+
* back from `t()`, because the fallback chain is current → base → the key.
|
|
1042
|
+
* Widgets that ask before translating asked the wrong one and painted
|
|
1043
|
+
* `settings.quality.low` into an English menu.
|
|
1044
|
+
*/
|
|
1045
|
+
declares(key: string): boolean;
|
|
1036
1046
|
/** Whether any locale declares this key — for the audit, not for the runtime. */
|
|
1037
1047
|
has(key: string): boolean;
|
|
1038
1048
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { j as registerBehavior, n as loadScene, w as diagnose } from "./loader-D8n7TU8W.js";
|
|
3
|
+
import { S as qualityRendering, _ as Engine, b as qualityCaps, g as AudioPlayer } from "./register-CDrAQqPp.js";
|
|
4
4
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
5
5
|
import { i as resolveRendering, n as attachTouchControls } from "./touch-DESwnpOc.js";
|
|
6
|
-
import { a as openBundledEditor, c as claimCanvasGestures, i as devServerLibrary, l as audioErrors, n as pauseWhenHidden, o as poseFromRenderer, r as crossFade, s as wireDevChannel, t as teardown } from "./teardown-
|
|
6
|
+
import { a as openBundledEditor, c as claimCanvasGestures, i as devServerLibrary, l as audioErrors, n as pauseWhenHidden, o as poseFromRenderer, r as crossFade, s as wireDevChannel, t as teardown } from "./teardown-RApWnM1G.js";
|
|
7
7
|
import { o as frameStats } from "./frame-report-BSMny7oe.js";
|
|
8
|
-
import { R as PhysicsBody3D, U as createCausticsQuad, V as Node3D, n as registerGameplayBehaviors } from "./gameplay-
|
|
8
|
+
import { R as PhysicsBody3D, U as createCausticsQuad, V as Node3D, n as registerGameplayBehaviors } from "./gameplay-BBEjPFsR.js";
|
|
9
9
|
import { t as debugSources } from "./debug-draw-BM3DsvtT.js";
|
|
10
|
-
import { E as Camera3D, U as TextureCache3D, g as ModelInstance3D, n as registerNodes3D, t as resolveEnvironmentHdri, v as DirectionalLight3D } from "./environment-presets-
|
|
11
|
-
import { n as enablePhysics3D } from "./physics-3d-
|
|
10
|
+
import { E as Camera3D, U as TextureCache3D, g as ModelInstance3D, n as registerNodes3D, t as resolveEnvironmentHdri, v as DirectionalLight3D } from "./environment-presets-DRAz5EV9.js";
|
|
11
|
+
import { n as enablePhysics3D } from "./physics-3d-CYxjh-HW.js";
|
|
12
12
|
import { ACESFilmicToneMapping, AmbientLight, Box3, BufferAttribute, BufferGeometry, Color, DepthTexture, EquirectangularReflectionMapping, FloatType, Fog, HalfFloatType, LineBasicMaterial, LineSegments, Matrix4, Mesh, PCFShadowMap, PMREMGenerator, PerspectiveCamera, PlaneGeometry, Quaternion, Raycaster, Scene, ShaderMaterial, Vector2, Vector3, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
13
13
|
import { VRMLoaderPlugin, VRMUtils } from "@pixiv/three-vrm";
|
|
14
14
|
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
|
@@ -173,6 +173,59 @@ var AssetStore3D = class {
|
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
//#endregion
|
|
176
|
+
//#region src/core/yield-frame.ts
|
|
177
|
+
/**
|
|
178
|
+
* Give the browser a chance to paint, and come back either way.
|
|
179
|
+
*
|
|
180
|
+
* Boot work that runs in slices — compiling shaders a few materials at a time,
|
|
181
|
+
* reporting progress — yields between slices so the page stays responsive and
|
|
182
|
+
* the loading bar can move. The obvious way to write that yield is
|
|
183
|
+
* `requestAnimationFrame`, and it is a trap: **a browser does not run rAF for
|
|
184
|
+
* a tab it considers hidden**, and "hidden" includes a background tab, a
|
|
185
|
+
* minimized window, and a window fully covered by another one. Not slowly —
|
|
186
|
+
* not at all. An `await` on rAF alone in that tab never returns.
|
|
187
|
+
*
|
|
188
|
+
* That is what happened to `createGame3D`: the shader warm-up hung mid-boot,
|
|
189
|
+
* so the promise never resolved, the game's own `#loading` overlay was never
|
|
190
|
+
* removed, and the dev channel — wired on the line after the one that hung —
|
|
191
|
+
* never answered `incanto-frame` or `incanto-logs`. `incanto-verify` reported
|
|
192
|
+
* `draws` and `says` as unmeasurable and told the reader to bring the window
|
|
193
|
+
* to the front, which was true but sounded like a browser limitation. It was
|
|
194
|
+
* ours, and it made two of the five verification rungs unreachable to anything
|
|
195
|
+
* that cannot focus a window.
|
|
196
|
+
*
|
|
197
|
+
* So: race the frame against a timer. When frames are coming the frame wins
|
|
198
|
+
* (~16 ms) and the behaviour is what it always was. When none is coming the
|
|
199
|
+
* timer wins and the boot finishes — slower, because a hidden tab also clamps
|
|
200
|
+
* timers to about a second, but finished beats hung.
|
|
201
|
+
*/
|
|
202
|
+
/** How long to wait for a paint that may never come. */
|
|
203
|
+
const DEFAULT_MAX_WAIT_MS = 50;
|
|
204
|
+
/**
|
|
205
|
+
* Resolve on the next painted frame, or after `maxWaitMs`, whichever is first.
|
|
206
|
+
*
|
|
207
|
+
* @param maxWaitMs how long to wait for a frame before giving up on one
|
|
208
|
+
* @param raf injected for tests; defaults to the global
|
|
209
|
+
*/
|
|
210
|
+
function yieldToFrame(maxWaitMs = DEFAULT_MAX_WAIT_MS, raf = typeof requestAnimationFrame === "function" ? requestAnimationFrame : void 0) {
|
|
211
|
+
return new Promise((resolve) => {
|
|
212
|
+
let done = false;
|
|
213
|
+
const finish = () => {
|
|
214
|
+
if (done) return;
|
|
215
|
+
done = true;
|
|
216
|
+
resolve();
|
|
217
|
+
};
|
|
218
|
+
const timer = setTimeout(finish, Math.max(0, maxWaitMs));
|
|
219
|
+
if (!raf) return;
|
|
220
|
+
raf(() => {
|
|
221
|
+
setTimeout(() => {
|
|
222
|
+
clearTimeout(timer);
|
|
223
|
+
finish();
|
|
224
|
+
}, 0);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
//#endregion
|
|
176
229
|
//#region src/3d/environment.ts
|
|
177
230
|
const SKY_KEYS = [
|
|
178
231
|
"type",
|
|
@@ -1804,9 +1857,7 @@ var Renderer3D = class {
|
|
|
1804
1857
|
for (let k = i * per; k < Math.min((i + 1) * per, hidden.length); k++) hidden[k].visible = true;
|
|
1805
1858
|
this.webgl.compile(this.threeScene, camera);
|
|
1806
1859
|
onProgress?.((i + 1) / slices);
|
|
1807
|
-
|
|
1808
|
-
requestAnimationFrame(() => setTimeout(resolve, 0));
|
|
1809
|
-
});
|
|
1860
|
+
await yieldToFrame();
|
|
1810
1861
|
}
|
|
1811
1862
|
} finally {
|
|
1812
1863
|
for (const obj of hidden) obj.visible = true;
|
|
@@ -2333,10 +2384,7 @@ async function createGame3D(opts) {
|
|
|
2333
2384
|
const report = async (fraction, label) => {
|
|
2334
2385
|
if (!opts.onProgress) return;
|
|
2335
2386
|
opts.onProgress(fraction, label);
|
|
2336
|
-
|
|
2337
|
-
await new Promise((resolve) => {
|
|
2338
|
-
requestAnimationFrame(() => setTimeout(resolve, 0));
|
|
2339
|
-
});
|
|
2387
|
+
await yieldToFrame();
|
|
2340
2388
|
};
|
|
2341
2389
|
registerNodes3D();
|
|
2342
2390
|
if (opts.gameplay ?? true) registerGameplayBehaviors();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as Engine, g as AudioPlayer } from "./register-
|
|
2
|
+
import { c as resolveViewport, j as registerBehavior, n as loadScene, s as computeViewport, w as diagnose } from "./loader-D8n7TU8W.js";
|
|
3
|
+
import { _ as Engine, g as AudioPlayer } from "./register-CDrAQqPp.js";
|
|
4
4
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
5
5
|
import { i as resolveRendering, n as attachTouchControls } from "./touch-DESwnpOc.js";
|
|
6
|
-
import { a as openBundledEditor, c as claimCanvasGestures, i as devServerLibrary, l as audioErrors, n as pauseWhenHidden, r as crossFade, s as wireDevChannel, t as teardown } from "./teardown-
|
|
6
|
+
import { a as openBundledEditor, c as claimCanvasGestures, i as devServerLibrary, l as audioErrors, n as pauseWhenHidden, r as crossFade, s as wireDevChannel, t as teardown } from "./teardown-RApWnM1G.js";
|
|
7
7
|
import { o as frameStats } from "./frame-report-BSMny7oe.js";
|
|
8
|
-
import { n as registerGameplayBehaviors } from "./gameplay-
|
|
9
|
-
import { g as PhysicsBody2D, n as UILayer, t as registerNodes2D, u as Camera2D, y as Node2D } from "./register-
|
|
8
|
+
import { n as registerGameplayBehaviors } from "./gameplay-BBEjPFsR.js";
|
|
9
|
+
import { g as PhysicsBody2D, n as UILayer, t as registerNodes2D, u as Camera2D, y as Node2D } from "./register-BpFcgdcL.js";
|
|
10
10
|
import { t as debugSources } from "./debug-draw-BM3DsvtT.js";
|
|
11
|
-
import { n as enablePhysics2D } from "./physics-2d-
|
|
11
|
+
import { n as enablePhysics2D } from "./physics-2d-BaRSRrrZ.js";
|
|
12
12
|
import { Box3, BufferAttribute, BufferGeometry, Color, LineBasicMaterial, LineSegments, LinearFilter, NearestFilter, OrthographicCamera, Raycaster, SRGBColorSpace, Scene, TextureLoader, Vector2, Vector3, WebGLRenderer } from "three";
|
|
13
13
|
//#region src/2d/assets.ts
|
|
14
14
|
/**
|
package/dist/debug.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pt as LogLevel, T as RendererStats, b as Engine } from "./behavior-
|
|
1
|
+
import { Pt as LogLevel, T as RendererStats, b as Engine } from "./behavior-DWKTUzKI.js";
|
|
2
2
|
|
|
3
3
|
//#region src/debug/panel.d.ts
|
|
4
4
|
/** Minimal document surface the overlay needs (injectable for tests). */
|
package/dist/debug.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as jsonClone } from "./json-
|
|
2
|
-
import { s as mergeStaticProps } from "./registry-
|
|
1
|
+
import { t as jsonClone } from "./json-CwwhxQgb.js";
|
|
2
|
+
import { s as mergeStaticProps } from "./registry-WWcQcfMr.js";
|
|
3
3
|
import { t as debugSources } from "./debug-draw-BM3DsvtT.js";
|
|
4
4
|
//#region src/debug/capture.ts
|
|
5
5
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as registerCoreNodes } from "./register-
|
|
1
|
+
import { w as diagnose } from "./loader-D8n7TU8W.js";
|
|
2
|
+
import { I as translateOn, t as registerCoreNodes } from "./register-CDrAQqPp.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
4
|
import { t as Rng } from "./rng-DP-SR7eg.js";
|
|
5
|
-
import { i as getNodeSchema, l as registerNode } from "./registry-
|
|
5
|
+
import { i as getNodeSchema, l as registerNode } from "./registry-WWcQcfMr.js";
|
|
6
6
|
import { t as createNoise2D } from "./noise-CGUMx44x.js";
|
|
7
|
-
import { i as ParticleSim, n as resolveFrames, o as PARTICLE_PRESET_NAMES, r as validateAnimationAliases, s as applyParticlePreset, t as resolveAnimation } from "./sprite-animation-
|
|
8
|
-
import { B as StaticBody3D, F as WaterCutout3D, G as colliderFootDrop, I as Area3D, L as CharacterBody3D, N as Water3D, R as PhysicsBody3D, V as Node3D, w as tolerateUnknownAction, z as RigidBody3D } from "./gameplay-
|
|
7
|
+
import { i as ParticleSim, n as resolveFrames, o as PARTICLE_PRESET_NAMES, r as validateAnimationAliases, s as applyParticlePreset, t as resolveAnimation } from "./sprite-animation-CY-mrr1L.js";
|
|
8
|
+
import { B as StaticBody3D, F as WaterCutout3D, G as colliderFootDrop, I as Area3D, L as CharacterBody3D, N as Water3D, R as PhysicsBody3D, V as Node3D, w as tolerateUnknownAction, z as RigidBody3D } from "./gameplay-BBEjPFsR.js";
|
|
9
9
|
import { t as checkSheetGrid } from "./sheet-grid-BT6N_Bjs.js";
|
|
10
10
|
import { n as splatWeights, t as buildHeightmap } from "./heightmap-CRK0M4jT.js";
|
|
11
11
|
import { AdditiveBlending, AnimationClip, AnimationMixer, Box3, BoxGeometry, BufferAttribute, BufferGeometry, CanvasTexture, CapsuleGeometry, ClampToEdgeWrapping, Color, ConeGeometry, CylinderGeometry, DataTexture, DirectionalLight, DoubleSide, DynamicDrawUsage, Euler, Group, IcosahedronGeometry, ImageBitmapLoader, InstancedBufferAttribute, InstancedMesh, LinearFilter, LinearMipmapLinearFilter, LoopOnce, LoopRepeat, Matrix4, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshPhysicalMaterial, MeshStandardMaterial, NearestFilter, NoBlending, NoColorSpace, NormalBlending, PerspectiveCamera, PlaneGeometry, PointLight, Points, PointsMaterial, Quaternion, QuaternionKeyframeTrack, RGBADepthPacking, RGBAFormat, RepeatWrapping, SRGBColorSpace, ShaderChunk, ShaderMaterial, SphereGeometry, Texture, TextureLoader, UniformsLib, UniformsUtils, Vector3, Vector4, VectorKeyframeTrack } from "three";
|
|
@@ -5837,8 +5837,9 @@ var Label3D = class extends Sprite3D {
|
|
|
5837
5837
|
canvasTexture = null;
|
|
5838
5838
|
lastKey = "";
|
|
5839
5839
|
resolveTexture(_assets) {
|
|
5840
|
-
|
|
5841
|
-
|
|
5840
|
+
const text = translateOn(this, this.text);
|
|
5841
|
+
if (text === "" || typeof document === "undefined") return null;
|
|
5842
|
+
const key = `${text}\0${this.height}\0${this.color}\0${this.font}\0${this.outline}`;
|
|
5842
5843
|
if (key !== this.lastKey) {
|
|
5843
5844
|
this.lastKey = key;
|
|
5844
5845
|
this.rasterize();
|
|
@@ -5847,6 +5848,7 @@ var Label3D = class extends Sprite3D {
|
|
|
5847
5848
|
}
|
|
5848
5849
|
/** Draw the text once, and size the quad to what it measured. */
|
|
5849
5850
|
rasterize() {
|
|
5851
|
+
const text = translateOn(this, this.text);
|
|
5850
5852
|
const fontPx = Math.max(8, Math.round(this.height * 256));
|
|
5851
5853
|
this.canvas ??= document.createElement("canvas");
|
|
5852
5854
|
const ctx = this.canvas.getContext("2d");
|
|
@@ -5854,7 +5856,7 @@ var Label3D = class extends Sprite3D {
|
|
|
5854
5856
|
const stroke = Math.max(1, Math.round(fontPx * .14));
|
|
5855
5857
|
const fontSpec = `bold ${fontPx}px ${this.font}`;
|
|
5856
5858
|
ctx.font = fontSpec;
|
|
5857
|
-
const width = Math.max(1, Math.ceil(ctx.measureText(
|
|
5859
|
+
const width = Math.max(1, Math.ceil(ctx.measureText(text).width) + stroke * 2);
|
|
5858
5860
|
const lineHeight = Math.ceil(fontPx * 1.35) + stroke * 2;
|
|
5859
5861
|
this.canvas.width = width;
|
|
5860
5862
|
this.canvas.height = lineHeight;
|
|
@@ -5865,10 +5867,10 @@ var Label3D = class extends Sprite3D {
|
|
|
5865
5867
|
ctx.lineWidth = stroke;
|
|
5866
5868
|
ctx.lineJoin = "round";
|
|
5867
5869
|
ctx.strokeStyle = this.outline;
|
|
5868
|
-
ctx.strokeText(
|
|
5870
|
+
ctx.strokeText(text, width / 2, lineHeight / 2);
|
|
5869
5871
|
}
|
|
5870
5872
|
ctx.fillStyle = this.color;
|
|
5871
|
-
ctx.fillText(
|
|
5873
|
+
ctx.fillText(text, width / 2, lineHeight / 2);
|
|
5872
5874
|
this.canvasTexture?.dispose();
|
|
5873
5875
|
const texture = new CanvasTexture(this.canvas);
|
|
5874
5876
|
texture.colorSpace = SRGBColorSpace;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as Node, E as Behavior, b as effectiveOrder, j as registerBehavior, n as loadScene, p as SaveSlots, w as diagnose } from "./loader-D8n7TU8W.js";
|
|
2
2
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
3
|
-
import { t as jsonClone } from "./json-
|
|
4
|
-
import { t as duplicateNode } from "./duplicate-
|
|
3
|
+
import { t as jsonClone } from "./json-CwwhxQgb.js";
|
|
4
|
+
import { t as duplicateNode } from "./duplicate-DJQd44CD.js";
|
|
5
5
|
import { Color, CubeCamera, DepthTexture, DoubleSide, Euler, FloatType, Frustum, HalfFloatType, LinearMipmapLinearFilter, MathUtils, Matrix4, Mesh, MeshDepthMaterial, Object3D, PerspectiveCamera, Plane, PlaneGeometry, Quaternion, ShaderMaterial, Sphere, Vector2, Vector3, Vector4, WebGLCubeRenderTarget, WebGLRenderTarget } from "three";
|
|
6
6
|
//#region src/3d/frustum.ts
|
|
7
7
|
const scratchFrustum = new Frustum();
|
|
@@ -2441,43 +2441,62 @@ var Node3D = class Node3D extends Node {
|
|
|
2441
2441
|
* `{shape:'capsule', radius, height}` (meters, y-up).
|
|
2442
2442
|
*/
|
|
2443
2443
|
var PhysicsBody3D = class extends Node3D {
|
|
2444
|
-
static props = {
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2444
|
+
static props = {
|
|
2445
|
+
collider: {
|
|
2446
|
+
default: {},
|
|
2447
|
+
variants: {
|
|
2448
|
+
tag: "shape",
|
|
2449
|
+
byTag: {
|
|
2450
|
+
auto: { shape: "auto" },
|
|
2451
|
+
box: {
|
|
2452
|
+
shape: "box",
|
|
2453
|
+
size: [
|
|
2454
|
+
1,
|
|
2455
|
+
1,
|
|
2456
|
+
1
|
|
2457
|
+
]
|
|
2458
|
+
},
|
|
2459
|
+
sphere: {
|
|
2460
|
+
shape: "sphere",
|
|
2461
|
+
radius: .5
|
|
2462
|
+
},
|
|
2463
|
+
capsule: {
|
|
2464
|
+
shape: "capsule",
|
|
2465
|
+
radius: .35,
|
|
2466
|
+
height: 1
|
|
2467
|
+
},
|
|
2468
|
+
trimesh: {
|
|
2469
|
+
shape: "trimesh",
|
|
2470
|
+
vertices: [],
|
|
2471
|
+
indices: []
|
|
2472
|
+
},
|
|
2473
|
+
heightfield: { shape: "heightfield" }
|
|
2474
|
+
}
|
|
2473
2475
|
}
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
|
+
},
|
|
2477
|
+
/**
|
|
2478
|
+
* Whether this body's collider takes part in physics right now.
|
|
2479
|
+
*
|
|
2480
|
+
* A melee hitbox is off most of the time and live for a few frames of a
|
|
2481
|
+
* swing, and there was no way to say so: games expressed it by REPLACING
|
|
2482
|
+
* `collider` with `{}`, which tears the rigid body down and builds a new
|
|
2483
|
+
* one twice per swing, and makes the engine warn `has no collider —
|
|
2484
|
+
* physics skips it` about a scene that is correct. Keep the real collider
|
|
2485
|
+
* and turn it off.
|
|
2486
|
+
*
|
|
2487
|
+
* Off means no contacts and no `triggerEnter`/`triggerExit`. The body
|
|
2488
|
+
* itself stays, so nothing is rebuilt and re-arming is one call.
|
|
2489
|
+
*/
|
|
2490
|
+
enabled: { default: true }
|
|
2491
|
+
};
|
|
2476
2492
|
/** The unified collision model: every collider participant can emit these. */
|
|
2477
2493
|
static signals = ["triggerEnter", "triggerExit"];
|
|
2478
2494
|
_collider = {};
|
|
2479
2495
|
/** @internal Physics resync flag — raised when `collider` is REPLACED. */
|
|
2480
2496
|
_colliderChanged = false;
|
|
2497
|
+
_enabled = true;
|
|
2498
|
+
/** @internal Physics resync flag — raised when `enabled` is written. */
|
|
2499
|
+
_enabledChanged = false;
|
|
2481
2500
|
/**
|
|
2482
2501
|
* Collider shape prop. Change it by REPLACING the object
|
|
2483
2502
|
* (`body.collider = { shape: 'box', size: [...] }`) — physics rebuilds the
|
|
@@ -2490,6 +2509,15 @@ var PhysicsBody3D = class extends Node3D {
|
|
|
2490
2509
|
this._collider = value;
|
|
2491
2510
|
this._colliderChanged = true;
|
|
2492
2511
|
}
|
|
2512
|
+
/** See the `enabled` prop. Writing it arms or disarms the existing collider. */
|
|
2513
|
+
get enabled() {
|
|
2514
|
+
return this._enabled;
|
|
2515
|
+
}
|
|
2516
|
+
set enabled(value) {
|
|
2517
|
+
if (value === this._enabled) return;
|
|
2518
|
+
this._enabled = value;
|
|
2519
|
+
this._enabledChanged = true;
|
|
2520
|
+
}
|
|
2493
2521
|
/** Loader hook: bad collider shapes fail at LOAD, not at physics start. */
|
|
2494
2522
|
static validateJson(node) {
|
|
2495
2523
|
const body = node;
|
package/dist/gameplay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as Node, b as Engine, d as PropSchema, n as BehaviorCtor, t as Behavior } from "./behavior-
|
|
1
|
+
import { At as Node, b as Engine, d as PropSchema, n as BehaviorCtor, t as Behavior } from "./behavior-DWKTUzKI.js";
|
|
2
2
|
import { c as JsonValue, s as JsonObject } from "./schema-CFeioQRE.js";
|
|
3
3
|
|
|
4
4
|
//#region src/gameplay/chase.d.ts
|
package/dist/gameplay.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as Health, C as restartScene, D as DayNight, E as FloatAway, M as Chase, O as phaseOf, S as goToScene, T as FollowCamera, _ as Cooldown, a as Wander, b as Interactable, c as SavePoint, d as Patrol, f as PathFollow, g as CameraShake, h as Lifetime, i as WaveSpawner, j as Collector, k as DamageOnContact, l as Projectile, m as MoveTo, n as registerGameplayBehaviors, o as Spawner, p as Oscillate, r as ZombieAI, s as ScoreKeeper, t as GAMEPLAY_BEHAVIORS, u as Pickup, v as hitStop, x as GameFlow, y as screenFlash } from "./gameplay-
|
|
1
|
+
import { A as Health, C as restartScene, D as DayNight, E as FloatAway, M as Chase, O as phaseOf, S as goToScene, T as FollowCamera, _ as Cooldown, a as Wander, b as Interactable, c as SavePoint, d as Patrol, f as PathFollow, g as CameraShake, h as Lifetime, i as WaveSpawner, j as Collector, k as DamageOnContact, l as Projectile, m as MoveTo, n as registerGameplayBehaviors, o as Spawner, p as Oscillate, r as ZombieAI, s as ScoreKeeper, t as GAMEPLAY_BEHAVIORS, u as Pickup, v as hitStop, x as GameFlow, y as screenFlash } from "./gameplay-BBEjPFsR.js";
|
|
2
2
|
export { CameraShake, Chase, Collector, Cooldown, DamageOnContact, DayNight, FloatAway, FollowCamera, GAMEPLAY_BEHAVIORS, GameFlow, Health, Interactable, Lifetime, MoveTo, Oscillate, PathFollow, Patrol, Pickup, Projectile, SavePoint, ScoreKeeper, Spawner, Wander, WaveSpawner, ZombieAI, goToScene, hitStop, phaseOf, registerGameplayBehaviors, restartScene, screenFlash };
|