incanto 0.19.0 → 0.20.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/3d.d.ts +211 -1
- package/dist/3d.js +5 -5
- package/dist/{create-game-Ct6RC4LF.js → create-game-pNf3sI-Q.js} +2 -2
- package/dist/env.js +1 -1
- package/dist/{heightmap-DgX-Opav.js → heightmap-CRK0M4jT.js} +35 -0
- package/dist/index.js +1 -1
- package/dist/{physics-3d-JPdedRAB.js → physics-3d-DxFDfUey.js} +1 -1
- package/dist/react.js +1 -1
- package/dist/{register-Cv5GNiVo.js → register-BWFgsGra.js} +1290 -125
- package/dist/test.js +3 -3
- package/editor/assets/{agent8-CcfBcssq.js → agent8-BZX7dF4f.js} +1 -1
- package/editor/assets/index-CXdpxO_B.js +7928 -0
- package/editor/index.html +1 -1
- package/package.json +1 -1
- package/schemas/scene.schema.json +171 -0
- package/skills/incanto-environment.md +122 -1
- package/skills/incanto-node-reference.md +29 -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/package.json +1 -1
- package/editor/assets/index-B7gj1VII.js +0 -7638
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-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-CXdpxO_B.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
|
@@ -277,6 +277,9 @@
|
|
|
277
277
|
{
|
|
278
278
|
"$ref": "#/$defs/RigidBody3D"
|
|
279
279
|
},
|
|
280
|
+
{
|
|
281
|
+
"$ref": "#/$defs/River3D"
|
|
282
|
+
},
|
|
280
283
|
{
|
|
281
284
|
"$ref": "#/$defs/Sprite2D"
|
|
282
285
|
},
|
|
@@ -4600,6 +4603,166 @@
|
|
|
4600
4603
|
},
|
|
4601
4604
|
"required": ["name", "type"]
|
|
4602
4605
|
},
|
|
4606
|
+
"River3D": {
|
|
4607
|
+
"type": "object",
|
|
4608
|
+
"properties": {
|
|
4609
|
+
"name": {
|
|
4610
|
+
"type": "string"
|
|
4611
|
+
},
|
|
4612
|
+
"uid": {
|
|
4613
|
+
"type": "string"
|
|
4614
|
+
},
|
|
4615
|
+
"type": {
|
|
4616
|
+
"const": "River3D"
|
|
4617
|
+
},
|
|
4618
|
+
"groups": {
|
|
4619
|
+
"type": "array",
|
|
4620
|
+
"items": {
|
|
4621
|
+
"type": "string"
|
|
4622
|
+
}
|
|
4623
|
+
},
|
|
4624
|
+
"tags": {
|
|
4625
|
+
"type": "object"
|
|
4626
|
+
},
|
|
4627
|
+
"props": {
|
|
4628
|
+
"type": "object",
|
|
4629
|
+
"properties": {
|
|
4630
|
+
"position": {
|
|
4631
|
+
"type": "array",
|
|
4632
|
+
"items": {
|
|
4633
|
+
"type": "number"
|
|
4634
|
+
},
|
|
4635
|
+
"minItems": 3,
|
|
4636
|
+
"maxItems": 3,
|
|
4637
|
+
"default": [0, 0, 0]
|
|
4638
|
+
},
|
|
4639
|
+
"rotation": {
|
|
4640
|
+
"type": "array",
|
|
4641
|
+
"items": {
|
|
4642
|
+
"type": "number"
|
|
4643
|
+
},
|
|
4644
|
+
"minItems": 3,
|
|
4645
|
+
"maxItems": 3,
|
|
4646
|
+
"default": [0, 0, 0]
|
|
4647
|
+
},
|
|
4648
|
+
"static": {
|
|
4649
|
+
"type": "boolean",
|
|
4650
|
+
"default": false
|
|
4651
|
+
},
|
|
4652
|
+
"scale": {
|
|
4653
|
+
"type": "array",
|
|
4654
|
+
"items": {
|
|
4655
|
+
"type": "number"
|
|
4656
|
+
},
|
|
4657
|
+
"minItems": 3,
|
|
4658
|
+
"maxItems": 3,
|
|
4659
|
+
"default": [1, 1, 1]
|
|
4660
|
+
},
|
|
4661
|
+
"visible": {
|
|
4662
|
+
"type": "boolean",
|
|
4663
|
+
"default": true
|
|
4664
|
+
},
|
|
4665
|
+
"renderOrder": {
|
|
4666
|
+
"type": "number",
|
|
4667
|
+
"default": 0
|
|
4668
|
+
},
|
|
4669
|
+
"orderGroup": {
|
|
4670
|
+
"type": "string",
|
|
4671
|
+
"enum": ["background", "terrain", "default", "characters", "effects", "overlay"],
|
|
4672
|
+
"default": "default"
|
|
4673
|
+
},
|
|
4674
|
+
"path": {
|
|
4675
|
+
"type": "array",
|
|
4676
|
+
"default": []
|
|
4677
|
+
},
|
|
4678
|
+
"width": {
|
|
4679
|
+
"type": "number",
|
|
4680
|
+
"default": 6
|
|
4681
|
+
},
|
|
4682
|
+
"widths": {
|
|
4683
|
+
"type": "array",
|
|
4684
|
+
"default": []
|
|
4685
|
+
},
|
|
4686
|
+
"depth": {
|
|
4687
|
+
"type": "number",
|
|
4688
|
+
"default": 0.8
|
|
4689
|
+
},
|
|
4690
|
+
"flowSpeed": {
|
|
4691
|
+
"type": "number",
|
|
4692
|
+
"default": 1.6
|
|
4693
|
+
},
|
|
4694
|
+
"colors": {
|
|
4695
|
+
"type": "object",
|
|
4696
|
+
"default": {}
|
|
4697
|
+
},
|
|
4698
|
+
"absorption": {
|
|
4699
|
+
"type": "number",
|
|
4700
|
+
"default": 0.5
|
|
4701
|
+
},
|
|
4702
|
+
"opacity": {
|
|
4703
|
+
"type": "number",
|
|
4704
|
+
"default": 0.85
|
|
4705
|
+
},
|
|
4706
|
+
"foam": {
|
|
4707
|
+
"type": "number",
|
|
4708
|
+
"default": 1
|
|
4709
|
+
},
|
|
4710
|
+
"ripples": {
|
|
4711
|
+
"type": "number",
|
|
4712
|
+
"default": 1
|
|
4713
|
+
},
|
|
4714
|
+
"sunDirection": {
|
|
4715
|
+
"type": "array",
|
|
4716
|
+
"items": {
|
|
4717
|
+
"type": "number"
|
|
4718
|
+
},
|
|
4719
|
+
"minItems": 3,
|
|
4720
|
+
"maxItems": 3,
|
|
4721
|
+
"default": [0.5, 0.8, 0.3]
|
|
4722
|
+
},
|
|
4723
|
+
"sunColor": {
|
|
4724
|
+
"type": "string",
|
|
4725
|
+
"default": "#fff6e0"
|
|
4726
|
+
},
|
|
4727
|
+
"sunIntensity": {
|
|
4728
|
+
"type": "number",
|
|
4729
|
+
"default": 1
|
|
4730
|
+
},
|
|
4731
|
+
"terrain": {
|
|
4732
|
+
"type": "string",
|
|
4733
|
+
"default": ""
|
|
4734
|
+
},
|
|
4735
|
+
"flowForce": {
|
|
4736
|
+
"type": "number",
|
|
4737
|
+
"default": 1
|
|
4738
|
+
}
|
|
4739
|
+
},
|
|
4740
|
+
"additionalProperties": false
|
|
4741
|
+
},
|
|
4742
|
+
"script": {
|
|
4743
|
+
"type": "object",
|
|
4744
|
+
"properties": {
|
|
4745
|
+
"name": {
|
|
4746
|
+
"type": "string"
|
|
4747
|
+
},
|
|
4748
|
+
"props": {
|
|
4749
|
+
"type": "object"
|
|
4750
|
+
}
|
|
4751
|
+
},
|
|
4752
|
+
"required": ["name"]
|
|
4753
|
+
},
|
|
4754
|
+
"network": {
|
|
4755
|
+
"type": "object"
|
|
4756
|
+
},
|
|
4757
|
+
"children": {
|
|
4758
|
+
"type": "array",
|
|
4759
|
+
"items": {
|
|
4760
|
+
"$ref": "#/$defs/node"
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
},
|
|
4764
|
+
"required": ["name", "type"]
|
|
4765
|
+
},
|
|
4603
4766
|
"Sprite2D": {
|
|
4604
4767
|
"type": "object",
|
|
4605
4768
|
"properties": {
|
|
@@ -5198,6 +5361,10 @@
|
|
|
5198
5361
|
"type": "array",
|
|
5199
5362
|
"default": []
|
|
5200
5363
|
},
|
|
5364
|
+
"channels": {
|
|
5365
|
+
"type": "array",
|
|
5366
|
+
"default": []
|
|
5367
|
+
},
|
|
5201
5368
|
"wetline": {
|
|
5202
5369
|
"default": null
|
|
5203
5370
|
}
|
|
@@ -6408,6 +6575,10 @@
|
|
|
6408
6575
|
"type": "number",
|
|
6409
6576
|
"default": 1000
|
|
6410
6577
|
},
|
|
6578
|
+
"mirror": {
|
|
6579
|
+
"type": "boolean",
|
|
6580
|
+
"default": false
|
|
6581
|
+
},
|
|
6411
6582
|
"foam": {
|
|
6412
6583
|
"type": "boolean",
|
|
6413
6584
|
"default": true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: incanto-environment
|
|
3
|
-
description: Generating game environments in Incanto — the deterministic `incanto-env` CLI and `incanto/env` library. EXACTLY three themed 3D generators (arena with boxes/ruins/garden, Terrain3D heightfield worlds with island/alpine/plains/desert/meadow/forest/savanna/snow/wetland/volcanic themes, maze with stone/hedge/canyon) plus 2D mazes, roguelike dungeons and platform courses; insertIntoScene, the GENERATORS catalog + runGenerator; and the environment nodes — Terrain3D (biome texture splatting, heightAt, heightfield collider), shader-water Water3D (FBM waves, anisotropic wind ripple, sparse sun glints, crystal shallows, refraction + depth absorption, reflections, shoreline foam, splash signals + ripples), shader-grass Foliage3D (real curved blade meshes, clumps, rolling wind, distance LOD, character bend), Flowers3D flower plants (lush/sparse/none density dial, daisy/cosmos/bellflower varieties, Voronoi patches, head-bob sway) and ez-tree Tree3D groves (branchy trunks, textured wind-swayed leaves, budget-checked tiers). Use when a game needs a level, stage, arena, terrain, heightfield, island, meadow, grass field, flowers, flower bed, forest, trees, mountain, desert, savanna, snow, tundra, swamp, wetland, marsh, volcano, lava field, maze, dungeon, platform course, scattered props, clouds, water, or a splash effect.
|
|
3
|
+
description: Generating game environments in Incanto — the deterministic `incanto-env` CLI and `incanto/env` library. EXACTLY three themed 3D generators (arena with boxes/ruins/garden, Terrain3D heightfield worlds with island/alpine/plains/desert/meadow/forest/savanna/snow/wetland/volcanic themes, maze with stone/hedge/canyon) plus 2D mazes, roguelike dungeons and platform courses; insertIntoScene, the GENERATORS catalog + runGenerator; and the environment nodes — Terrain3D (biome texture splatting, heightAt, heightfield collider), shader-water Water3D (FBM waves, anisotropic wind ripple, sparse sun glints, crystal shallows, refraction + depth absorption, reflections, shoreline foam, splash signals + ripples), River3D running water (path-derived course, terrain-cut banks, derived rapids/riffles, a current that sweeps bodies), shader-grass Foliage3D (real curved blade meshes, clumps, rolling wind, distance LOD, character bend), Flowers3D flower plants (lush/sparse/none density dial, daisy/cosmos/bellflower varieties, Voronoi patches, head-bob sway) and ez-tree Tree3D groves (branchy trunks, textured wind-swayed leaves, budget-checked tiers). Use when a game needs a level, stage, arena, terrain, heightfield, island, meadow, grass field, flowers, flower bed, forest, trees, mountain, desert, savanna, snow, tundra, swamp, wetland, marsh, volcano, lava field, maze, dungeon, platform course, scattered props, clouds, water, a river, stream, creek, brook, rapids, a ford, or a splash effect.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Environment generation — levels from a seed
|
|
@@ -554,6 +554,7 @@ is radians of `atan(|∇h|)`. Default textures stream from the live agent8 CDN
|
|
|
554
554
|
| `layers` | `[]` | custom splat layers (theme `custom` only) |
|
|
555
555
|
| `textureBase` | agent8 CDN | base URL: `<base>/<name>.png` + `<base>/<name>_normal.png` |
|
|
556
556
|
| `basins` | `[]` | lake/pond bowls — `[{ x, z, radius, depth }]` (centered meters) carved into the surface (smooth, 0-slope rim); **negative `depth` RAISES a smooth dome mound instead** (a hill, an islet); `heightAt`, the collider AND draped grass all see them |
|
|
557
|
+
| `channels` | `[]` | river/road TRENCHES carved along polylines — `[{ path, width, depth, taper? }]` (the line counterpart of `basins`). This is what gives a `River3D` a bed to sit in; `heightAt`, the collider and draped vegetation all see it |
|
|
557
558
|
| `wetline` | `null` | WET SAND band — `{ y, band? }` darkens + glosses the splat in a noisy, breathing band just above height `y` (a waterline): the trace of the last swash runup. `band` (default `1.1` m) caps how high above `y` reads wet. `null` = off |
|
|
558
559
|
|
|
559
560
|
**Wet sand at a shoreline.** Set `wetline.y` to the SAME world height as the
|
|
@@ -697,6 +698,7 @@ hue reads grey.
|
|
|
697
698
|
| `colors` | `{}` | fancy ramp overrides: `{"trough", "surface", "peak"}` hex strings |
|
|
698
699
|
| `reflection` | `true` | live CubeCamera reflections (fancy only; needs a renderer) |
|
|
699
700
|
| `reflectionInterval` | `1000` | ms between CubeCamera reflection re-renders |
|
|
701
|
+
| `mirror` | `false` | TRUE planar reflection (see below) — the only way the dock, the boat and the player appear IN the water. One extra scene render per frame |
|
|
700
702
|
| `foam` | `true` | noise-broken shoreline foam band + crest foam near shores |
|
|
701
703
|
| `interaction` | `true` | character interaction: bodies (CharacterBody3D/RigidBody3D) inside the XZ footprint whose FEET dip below the surface count as in-water — so a WADING character (origin above water, feet below, sized from its collider) splashes, not only a fully-submerged one. Entry/exit emit `entered`/`exited` + a splash ripple; striding through water trails a WAKE (a ripple every ~0.45 m); floating bodies bob gently. Ripples drive both shaders' `uRipples[8]` (fancy) and CPU-displace the mesh (`simple`) |
|
|
702
704
|
| `splash` | `true` | built-in splash WHITEWATER (needs `interaction`): the shaders paint expanding **surface foam** where bodies interact — a **"풍덩"** froth bloom when a body plunges in (bigger the faster it falls) and a **foam trail ("물살")** behind a body wading/running through. Real frothy whitewater on the surface, not flying droplets; works on both `fancy` and `simple` quality. `false` keeps the ripples/waves but paints no foam. No wiring needed; for an extra custom burst add your own `Particles3D` on the `entered` signal |
|
|
@@ -737,6 +739,32 @@ Two placement rules keep the surface artifact-free:
|
|
|
737
739
|
intentionally does not — its submerged hull shows through `refraction`
|
|
738
740
|
instead.
|
|
739
741
|
|
|
742
|
+
### `mirror` — a TRUE planar reflection
|
|
743
|
+
|
|
744
|
+
The default reflection is a CubeCamera env map: it carries the sky and the far
|
|
745
|
+
shore, and it deliberately near-clips everything inside the water's own
|
|
746
|
+
footprint (a nearby crate sampled as an infinite environment smears across the
|
|
747
|
+
whole surface). So the boat, the dock, the pier lamp and the player standing at
|
|
748
|
+
the edge are exactly what it CANNOT show.
|
|
749
|
+
|
|
750
|
+
`mirror: true` re-renders the scene from the camera mirrored across the water
|
|
751
|
+
plane and samples it per fragment, so those things appear in the water:
|
|
752
|
+
|
|
753
|
+
```json
|
|
754
|
+
{ "type": "Water3D", "props": { "preset": "lake", "mirror": true,
|
|
755
|
+
"waveHeight": 0.012, "detailStrength": 0.07 } }
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
- Costs **one extra scene render per frame** (half the drawing buffer, clamped)
|
|
759
|
+
— off by default; a still lake or a pool earns it, open ocean rarely does.
|
|
760
|
+
- A mirror needs a CALM surface to read: chop that shatters the reflection is
|
|
761
|
+
what makes game lakes look like blue plastic. Pair it with a low `waveHeight`
|
|
762
|
+
and a gentle `detailStrength`.
|
|
763
|
+
- Rays that leave the screen have no planar sample; those fragments fall back to
|
|
764
|
+
the cube map (keep `reflection: true`), so there is no hard cut at the edges.
|
|
765
|
+
- Geometry below the waterline is clipped out of the mirror pass, and the whole
|
|
766
|
+
pass is skipped while the camera is submerged.
|
|
767
|
+
|
|
740
768
|
### Character interaction — `entered(body)` / `exited(body)`
|
|
741
769
|
|
|
742
770
|
With `interaction: true` the water scans the tree each frame for
|
|
@@ -779,6 +807,99 @@ emitter only when you want a specific custom burst:
|
|
|
779
807
|
emitter to the body first — the signal hands you the node:
|
|
780
808
|
`onEntered(body) { splash.position = body.position; splash.replay(); }`.)
|
|
781
809
|
|
|
810
|
+
## River3D — running water
|
|
811
|
+
|
|
812
|
+
`Water3D` is a *surface*; `River3D` is a *current*. A river is authored as a
|
|
813
|
+
line, not a shape: give it a centerline `path` and a width, and the terrain
|
|
814
|
+
underneath decides everything else.
|
|
815
|
+
|
|
816
|
+
```json
|
|
817
|
+
{ "name": "Creek", "type": "River3D", "props": {
|
|
818
|
+
"path": [[-80, -30], [-20, 5], [30, 10], [90, -10]],
|
|
819
|
+
"widths": [2.5, 5, 9],
|
|
820
|
+
"depth": 1,
|
|
821
|
+
"flowSpeed": 1.6,
|
|
822
|
+
"colors": { "shallow": "#79b6a4", "deep": "#103c49", "bank": "#39472f" }
|
|
823
|
+
} }
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
| prop | default | meaning |
|
|
827
|
+
|---|---|---|
|
|
828
|
+
| `path` | `[]` | centerline `[[x, z], …]` in NODE-LOCAL meters, Catmull-Rom smoothed (2+ points) |
|
|
829
|
+
| `width` | `6` | channel width in meters |
|
|
830
|
+
| `widths` | `[]` | width profile lerped source→mouth (e.g. `[2.5, 5, 9]`); empty = constant `width` |
|
|
831
|
+
| `depth` | `0.8` | water column at the centerline — also the scale foam thresholds read as "shallow" |
|
|
832
|
+
| `flowSpeed` | `1.6` | reference current in m/s (the mean; reaches speed up and slow down) |
|
|
833
|
+
| `colors` | `{}` | `{ shallow, deep, sky, horizon, bank }` — the body ramp plus what the surface mirrors |
|
|
834
|
+
| `absorption` | `0.5` | how fast the water hides its bed (Beer's law) |
|
|
835
|
+
| `opacity` | `0.85` | upper bound on the body's opacity |
|
|
836
|
+
| `foam` | `1` | whitewater dial — 0 = a glassy canal, 2 = raging |
|
|
837
|
+
| `ripples` | `1` | surface-detail dial (ripple relief + glitter) |
|
|
838
|
+
| `terrain` | `''` | drape target path; empty = auto-find the first Terrain3D (a wrong path fails at load) |
|
|
839
|
+
| `flowForce` | `1` | how hard the current sweeps bodies downstream (0 = visual only) |
|
|
840
|
+
| `sunDirection` / `sunColor` / `sunIntensity` | sky / `#fff6e0` / `1` | glint (the environment sun wins while `sunDirection` is default) |
|
|
841
|
+
|
|
842
|
+
**What the node derives for you**, all from `path` + the ground:
|
|
843
|
+
|
|
844
|
+
- a surface that follows the bed's DESCENDING envelope — water pours over a lip
|
|
845
|
+
and never climbs one (a rising bed dams it into a still pool);
|
|
846
|
+
- **the visible width**: every vertex carries its own water column
|
|
847
|
+
(`surfaceY − bed`) and the shader stops drawing where that runs out, so
|
|
848
|
+
banks, gravel bars and half-drowned boulders cut the ribbon;
|
|
849
|
+
- **the current**: continuity (a pinched channel runs faster) × grade (a chute
|
|
850
|
+
runs faster), which is what puts rapids where a real river has them;
|
|
851
|
+
- **whitewater**: grade × speed makes rapids, the bank shear line makes edge
|
|
852
|
+
froth, a thinning column riffles over rock. Foam then rides downstream.
|
|
853
|
+
|
|
854
|
+
It costs NO extra render passes (unlike fancy `Water3D`), so a map can carry a
|
|
855
|
+
dozen rivers.
|
|
856
|
+
|
|
857
|
+
### Cut the bed first
|
|
858
|
+
|
|
859
|
+
Water needs somewhere to be. Give the same path to the terrain as a `channels`
|
|
860
|
+
carve, or the creek will lie on top of the ground as a thin film and read as
|
|
861
|
+
riffle everywhere:
|
|
862
|
+
|
|
863
|
+
```ts
|
|
864
|
+
const path = traceDownhillPath(terrain.heightAt, { x: peakX, z: peakZ, step: 7 });
|
|
865
|
+
// terrain prop — the trench (collider + heightAt + drape all see it)
|
|
866
|
+
"channels": [{ "path": path, "width": 7, "depth": 2.2, "taper": 9 }]
|
|
867
|
+
// river prop — the water in it
|
|
868
|
+
"path": path, "widths": [2.4, 4.5, 7, 9], "depth": 1
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
### Let the terrain choose the course — `traceDownhillPath`
|
|
872
|
+
|
|
873
|
+
```ts
|
|
874
|
+
import { traceDownhillPath } from 'incanto/3d';
|
|
875
|
+
const path = traceDownhillPath((x, z) => terrain.heightAt(x, z), {
|
|
876
|
+
x: sourceX, z: sourceZ, // start high
|
|
877
|
+
step: 7, // meters per step (also the gradient probe radius)
|
|
878
|
+
bounds: 100, // stay inside ±100 m
|
|
879
|
+
maxPoints: 46,
|
|
880
|
+
});
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
Steepest descent with momentum and a thalweg snap, so the line follows the
|
|
884
|
+
valley floor instead of rattling between its walls. It ends in a pool, at the
|
|
885
|
+
map edge or at `maxPoints`; `[]` means the start was flat.
|
|
886
|
+
|
|
887
|
+
### The current is gameplay
|
|
888
|
+
|
|
889
|
+
`flowForce` drags bodies toward the water's own velocity — drag, never thrust,
|
|
890
|
+
so a raft accelerates until it matches the current and then coasts, and a
|
|
891
|
+
character can fight across a slow ford but loses ground in a fast one. For
|
|
892
|
+
scripts, `sampleAt(x, z)` (WORLD coords) answers where a point sits:
|
|
893
|
+
|
|
894
|
+
```ts
|
|
895
|
+
const hit = creek.sampleAt(player.position[0], player.position[2]);
|
|
896
|
+
if (hit?.inside && hit.speed > 3) hud.warn('too fast to ford here');
|
|
897
|
+
// hit: { inside, across (±1 = banks), along, surfaceY, dirX, dirZ, speed, halfWidth }
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
The course is derived on the CPU in `update()`, so `sampleAt` works headlessly
|
|
901
|
+
(servers, `bun verify.ts`) before anything has ever been rendered.
|
|
902
|
+
|
|
782
903
|
## Determinism, verified
|
|
783
904
|
|
|
784
905
|
`--seed` makes every run reproducible — keep the seed in your scene comments
|
|
@@ -670,6 +670,33 @@ Signals: `triggerEnter(other)` · `triggerExit(other)`
|
|
|
670
670
|
|
|
671
671
|
Signals: `triggerEnter(other)` · `triggerExit(other)`
|
|
672
672
|
|
|
673
|
+
## `River3D` — `incanto/3d`
|
|
674
|
+
|
|
675
|
+
| Prop | Default | Kind |
|
|
676
|
+
|---|---|---|
|
|
677
|
+
| `position` | `[0,0,0]` | array |
|
|
678
|
+
| `rotation` | `[0,0,0]` | array |
|
|
679
|
+
| `static` | `false` | boolean |
|
|
680
|
+
| `scale` | `[1,1,1]` | array |
|
|
681
|
+
| `visible` | `true` | boolean |
|
|
682
|
+
| `renderOrder` | `0` | number |
|
|
683
|
+
| `orderGroup` | `"default"` | one of: `background` `terrain` `default` `characters` `effects` `overlay` |
|
|
684
|
+
| `path` | `[]` | array |
|
|
685
|
+
| `width` | `6` | number |
|
|
686
|
+
| `widths` | `[]` | array |
|
|
687
|
+
| `depth` | `0.8` | number |
|
|
688
|
+
| `flowSpeed` | `1.6` | number |
|
|
689
|
+
| `colors` | `{}` | object |
|
|
690
|
+
| `absorption` | `0.5` | number |
|
|
691
|
+
| `opacity` | `0.85` | number |
|
|
692
|
+
| `foam` | `1` | number |
|
|
693
|
+
| `ripples` | `1` | number |
|
|
694
|
+
| `sunDirection` | `[0.5,0.8,0.3]` | array |
|
|
695
|
+
| `sunColor` | `"#fff6e0"` | string |
|
|
696
|
+
| `sunIntensity` | `1` | number |
|
|
697
|
+
| `terrain` | `""` | string |
|
|
698
|
+
| `flowForce` | `1` | number |
|
|
699
|
+
|
|
673
700
|
## `Sprite2D` — `incanto/2d`
|
|
674
701
|
|
|
675
702
|
| Prop | Default | Kind |
|
|
@@ -764,6 +791,7 @@ Signals: `triggerEnter(other)` · `triggerExit(other)`
|
|
|
764
791
|
| `layers` | `[]` | array |
|
|
765
792
|
| `textureBase` | `"https://agent8-games.verse8.io/assets/3D/default/textures/terrain"` | string |
|
|
766
793
|
| `basins` | `[]` | array |
|
|
794
|
+
| `channels` | `[]` | array |
|
|
767
795
|
| `wetline` | `null` | null |
|
|
768
796
|
|
|
769
797
|
## `TileMap2D` — `incanto/2d`
|
|
@@ -944,6 +972,7 @@ Signals: `blocksChanged`
|
|
|
944
972
|
| `colors` | `{}` | object |
|
|
945
973
|
| `reflection` | `true` | boolean |
|
|
946
974
|
| `reflectionInterval` | `1000` | number |
|
|
975
|
+
| `mirror` | `false` | boolean |
|
|
947
976
|
| `foam` | `true` | boolean |
|
|
948
977
|
| `interaction` | `true` | boolean |
|
|
949
978
|
| `splash` | `true` | boolean |
|