incanto 0.27.0 → 0.28.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/editor/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Incanto Scene Editor</title>
7
7
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='3' fill='%236ee7dc'/><text x='8' y='12' text-anchor='middle' font-size='11' font-family='monospace' fill='%230e1018'>i</text></svg>" />
8
- <script type="module" crossorigin src="./assets/index-BrneVqN0.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-D6RQgROR.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="./assets/GameServer-C56iOUgF.js">
10
10
  <link rel="stylesheet" crossorigin href="./assets/index-D8QvwvOm.css">
11
11
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incanto",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -2379,6 +2379,10 @@
2379
2379
  "drape": {
2380
2380
  "default": null
2381
2381
  },
2382
+ "avoidWater": {
2383
+ "type": "boolean",
2384
+ "default": true
2385
+ },
2382
2386
  "terrain": {
2383
2387
  "type": "string",
2384
2388
  "default": ""
@@ -2566,6 +2570,10 @@
2566
2570
  "drape": {
2567
2571
  "default": null
2568
2572
  },
2573
+ "avoidWater": {
2574
+ "type": "boolean",
2575
+ "default": true
2576
+ },
2569
2577
  "terrain": {
2570
2578
  "type": "string",
2571
2579
  "default": ""
@@ -359,6 +359,7 @@ tops radially away with a smooth falloff as a character wades through.
359
359
  | `flowers` | `0` | DEPRECATED — confetti heads; use a `Flowers3D` node (load-time check 0–0.2) |
360
360
  | `seed` | `1` | placement seed — identical field across runs/machines |
361
361
  | `drape` | `null` | **AUTO by default**: whenever the scene has a Terrain3D, every blade roots on the ground under it (samples `heightAt`) — omit this prop and rolling terrain just works. `true` forces it (keeps retrying until a terrain appears — streamed worlds), `false` opts out (flat carpet at the node's Y) |
362
+ | `avoidWater` | `true` | blades keep OUT of the water — any instance whose ground sits under a `Water3D` or `River3D` surface is dropped, so a creek that cuts its bed through a meadow gets banks instead of blades waving in the current. `false` plants reeds and paddy fields |
362
363
  | `terrain` | `""` | drape target node path; empty = **auto-find the first Terrain3D** in the tree. A non-empty path that is NOT a Terrain3D fails at load — no silent floating |
363
364
 
364
365
  > **Rolling terrain just works.** Since 0.14 draping is on by default: with a
@@ -415,6 +416,7 @@ billboard confetti. Deterministic from the `seed` PROP.
415
416
  | `clustering` | `0.6` | 0 uniform … 1 tight Voronoi patches (load-time check) |
416
417
  | `sway` | `0.5` | head-bob wind strength; 0 disables |
417
418
  | `drape` | `null` | AUTO by default — plants root on the scene's Terrain3D when one exists; `true` forces, `false` opts out — see the Foliage3D drape note above |
419
+ | `avoidWater` | `true` | plants keep OUT of the water (see the Foliage3D note) — `false` for lilies and marsh planting |
418
420
  | `terrain` | `""` | drape target node path; empty = auto-find the first Terrain3D (a wrong path fails at load) |
419
421
 
420
422
  ## Tree3D
@@ -991,6 +993,10 @@ underneath decides everything else.
991
993
  runs faster), which is what puts rapids where a real river has them;
992
994
  - **whitewater**: grade × speed makes rapids, the bank shear line makes edge
993
995
  froth, a thinning column riffles over rock. Foam then rides downstream.
996
+ - **a dry bank**: `Foliage3D` and `Flowers3D` refuse to plant where a river
997
+ runs (`avoidWater`, on by default), so a creek cutting its bed through a
998
+ meadow gets bare wet ground at the edge instead of blades waving in the
999
+ current;
994
1000
  - **what stands in the water**: drop boulders in the channel and the current
995
1001
  answers them — a cushion of white piled on the upstream face, a torn wake
996
1002
  opening downstream, and the surface sheen bending around the stone. Nothing
@@ -1048,6 +1054,23 @@ should be.
1048
1054
  const path = traceDownhillPath(terrain.heightAt, { x: peakX, z: peakZ, step: 7 });
1049
1055
  ```
1050
1056
 
1057
+ **Placing things against a self-carved bed?** Ask the engine what the cut will
1058
+ be — never mirror it by hand. `riverCarveChannels` is the same function the node
1059
+ runs at load, so a generator that assigns its result to a scratch Terrain3D gets
1060
+ the EXACT ground the game will have; a hand-rolled approximation puts the player
1061
+ inside a hill.
1062
+
1063
+ ```ts
1064
+ const carved = new Terrain3D('probe');
1065
+ Object.assign(carved, terrainProps);
1066
+ carved.channels = riverCarveChannels({
1067
+ path, widths, depth,
1068
+ cell: size / resolution, // the terrain's own grid
1069
+ groundAt: (x, z) => rawTerrain.heightAt(x, z),
1070
+ });
1071
+ const groundAt = (x: number, z: number) => carved.heightAt(x, z); // place against THIS
1072
+ ```
1073
+
1051
1074
 
1052
1075
  ### Waterfalls happen — you do not author them
1053
1076
 
@@ -331,6 +331,7 @@ Signals: `movementStateChanged(state)`
331
331
  | `clustering` | `0.6` | number |
332
332
  | `sway` | `0.5` | number |
333
333
  | `drape` | `null` | null |
334
+ | `avoidWater` | `true` | boolean |
334
335
  | `terrain` | `""` | string |
335
336
 
336
337
  ## `Foliage3D` — `incanto/3d`
@@ -363,6 +364,7 @@ Signals: `movementStateChanged(state)`
363
364
  | `flowers` | `0` | number |
364
365
  | `seed` | `1` | number |
365
366
  | `drape` | `null` | null |
367
+ | `avoidWater` | `true` | boolean |
366
368
  | `terrain` | `""` | string |
367
369
 
368
370
  ## `HudLayer` — `incanto`
@@ -14,7 +14,7 @@
14
14
  "@dimforge/rapier2d-compat": "0.19.3",
15
15
  "@dimforge/rapier3d-compat": "0.19.3",
16
16
  "@pixiv/three-vrm": "^3.5.3",
17
- "incanto": "^0.27.0",
17
+ "incanto": "^0.28.0",
18
18
  "three": "^0.184.0"
19
19
  },
20
20
  "devDependencies": {
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.27.0",
16
+ "incanto": "^0.28.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.27.0",
16
+ "incanto": "^0.28.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {