incanto 0.64.1 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/2d.d.ts +38 -3
  2. package/dist/2d.js +3 -3
  3. package/dist/3d.d.ts +130 -3
  4. package/dist/3d.js +5 -5
  5. package/dist/{audio-player-D5GJgb_x.d.ts → audio-player-_UAcHxnC.d.ts} +1 -1
  6. package/dist/{behavior-DsgayMsH.d.ts → behavior-BXNLfIJk.d.ts} +128 -0
  7. package/dist/{create-game-B746rYbr.js → create-game-DYJCIzO0.js} +67 -6
  8. package/dist/{create-game-B1KM6dA6.js → create-game-Dd7H4bJV.js} +6 -6
  9. package/dist/debug.d.ts +1 -1
  10. package/dist/{duplicate-BOOKmkQ7.js → duplicate-CqSAtdrh.js} +1 -1
  11. package/dist/{environment-presets-D2vzw583.js → environment-presets-BlPsEmq6.js} +70 -6
  12. package/dist/{gameplay-CLgFdkh5.js → gameplay-D1RADWu3.js} +374 -18
  13. package/dist/gameplay.d.ts +94 -3
  14. package/dist/gameplay.js +2 -2
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.js +5 -5
  17. package/dist/{loader-DolLJWJn.d.ts → loader-Cga7FVP4.d.ts} +1 -1
  18. package/dist/{loader-zDynoew_.js → loader-lQDCwNag.js} +59 -3
  19. package/dist/net.d.ts +2 -2
  20. package/dist/net.js +1 -1
  21. package/dist/{physics-2d-BPJcJRRP.js → physics-2d-Cji5A6sX.js} +32 -4
  22. package/dist/{physics-3d-BOO58xzw.js → physics-3d-BkHjwJgI.js} +49 -5
  23. package/dist/{quiet-rapier-BAJ4K94N.js → quiet-rapier-C6fW4zcW.js} +14 -1
  24. package/dist/react.d.ts +1 -1
  25. package/dist/react.js +1 -1
  26. package/dist/{register-Btm7_Emq.js → register-BmuqYTiY.js} +44 -1
  27. package/dist/{register-dGsbnJ87.js → register-D0CxCveZ.js} +38 -4
  28. package/dist/{replay-C5x2vPF5.d.ts → replay-BHoB6fCU.d.ts} +1 -1
  29. package/dist/{replay-DKRmiVjk.js → replay-IsZbNu6d.js} +2 -2
  30. package/dist/{split-screen-Dx0LvzqS.js → split-screen-D_i7GRcY.js} +2 -2
  31. package/dist/{split-screen-D7OopelJ.d.ts → split-screen-eJUFjhi1.d.ts} +2 -2
  32. package/dist/{src-CNS2xQB1.js → src-BTLbXFPZ.js} +1 -1
  33. package/dist/{teardown-BwhkcNt8.js → teardown-byR9USax.js} +1 -1
  34. package/dist/{test-Ccob3X5i.js → test-DgrD0jHD.js} +13 -13
  35. package/dist/test.d.ts +4 -4
  36. package/dist/test.js +2 -2
  37. package/dist/vite.js +2 -2
  38. package/editor/assets/{agent8-Di-UEn5O.js → agent8-9N-Pd_YS.js} +1 -1
  39. package/editor/assets/{debug-DWztJ5_y.js → debug-CkbJICYp.js} +1 -1
  40. package/editor/assets/{index-fct4H89G.js → index-CeDhIPTC.js} +53 -53
  41. package/editor/index.html +1 -1
  42. package/package.json +1 -1
  43. package/schemas/scene.schema.json +19 -0
  44. package/skills/incanto-3d-character.md +11 -1
  45. package/skills/incanto-behaviors-and-scripts.md +21 -0
  46. package/skills/incanto-gameplay-behaviors.md +177 -9
  47. package/skills/incanto-node-reference.md +59 -1
  48. package/skills/incanto-physics-and-input.md +84 -1
  49. package/skills/incanto-web-integration.md +24 -3
  50. package/templates-app/beacon-isle-3d/package.json +1 -1
  51. package/templates-app/platformer-2d/package.json +1 -1
  52. package/templates-app/star-survivor/package.json +1 -1
  53. package/templates-app/tps-3d/package.json +1 -1
  54. package/templates-app/village-quest-3d/package.json +1 -1
  55. package/templates-app/beacon-isle-3d/coverage.json +0 -9
  56. package/templates-app/platformer-2d/coverage.json +0 -5
  57. package/templates-app/star-survivor/coverage.json +0 -5
  58. package/templates-app/tps-3d/coverage.json +0 -5
  59. package/templates-app/village-quest-3d/coverage.json +0 -9
@@ -1,11 +1,11 @@
1
- import { k as diagnose } from "./loader-zDynoew_.js";
2
- import { L as translateOn, t as registerCoreNodes } from "./register-Btm7_Emq.js";
1
+ import { k as diagnose } from "./loader-lQDCwNag.js";
2
+ import { L as translateOn, t as registerCoreNodes } from "./register-BmuqYTiY.js";
3
3
  import { t as IncantoError } from "./errors-BpWbnbb_.js";
4
4
  import { t as Rng } from "./rng-DP-SR7eg.js";
5
5
  import { i as getNodeSchema, l as registerNode } from "./registry-CF70EArN.js";
6
6
  import { t as createNoise2D } from "./noise-CGUMx44x.js";
7
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 CharacterBody3D, F as Water3D, H as RigidBody3D, J as colliderFootDrop, L as WaterCutout3D, R as rejectScale, U as StaticBody3D, V as PhysicsBody3D, W as Node3D, w as tolerateUnknownAction, z as Area3D } from "./gameplay-CLgFdkh5.js";
8
+ import { B as rejectScale, G as StaticBody3D, H as CharacterBody3D, K as Node3D, L as Water3D, U as PhysicsBody3D, V as Area3D, W as RigidBody3D, X as colliderFootDrop, w as tolerateUnknownAction, z as WaterCutout3D } from "./gameplay-D1RADWu3.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";
@@ -742,7 +742,8 @@ var Joint3D = class extends Node3D {
742
742
  ] },
743
743
  length: { default: 0 },
744
744
  stiffness: { default: 50 },
745
- damping: { default: 5 }
745
+ damping: { default: 5 },
746
+ collide: { default: null }
746
747
  };
747
748
  type = "spherical";
748
749
  target = "";
@@ -760,6 +761,31 @@ var Joint3D = class extends Node3D {
760
761
  length = 0;
761
762
  stiffness = 50;
762
763
  damping = 5;
764
+ /**
765
+ * Do the two linked bodies still collide with EACH OTHER?
766
+ *
767
+ * `null` (default) decides from the joint type, because the two families want
768
+ * opposite answers:
769
+ *
770
+ * - **pivots** (`fixed`, `spherical`, `revolute`) → **off**. A hinge's bodies
771
+ * overlap at the pivot by construction, so the contact solver fights the
772
+ * joint and flings them. A puzzle builder's first hinge produced a bar that
773
+ * spun chaotically forever and threw a 40 kg box thirty metres, and they
774
+ * nearly filed "spherical joints inject energy":
775
+ *
776
+ * ```
777
+ * t= 0 Plank r=[0,0,0] Box [ 0.00, 5.50, 2.40]
778
+ * t=3000 Plank r=[-66,24,64] Box [-29.70, 0.40, -4.91]
779
+ * ```
780
+ *
781
+ * - **tethers** (`rope`, `spring`) → **on**. These anchor a thing to the world,
782
+ * and the thing has to rest on what it is tethered to. Defaulting these off
783
+ * drops a barrel roped to the floor straight through it — measured, in this
784
+ * repo's own conformance room.
785
+ *
786
+ * Set `true`/`false` to say it outright.
787
+ */
788
+ collide = null;
763
789
  onEnterTree() {
764
790
  if (!(this.parent instanceof PhysicsBody3D)) throw new IncantoError("TREE_VIOLATION", `Joint3D '${this.name}' must be a child of a physics body (its body A); parent is '${this.parent?.name ?? "none"}'.`);
765
791
  if (this.target === "") throw new IncantoError("BAD_FORMAT", `Joint3D '${this.name}' needs a "target" node path to the body it links to.`);
@@ -2641,6 +2667,7 @@ var CharacterController3D = class extends Node3D {
2641
2667
  /** Gravity multiplier while falling — >1 is the "snappy" arc. */
2642
2668
  fallGravity: { default: 2.5 },
2643
2669
  floatHeight: { default: .01 },
2670
+ stepHeight: { default: .35 },
2644
2671
  mouseLook: { default: true },
2645
2672
  zoomMin: { default: 0 },
2646
2673
  zoomMax: { default: 0 },
@@ -2673,6 +2700,25 @@ var CharacterController3D = class extends Node3D {
2673
2700
  airControl = .2;
2674
2701
  fallGravity = 2.5;
2675
2702
  floatHeight = .01;
2703
+ /**
2704
+ * How high a step the PLAYER walks up without jumping (0 = off).
2705
+ *
2706
+ * The hover spring holds the capsule a fixed distance above whatever is
2707
+ * DIRECTLY below it, so a vertical face stopped the player dead at about
2708
+ * 0.2 m — while `CharacterBody3D.stepHeight` let every enemy climb 0.35 m.
2709
+ * The docs said the player did not need this ("it floats over small ledges
2710
+ * already"); it floats over 18 cm ones.
2711
+ *
2712
+ * This probes just AHEAD of the capsule in the direction of travel: if the
2713
+ * ground there is higher, but by no more than `stepHeight`, the spring aims
2714
+ * at THAT surface and lifts the character onto it. A wall taller than the
2715
+ * step is not a step and still stops you.
2716
+ *
2717
+ * Do not reach for `floatHeight` instead. It does raise the character over
2718
+ * ledges, and it silently makes it WEIGHTLESS: at `floatHeight: 0.28` a
2719
+ * 200 kg character does not move a seesaw a 70 kg crate tips.
2720
+ */
2721
+ stepHeight = .35;
2676
2722
  mouseLook = true;
2677
2723
  zoomMin = 0;
2678
2724
  zoomMax = 0;
@@ -2803,8 +2849,26 @@ var CharacterController3D = class extends Node3D {
2803
2849
  0,
2804
2850
  -vel[2] * DRAG_DAMPING * mass
2805
2851
  ]);
2806
- if (toi !== null && toi < floatingDis * 2 && !this.jumping) {
2807
- const spring = SPRING_K * (floatingDis - toi) - vel[1] * SPRING_DAMPING;
2852
+ let springToi = toi;
2853
+ if (this.stepHeight > 0 && moving && toi !== null && !this.jumping && (vel[1] ?? 0) <= .5) {
2854
+ const ahead = radius + .12;
2855
+ const probeTop = originY + this.stepHeight + .05;
2856
+ const stepHit = physics.castRay([
2857
+ pos[0] + mx * ahead,
2858
+ probeTop,
2859
+ pos[2] + mz * ahead
2860
+ ], [
2861
+ 0,
2862
+ -1,
2863
+ 0
2864
+ ], this.stepHeight + .05 + rayLen, body);
2865
+ if (stepHit) {
2866
+ const rise = probeTop - stepHit.distance - (originY - toi);
2867
+ if (rise > .02 && rise <= this.stepHeight + .02) springToi = toi - rise;
2868
+ }
2869
+ }
2870
+ if (springToi !== null && springToi < floatingDis * 2 && !this.jumping) {
2871
+ const spring = SPRING_K * (floatingDis - springToi) - vel[1] * SPRING_DAMPING;
2808
2872
  body.applyImpulse([
2809
2873
  0,
2810
2874
  spring * mass,