diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.blend b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.blend new file mode 100644 index 000000000..675b4ad31 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.glb b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.glb new file mode 100644 index 000000000..78de66c46 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.preview.png new file mode 100644 index 000000000..0f6864794 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Gun.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.blend b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.blend new file mode 100644 index 000000000..2b02371b5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.glb b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.glb new file mode 100644 index 000000000..642a84703 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.preview.png new file mode 100644 index 000000000..5fa1de017 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character Humanoid Rig.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character.blend b/examples/3d-third-person/3D Platformer Game Kit/Character/Character.blend new file mode 100644 index 000000000..f8dcd7ceb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character.glb b/examples/3d-third-person/3D Platformer Game Kit/Character/Character.glb new file mode 100644 index 000000000..08dc851c7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Character/Character.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Character/Character.preview.png new file mode 100644 index 000000000..645e6eef5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Character/Character.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.blend new file mode 100644 index 000000000..e0734ec1e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.glb new file mode 100644 index 000000000..e78c423b7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.preview.png new file mode 100644 index 000000000..c8efca7f1 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Bricks.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.blend new file mode 100644 index 000000000..0890098c4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.glb new file mode 100644 index 000000000..b3cb79cd6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.preview.png new file mode 100644 index 000000000..8c9615772 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Crate.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.blend new file mode 100644 index 000000000..867218e20 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.glb new file mode 100644 index 000000000..6e9a44eb2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.preview.png new file mode 100644 index 000000000..33a9bfa16 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Default.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.blend new file mode 100644 index 000000000..cbad0d137 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.glb new file mode 100644 index 000000000..2d381ab1e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.preview.png new file mode 100644 index 000000000..651306a82 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Dirt Single.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.blend new file mode 100644 index 000000000..328f8796b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.glb new file mode 100644 index 000000000..c5900551d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.preview.png new file mode 100644 index 000000000..488655300 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Exclamation.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.blend new file mode 100644 index 000000000..ff993c0e6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.glb new file mode 100644 index 000000000..8c23a8fb6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.preview.png new file mode 100644 index 000000000..f53f0a062 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Grass Single.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.blend new file mode 100644 index 000000000..f7ecf3550 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.glb new file mode 100644 index 000000000..6a6e037d7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.preview.png new file mode 100644 index 000000000..ba9103630 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Question.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.blend b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.blend new file mode 100644 index 000000000..87ca3d515 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.glb b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.glb new file mode 100644 index 000000000..5da1ce23a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.preview.png new file mode 100644 index 000000000..43ce9f992 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Cubes/Cube Spikes.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.blend b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.blend new file mode 100644 index 000000000..666fde9c1 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.glb b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.glb new file mode 100644 index 000000000..577ea0a70 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.preview.png new file mode 100644 index 000000000..cac7cd0fb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Bee.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.blend b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.blend new file mode 100644 index 000000000..fc4eedd6c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.glb b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.glb new file mode 100644 index 000000000..17d9fde67 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.preview.png new file mode 100644 index 000000000..46f6202d9 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Crab.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.blend b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.blend new file mode 100644 index 000000000..301c127cb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.glb b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.glb new file mode 100644 index 000000000..3c599373c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.preview.png new file mode 100644 index 000000000..f4e49384b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Enemy.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.blend b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.blend new file mode 100644 index 000000000..66fba8417 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.glb b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.glb new file mode 100644 index 000000000..5800abe66 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.preview.png new file mode 100644 index 000000000..dd0f7a848 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Enemies/Skull.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.blend new file mode 100644 index 000000000..7e501b787 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.glb new file mode 100644 index 000000000..08038a264 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.preview.png new file mode 100644 index 000000000..8f7c4ca19 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Side.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.blend new file mode 100644 index 000000000..64a4e2d93 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.glb new file mode 100644 index 000000000..2bf77601a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.preview.png new file mode 100644 index 000000000..a1062ea25 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow Up.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.blend new file mode 100644 index 000000000..708464187 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.glb new file mode 100644 index 000000000..282f6cf4b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.preview.png new file mode 100644 index 000000000..a8bc1e20e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Arrow.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.blend new file mode 100644 index 000000000..e79d2d1ec Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.glb new file mode 100644 index 000000000..e33918bc9 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.preview.png new file mode 100644 index 000000000..cb80c4306 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bomb.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.blend new file mode 100644 index 000000000..57892be2d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.glb new file mode 100644 index 000000000..6ab201c1a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.preview.png new file mode 100644 index 000000000..fdad64b39 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bouncer.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.blend new file mode 100644 index 000000000..71920e051 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.glb new file mode 100644 index 000000000..6db238048 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.preview.png new file mode 100644 index 000000000..1dafe5d6b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular Center.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.blend new file mode 100644 index 000000000..ffff102d8 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.glb new file mode 100644 index 000000000..0163b214f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.preview.png new file mode 100644 index 000000000..e6933aa70 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Modular.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.blend new file mode 100644 index 000000000..b289d6b01 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.glb new file mode 100644 index 000000000..7e44e7b7a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.preview.png new file mode 100644 index 000000000..8ef91cbe5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Bridge Small.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.blend new file mode 100644 index 000000000..0bafb0fa6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.glb new file mode 100644 index 000000000..55313c2d7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.preview.png new file mode 100644 index 000000000..a78d6d74d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannon.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.blend new file mode 100644 index 000000000..d7585bfa1 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.glb new file mode 100644 index 000000000..dbf4eeb55 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.preview.png new file mode 100644 index 000000000..1addc750d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Cannonball.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.blend new file mode 100644 index 000000000..82a14555a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.glb new file mode 100644 index 000000000..112b1716b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.preview.png new file mode 100644 index 000000000..b7e2eeb93 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Chest.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.blend new file mode 100644 index 000000000..7f00bd825 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.glb new file mode 100644 index 000000000..042cc3576 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.preview.png new file mode 100644 index 000000000..591d21348 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Door.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.blend new file mode 100644 index 000000000..5cdf2cefc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.glb new file mode 100644 index 000000000..f58b81b75 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.preview.png new file mode 100644 index 000000000..678af55fb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence 1.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.blend new file mode 100644 index 000000000..bf9d951ce Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.glb new file mode 100644 index 000000000..a6be24b32 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.preview.png new file mode 100644 index 000000000..2dc0e0218 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Corner.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.blend new file mode 100644 index 000000000..0babfed5e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.glb new file mode 100644 index 000000000..6fc441af3 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.preview.png new file mode 100644 index 000000000..5d26b2ddc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Fence Middle.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.blend new file mode 100644 index 000000000..c4f7eb77a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.glb new file mode 100644 index 000000000..2d6494119 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.preview.png new file mode 100644 index 000000000..00ca3c77d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Goal Flag.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.blend new file mode 100644 index 000000000..e872c43b5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.glb new file mode 100644 index 000000000..4a5362de0 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.preview.png new file mode 100644 index 000000000..9ce647025 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Cylinder.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.blend new file mode 100644 index 000000000..37d9d7221 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.glb new file mode 100644 index 000000000..903445686 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.preview.png new file mode 100644 index 000000000..0b319f971 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Saw.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.blend new file mode 100644 index 000000000..f75052003 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.glb new file mode 100644 index 000000000..4f86e82ea Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.preview.png new file mode 100644 index 000000000..9d685d678 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Hazard Spike Trap.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.blend new file mode 100644 index 000000000..99a3b952a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.glb new file mode 100644 index 000000000..f096d8508 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.preview.png new file mode 100644 index 000000000..2a7c63fb0 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Lever.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.blend new file mode 100644 index 000000000..b3178961f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.glb new file mode 100644 index 000000000..27aa7db2d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.preview.png new file mode 100644 index 000000000..5fc642312 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 0.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.blend new file mode 100644 index 000000000..1f9c477fb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.glb new file mode 100644 index 000000000..e53c958c4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.preview.png new file mode 100644 index 000000000..31036e499 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 1.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.blend new file mode 100644 index 000000000..35acb9ff1 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.glb new file mode 100644 index 000000000..df527d6b7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.preview.png new file mode 100644 index 000000000..fbd55f8bf Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 2.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.blend new file mode 100644 index 000000000..673e1b99a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.glb new file mode 100644 index 000000000..e453783ba Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.preview.png new file mode 100644 index 000000000..b1627995c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 3.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.blend new file mode 100644 index 000000000..8e28df777 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.glb new file mode 100644 index 000000000..21acfd26d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.preview.png new file mode 100644 index 000000000..872d82eab Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 4.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.blend new file mode 100644 index 000000000..2aff75c39 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.glb new file mode 100644 index 000000000..274113421 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.preview.png new file mode 100644 index 000000000..018c45cc8 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 5.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.blend new file mode 100644 index 000000000..925e104cd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.glb new file mode 100644 index 000000000..6f264031f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.preview.png new file mode 100644 index 000000000..17d8165c8 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 6.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.blend new file mode 100644 index 000000000..9c0967bf1 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.glb new file mode 100644 index 000000000..0551040ff Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.preview.png new file mode 100644 index 000000000..4b0d8d69c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 7.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.blend new file mode 100644 index 000000000..18e05f09b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.glb new file mode 100644 index 000000000..bf874ddf4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.preview.png new file mode 100644 index 000000000..0f1825a52 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 8.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.blend new file mode 100644 index 000000000..5580c9b8d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.glb new file mode 100644 index 000000000..91f8b15cc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.preview.png new file mode 100644 index 000000000..f2539d862 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Numbers 9.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.blend new file mode 100644 index 000000000..9870c8210 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.glb new file mode 100644 index 000000000..c9ac99750 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.preview.png new file mode 100644 index 000000000..e9b470f7b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe 90.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.blend new file mode 100644 index 000000000..93ac0a052 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.glb new file mode 100644 index 000000000..ee77e321b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.preview.png new file mode 100644 index 000000000..70a4fca64 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe End.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.blend new file mode 100644 index 000000000..c69d126a3 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.glb new file mode 100644 index 000000000..62a6d2d12 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.preview.png new file mode 100644 index 000000000..b3b6d9afb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe Straight.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.blend new file mode 100644 index 000000000..3ebe9e65c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.glb new file mode 100644 index 000000000..0f059710c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.preview.png new file mode 100644 index 000000000..4914dc8fd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Pipe T.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.blend new file mode 100644 index 000000000..4e5c8e17b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.glb new file mode 100644 index 000000000..9ee75396d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.preview.png new file mode 100644 index 000000000..ace78877f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Large.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.blend new file mode 100644 index 000000000..6d483bb14 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.glb new file mode 100644 index 000000000..e1940e144 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.preview.png new file mode 100644 index 000000000..518b280b4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Plant Small.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.blend new file mode 100644 index 000000000..40f28b487 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.glb new file mode 100644 index 000000000..0ed407ad0 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.preview.png new file mode 100644 index 000000000..9ab85d940 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spikes.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.blend new file mode 100644 index 000000000..671a0ab13 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.glb new file mode 100644 index 000000000..944bbd40e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.preview.png new file mode 100644 index 000000000..f6df4d62c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Spiky Ball.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.blend new file mode 100644 index 000000000..f961482bb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.glb new file mode 100644 index 000000000..0db67d5fc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.preview.png new file mode 100644 index 000000000..7556ddca1 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular End.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.blend new file mode 100644 index 000000000..a99419a7a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.glb new file mode 100644 index 000000000..e85c304aa Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.preview.png new file mode 100644 index 000000000..351f14034 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Middle.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.blend new file mode 100644 index 000000000..b61e8cc36 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.glb new file mode 100644 index 000000000..7a74bc6f5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.preview.png new file mode 100644 index 000000000..30e3e5405 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Modular Start.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.blend new file mode 100644 index 000000000..fcf375223 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.glb new file mode 100644 index 000000000..c50f1b6b2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.preview.png new file mode 100644 index 000000000..7574c5400 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs Small.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.blend new file mode 100644 index 000000000..3d197f0bc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.glb new file mode 100644 index 000000000..3ea473112 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.preview.png new file mode 100644 index 000000000..cf26178e2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Stairs.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.blend b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.blend new file mode 100644 index 000000000..73ff80707 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.glb b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.glb new file mode 100644 index 000000000..f07b6fa5f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.preview.png new file mode 100644 index 000000000..f013e4264 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Level and Mechanics/Tower.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/License.txt b/examples/3d-third-person/3D Platformer Game Kit/License.txt new file mode 100644 index 000000000..6d1439ee6 --- /dev/null +++ b/examples/3d-third-person/3D Platformer Game Kit/License.txt @@ -0,0 +1,12 @@ +------------------------------------------------------ +Ultimate Platformer Pack by @Quaternius +Consider supporting me on Patreon, even $1 helps me a lot! + +https://www.patreon.com/quaternius +------------------------------------------------------- + +License: +CC0 1.0 Universal (CC0 1.0) +Public Domain Dedication +https://creativecommons.org/publicdomain/zero/1.0/ + diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.blend new file mode 100644 index 000000000..301508162 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.glb new file mode 100644 index 000000000..401a90a82 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.preview.png new file mode 100644 index 000000000..e633cff8a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 Center.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.blend new file mode 100644 index 000000000..8e21fa49e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.glb new file mode 100644 index 000000000..a04b32d7a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.preview.png new file mode 100644 index 000000000..f213ef9c7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Dirt 1x1 End.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.blend new file mode 100644 index 000000000..74d055d9b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.glb new file mode 100644 index 000000000..37051283f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.preview.png new file mode 100644 index 000000000..9a3feea22 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 Center.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.blend new file mode 100644 index 000000000..8e06a24ec Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.glb new file mode 100644 index 000000000..943bebec4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.preview.png new file mode 100644 index 000000000..cb25fed34 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/2D/Cube Grass 1x1 End.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.blend new file mode 100644 index 000000000..ca12f0ebc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.glb new file mode 100644 index 000000000..2246a1a04 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.preview.png new file mode 100644 index 000000000..1be4160cf Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Center Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.blend new file mode 100644 index 000000000..c8e4a5dcb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.glb new file mode 100644 index 000000000..1f6b92af7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.preview.png new file mode 100644 index 000000000..4f245822e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Corner Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.blend new file mode 100644 index 000000000..5cd78200c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.glb new file mode 100644 index 000000000..23878fa02 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.preview.png new file mode 100644 index 000000000..9e5f79fcf Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Dirt Side Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.blend new file mode 100644 index 000000000..3e1ec6159 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.glb new file mode 100644 index 000000000..e54dfeff3 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.preview.png new file mode 100644 index 000000000..4df50d5f6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.blend new file mode 100644 index 000000000..98dc7a08c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.glb new file mode 100644 index 000000000..da5e43331 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.preview.png new file mode 100644 index 000000000..7cc26d8e7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.blend new file mode 100644 index 000000000..bce9758dd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.glb new file mode 100644 index 000000000..62e80abac Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.preview.png new file mode 100644 index 000000000..b458fe411 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.blend new file mode 100644 index 000000000..e30b377de Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.glb new file mode 100644 index 000000000..92c65b9ef Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.preview.png new file mode 100644 index 000000000..e0be8c94b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.blend new file mode 100644 index 000000000..ee9e0a368 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.glb new file mode 100644 index 000000000..072580155 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.preview.png new file mode 100644 index 000000000..a6e03990d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.blend new file mode 100644 index 000000000..11bf10d9b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.glb new file mode 100644 index 000000000..4098d5f43 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.preview.png new file mode 100644 index 000000000..2c1814910 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.blend new file mode 100644 index 000000000..fc1f4a0ad Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.glb new file mode 100644 index 000000000..ea10cadad Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.preview.png new file mode 100644 index 000000000..8dac9b108 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.blend new file mode 100644 index 000000000..360c3126d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.glb new file mode 100644 index 000000000..d103f1e18 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.preview.png new file mode 100644 index 000000000..fcb1e9a95 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.blend new file mode 100644 index 000000000..cbad0d137 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.glb new file mode 100644 index 000000000..2d381ab1e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.preview.png new file mode 100644 index 000000000..af3c3f703 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Dirt Single.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.blend new file mode 100644 index 000000000..ff993c0e6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.glb new file mode 100644 index 000000000..8c23a8fb6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.preview.png new file mode 100644 index 000000000..70b4b3501 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Cube/Cube Grass Single.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.blend new file mode 100644 index 000000000..59269681d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.glb new file mode 100644 index 000000000..e41bef9bd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.preview.png new file mode 100644 index 000000000..412cc9ad4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Center.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.blend new file mode 100644 index 000000000..60149acc2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.glb new file mode 100644 index 000000000..d8cd345c8 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.preview.png new file mode 100644 index 000000000..fde356804 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Corner.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.blend new file mode 100644 index 000000000..f5540c735 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.glb new file mode 100644 index 000000000..9c6392723 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.preview.png new file mode 100644 index 000000000..0dbc32ab5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Dirt Side.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.blend new file mode 100644 index 000000000..c65d74130 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.glb new file mode 100644 index 000000000..f09e8c6a0 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.preview.png new file mode 100644 index 000000000..c123707a4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Center.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.blend new file mode 100644 index 000000000..f488e19fa Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.glb new file mode 100644 index 000000000..be7356dff Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.preview.png new file mode 100644 index 000000000..7c7c50c5e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.blend b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.blend new file mode 100644 index 000000000..e0cbcef47 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.glb b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.glb new file mode 100644 index 000000000..0c3e42efd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.preview.png new file mode 100644 index 000000000..caed34f54 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Tutorial.jpg b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Tutorial.jpg new file mode 100644 index 000000000..e0a826f85 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Modular Platforms/Tutorial.jpg differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.blend new file mode 100644 index 000000000..28e89e444 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.glb new file mode 100644 index 000000000..3a7fb9d05 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.preview.png new file mode 100644 index 000000000..4dbc8b94b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush Fruit.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.blend new file mode 100644 index 000000000..53f1473fb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.glb new file mode 100644 index 000000000..dfdb0777c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.preview.png new file mode 100644 index 000000000..44a313465 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Bush.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.blend new file mode 100644 index 000000000..20f11f647 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.glb new file mode 100644 index 000000000..1b637cd1c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.preview.png new file mode 100644 index 000000000..116d6fd32 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 1.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.blend new file mode 100644 index 000000000..019527c10 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.glb new file mode 100644 index 000000000..ee78d1b5d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.preview.png new file mode 100644 index 000000000..06b8289a5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 2.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.blend new file mode 100644 index 000000000..13aeb19fc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.glb new file mode 100644 index 000000000..593166ce7 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.preview.png new file mode 100644 index 000000000..9e5b4d315 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Cloud 3.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.blend new file mode 100644 index 000000000..2e1b902ee Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.glb new file mode 100644 index 000000000..7523d523c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.preview.png new file mode 100644 index 000000000..b3296322c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Fruit.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.blend new file mode 100644 index 000000000..7535a9714 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.glb new file mode 100644 index 000000000..d813738be Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.preview.png new file mode 100644 index 000000000..b5645ef7c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 1.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.blend new file mode 100644 index 000000000..96e7d8a72 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.glb new file mode 100644 index 000000000..c8982a7e3 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.preview.png new file mode 100644 index 000000000..c8fb12241 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 2.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.blend new file mode 100644 index 000000000..c70fb05c4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.glb new file mode 100644 index 000000000..8bed892c5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.preview.png new file mode 100644 index 000000000..722333252 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Grass 3.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.blend new file mode 100644 index 000000000..2999f5c93 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.glb new file mode 100644 index 000000000..d65e39efc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.preview.png new file mode 100644 index 000000000..9299b28d2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 1.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.blend new file mode 100644 index 000000000..0452237b6 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.glb new file mode 100644 index 000000000..cdf3fccdd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.preview.png new file mode 100644 index 000000000..d22bd8bb9 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock 2.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.blend new file mode 100644 index 000000000..d0f77a3c4 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.glb new file mode 100644 index 000000000..55174409a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.preview.png new file mode 100644 index 000000000..72108d56e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platform Tall.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.blend new file mode 100644 index 000000000..c02bdf9ca Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.glb new file mode 100644 index 000000000..93e7bef38 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.preview.png new file mode 100644 index 000000000..46a5e9ec8 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 1.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.blend new file mode 100644 index 000000000..09d408d41 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.glb new file mode 100644 index 000000000..9589af49e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.preview.png new file mode 100644 index 000000000..a6cb3aa6d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 2.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.blend new file mode 100644 index 000000000..78d4b08c5 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.glb new file mode 100644 index 000000000..0c1167214 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.preview.png new file mode 100644 index 000000000..a37a8c1eb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms 3.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.blend new file mode 100644 index 000000000..b02e76507 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.glb new file mode 100644 index 000000000..83369a3cd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.preview.png new file mode 100644 index 000000000..8b7083ced Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Large.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.blend new file mode 100644 index 000000000..3dbf241e2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.glb new file mode 100644 index 000000000..e05c4ebef Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.preview.png new file mode 100644 index 000000000..b41a48064 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Rock Platforms Medium.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.blend new file mode 100644 index 000000000..3d80dec38 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.glb new file mode 100644 index 000000000..c4be6e930 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.preview.png new file mode 100644 index 000000000..41421266e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree Fruit.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.blend b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.blend new file mode 100644 index 000000000..1101e69ee Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.glb b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.glb new file mode 100644 index 000000000..20031d275 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.preview.png new file mode 100644 index 000000000..b24cd0ebb Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Nature/Tree.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.blend new file mode 100644 index 000000000..3f4719c91 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.glb new file mode 100644 index 000000000..2b37845a8 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.preview.png new file mode 100644 index 000000000..01cb58d05 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Coin.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.blend new file mode 100644 index 000000000..378a286f3 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.glb new file mode 100644 index 000000000..6f364efdf Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.preview.png new file mode 100644 index 000000000..0f7116224 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Blue.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.blend new file mode 100644 index 000000000..deeedf67a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.glb new file mode 100644 index 000000000..159d9b376 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.preview.png new file mode 100644 index 000000000..4892310a2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Green.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.blend new file mode 100644 index 000000000..0b656e22c Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.glb new file mode 100644 index 000000000..01162e6cc Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.preview.png new file mode 100644 index 000000000..56c9887dd Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Gem Pink.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.blend new file mode 100644 index 000000000..eb267a2d0 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.glb new file mode 100644 index 000000000..69be8cb09 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.preview.png new file mode 100644 index 000000000..e4f512358 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Half.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.blend new file mode 100644 index 000000000..b0f27c5cf Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.glb new file mode 100644 index 000000000..ac9d4c44e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.preview.png new file mode 100644 index 000000000..57d365744 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart Outline.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.blend new file mode 100644 index 000000000..2d21e2247 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.glb new file mode 100644 index 000000000..63ba7062a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.preview.png new file mode 100644 index 000000000..a93be7e99 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Heart.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.blend new file mode 100644 index 000000000..1152bd2d2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.glb new file mode 100644 index 000000000..ba798a07b Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.preview.png new file mode 100644 index 000000000..7ca349d0d Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Key.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.blend new file mode 100644 index 000000000..2cbc42f30 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.glb new file mode 100644 index 000000000..370646cac Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.preview.png new file mode 100644 index 000000000..dded6d01e Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star Outline.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.blend new file mode 100644 index 000000000..83b84fe2a Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.glb new file mode 100644 index 000000000..a0cb0f104 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.preview.png new file mode 100644 index 000000000..c5e8c2b2f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Star.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.blend b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.blend new file mode 100644 index 000000000..4d94265d2 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.blend differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.glb b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.glb new file mode 100644 index 000000000..c6f82aea1 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.glb differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.preview.png b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.preview.png new file mode 100644 index 000000000..b0147dc21 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Powerups and Pickups/Thunder.preview.png differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Preview.jpg b/examples/3d-third-person/3D Platformer Game Kit/Preview.jpg new file mode 100644 index 000000000..ddd90fb0f Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Preview.jpg differ diff --git a/examples/3d-third-person/3D Platformer Game Kit/Preview2.jpg b/examples/3d-third-person/3D Platformer Game Kit/Preview2.jpg new file mode 100644 index 000000000..1b8f8e185 Binary files /dev/null and b/examples/3d-third-person/3D Platformer Game Kit/Preview2.jpg differ diff --git a/examples/3d-third-person/3d-third-person.json b/examples/3d-third-person/3d-third-person.json new file mode 100644 index 000000000..8aa0d41ae --- /dev/null +++ b/examples/3d-third-person/3d-third-person.json @@ -0,0 +1,42764 @@ +{ + "firstLayout": "", + "gdVersion": { + "build": 99, + "major": 4, + "minor": 0, + "revision": 0 + }, + "properties": { + "adaptGameResolutionAtRuntime": true, + "antialiasingMode": "MSAA", + "antialisingEnabledOnMobile": false, + "folderProject": false, + "orientation": "landscape", + "packageName": "com.example.firstperson3d", + "pixelsRounding": false, + "projectUuid": "df6e4793-47c9-4ab9-af06-e31eecacbe56", + "scaleMode": "linear", + "sizeOnStartupMode": "adaptWidth", + "templateSlug": "", + "useExternalSourceFiles": false, + "version": "1.0.0", + "name": "3D First Person", + "description": "A 3D first person movement example featuring 3D first person movement on the X and Y planes, the pointer lock extension, and mobile controls", + "author": "", + "windowWidth": 1280, + "windowHeight": 720, + "latestCompilationDirectory": "", + "maxFPS": 60, + "minFPS": 20, + "verticalSync": false, + "platformSpecificAssets": { + "android-icon-144": "android-icon-144.png", + "android-icon-192": "android-icon-192.png", + "android-icon-36": "android-icon-36.png", + "android-icon-48": "android-icon-48.png", + "android-icon-72": "android-icon-72.png", + "android-icon-96": "android-icon-96.png", + "android-windowSplashScreenAnimatedIcon": "android-windowSplashScreenAnimatedIcon.png", + "desktop-icon-512": "desktop-icon-512.png", + "ios-icon-100": "ios-icon-100.png", + "ios-icon-1024": "ios-icon-1024.png", + "ios-icon-114": "ios-icon-114.png", + "ios-icon-120": "ios-icon-120.png", + "ios-icon-144": "ios-icon-144.png", + "ios-icon-152": "ios-icon-152.png", + "ios-icon-167": "ios-icon-167.png", + "ios-icon-180": "ios-icon-180.png", + "ios-icon-20": "ios-icon-20.png", + "ios-icon-29": "ios-icon-29.png", + "ios-icon-40": "ios-icon-40.png", + "ios-icon-50": "ios-icon-50.png", + "ios-icon-57": "ios-icon-57.png", + "ios-icon-58": "ios-icon-58.png", + "ios-icon-60": "ios-icon-60.png", + "ios-icon-72": "ios-icon-72.png", + "ios-icon-76": "ios-icon-76.png", + "ios-icon-80": "ios-icon-80.png", + "ios-icon-87": "ios-icon-87.png", + "liluo-thumbnail": "preview.png" + }, + "loadingScreen": { + "backgroundColor": 0, + "backgroundFadeInDuration": 0.2, + "backgroundImageResourceName": "", + "gdevelopLogoStyle": "light", + "logoAndProgressFadeInDuration": 0.2, + "logoAndProgressLogoFadeInDelay": 0.2, + "minDuration": 1.5, + "progressBarColor": 16777215, + "progressBarHeight": 20, + "progressBarMaxWidth": 200, + "progressBarMinWidth": 40, + "progressBarWidthPercent": 30, + "showGDevelopSplash": true, + "showProgressBar": true + }, + "watermark": { + "placement": "bottom-left", + "showWatermark": true + }, + "authorIds": [], + "authorUsernames": [], + "categories": [], + "playableDevices": [], + "extensionProperties": [], + "platforms": [ + { + "name": "GDevelop JS platform" + } + ], + "currentPlatform": "GDevelop JS platform" + }, + "resources": { + "resources": [ + { + "alwaysLoaded": false, + "file": "assets/Shaded dark joystick border.png", + "kind": "image", + "metadata": "", + "name": "Shaded dark joystick border.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Multitouch joysticks/dd6e3c2d11ba02bd5a052cd47908e851b656d0fb492b52006afa4843e597d0cc_Shaded dark joystick border.png", + "name": "Shaded dark joystick border.png" + } + }, + { + "alwaysLoaded": false, + "file": "assets/Shaded dark joystick thumb.png", + "kind": "image", + "metadata": "", + "name": "Shaded dark joystick thumb.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Multitouch joysticks/13d8225be69d0f11b6de965cac0d840e7e63e2510a638af89ae42b052caa2460_Shaded dark joystick thumb.png", + "name": "Shaded dark joystick thumb.png" + } + }, + { + "alwaysLoaded": false, + "file": "Camera.png", + "kind": "image", + "metadata": "", + "name": "Camera.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/SmoothParticle.png", + "kind": "image", + "metadata": "", + "name": "assets\\SmoothParticle.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/Grass.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/Grass.png\",\"extension\":\".png\",\"pskl\":{}}", + "name": "assets\\Grass.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/Soil.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/Soil.png\",\"extension\":\".png\",\"pskl\":{}}", + "name": "assets\\Soil.png", + "smoothed": true, + "userAdded": true + }, + { + "file": "assets/Bunny.glb", + "kind": "model3D", + "metadata": "", + "name": "Bunny.glb", + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/3D Colorful Monsters/Standing/d3ede48f1b7b3c5c2a0aba8499f84117c72e1411f3069b94dd026db295587de5_Bunny.glb", + "name": "Bunny.glb" + } + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Tall.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Nature/Grass 3.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Nature\\Grass 3.glb", + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "assets/Water.png", + "kind": "image", + "metadata": "{\"localFilePath\":\"assets/Water.png\",\"extension\":\".png\",\"pskl\":{}}", + "name": "assets\\Water.png", + "smoothed": true, + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Level and Mechanics/Fence Middle.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Level and Mechanics\\Fence Middle.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Nature/Cloud 2.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Nature\\Cloud 2.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Powerups and Pickups/Coin.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Powerups and Pickups\\Coin.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Cubes/Cube Crate.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Cubes\\Cube Crate.glb", + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Particle.png", + "kind": "image", + "metadata": "", + "name": "Particle.png", + "smoothed": true, + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Shadow.png", + "kind": "image", + "metadata": "", + "name": "Shadow.png", + "smoothed": true, + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Center Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Center Tall.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Bottom Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Bottom Tall.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Tall.glb", + "userAdded": false + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Center Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Center Tall.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Center Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Center Tall.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Corner Bottom Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Bottom Tall.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/3D/Cube Grass Side Bottom Tall.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Bottom Tall.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Corner.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Corner.glb", + "userAdded": true + }, + { + "file": "3D Platformer Game Kit/Modular Platforms/Single Height/Cube Grass Side.glb", + "kind": "model3D", + "metadata": "", + "name": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Side.glb", + "userAdded": true + }, + { + "alwaysLoaded": false, + "file": "Top arrow round button.png", + "kind": "image", + "metadata": "", + "name": "Top arrow round button.png", + "smoothed": true, + "userAdded": true + } + ], + "resourceFolders": [] + }, + "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, + "objectsGroups": [], + "variables": [], + "layouts": [ + { + "b": 250, + "disableInputWhenNotFocused": true, + "mangledName": "GameScene", + "name": "GameScene", + "r": 116, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 219, + "uiSettings": { + "grid": true, + "gridType": "rectangular", + "gridWidth": 25, + "gridHeight": 25, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": true, + "zoomFactor": 0.4481978045410586, + "windowMask": false + }, + "objectsGroups": [ + { + "name": "Obstacle", + "objects": [ + { + "name": "Platform" + }, + { + "name": "Fence" + }, + { + "name": "Platform9Patch" + } + ] + }, + { + "name": "ShadowReceiver", + "objects": [ + { + "name": "Platform" + }, + { + "name": "Water" + } + ] + }, + { + "name": "MobileControl", + "objects": [ + { + "name": "JumpButton" + }, + { + "name": "WalkJoystick" + }, + { + "name": "LookJoystick" + } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "ControlKind", + "type": "string", + "value": "" + } + ], + "instances": [ + { + "angle": 90, + "customSize": true, + "depth": 200, + "height": 1225, + "layer": "", + "name": "Platform", + "persistentUuid": "bf94d379-bd2a-490b-9f93-b1af80fabd76", + "width": 651, + "x": 312, + "y": -287, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 200, + "layer": "MobileUI", + "name": "WalkJoystick", + "persistentUuid": "618a7ba7-ceae-4203-a30b-01bcfdf1176a", + "width": 200, + "x": 150, + "y": 575, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 400, + "height": 300, + "layer": "", + "name": "Platform", + "persistentUuid": "a194307a-fa28-4ded-b8b9-6b1dd2176d42", + "width": 375, + "x": 900, + "y": -25, + "z": -100, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 100, + "height": 300, + "layer": "", + "name": "Platform", + "persistentUuid": "22460dba-c819-4694-ad96-aa8f857a90a9", + "width": 375, + "x": 325, + "y": -150, + "z": 400, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Bunny", + "persistentUuid": "5f19ba70-5a5d-44b4-87f9-40efd00b3ee5", + "width": 0, + "x": 174, + "y": 349, + "z": 100, + "zOrder": 17, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 80, + "height": 50, + "layer": "", + "name": "Camera", + "persistentUuid": "ff5eb8ec-abfa-4466-ae38-23ef5e1b1ea8", + "width": 50, + "x": 150, + "y": 319, + "z": 100, + "zOrder": 18, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 100, + "height": 300, + "layer": "", + "name": "Platform", + "persistentUuid": "fb753bbc-f51b-4ac5-804c-4f5c8b77966a", + "width": 375, + "x": 1000, + "y": -450, + "z": 400, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 100, + "height": 300, + "layer": "", + "name": "Platform", + "persistentUuid": "7d26d2b0-dd69-4d3d-9c5b-dae7916f78f2", + "width": 375, + "x": 400, + "y": -550, + "z": 500, + "zOrder": 16, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 20000, + "layer": "", + "locked": true, + "name": "Water", + "persistentUuid": "edd3d912-4b61-4438-a388-739e8484859f", + "sealed": true, + "width": 20000, + "x": -10000, + "y": -10000, + "z": -2, + "zOrder": 20, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 200, + "height": 500, + "layer": "", + "name": "Platform", + "persistentUuid": "bbf8b192-a484-47a0-a19c-7881dd468e0c", + "width": 325, + "x": 913, + "y": -1512, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 121, + "customSize": true, + "depth": 200, + "height": 425, + "layer": "", + "name": "Platform", + "persistentUuid": "f056bda7-bd96-4480-949c-be30ff9bacf3", + "width": 574, + "x": 1776, + "y": -150, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": true, + "depth": 200, + "height": 800, + "layer": "", + "name": "Platform", + "persistentUuid": "01ff936e-350f-449f-a65c-01b32715f243", + "width": 450, + "x": 1201, + "y": 1075, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 74, + "customSize": true, + "depth": 200, + "height": 250, + "layer": "", + "name": "Platform", + "persistentUuid": "9eaf37c7-39bf-44c3-b108-53e698435e2e", + "width": 200, + "x": -624, + "y": 1001, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 129, + "customSize": true, + "depth": 200, + "height": 325, + "layer": "", + "name": "Platform", + "persistentUuid": "180fea61-dc65-41e3-aa39-594b95fc518c", + "width": 376, + "x": -1025, + "y": -599, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Fence", + "persistentUuid": "02c1cf80-de0f-45c7-b218-da6d1acb1332", + "width": 0, + "x": 375, + "y": 143, + "z": 500, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Fence", + "persistentUuid": "14ae638e-8a9e-468b-96d3-9309f8e8d8be", + "width": 0, + "x": 475, + "y": 143, + "z": 500, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Fence", + "persistentUuid": "3de1dfae-6743-40cf-b914-7b9582f638cb", + "width": 0, + "x": 575, + "y": 143, + "z": 500, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "Fence", + "persistentUuid": "bee5fd15-7bdc-440a-8792-7921d13a5b62", + "width": 0, + "x": 332, + "y": 100, + "z": 500, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 90, + "customSize": false, + "height": 0, + "layer": "", + "name": "Fence", + "persistentUuid": "681f3839-5193-4b17-b8e7-0c8c2f07fdec", + "width": 0, + "x": 332, + "y": 0, + "z": 500, + "zOrder": 21, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 64, + "customSize": true, + "depth": 200, + "height": 525, + "layer": "", + "name": "Platform", + "persistentUuid": "53fb91b5-4095-4af7-bb52-890cb653be13", + "width": 200, + "x": 1446, + "y": 1013, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 64, + "customSize": true, + "depth": 200, + "height": 947, + "layer": "", + "name": "Platform", + "persistentUuid": "faa4ca49-dcee-429b-b574-94eace66abb1", + "width": 600, + "x": 19.5, + "y": -300.25, + "z": -100, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "994fca4b-f307-4003-9379-3f4bb08ca521", + "width": 0, + "x": 568, + "y": 376, + "z": 125, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "eb865e2b-1329-4716-bbbd-6e4217709aa7", + "width": 0, + "x": 443, + "y": 326, + "z": 125, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "c4e2c07c-bd1b-4b5d-9a20-5372377d4eac", + "width": 0, + "x": 700, + "y": 350, + "z": 125, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "83ab7fec-2762-4a8c-8488-96dad8c11760", + "width": 0, + "x": 982, + "y": 97, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "3ef376b8-2643-4d9b-a352-c564a124afce", + "width": 0, + "x": 1093, + "y": 224, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "8b0279d0-04b6-40c0-b087-020ed91535d6", + "width": 0, + "x": 1207, + "y": 122, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "729c7e3b-c79d-4854-ab5e-8a5170646ed5", + "width": 0, + "x": 1107, + "y": 24, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "32016134-0c87-4a68-96d9-467a63804d7a", + "width": 0, + "x": 1168, + "y": 45, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "bc8ca7ec-8822-4f7d-a854-b87709cc42b0", + "width": 0, + "x": 1157, + "y": 197, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "d12107f4-1820-4a2b-9f02-aed7fbafd76c", + "width": 0, + "x": 1021, + "y": 47, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Coin", + "persistentUuid": "001a00bc-bd5d-4045-99f2-2946888a03c4", + "width": 0, + "x": 1007, + "y": 197, + "z": 325, + "zOrder": 22, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "15eea327-a256-4577-bef5-cb72970ad091", + "width": 0, + "x": 575, + "y": 950, + "z": -30, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "45759233-0322-4cdc-8de1-2024fe8de783", + "width": 0, + "x": 375, + "y": 975, + "z": -30, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "e29b5bff-ec12-41e4-9985-74a97d454d93", + "width": 0, + "x": 775, + "y": 950, + "z": -30, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "6394e52e-b660-475d-afaa-ca5dd52669a8", + "width": 0, + "x": 575, + "y": 1150, + "z": -30, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "a85d4c13-d113-46cd-b1d9-b2e905f3f844", + "width": 0, + "x": 425, + "y": 1150, + "z": -30, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "cef8e7fc-f93e-4b1e-8f30-6aaab8e2ab79", + "width": 0, + "x": 775, + "y": 1150, + "z": -30, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Shadow", + "persistentUuid": "e131721c-49f9-48aa-af81-cff20fb46607", + "width": 0, + "x": 146, + "y": 290, + "z": 100, + "zOrder": 24, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "", + "name": "Crate", + "persistentUuid": "e5231cb5-a480-478d-ac55-a1e94c56b1f4", + "width": 0, + "x": 1550, + "y": 600, + "z": -30, + "zOrder": 23, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 180, + "layer": "MobileUI", + "name": "JumpButton", + "persistentUuid": "8e6d5412-ef65-4158-af76-1a631665a61c", + "width": 180, + "x": 1040, + "y": 485, + "zOrder": 25, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 200, + "height": 275, + "layer": "", + "name": "Platform9Patch", + "persistentUuid": "602ac58d-96cb-43c7-b1d9-a490d96c7023", + "width": 425, + "x": 1600, + "y": 650, + "z": 100, + "zOrder": 26, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "", + "name": "Platform", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Z", + "frontFaceResourceName": "assets\\Grass.png", + "backFaceResourceName": "assets\\Soil.png", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "assets\\Soil.png", + "rightFaceResourceName": "assets\\Soil.png", + "topFaceResourceName": "assets\\Soil.png", + "bottomFaceResourceName": "assets\\Soil.png", + "frontFaceVisible": true, + "backFaceVisible": true, + "leftFaceVisible": true, + "rightFaceVisible": true, + "topFaceVisible": true, + "bottomFaceVisible": true, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": true, + "leftFaceResourceRepeat": true, + "rightFaceResourceRepeat": true, + "topFaceResourceRepeat": true, + "bottomFaceResourceRepeat": true, + "materialType": "StandardWithoutMetalness" + } + }, + { + "assetStoreId": "", + "name": "Camera", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Jump3D", + "type": "Jump3D::Jump3D", + "Object3D": "Object3D", + "JumpHeight": 250, + "Time": 150.00000000011647, + "Duration": 150.00000000011647, + "MaxFallingSpeed": 700, + "Gravity": 1000, + "JumpSpeed": 600, + "JumpSustainTime": 0.2, + "State": "", + "CurrentJumpSpeed": 0.19999992847454, + "CurrentFallSpeed": 0.19999992847454, + "PreviousJumpSpeed": 0.19999992847454, + "PreviousFallSpeed": 0.19999992847454, + "HasPressedJumpKey": false + }, + { + "name": "ThirdPersonCamera", + "type": "ThirdPersonCamera::ThirdPersonCamera", + "Object3D": "Object3D", + "RotationHalfwayDuration": 0.125, + "TranslationZHalfwayDuration": 0.125, + "Distance": 500, + "OffsetX": 0, + "OffsetY": 0, + "OffsetZ": 0, + "RotationAngleOffset": 0, + "ElevationAngleOffset": 20, + "FollowFreeAreaZMax": 0, + "FollowFreeAreaZMin": 0, + "RotationLogSpeed": 2.0247e-320, + "TranslationZLogSpeed": 2.0247e-320, + "IsCalledManually": false, + "CameraZ": 0 + }, + { + "name": "TopDownWalk", + "type": "Walk3D::Walk3D", + "RotationSpeedMax": 180, + "RotationAcceleration": 720, + "RotationDeceleration": 720, + "TranslationSpeedMax": 400, + "TranslationAcceleration": 800, + "TranslationDeceleration": 800, + "CurrentRotationSpeed": 0, + "PreviousRotationSpeed": 2.0247e-320, + "CurrentTranslationSpeed": 0, + "PreviousTranslationSpeed": 2.0247e-320, + "HasPressedTurnLeft": false, + "HasPressedTurnRight": false, + "HasPressedForward": false, + "HasPressedBackward": false + } + ], + "content": { + "width": 100, + "height": 100, + "depth": 180, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "Camera.png", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": false, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": false, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false + } + }, + { + "assetStoreId": "9be1b0d0d5a1afad4537db989ea5e3a4a4564dfd123630a9bf61330a73803c63", + "name": "WalkJoystick", + "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "variables": [], + "effects": [], + "behaviors": [], + "content": {}, + "childrenContent": { + "Border": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Shaded dark joystick border.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + "Thumb": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Shaded dark joystick thumb.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "9be1b0d0d5a1afad4537db989ea5e3a4a4564dfd123630a9bf61330a73803c63", + "name": "LookJoystick", + "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "ControllerIdentifier": 2, + "JoystickIdentifier": "Secondary" + }, + "childrenContent": { + "Border": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Shaded dark joystick border.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + "Thumb": { + "adaptCollisionMaskAutomatically": false, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Shaded dark joystick thumb.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "7f724eed4de900004f1edcbf2bad9f651868cf2448150a49fe6c27d3a1846b33", + "name": "Bunny", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Sticker", + "type": "Sticker::Sticker", + "OnlyFollowPosition": false, + "IsDestroyedWithParent": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D", + "Object3D": "Object3D", + "Scale": "Scale", + "Tween": "Tween" + } + ], + "content": { + "centerLocation": "ModelOrigin", + "depth": 144, + "height": 144, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "Bunny.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 144, + "animations": [ + { + "loop": true, + "name": "Idle", + "source": "Idle" + }, + { + "loop": true, + "name": "Walk", + "source": "Walk" + }, + { + "loop": true, + "name": "Run", + "source": "Run" + }, + { + "loop": false, + "name": "Duck", + "source": "Duck" + }, + { + "loop": false, + "name": "Jump", + "source": "Jump" + }, + { + "loop": false, + "name": "Punch", + "source": "Punch" + }, + { + "loop": false, + "name": "Death", + "source": "Death" + }, + { + "loop": true, + "name": "JumpIdle", + "source": "Jump_Idle" + }, + { + "loop": false, + "name": "JumpLand", + "source": "Jump_Land" + }, + { + "loop": false, + "name": "HitReact", + "source": "HitReact" + }, + { + "loop": false, + "name": "Wave", + "source": "Wave" + }, + { + "loop": false, + "name": "Weapon", + "source": "Weapon" + }, + { + "loop": false, + "name": "Yes", + "source": "Yes" + }, + { + "loop": false, + "name": "No", + "source": "No" + } + ] + } + }, + { + "assetStoreId": "", + "name": "PlatformTopCorner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.79781210422519, + "height": 105.83594739437106, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83598613739017, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Grass3", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "BottomCenterZ", + "depth": 31.32753252983094, + "height": 37.94128954410554, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Nature\\Grass 3.glb", + "originLocation": "BottomCenterZ", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 64.26115930080414, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Water", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 100, + "height": 100, + "depth": 1, + "enableTextureTransparency": false, + "facesOrientation": "Y", + "frontFaceResourceName": "assets\\Water.png", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": false, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": false, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + }, + { + "assetStoreId": "", + "name": "Fence", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 62.55634427070618, + "height": 13.217660039663329, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Level and Mechanics\\Fence Middle.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 0, + "width": 99.99999403953552, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Cloud", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 240.160158276558, + "height": 400.61379671096813, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Nature\\Cloud 2.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 244.74914073944106, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Coin", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 52.34474539756775, + "height": 192.01879501342773, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Powerups and Pickups\\Coin.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 191.7772650718689, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Crate", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ObjectCenter", + "depth": 99.99983633995058, + "height": 99.99983633995058, + "keepAspectRatio": true, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Cubes\\Cube Crate.glb", + "originLocation": "BottomCenterZ", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 99.9998363399506, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "CoinExplosion", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "StartColor": "255;230;145", + "EndOpacity": 255, + "StartOpacity": 128, + "EndScale": 0, + "SpayConeAngle": 180, + "RotationY": 0, + "StartSpeedMin": 200, + "StartSpeedMax": 300, + "LifespanMax": 0.5, + "LifespanMin": 0.25, + "Duration": 0.0625, + "Flow": 200, + "StartSizeMin": 10, + "EndColor": "255;230;142", + "Blending": "Normal", + "StartSizeMax": 20 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "Particle.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 32, + "y": 0 + }, + { + "x": 32, + "y": 32 + }, + { + "x": 0, + "y": 32 + } + ] + ] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "", + "name": "Shadow", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 40, + "height": 60, + "depth": 1, + "enableTextureTransparency": true, + "facesOrientation": "Y", + "frontFaceResourceName": "Shadow.png", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": false, + "leftFaceVisible": false, + "rightFaceVisible": false, + "topFaceVisible": false, + "bottomFaceVisible": false, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + }, + { + "assetStoreId": "", + "name": "PlatformBottomCorner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.99999701976779, + "height": 100.0000596046448, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Bottom Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.00004768371586, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformTopSide", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.79781210422519, + "height": 105.83594739437106, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83598613739017, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformBottomSide", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.99999701976779, + "height": 99.99999403953555, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Bottom Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.00000298023228, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformCenterSide", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 99.99999403953552, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 49.99999701976778, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformCenterCorner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.99999701976779, + "height": 99.99998807907107, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.00004768371586, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformTop", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 49.79781508445741, + "height": 100.00002384185794, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.0000059604645, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformBottom", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 50.000000000000014, + "height": 100.00002384185794, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Bottom Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.0000059604645, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformCorner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.79781210422519, + "height": 105.83601593971255, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Corner.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83598613739017, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "PlatformSide", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.79781210422519, + "height": 100.00002384185794, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\Single Height\\Cube Grass Side.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83593249320984, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "SmokeEmitter", + "type": "ParticleEmitter3D::ParticleEmitter3D", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "EndColor": "238;238;194", + "StartColor": "238;238;194", + "Duration": 0.07, + "Flow": 500, + "LifespanMax": 0.75, + "SpayConeAngle": 90, + "RotationY": -90, + "EndScale": 4, + "StartSpeedMin": 150, + "EndOpacity": 0, + "StartOpacity": 128, + "StartSizeMin": 20, + "StartSizeMax": 20, + "Blending": "Normal", + "StartSpeedMax": 150, + "LifespanMin": 0.5 + }, + "childrenContent": { + "Particle": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\SmoothParticle.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 20, + "y": 21 + }, + { + "x": 44, + "y": 21 + }, + { + "x": 44, + "y": 46 + }, + { + "x": 20, + "y": 46 + } + ] + ] + } + ] + } + ] + } + ] + } + } + }, + { + "assetStoreId": "", + "name": "Platform9Patch", + "type": "Model9Patch3D::Model9Patch3D", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "IsTiledOnY": false, + "IsTiledOnZ": true + }, + "childrenContent": { + "BottomCenter": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 50.000000000000014, + "height": 100.00002384185794, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Bottom Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.0000059604645, + "animations": [] + } + }, + "BottomCorner": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Bottom Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100, + "animations": [] + } + }, + "BottomSide": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Bottom Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100, + "animations": [] + } + }, + "CenterCorner": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100, + "animations": [] + } + }, + "CenterSide": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 99.99999403953552, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 49.99999701976778, + "animations": [] + } + }, + "Placeholder": { + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Z", + "frontFaceResourceName": "assets\\Grass.png", + "backFaceResourceName": "assets\\Soil.png", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "assets\\Soil.png", + "rightFaceResourceName": "assets\\Soil.png", + "topFaceResourceName": "assets\\Soil.png", + "bottomFaceResourceName": "assets\\Soil.png", + "frontFaceVisible": true, + "backFaceVisible": true, + "leftFaceVisible": true, + "rightFaceVisible": true, + "topFaceVisible": true, + "bottomFaceVisible": true, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": true, + "leftFaceResourceRepeat": true, + "rightFaceResourceRepeat": true, + "topFaceResourceRepeat": true, + "bottomFaceResourceRepeat": true, + "materialType": "Basic" + } + }, + "TopCenter": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 49.79781508445741, + "height": 100.00002384185794, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.0000059604645, + "animations": [] + } + }, + "TopCorner": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.79781210422519, + "height": 105.83594739437106, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Corner Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83598613739017, + "animations": [] + } + }, + "TopSide": { + "content": { + "centerLocation": "ModelOrigin", + "depth": 99.7978150844574, + "height": 100.00002384185794, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Side Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 105.83592653274539, + "animations": [] + } + } + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "JumpButton", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 2, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton", + "ControllerIdentifier": 1, + "ButtonIdentifier": "A", + "TouchId": 0, + "TouchIndex": 2.0247e-320, + "IsReleased": false + } + ], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "Top arrow round button.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 80, + "y": 0 + }, + { + "x": 80, + "y": 80 + }, + { + "x": 0, + "y": 80 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "name": "New3DModel", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 49.79781508445741, + "height": 100.00002384185794, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "3D Platformer Game Kit\\Modular Platforms\\3D\\Cube Grass Center Tall.glb", + "originLocation": "ModelOrigin", + "rotationX": 90, + "rotationY": 0, + "rotationZ": 90, + "width": 100.0000059604645, + "animations": [] + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "folderName": "UI", + "children": [ + { + "objectName": "WalkJoystick" + }, + { + "objectName": "LookJoystick" + }, + { + "objectName": "JumpButton" + } + ] + }, + { + "folderName": "Obstacles", + "children": [ + { + "folderName": "Platform", + "children": [ + { + "objectName": "Platform" + }, + { + "objectName": "PlatformTop" + }, + { + "objectName": "PlatformTopCorner" + }, + { + "objectName": "PlatformTopSide" + }, + { + "objectName": "PlatformCenterCorner" + }, + { + "objectName": "PlatformCenterSide" + }, + { + "objectName": "PlatformBottomCorner" + }, + { + "objectName": "PlatformBottomSide" + }, + { + "objectName": "PlatformBottom" + }, + { + "objectName": "PlatformCorner" + }, + { + "objectName": "PlatformSide" + } + ] + }, + { + "objectName": "Fence" + } + ] + }, + { + "objectName": "Camera" + }, + { + "objectName": "CoinExplosion" + }, + { + "objectName": "Bunny" + }, + { + "objectName": "Water" + }, + { + "objectName": "Grass3" + }, + { + "objectName": "Cloud" + }, + { + "objectName": "Coin" + }, + { + "objectName": "Crate" + }, + { + "objectName": "Shadow" + }, + { + "objectName": "SmokeEmitter" + }, + { + "objectName": "Platform9Patch" + }, + { + "objectName": "New3DModel" + } + ] + }, + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Camera" + ] + }, + { + "type": { + "value": "Sticker::Sticker::Stick" + }, + "parameters": [ + "Bunny", + "Sticker", + "Camera", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "MobileControl", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "16", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Cloud", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Cloud", + "=", + "RandomFloat(360)" + ] + }, + { + "type": { + "value": "MettreAutourPos" + }, + "parameters": [ + "Cloud", + "0", + "0", + "RandomFloatInRange(2000, 8000)", + "Cloud.Angle()" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Cloud", + "+", + "RandomFloatInRange(-15, 15)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Cloud", + "Object3D", + "=", + "RandomFloatInRange(-30, -15)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Cloud", + "Object3D", + "=", + "RandomFloatInRange(100, 800)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Cloud", + "Scale", + "=", + "RandomFloatInRange(0.5, 2)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Cloud", + "Scale", + "*", + "RandomFloatInRange(0.8, 1.25)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Cloud", + "Scale", + "*", + "RandomFloatInRange(1, 1.25)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetScaleZ" + }, + "parameters": [ + "Cloud", + "Object3D", + "*", + "RandomFloatInRange(0.8, 1.125)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Coin", + "=", + "RandomFloat(360)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::Depth" + }, + "parameters": [ + "Platform", + "Object3D", + "<=", + "100" + ] + } + ], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Create9PatchSingleHeight" + }, + "parameters": [ + "", + "Platform", + "100", + "PlatformTop", + "PlatformCorner", + "PlatformSide", + "PlatformBottom", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::Depth" + }, + "parameters": [ + "Platform", + "Object3D", + ">", + "100" + ] + } + ], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Create9Patch" + }, + "parameters": [ + "", + "Platform", + "100", + "PlatformTop", + "PlatformTopCorner", + "PlatformTopSide", + "PlatformCenterCorner", + "PlatformCenterSide", + "PlatformBottomCorner", + "PlatformBottomSide", + "PlatformBottom", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Platform" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Platform", + "conditions": [], + "actions": [ + { + "type": { + "value": "Decorator::CreateRandomGrid" + }, + "parameters": [ + "", + "Grass3", + "400", + "Platform", + "20", + "" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Grass3", + "Object3D", + "=", + "Platform.Object3D::Z() + Platform.Object3D::Depth()" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Rotate" + }, + "parameters": [ + "Coin", + "45", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Test the nearest condition" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Collision3D::PickNearest" + }, + "parameters": [ + "", + "Coin", + "Bunny.CenterX()", + "Bunny.CenterY()", + "Bunny.Object3D::CenterZ()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Rotate" + }, + "parameters": [ + "Coin", + "180", + "" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Player controls", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Moving the Camera object along the X/Y plane with forces" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Up" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "z" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "w" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SimulateMoveForwardKey" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Down" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "s" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SimulateMoveBackwardKey" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Left" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "q" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "a" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SimulateTurnLeftKey" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SimulateMoveLeftKey" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Right" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "d" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SimulateTurnRightKey" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SimulateMoveRightKey" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Space" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"A\"", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "JumpButton", + "MultitouchButton", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SimulateJumpKey" + }, + "parameters": [ + "Camera", + "Jump3D", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AnyKeyPressed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "ControlKind", + "=", + "\"Keyboard\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "WalkJoystick", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Camera", + "=", + "WalkJoystick.StickAngle() + CameraAngle()" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SimulateMoveStick" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "-90", + "WalkJoystick.StickForce()", + "" + ] + }, + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "ControlKind", + "=", + "\"Touch\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "1", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Camera", + "=", + "Gamepads::StickAngle(1, \"Left\") + CameraAngle()" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SimulateMoveStick" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "-90", + "Gamepads::StickForce(1, \"Left\")", + "" + ] + }, + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "ControlKind", + "=", + "\"Gamepad\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Camera controls", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Camera object rotates along with the player's cursor, and the in game camera rotates based on the position of the Camera object" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "MouseButtonReleased" + }, + "parameters": [ + "", + "Left" + ] + }, + { + "type": { + "inverted": true, + "value": "MousePointerLock::isPointerLocked" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MousePointerLock::RequestPointerLock" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "MousePointerLock::isPointerLocked" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Camera", + "+", + "0.1 * MousePointerLock::MovementX()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Camera", + "Object3D", + "+", + "0.1 * MousePointerLock::MovementY()" + ] + } + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Camera", + "+", + "LookJoystick.StickForceX() * 4 * TimeDelta()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Camera", + "Object3D", + "+", + "LookJoystick.StickForceY() * 2 * TimeDelta()" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "1", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Camera", + "+", + "Gamepads::StickForceX(1, \"Right\") * TimeDelta()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Camera", + "Object3D", + "+", + "Gamepads::StickForceY(1, \"Right\") * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "ControlKind", + "=", + "\"Keyboard\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Camera", + "ThirdPersonCamera", + "=", + "0.125", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "ControlKind", + "!=", + "\"Keyboard\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Camera", + "ThirdPersonCamera", + "=", + "0.5", + "" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "Gamepads::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "1", + "\"Left\"", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "WalkJoystick", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Camera", + "ThirdPersonCamera", + "=", + "0.5", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the camera doesn't get upsidedown." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Camera", + "Object3D", + "=", + "clamp(Camera.RotationY(), -90, 90)" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtObject3D" + }, + "parameters": [ + "", + "Camera", + "Object3D", + "400", + "Camera.Angle() + 90", + "Camera.RotationY()", + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SeparateFromPlatforms" + }, + "parameters": [ + "Camera", + "Jump3D", + "Obstacle", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Jump3D::Jump3D::IsOnFloor" + }, + "parameters": [ + "Camera", + "Jump3D", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetFollowFreeAreaZMin" + }, + "parameters": [ + "Camera", + "ThirdPersonCamera", + "=", + "70", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::IsOnFloor" + }, + "parameters": [ + "Camera", + "Jump3D", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetFollowFreeAreaZMin" + }, + "parameters": [ + "Camera", + "ThirdPersonCamera", + "=", + "0", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Animation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Bunny", + "Object3D", + "=", + "Camera.Object3D::Z()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" + }, + "parameters": [ + "Bunny", + "Animation", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::IsJumping" + }, + "parameters": [ + "Camera", + "Jump3D", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Bunny", + "Animation", + "=", + "\"Jump\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Bunny", + "Tween3D", + "\"Stretch\"", + "1.5", + "0.15", + "\"easeOutCubic\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.15" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Bunny", + "Tween3D", + "\"Stretch\"", + "1", + "0.2", + "\"easeInOutCubic\"", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Jump3D::Jump3D::IsJumping" + }, + "parameters": [ + "Camera", + "Jump3D", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Bunny", + "Tween3D", + "\"Stretch\"", + "0.67", + "0.125", + "\"easeOutCubic\"", + "" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.125" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::TweenStretchZ" + }, + "parameters": [ + "Bunny", + "Tween3D", + "\"Stretch\"", + "1", + "0.25", + "\"easeInOutCubic\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::CurrentForwardSpeed" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "=", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Bunny", + "Animation", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::CurrentForwardSpeed" + }, + "parameters": [ + "Camera", + "TopDownWalk", + "!=", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Bunny", + "Animation", + "=", + "\"Run\"" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" + }, + "parameters": [ + "Bunny", + "Animation", + "=", + "Camera.TopDownWalk::CurrentForwardSpeed() / Camera.TopDownWalk::TranslationSpeedMax()" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Raycaster3D::RaycastBetweenPosition" + }, + "parameters": [ + "", + "ShadowReceiver", + "Bunny.X()", + "Bunny.Y()", + "Bunny.Object3D::Z()", + "Bunny.X()", + "Bunny.Y()", + "Bunny.Object3D::Z() - 1000", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Shadow", + "=", + "Bunny.Angle()" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Shadow", + "=", + "Bunny.X()", + "=", + "Bunny.Y()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Shadow", + "Object3D", + "=", + "Raycaster3D::IntersectionZ()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::IsOnFloor" + }, + "parameters": [ + "Camera", + "Jump3D", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + }, + { + "type": { + "inverted": true, + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "SmokeEmitter", + "Camera.CenterX()", + "Camera.CenterY()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetZ" + }, + "parameters": [ + "SmokeEmitter", + "=", + "Camera.Z()", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Test the distance condition" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Collision3D::AreWithinDistance" + }, + "parameters": [ + "", + "Bunny", + "Coin", + "50", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Coin", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "CoinExplosion", + "Coin.CenterX()", + "Coin.CenterY()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetZ" + }, + "parameters": [ + "CoinExplosion", + "=", + "Coin.Object3D::CenterZ()", + "" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "CoinExplosion", + "=", + "Bunny.Angle()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::Z" + }, + "parameters": [ + "Crate", + "Object3D", + "<", + "-30" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Crate", + "Object3D", + "=", + "lerp(Crate.Object3D::Z(), -30, 10 * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Test the separate action" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Collision3D::SeparateFromObjects" + }, + "parameters": [ + "", + "Crate", + "Object3D", + "Crate", + "Object3D", + "" + ] + }, + { + "type": { + "value": "Collision3D::SeparateFromObjects" + }, + "parameters": [ + "", + "Crate", + "Object3D", + "Platform", + "Object3D", + "" + ] + }, + { + "type": { + "value": "Collision3D::SeparateFromObjects" + }, + "parameters": [ + "", + "Crate", + "Object3D", + "Bunny", + "Object3D", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Smoke test distance expressions" + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Collision3D::Distance(Bunny, Bunny)", + "=", + "Collision3D::SqDistance(Bunny, Bunny)" + ] + } + ], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Collision3D::DistanceToPosition(Bunny, 0, 0, 0)", + "=", + "Collision3D::SqDistanceToPosition(Bunny, 0, 0, 0)" + ] + } + ], + "actions": [] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Rotate" + }, + "parameters": [ + "Platform9Patch", + "45", + "" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Platform9Patch", + "Object3D", + "+", + "TimeDelta() * 45" + ] + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 196608, + "ambientLightColorG": 0, + "ambientLightColorR": 8126128, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "3d", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "Effect2", + "doubleParameters": { + "elevation": 70, + "intensity": 1.5, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "127;127;127", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + } + ] + }, + { + "ambientLightColorB": 8908016, + "ambientLightColorG": 0, + "ambientLightColorR": 6071712, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "MobileUI", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "Crosshair", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Light", + "doubleParameters": { + "elevation": 45, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "64;64;64", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + } + ] + } + ], + "behaviorsSharedData": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Jump3D", + "type": "Jump3D::Jump3D" + }, + { + "name": "MultitouchButton", + "type": "SpriteMultitouchJoystick::MultitouchButton" + }, + { + "name": "Object3D", + "type": "Scene3D::Base3DBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "Sticker", + "type": "Sticker::Sticker" + }, + { + "name": "ThirdPersonCamera", + "type": "ThirdPersonCamera::ThirdPersonCamera" + }, + { + "name": "TopDownWalk", + "type": "Walk3D::Walk3D" + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + }, + { + "name": "Tween3D", + "type": "Tween3D::Tween3D" + } + ] + } + ], + "externalEvents": [], + "eventsFunctionsExtensions": [ + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Panel sprite button", + "helpPath": "/objects/button", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", + "name": "PanelSpriteButton", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", + "shortDescription": "A button that can be customized.", + "version": "1.4.4", + "description": [ + "The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", + "", + "There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)." + ], + "origin": { + "identifier": "PanelSpriteButton", + "name": "gdevelop-extension-store" + }, + "tags": [ + "button", + "ui" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "The finite state machine used internally by the button object.", + "fullName": "Button finite state machine", + "name": "ButtonFSM", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Finite state machine", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The \"Validated\" state only last one frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Check position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the cursor position is only checked once per frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyShouldCheckHovering" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Touches are always pressed, so ShouldCheckHovering doesn't matter." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", + "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch start", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply position changes", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch end", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "Object.Behavior::PropertyTouchId()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + }, + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::ResetState" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the state of the button.", + "fullName": "Reset state", + "functionType": "Action", + "name": "ResetState", + "private": true, + "sentence": "Reset the button state of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed outside with mouse or touch.", + "fullName": "Is held outside", + "functionType": "Condition", + "name": "IsPressedOutside", + "sentence": "_PARAM0_ is held outside", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the touch id that is using the button or 0 if none.", + "fullName": "Touch id", + "functionType": "ExpressionAndCondition", + "name": "TouchId", + "sentence": "the touch id", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyTouchId()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteButton::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Should check hovering", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldCheckHovering" + }, + { + "value": "Idle", + "type": "Choice", + "label": "State", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Hovered", + "PressedInside", + "PressedOutside", + "Validated" + ], + "hidden": true, + "name": "State" + }, + { + "value": "0", + "type": "Number", + "label": "Touch id", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Boolean", + "label": "Touch is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIsInside" + }, + { + "value": "", + "type": "Boolean", + "label": "Mouse is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "MouseIsInside" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Index" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "defaultName": "Button", + "description": "A button that can be customized.", + "fullName": "Button (panel sprite)", + "name": "PanelSpriteButton", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create one background instance for of each state.\nOnly the instance for the current state is shown." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Idle", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Hovered", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Pressed", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Hovered", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Place the label over the backgrounds." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Label", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Label", + "=", + "2" + ] + }, + { + "type": { + "value": "TextObject::SetWrapping" + }, + "parameters": [ + "Label", + "yes" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Show the right background accordingly to the new state." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Idle", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Visible" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + }, + "parameters": [ + "Object", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Hovered", + "Tween", + "\"Fadeout\"", + "0", + "\"linear\"", + "Object.PropertyHoveredFadeOutDuration() * 1000", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + }, + "parameters": [ + "Object", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteObject::Opacity" + }, + "parameters": [ + "Hovered", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "PanelSpriteObject::SetOpacity" + }, + "parameters": [ + "Hovered", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsHovered" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Hovered", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Hovered", + "Tween", + "\"Fadeout\"" + ] + }, + { + "type": { + "value": "PanelSpriteObject::SetOpacity" + }, + "parameters": [ + "Hovered", + "=", + "255" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY() + Object.PropertyPressedLabelOffsetY()" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Hovered" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Pressed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Idle" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Hovered", + "" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Pressed" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Resize", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Children instances must be resized when the button size change:\n- backgrounds for each state are resized to take the full dimensions of the button\n- the label is put back at the center of the button\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Width()", + "!=", + "max(Idle.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Idle.BoundingBoxLeft(), Label.BoundingBoxLeft())" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Height()", + "!=", + "max(Idle.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Idle.BoundingBoxTop(), Label.BoundingBoxTop())" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Idle", + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Idle", + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteButton::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Idle.Variable(Width)" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Idle.Variable(Height)" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsIdle" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsClicked" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsHovered" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsFocused" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::ButtonFSM::IsPressed" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change the text of the button label.", + "fullName": "Label text", + "functionType": "Action", + "name": "SetLabelText", + "sentence": "Change the text of _PARAM0_ to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextObject::String" + }, + "parameters": [ + "Label", + "=", + "GetArgumentAsString(\"LabelText\")" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + }, + { + "description": "Text", + "name": "LabelText", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Return the label text.", + "fullName": "Label text", + "functionType": "StringExpression", + "name": "LabelText", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Label.String()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the label center Y according to the button configuration. This expression is used in doStepPostEvents when the button is pressed or released.", + "fullName": "", + "functionType": "Expression", + "name": "CenterWithPaddingY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Idle.CenterY() + (Object.PropertyTopPadding() - Object.PropertyBottomPadding()) / 2" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Center the label according to the button configuration. This is used in doStepPostEvents when the button is resized.", + "fullName": "", + "functionType": "Action", + "name": "CenterLabel", + "private": true, + "sentence": "Center the label of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Label", + "=", + "Object.PropertyLeftPadding()", + "=", + "Object.PropertyTopPadding()" + ] + }, + { + "type": { + "value": "TextObject::WrappingWidth" + }, + "parameters": [ + "Label", + "=", + "Idle.Width() - Object.PropertyLeftPadding() - Object.PropertyRightPadding()" + ] + }, + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "Object.CenterWithPaddingY()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "Label", + "=", + "Background.CenterX() + (Object.PropertyLeftPadding() - Object.PropertyRightPadding()) / 2" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Label", + "+", + "Object.PropertyPressedLabelOffsetY()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ] + }, + { + "description": "De/activate interactions with the button.", + "fullName": "De/activate interactions", + "functionType": "Action", + "name": "Activate", + "sentence": "Activate interactions with _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Idle", + "ButtonFSM", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if interactions are activated on the button.", + "fullName": "Interactions activated", + "functionType": "Condition", + "name": "IsActivated", + "sentence": "Interactions on _PARAM0_ are activated", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Idle", + "ButtonFSM" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "Label offset on Y axis when pressed", + "description": "", + "group": "", + "extraInformation": [], + "name": "PressedLabelOffsetY" + }, + { + "value": "0", + "type": "Number", + "label": "Left padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "LeftPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Right padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "RightPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Top padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "TopPadding" + }, + { + "value": "0", + "type": "Number", + "label": "Bottom padding", + "description": "", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "BottomPadding" + }, + { + "value": "0.25", + "type": "Number", + "label": "Hovered fade out duration (in seconds)", + "description": "", + "group": "", + "extraInformation": [], + "name": "HoveredFadeOutDuration" + } + ], + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Text", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + } + } + ] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "Advanced 3D tween (experimental)", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXRlbm5pcy1iYWxsIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEyLDJDMTQuNSwyIDE2Ljc1LDIuOSAxOC41LDQuNEMxNi4zNiw2LjIzIDE1LDguOTYgMTUsMTJDMTUsMTUuMDQgMTYuMzYsMTcuNzcgMTguNSwxOS42QzE2Ljc1LDIxLjEgMTQuNSwyMiAxMiwyMkM5LjUsMjIgNy4yNSwyMS4xIDUuNSwxOS42QzcuNjQsMTcuNzcgOSwxNS4wNCA5LDEyQzksOC45NiA3LjY0LDYuMjMgNS41LDQuNEM3LjI1LDIuOSA5LjUsMiAxMiwyTTIyLDEyQzIyLDE0LjMyIDIxLjIxLDE2LjQ1IDE5Ljg4LDE4LjE1QzE4LjEyLDE2LjY4IDE3LDE0LjQ3IDE3LDEyQzE3LDkuNTMgMTguMTIsNy4zMiAxOS44OCw1Ljg1QzIxLjIxLDcuNTUgMjIsOS42OCAyMiwxMk0yLDEyQzIsOS42OCAyLjc5LDcuNTUgNC4xMiw1Ljg1QzUuODgsNy4zMiA3LDkuNTMgNywxMkM3LDE0LjQ3IDUuODgsMTYuNjggNC4xMiwxOC4xNUMyLjc5LDE2LjQ1IDIsMTQuMzIgMiwxMloiIC8+PC9zdmc+", + "name": "Tween3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/30bc03f9cf5f2f42960246a605352a6937ae6b603f0177396a83193849a4724a_tennis-ball.svg", + "shortDescription": "Smoothly squash, strentch and wobble 3D models.", + "version": "0.1.0", + "description": [ + "Change 3D models proportions over time to make smooth animations like wobbling.", + "", + "It's used in this example:", + "* a 3D Bomberman-like game ([open the project online](https://editor.gdevelop.io/?project=example://3d-bomber-bunny))", + "", + "Breaking changes of 0.1.0:", + "- The Tween behavior is now required by the 3D Tween behavior. Add the Tween behavior on any object that uses the 3D Tween behavior" + ], + "origin": { + "identifier": "Tween3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "tween", + "smooth", + "interpolation", + "wobble" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "the stretch on Z axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Z in proportion to the dimensions on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ExpressionAndCondition", + "name": "StretchZ", + "private": true, + "sentence": "the stretch on Z axis of _PARAM1_ (it no longer does anything, use the one from 3D tween behavior instead)", + "events": [], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchZ", + "name": "SetStretchZ", + "private": true, + "sentence": "", + "events": [], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the stretch on Y axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Y in proportion to the dimensions on X and Z.", + "fullName": "Stretch on Y axis", + "functionType": "ExpressionAndCondition", + "name": "StretchY", + "private": true, + "sentence": "the stretch on Y axis of _PARAM1_ (it no longer does anything, use the one from 3D tween behavior instead)", + "events": [], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchY", + "name": "SetStretchY", + "private": true, + "sentence": "", + "events": [], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the scale volume.", + "fullName": "Scale volume", + "functionType": "ExpressionAndCondition", + "name": "ScaleVolume", + "private": true, + "sentence": "the scale volume of _PARAM1_ (it no longer does anything, use the one from 3D tween behavior instead)", + "events": [], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "ScaleVolume", + "name": "SetScaleVolume", + "private": true, + "sentence": "", + "events": [], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Exponentially tween bewteen 2 values according to an easing function.", + "fullName": "Ease exponentially", + "functionType": "Expression", + "name": "EaseExp", + "private": true, + "sentence": "the exponent-tweened value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "exp(Tween::Ease(GetArgumentAsString(\"Easing\"), log(GetArgumentAsNumber(\"InitialValue\")), log(GetArgumentAsNumber(\"TargetedValue\")), GetArgumentAsNumber(\"Weighting\")))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Easing", + "name": "Easing", + "type": "string" + }, + { + "description": "Initial value", + "name": "InitialValue", + "type": "expression" + }, + { + "description": "Targeted value", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Weighting", + "name": "Weighting", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Smoothly animate scale and rotation of 3d models.", + "fullName": "3D tween (experimental)", + "name": "Tween3D", + "objectType": "", + "eventsFunctions": [ + { + "description": "the stretch on Z axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Z in proportion to the dimensions on X and Y.", + "fullName": "Stretch on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Size", + "name": "StretchZ", + "sentence": "the stretch on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Object3D::ScaleZ() / sqrt(Object.Scale::X() * Object.Scale::Y())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchZ", + "name": "SetStretchZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Volume", + "=", + "Object.Behavior::ScaleVolume()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetScaleZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.SurfaceRatio", + "=", + "sqrt((Variable(_Tween3D.Volume) / Object.Object3D::ScaleZ()) / (Object.Scale::X() * Object.Scale::Y()))" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the stretch on Y axis. The object volume is conserved. A stretch of 2 makes the object appear 2 times longer on Y in proportion to the dimensions on X and Z.", + "fullName": "Stretch on Y axis", + "functionType": "ExpressionAndCondition", + "group": "Size", + "name": "StretchY", + "sentence": "the stretch on Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Scale::Y() / sqrt(Object.Scale::X() * Object.Object3D::ScaleZ())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "StretchY", + "name": "SetStretchY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Volume", + "=", + "Object.Behavior::ScaleVolume()" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Object", + "Scale", + "=", + "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.SurfaceRatio", + "=", + "sqrt((Variable(_Tween3D.Volume) / Object.Object3D::ScaleZ()) / (Object.Scale::X() * Object.Scale::Y()))" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetScaleZ" + }, + "parameters": [ + "Object", + "Object3D", + "*", + "Variable(_Tween3D.SurfaceRatio)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the scale volume.", + "fullName": "Scale volume", + "functionType": "ExpressionAndCondition", + "group": "Size", + "name": "ScaleVolume", + "sentence": "the scale volume", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Scale::X() * Object.Scale::Y() * Object.Object3D::ScaleZ()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Stretch on Z axis", + "functionType": "ActionWithOperator", + "getterName": "ScaleVolume", + "name": "SetScaleVolume", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Ratio", + "=", + "pow(GetArgumentAsNumber(\"Value\") / Object.Behavior::ScaleVolume(), 1 / 3)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetScaleZ" + }, + "parameters": [ + "Object", + "Object3D", + "*", + "Variable(_Tween3D.Ratio)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetY" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.Ratio)" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetX" + }, + "parameters": [ + "Object", + "Scale", + "*", + "Variable(_Tween3D.Ratio)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Scalable capacity", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "Stretch ratio", + "name": "StretchRatio", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object stretch Z from its current value to a new one. The stretch can never be 0 or less.", + "fullName": "Tween stretch Z", + "functionType": "Action", + "group": "Size", + "name": "TweenStretchZ", + "sentence": "Tween the stretch Z of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"StretchZ\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch on Z axis", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object stretch Y from its current value to a new one. The stretch can never be 0 or less.", + "fullName": "Tween stretch Y", + "functionType": "Action", + "group": "Size", + "name": "TweenStretchY", + "sentence": "Tween the stretch Y of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"StretchY\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch on Y axis", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object scale volume from its current value to a new one. The scale volume can never be 0 or less.", + "fullName": "Tween scale volume", + "functionType": "Action", + "group": "Size", + "name": "TweenScaleVolume", + "sentence": "Tween the scale volume of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"Easing\")", + "\"ScaleVolume\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Scale volume", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object Z position from its current value to a new one.", + "fullName": "Tween Z position (deprecated)", + "functionType": "Action", + "group": "Position", + "name": "TweenPositionZ", + "private": true, + "sentence": "Tween the Z position of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectPositionZTween2" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation X in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object depth from its current value to a new one.", + "fullName": "Tween depth (Z size) (deprecated)", + "functionType": "Action", + "group": "Position", + "name": "TweenDepth", + "private": true, + "sentence": "Tween the depth of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectDepthTween2" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation X in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object X rotation from its current value to a new one.", + "fullName": "Tween X rotation (deprecated)", + "functionType": "Action", + "group": "Angle", + "name": "TweenRotationX", + "private": true, + "sentence": "Tween the X rotation of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectRotationXTween" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation X in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object Y rotation from its current value to a new one.", + "fullName": "Tween rotation Y (deprecated)", + "functionType": "Action", + "group": "Angle", + "name": "TweenRotationY", + "private": true, + "sentence": "Tween the Y rotation of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectRotationYTween" + }, + "parameters": [ + "Object", + "Tween", + "Object3D", + "GetArgumentAsString(\"TweenIdentifier\")", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsNumber(\"Duration\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Rotation Y in degree", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Index", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(_Tween3D.Tweens)", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "_Tween3D.Identifier", + "=", + "Object.Behavior::TweenIdentifier(Variable(_Tween3D.Index))" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::IsPlaying" + }, + "parameters": [ + "Object", + "Behavior", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(Object.Behavior::Time(VariableString(_Tween3D.Identifier)) + TimeDelta() * LayerTimeScale(Object.Layer()), Object.Behavior::Duration(VariableString(_Tween3D.Identifier)))", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"StretchZ\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ExponentTweenedValue(VariableString(_Tween3D.Identifier))", + "Object3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"StretchY\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ExponentTweenedValue(VariableString(_Tween3D.Identifier))", + "Object3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Type" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"ScaleVolume\"", + "VariableString(_Tween3D.Identifier)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetScaleVolume" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ExponentTweenedValue(VariableString(_Tween3D.Identifier))", + "Object3D" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Tween3D.Index", + "+", + "1" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the tweened value", + "fullName": "Tweened value", + "functionType": "ExpressionAndCondition", + "name": "TweenedValue", + "private": true, + "sentence": "the value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Tween::Ease(Object.Behavior::Easing(VariableString(_Tween3D.Identifier)), Object.Behavior::InitialValue(VariableString(_Tween3D.Identifier)), Object.Behavior::TargetedValue(VariableString(_Tween3D.Identifier)), Object.Behavior::Progress(VariableString(_Tween3D.Identifier)))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the exponent-tweened value", + "fullName": "Tweened value (exponent)", + "functionType": "ExpressionAndCondition", + "name": "ExponentTweenedValue", + "private": true, + "sentence": "the exponent-tweened value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Tween3D::EaseExp(Object.Behavior::Easing(VariableString(_Tween3D.Identifier)), Object.Behavior::InitialValue(VariableString(_Tween3D.Identifier)), Object.Behavior::TargetedValue(VariableString(_Tween3D.Identifier)), Object.Behavior::Progress(VariableString(_Tween3D.Identifier)))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "Start tween", + "functionType": "Action", + "name": "StartTween", + "private": true, + "sentence": "Tween the _PARAM6_ of object _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with _PARAM5_ easing as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::InvalidateTweenIdentifiers" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Type\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Duration\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Easing\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::SetTargetedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetedValue\")", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"StretchZ\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::StretchZ()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"StretchY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::StretchY()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"ScaleVolume\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ScaleVolume()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"PositionZ\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Object3D::Z()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"RotationX\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Type\"", + "=", + "\"RotationY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Object3D::RotationY()", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + { + "description": "Type", + "name": "Type", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "the tween type", + "fullName": "Type", + "functionType": "ExpressionAndCondition", + "name": "Type", + "private": true, + "sentence": "the type of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Type", + "name": "SetType", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the elapsed time", + "fullName": "Time", + "functionType": "ExpressionAndCondition", + "name": "Time", + "private": true, + "sentence": "the elapsed time of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Time", + "name": "SetTime", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween duration", + "fullName": "Duration", + "functionType": "ExpressionAndCondition", + "name": "Duration", + "private": true, + "sentence": "the duration of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Duration", + "name": "SetDuration", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween easing", + "fullName": "Easing", + "functionType": "ExpressionAndCondition", + "name": "Easing", + "private": true, + "sentence": "the easing of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing)" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Easing", + "name": "SetEasing", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjetTxt" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween initial value", + "fullName": "Initial value", + "functionType": "ExpressionAndCondition", + "name": "InitialValue", + "private": true, + "sentence": "the initial value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].InitialValue)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "InitialValue", + "name": "SetInitialValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].InitialValue", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween targeted value", + "fullName": "Targeted value", + "functionType": "ExpressionAndCondition", + "name": "TargetedValue", + "private": true, + "sentence": "the targeted value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].TargetedValue)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween is paused", + "fullName": "Paused", + "functionType": "Condition", + "name": "IsPaused", + "private": true, + "sentence": "The tween _PARAM2_ of _PARAM0_ is paused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Change if the tween is paused", + "fullName": "Paused", + "functionType": "Action", + "name": "SetPaused", + "private": true, + "sentence": "The tween _PARAM2_ of _PARAM0_ is paused: _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"IsPaused\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"IsPaused\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "False" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Paused", + "name": "IsPaused", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TargetedValue", + "name": "SetTargetedValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].TargetedValue", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Stop the running tween animation.", + "fullName": "Stop a tween", + "functionType": "Action", + "name": "StopTween", + "sentence": "Stop the tween _PARAM2_ on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"JumpToEnd\"" + ] + } + ], + "actions": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Jump to end", + "name": "JumpToEnd", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Pause the running tween animation.", + "fullName": "Pause a tween", + "functionType": "Action", + "name": "PauseTween", + "sentence": "Pause the tween _PARAM2_ on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetPaused" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "yes", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Resume the tween animation.", + "fullName": "Resume a tween", + "functionType": "Action", + "name": "ResumeTween", + "sentence": "Resume the tween _PARAM2_ on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetPaused" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "no", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Remove the tween animation from the object.", + "fullName": "Remove a tween", + "functionType": "Action", + "name": "RemoveTween", + "sentence": "Remove the tween _PARAM2_ from _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariableRemoveChild" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens", + "GetArgumentAsString(\"TweenIdentifier\")" + ] + }, + { + "type": { + "value": "Tween3D::Tween3D::InvalidateTweenIdentifiers" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween animation exists.", + "fullName": "Tween exists", + "functionType": "Condition", + "name": "Exists", + "sentence": "Tween _PARAM2_ on _PARAM0_ exists", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableChildExists" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens", + "GetArgumentAsString(\"TweenIdentifier\")" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween animation is currently playing.", + "fullName": "Tween is playing", + "functionType": "Condition", + "name": "IsPlaying", + "sentence": "Tween _PARAM2_ on _PARAM0_ is playing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "Tween3D::Tween3D::HasFinished" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "Tween3D::Tween3D::IsPaused" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the tween animation has finished playing.", + "fullName": "Tween finished playing", + "functionType": "Condition", + "name": "HasFinished", + "sentence": "Tween _PARAM2_ on _PARAM0_ has finished playing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Progress" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "1", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the progress of a tween (between 0.0 and 1.0).", + "fullName": "Progress of a tween", + "functionType": "ExpressionAndCondition", + "name": "Progress", + "sentence": "the progress of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Tween3D::Exists" + }, + "parameters": [ + "Object", + "Behavior", + "GetArgumentAsString(\"TweenIdentifier\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::Time(GetArgumentAsString(\"TweenIdentifier\")) / Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "Return the tween identifier for a given index.", + "fullName": "Tween identifier", + "functionType": "StringExpression", + "name": "TweenIdentifier", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "", + "const childIndex = eventsFunctionContext.getArgument(\"ChildIndex\");", + "", + "object.__Tween3D = object.__Tween3D || {};", + "object.__Tween3D.variableIdentifiers =", + " object.__Tween3D.variableIdentifiers", + " || Object.keys(object.getVariables().get(\"_Tween3D\").getChild(\"Tweens\").getAllChildren());", + "", + "eventsFunctionContext.returnValue = object.__Tween3D.variableIdentifiers[childIndex];", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Child index", + "name": "ChildIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Invalidate tween identifiers.", + "fullName": "Invalidate tween identifiers", + "functionType": "Action", + "name": "InvalidateTweenIdentifiers", + "private": true, + "sentence": "Invalidate tween identifiers of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "", + "object.__Tween3D = object.__Tween3D || {};", + "object.__Tween3D.variableIdentifiers = null;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "", + "type": "Behavior", + "label": "Scalable capacity", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "name": "Tween" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Squash and stretch a 3D model in loop.", + "fullName": "3D wobble", + "name": "Wobble", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::UpdateScaleVolume" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::UpdateStretch" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Tween", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PropertyScaleMinTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::TimeDelta()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Tween3D::EaseExp(Object.Behavior::PropertyScaleMinTweenEasing(), Object.Behavior::PropertyScaleMinTweenInitialValue(), Object.Behavior::PropertyScaleMinTweenTarget(), Object.Behavior::PropertyScaleMinTweenTime() / Object.Behavior::PropertyScaleMinTweenDuration())" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "Object.Behavior::PropertyScaleMinTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyScaleMinTweenTarget()" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::PropertyScaleMaxTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::TimeDelta()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Tween3D::EaseExp(Object.Behavior::PropertyScaleMaxTweenEasing(), Object.Behavior::PropertyScaleMaxTweenInitialValue(), Object.Behavior::PropertyScaleMaxTweenTarget(), Object.Behavior::PropertyScaleMaxTweenTime() / Object.Behavior::PropertyScaleMaxTweenDuration())" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "Object.Behavior::PropertyScaleMaxTweenDuration()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyScaleMinTweenTarget()" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Wobble", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::UpdateScaleVolume" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::UpdateStretch" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyAngle" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "mod(Object.Behavior::TimeDelta() * 2 * Pi()\n / Object.Behavior::PropertyPeriodDuration(), 2 * Pi())" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum scale volume of the object.", + "fullName": "Minimum scale volume", + "functionType": "ExpressionAndCondition", + "group": "3D wobble scale configuration", + "name": "ScaleMin", + "sentence": "the minimum scale volume", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyScaleMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScaleMin", + "name": "SetScaleMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum scale volume of the object.", + "fullName": "Maximum scale volume", + "functionType": "ExpressionAndCondition", + "group": "3D wobble scale configuration", + "name": "ScaleMax", + "sentence": "the maximum scale volume", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyScaleMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScaleMax", + "name": "SetScaleMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens the minimum scale volume from its current value to a new one. The scale volume can never be 0 or less.", + "fullName": "Tween minimum scale volume", + "functionType": "Action", + "group": "3D wobble scale configuration", + "name": "TweenScaleMin", + "sentence": "Tween the minimum scale volume of object _PARAM0_ to _PARAM2_ over _PARAM3_ seconds with _PARAM4_ easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ScaleMin()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenTarget" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetedValue\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Duration\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMinTweenEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Easing\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + }, + { + "description": "Minimum scale volume", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens the maximum scale volume from its current value to a new one. The scale volume can never be 0 or less.", + "fullName": "Tween maximum scale volume", + "functionType": "Action", + "group": "3D wobble scale configuration", + "name": "TweenScaleMax", + "sentence": "Tween the maximum scale volume of object _PARAM0_ to _PARAM2_ over _PARAM3_ seconds with _PARAM4_ easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::ScaleMax()" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenTarget" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"TargetedValue\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Duration\")" + ] + }, + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScaleMaxTweenEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Easing\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + }, + { + "description": "Maximum scale volume", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "fullName": "Time delta", + "functionType": "Expression", + "name": "TimeDelta", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TimeDelta() * LayerTimeScale(Object.Layer())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update scale volume", + "functionType": "Action", + "name": "UpdateScaleVolume", + "private": true, + "sentence": "Update scale volume of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetScaleVolume" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "exp(log(Object.Behavior::PropertyScaleMin()) + (log(Object.Behavior::PropertyScaleMax()) - log(Object.Behavior::PropertyScaleMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyScalePeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "Object3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update stretch", + "functionType": "Action", + "name": "UpdateStretch", + "private": true, + "sentence": "Update stretch of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Z+\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchZ" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "exp(log(Object.Behavior::PropertyStretchMin()) + (log(Object.Behavior::PropertyStretchMax()) - log(Object.Behavior::PropertyStretchMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyStretchPeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "Object3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween3D::Wobble::PropertyTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y-\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::SetStretchY" + }, + "parameters": [ + "Object", + "Tween3D", + "=", + "exp(log(Object.Behavior::PropertyStretchMin()) + (log(Object.Behavior::PropertyStretchMax()) - log(Object.Behavior::PropertyStretchMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyStretchPeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "Object3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the cycle duration of the object.", + "fullName": "Cycle duration", + "functionType": "ExpressionAndCondition", + "group": "3D wobble configuration", + "name": "PeriodDuration", + "sentence": "the cycle duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyPeriodDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PeriodDuration", + "name": "SetPeriodDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyPeriodDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the scale cycle offset of the object.", + "fullName": "Scale cycle offset", + "functionType": "ExpressionAndCondition", + "group": "3D wobble scale configuration", + "name": "ScalePeriodOffset", + "sentence": "the scale cycle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyScalePeriodOffset()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScalePeriodOffset", + "name": "SetScalePeriodOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyScalePeriodOffset" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the minimum stretch of the object.", + "fullName": "Minimum stretch", + "functionType": "ExpressionAndCondition", + "group": "3D wobble stretch configuration", + "name": "StretchMin", + "sentence": "the minimum stretch", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyStretchMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StretchMin", + "name": "SetStretchMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyStretchMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum stretch of the object.", + "fullName": "Maximum stretch", + "functionType": "ExpressionAndCondition", + "group": "3D wobble stretch configuration", + "name": "StretchMax", + "sentence": "the maximum stretch", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyStretchMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StretchMax", + "name": "SetStretchMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyStretchMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the stretch cycle offset of the object.", + "fullName": "Stretch cycle offset", + "functionType": "ExpressionAndCondition", + "group": "3D wobble stretch configuration", + "name": "StretchPeriodOffset", + "sentence": "the stretch cycle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyStretchPeriodOffset()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StretchPeriodOffset", + "name": "SetStretchPeriodOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Wobble::SetPropertyStretchPeriodOffset" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Wobble", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.75", + "type": "Number", + "unit": "Dimensionless", + "label": "Minimum scale volume", + "description": "", + "group": "Scale", + "extraInformation": [], + "name": "ScaleMin" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Maximum scale volume", + "description": "", + "group": "Scale", + "extraInformation": [], + "name": "ScaleMax" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Cycle duration", + "description": "", + "group": "", + "extraInformation": [], + "name": "PeriodDuration" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Scale cycle offset", + "description": "", + "group": "Scale", + "extraInformation": [], + "name": "ScalePeriodOffset" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Minimum stretch", + "description": "", + "group": "Stretch", + "extraInformation": [], + "name": "StretchMin" + }, + { + "value": "1.25", + "type": "Number", + "unit": "Dimensionless", + "label": "Maximum stretch", + "description": "", + "group": "Stretch", + "extraInformation": [], + "name": "StretchMax" + }, + { + "value": "-0.25", + "type": "Number", + "unit": "Second", + "label": "Stretch cycle offset", + "description": "", + "group": "Stretch", + "extraInformation": [], + "name": "StretchPeriodOffset" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Angle" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenTarget" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenDuration" + }, + { + "value": "", + "type": "String", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenEasing" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenTarget" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenDuration" + }, + { + "value": "", + "type": "String", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenEasing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenTime" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenTime" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMinTweenInitialValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ScaleMaxTweenInitialValue" + }, + { + "value": "Z+", + "type": "Choice", + "label": "Top orientation", + "description": "", + "group": "", + "extraInformation": [ + "Z+", + "Y-" + ], + "name": "Top" + }, + { + "value": "", + "type": "Behavior", + "label": "3D tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween3D::Tween3D" + ], + "name": "Tween3D" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Third person camera", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSI3LDEwIDEsMTMgNywxNiAxMywxMyAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjEsMTMgMSwyMCA3LDIzIDEzLDIwIDEzLDEzICIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjciIHkxPSIxNiIgeDI9IjciIHkyPSIyMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMxIiB5MT0iMTYiIHgyPSIyMSIgeTI9IjgiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyMSIgeTE9IjI0IiB4Mj0iMzEiIHkyPSIxNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIyLjcsMjIuNkMyMCwyMS43LDE4LDE5LjEsMTgsMTZjMC0zLjEsMi01LjcsNC43LTYuNiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTE5LjgsMTEuM2MxLjQsMS4xLDIuMiwyLjgsMi4yLDQuN2MwLDEuOS0wLjksMy42LTIuMiw0LjciLz4NCjwvc3ZnPg0K", + "name": "ThirdPersonCamera", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Virtual Reality/94e95d2c318e1f3dc7151a351024e13c574e1e44669c6696aa107d60230073f6_Virtual Reality_3d_vision_eye_vr.svg", + "shortDescription": "Move the camera to look at an object from a given distance.", + "version": "1.2.1", + "description": [ + "Move the camera to look at an object from a given distance with a rotation and an elevation angles.", + "", + "It can be useful for:", + "- Third person camera", + "- Isometric-like point of view", + "" + ], + "origin": { + "identifier": "ThirdPersonCamera", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "camera" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Move the camera to look at a position from a distance.", + "fullName": "Look at a position from a distance (deprecated)", + "functionType": "Action", + "name": "LookFromDistanceAtPosition", + "private": true, + "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_; _PARAM2_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "=", + "GetArgumentAsNumber(\"PositionX\") + GetArgumentAsNumber(\"Distance\") * cos(ToRad(GetArgumentAsNumber(\"RotationAngle\") + 90)) * cos(ToRad(GetArgumentAsNumber(\"ElevationAngle\")))", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "=", + "GetArgumentAsNumber(\"PositionY\") + GetArgumentAsNumber(\"Distance\") * sin(ToRad(GetArgumentAsNumber(\"RotationAngle\") + 90)) * cos(ToRad(GetArgumentAsNumber(\"ElevationAngle\")))", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "GetArgumentAsNumber(\"Distance\") * sin(ToRad(GetArgumentAsNumber(\"ElevationAngle\")))", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "Scene3D::TurnCameraTowardPosition" + }, + "parameters": [ + "", + "GetArgumentAsNumber(\"PositionX\")", + "GetArgumentAsNumber(\"PositionY\")", + "0", + "GetArgumentAsString(\"Layer\")", + "", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Position on X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Position on Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look at an object from a distance.", + "fullName": "Look at an object from a distance (deprecated)", + "functionType": "Action", + "name": "LookFromDistanceAtObject", + "private": true, + "sentence": "Move the camera of _PARAM5_ to look at _PARAM1_ from _PARAM2_ pixels with a rotation of _PARAM3_° and an elevation of _PARAM4_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition" + }, + "parameters": [ + "", + "Object.CenterX()", + "Object.CenterY()", + "GetArgumentAsNumber(\"Distance\")", + "GetArgumentAsNumber(\"RotationAngle\")", + "GetArgumentAsNumber(\"ElevationAngle\")", + "GetArgumentAsString(\"Layer\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look at a position from a distance.", + "fullName": "Look at a position from a distance", + "functionType": "Action", + "name": "LookFromDistanceAtPosition3D", + "sentence": "Move the camera of _PARAM7_ to look at _PARAM1_; _PARAM2_; _PARAM3_ from _PARAM4_ pixels with a rotation of _PARAM5_° and an elevation of _PARAM6_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "=", + "PositionX + Distance * cos(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "=", + "PositionY + Distance * sin(ToRad(RotationAngle + 90)) * cos(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "PositionZ + Distance * sin(ToRad(ElevationAngle))", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationX" + }, + "parameters": [ + "", + "=", + "90 - ElevationAngle", + "Layer", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationY" + }, + "parameters": [ + "", + "=", + "0", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "RotationAngle", + "Layer", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Position on X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Position on Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Position on Z axis", + "name": "PositionZ", + "type": "expression" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look at an object from a distance.", + "fullName": "Look at an object from a distance", + "functionType": "Action", + "group": "Layers and cameras", + "name": "LookFromDistanceAtObject3D", + "sentence": "Move the camera of _PARAM6_ to look at _PARAM1_ from _PARAM3_ pixels with a rotation of _PARAM4_° and an elevation of _PARAM5_°", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" + }, + "parameters": [ + "", + "Object.CenterX()", + "Object.CenterY()", + "Object.Object3D::CenterZ()", + "Distance", + "RotationAngle", + "ElevationAngle", + "Layer", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Rotation angle (around Z axis)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Elevation angle (around Y axis)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Smoothly follow an object at a distance.", + "fullName": "Third person camera", + "name": "ThirdPersonCamera", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update private properties through setters to check their values and initialize state." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyRotationHalfwayDuration()", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetTranslationZHalfwayDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyTranslationZHalfwayDuration()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ThirdPersonCamera::ThirdPersonCamera::PropertyIsCalledManually" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", + "fullName": "Move the camera closer", + "functionType": "Action", + "name": "MoveCameraCloser", + "sentence": "Move the camera closer to _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyIsCalledManually" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera closer to the object.", + "fullName": "Do move the camera closer", + "functionType": "Action", + "name": "DoMoveCameraCloser", + "private": true, + "sentence": "Do move the camera closer _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * (1 - speed)\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * (1 - speed)\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * (1 - speed)^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln((1 - speed)))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough." + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Z translation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::PropertyCameraZ" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::FreeAreaZMin()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyCameraZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::FreeAreaZMin() + (CameraZ - Object.Behavior::FreeAreaZMin()) * exp(TimeDelta() * TranslationZLogSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::PropertyCameraZ" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::FreeAreaZMax()" + ] + } + ], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyCameraZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::FreeAreaZMax() + (CameraZ - Object.Behavior::FreeAreaZMax()) * exp(TimeDelta() * TranslationZLogSpeed)" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Z rotation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::LookFromDistanceAtPosition3D" + }, + "parameters": [ + "", + "Object.X() + OffsetX", + "Object.Y() + OffsetY", + "CameraZ + OffsetZ", + "Distance", + "Object.Angle() + 90 + (AngleDifference(CameraAngle(Object.Layer(), 0), (Object.Angle() + 90))) * exp(TimeDelta() * Object.Behavior::PropertyRotationLogSpeed()) + RotationAngleOffset", + "Object.Object3D::RotationY() + ElevationAngleOffset", + "", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the halfway time for rotation of the object.", + "fullName": "Halfway time for rotation", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "RotationHalfwayDuration", + "sentence": "the halfway time for rotation", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RotationHalfwayDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationHalfwayDuration", + "name": "SetRotationHalfwayDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyRotationHalfwayDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyRotationLogSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(0.5) / Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the halfway time on Z axis of the object.", + "fullName": "Halfway time on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "TranslationZHalfwayDuration", + "sentence": "the halfway time on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TranslationZHalfwayDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TranslationZHalfwayDuration", + "name": "SetTranslationZHalfwayDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ln((1 - speed)) = ln(1 / 2) / halfwatTime" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyTranslationZHalfwayDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyTranslationZLogSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(0.5) / Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area bottom border Z.", + "fullName": "Free area Z min", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaZMin", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Object3D::CenterZ() + OffsetZ - FollowFreeAreaZMin" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area top border Z.", + "fullName": "Free area Z max", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaZMax", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Object3D::CenterZ() + OffsetZ + FollowFreeAreaZMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the follow free area top border on Z axis of the object.", + "fullName": "Follow free area top border on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "FollowFreeAreaZMax", + "sentence": "the follow free area top border on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FollowFreeAreaZMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FollowFreeAreaZMax", + "name": "SetFollowFreeAreaZMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyFollowFreeAreaZMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the follow free area bottom border on Z axis of the object.", + "fullName": "Follow free area bottom border on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "FollowFreeAreaZMin", + "sentence": "the follow free area bottom border on Z axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FollowFreeAreaZMin" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FollowFreeAreaZMin", + "name": "SetFollowFreeAreaZMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyFollowFreeAreaZMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the camera distance of the object.", + "fullName": "Camera distance", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "Distance", + "sentence": "the camera distance", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Distance" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Distance", + "name": "SetDistance", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyDistance" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the x offset of the object.", + "fullName": "X offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "OffsetX", + "sentence": "the x offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetX" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetX", + "name": "SetOffsetX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyOffsetX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the y offset of the object.", + "fullName": "Y offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "OffsetY", + "sentence": "the y offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetY" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetY", + "name": "SetOffsetY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyOffsetY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the z offset of the object.", + "fullName": "Z offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "OffsetZ", + "sentence": "the z offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetZ" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetZ", + "name": "SetOffsetZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyOffsetZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation angle offset of the object.", + "fullName": "Rotation angle offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "RotationAngleOffset", + "sentence": "the rotation angle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RotationAngleOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationAngleOffset", + "name": "SetRotationAngleOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyRotationAngleOffset" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the elevation angle offset of the object.", + "fullName": "Elevation angle offset", + "functionType": "ExpressionAndCondition", + "group": "Third person camera configuration", + "name": "ElevationAngleOffset", + "sentence": "the elevation angle offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ElevationAngleOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ElevationAngleOffset", + "name": "SetElevationAngleOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ThirdPersonCamera::ThirdPersonCamera::SetPropertyElevationAngleOffset" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ThirdPersonCamera::ThirdPersonCamera", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "0.125", + "type": "Number", + "unit": "Second", + "label": "Halfway time for rotation", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "RotationHalfwayDuration" + }, + { + "value": "0.125", + "type": "Number", + "unit": "Second", + "label": "Halfway time on Z axis", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "TranslationZHalfwayDuration" + }, + { + "value": "500", + "type": "Number", + "unit": "Pixel", + "label": "Camera distance", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "Distance" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "X offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Y offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation angle offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "RotationAngleOffset" + }, + { + "value": "20", + "type": "Number", + "unit": "DegreeAngle", + "label": "Elevation angle offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "ElevationAngleOffset" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top border on Z axis", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaZMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom border on Z axis", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaZMin" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "RotationLogSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TranslationZLogSpeed" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsCalledManually" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CameraZ" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "D8H", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Stick objects to others", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXN0aWNrZXItb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik01LjUgMkMzLjYgMiAyIDMuNiAyIDUuNVYxOC41QzIgMjAuNCAzLjYgMjIgNS41IDIySDE2TDIyIDE2VjUuNUMyMiAzLjYgMjAuNCAyIDE4LjUgMkg1LjVNNS44IDRIMTguM0MxOS4zIDQgMjAuMSA0LjggMjAuMSA1LjhWMTVIMTguNkMxNi43IDE1IDE1LjEgMTYuNiAxNS4xIDE4LjVWMjBINS44QzQuOCAyMCA0IDE5LjIgNCAxOC4yVjUuOEM0IDQuOCA0LjggNCA1LjggNCIgLz48L3N2Zz4=", + "name": "Sticker", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sticker-outline.svg", + "shortDescription": "Make objects follow the position and rotation of the object they are stuck to.", + "version": "0.5.0", + "description": [ + "This extension can be useful to:", + "* Stick accessories to moving objects", + "* Animate a skeleton", + "* Delete an object with another one", + "", + "An example allows to check it out ([open the project online](https://editor.gdevelop.io/?project=example://stick-objects))." + ], + "origin": { + "identifier": "Sticker", + "name": "gdevelop-extension-store" + }, + "tags": [ + "sticker", + "stick", + "follow", + "skeleton", + "joint", + "pin", + "bind", + "glue", + "tie", + "attach", + "hold", + "paste", + "wear" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._stickerExtension) {", + " return;", + "}", + "", + "// Unstick from deleted objects.", + "gdjs.registerObjectDeletedFromSceneCallback(function (runtimeScene, deletedObject) {", + " const extension = runtimeScene._stickerExtension;", + " if (!extension) {", + " return;", + " }", + " const allStickers = runtimeScene._stickerExtension.allStickers;", + " for (const behavior of allStickers) {", + " const sticker = behavior._sticker;", + " if (sticker.isStuckTo(deletedObject)) {", + " if (behavior._getIsDestroyedWithParent()) {", + " behavior.owner.deleteFromScene(runtimeScene);", + " }", + " sticker.unstick();", + " }", + " }", + "});", + "", + "class Sticker {", + " /** @type {gdjs.RuntimeBehavior} */", + " behavior;", + " /** @type {gdjs.RuntimeObject | null} */", + " basisObject;", + " followingDoneThisFrame = false;", + " relativeX = 0;", + " relativeY = 0;", + " relativeAngle = 0;", + " relativeRotatedX = 0;", + " relativeRotatedY = 0;", + " basisOldX = 0;", + " basisOldY = 0;", + " basisOldAngle = 0;", + " basisOldWidth = 0;", + " basisOldHeight = 0;", + " basisOldCenterXInScene = 0;", + " basisOldCenterYInScene = 0;", + "", + " /**", + " * @param {gdjs.RuntimeBehavior} behavior", + " */", + " constructor(behavior) {", + " this.behavior = behavior;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " isStuckTo(basisObject) {", + " return this.basisObject === basisObject;", + " }", + "", + " /**", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " stickTo(basisObject) {", + " this.basisObject = basisObject;", + " this.updateOldCoordinates();", + " this.updateRelativeCoordinates();", + " }", + "", + " unstick() {", + " this.basisObject = null;", + " }", + "", + " onStepPreEvents() {", + " this.followingDoneThisFrame = false;", + " }", + "", + " /**", + " * Update the coordinates in the basisObject basis.", + " * ", + " * It uses the basisObject coordinates from the previous frame.", + " * This way, the sticker can move relatively to it and still", + " * follow basisObject.", + " * ", + " * @param {gdjs.RuntimeObject} basisObject", + " */", + " updateRelativeCoordinates() {", + " const object = this.behavior.owner;", + "", + " // Update relative coordinates", + " this.relativeX = object.getX() - this.basisOldX;", + " this.relativeY = object.getY() - this.basisOldY;", + " if (!this.behavior._getOnlyFollowPosition()) {", + " this.relativeAngle = object.getAngle() - this.basisOldAngle;", + " this.relativeWidth = object.getWidth() / this.basisOldWidth;", + " this.relativeHeight = object.getHeight() / this.basisOldHeight;", + " const deltaX = object.getCenterXInScene() - this.basisOldCenterXInScene;", + " const deltaY = object.getCenterYInScene() - this.basisOldCenterYInScene;", + " const angle = this.basisOldAngle * Math.PI / 180;", + " this.relativeRotatedX = (deltaX * Math.cos(angle) + deltaY * Math.sin(angle)) / this.basisOldWidth;", + " this.relativeRotatedY = (-deltaX * Math.sin(angle) + deltaY * Math.cos(angle)) / this.basisOldHeight;", + "", + " // Save initial values to avoid calculus and rounding errors", + " this.basisOriginalWidth = this.basisObject.getWidth();", + " this.basisOriginalHeight = this.basisObject.getHeight();", + " this.basisOriginalAngle = this.basisObject.getAngle();", + " }", + " }", + "", + " /**", + " * Copy the coordinates to use it the next frame.", + " */", + " updateOldCoordinates() {", + " const object = this.behavior.owner;", + "", + " this.ownerOldX = object.getX();", + " this.ownerOldY = object.getY();", + "", + " this.basisOldX = this.basisObject.getX();", + " this.basisOldY = this.basisObject.getY();", + "", + " if (!this.behavior._getOnlyFollowPosition()) {", + " this.ownerOldAngle = object.getAngle();", + " this.ownerOldWidth = object.getWidth();", + " this.ownerOldHeight = object.getHeight();", + "", + " this.basisOldAngle = this.basisObject.getAngle();", + " this.basisOldWidth = this.basisObject.getWidth();", + " this.basisOldHeight = this.basisObject.getHeight();", + " this.basisOldCenterXInScene = this.basisObject.getCenterXInScene();", + " this.basisOldCenterYInScene = this.basisObject.getCenterYInScene();", + " }", + " }", + "", + " /**", + " * Follow the basisObject (called in doStepPostEvents).", + " * ", + " * This method is also called by children to ensure", + " * parents are updated first.", + " */", + " followBasisObject() {", + " if (this.followingDoneThisFrame) {", + " return;", + " }", + " this.followingDoneThisFrame = true;", + " const basisObject = this.basisObject;", + " if (basisObject) {", + " // If the behavior on the basis object has a different name,", + " // the objects will still follow their basis objects", + " // but frame delays could happen.", + " const behaviorName = this.behavior.getName();", + " if (basisObject.hasBehavior(behaviorName)) {", + " const basisBehavior = basisObject.getBehavior(behaviorName);", + " if (basisBehavior.type === this.behavior.type) {", + " // Follow parents 1st to avoid frame delays", + " basisBehavior._sticker.followBasisObject();", + " }", + " }", + "", + " const object = this.behavior.owner;", + "", + " if (this.behavior._getOnlyFollowPosition()) {", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY) {", + " this.updateRelativeCoordinates();", + " }", + "", + " if (this.basisOldX !== basisObject.getX() ||", + " this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", + " }", + " } else {", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY", + " || object.getAngle() !== this.ownerOldAngle", + " || object.getWidth() !== this.ownerOldWidth", + " || object.getHeight() !== this.ownerOldHeight) {", + " this.updateRelativeCoordinates();", + " }", + "", + " // Follow basisObject", + " if (basisObject.getAngle() === this.basisOriginalAngle && this.basisOriginalAngle === 0) {", + " if (basisObject.getWidth() === this.basisOriginalWidth ||", + " basisObject.getHeight() === this.basisOriginalHeight) {", + " if (this.basisOldX !== basisObject.getX() ||", + " this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", + " }", + " } else {", + " object.setPosition(", + " basisObject.getX() + this.relativeRotatedX * basisObject.getWidth(),", + " basisObject.getY() + this.relativeRotatedY * basisObject.getHeight());", + " }", + " } else {", + " object.setAngle(basisObject.getAngle() + this.relativeAngle);", + "", + " const deltaX = this.relativeRotatedX * basisObject.getWidth();", + " const deltaY = this.relativeRotatedY * basisObject.getHeight();", + " const angle = -basisObject.getAngle() * Math.PI / 180;", + " object.setX(basisObject.getCenterXInScene() + object.getX() - object.getCenterXInScene() + deltaX * Math.cos(angle) + deltaY * Math.sin(angle));", + " object.setY(basisObject.getCenterYInScene() + object.getY() - object.getCenterYInScene() - deltaX * Math.sin(angle) + deltaY * Math.cos(angle));", + " }", + " // Unproportional dimensions changes won't work as expected", + " // if the object angle is not null but nothing more can be done", + " // because there is no full affine transformation on objects.", + " if (basisObject.getWidth() !== this.basisOriginalWidth) {", + " object.setWidth(this.relativeWidth * basisObject.getWidth());", + " }", + " if (basisObject.getHeight() !== this.basisOriginalHeight) {", + " object.setHeight(this.relativeHeight * basisObject.getHeight());", + " }", + " }", + "", + " this.updateOldCoordinates();", + " }", + " }", + "}", + "", + "gdjs._stickerExtension = {", + " Sticker", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if the object is stuck to another object.", + "fullName": "Is stuck to another object", + "functionType": "Condition", + "name": "IsStuck", + "sentence": "_PARAM1_ is stuck to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const stickerBehaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "/** @type {Hashtable} */", + "const stickerObjectsLists = eventsFunctionContext.getObjectsLists(\"Object\");", + "/** @type {Hashtable} */", + "const basisObjectsLists = eventsFunctionContext.getObjectsLists(\"BasisObject\");", + "", + "eventsFunctionContext.returnValue = gdjs.evtTools.object.twoListsTest(", + " (stickerObject, basisObject) => {", + " const sticker = stickerObject.getBehavior(stickerBehaviorName)._sticker;", + " return sticker.isStuckTo(basisObject);", + " },", + " stickerObjectsLists,", + " basisObjectsLists,", + " false", + ");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Sticker", + "name": "Object", + "type": "objectList" + }, + { + "description": "Sticker behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + }, + { + "description": "Basis", + "name": "BasisObject", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Stick the object to another. Use the action to stick the object, or unstick it later.", + "fullName": "Sticker", + "name": "Sticker", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Sticker::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const Sticker = gdjs._stickerExtension.Sticker;", + "", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker = new Sticker(behavior);", + "", + "// Set up the scene sticker objects list - if not done already.", + "runtimeScene._stickerExtension = runtimeScene._stickerExtension || {", + " allStickers: new Set(),", + "};", + "// Register this object as a sticker.", + "runtimeScene._stickerExtension.allStickers.add(behavior);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker.onStepPreEvents();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "behavior._sticker.followBasisObject();" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stick on another object.", + "fullName": "Stick", + "functionType": "Action", + "name": "Stick", + "sentence": "Stick _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const basisObjects = eventsFunctionContext.getObjects(\"BasisObject\");", + "", + "if (basisObjects.length === 0) return;", + "// An object can stick to only one object.", + "const basisObject = basisObjects[0];", + "object.getBehavior(behaviorName)._sticker.stickTo(basisObject);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + }, + { + "description": "Object to stick to", + "name": "BasisObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Unstick from the object it was stuck to.", + "fullName": "Unstick", + "functionType": "Action", + "name": "Unstick", + "sentence": "Unstick _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "", + "object.getBehavior(behaviorName)._sticker.unstick();", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const object = objects[0];", + "const behavior = object.getBehavior(behaviorName);", + "", + "runtimeScene._stickerExtension.allStickers.delete(behavior._sticker);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Sticker::Sticker", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Boolean", + "label": "Only follow the position", + "description": "", + "group": "", + "extraInformation": [], + "name": "OnlyFollowPosition" + }, + { + "value": "", + "type": "Boolean", + "label": "Destroy when the object it's stuck on is destroyed", + "description": "", + "group": "", + "extraInformation": [], + "name": "IsDestroyedWithParent" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Movement", + "extensionNamespace": "", + "fullName": "3D jump", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI3LDI4aC04LjFjLTEuMiwwLTIuMy0wLjUtMy4yLTEuM0wzLDE0bDctOHYwYzAsMy45LDQuMSw4LDgsOGgxdjBjLTAuMSw0LjUsMS42LDcuOCw2LDkuMg0KCWMwLjMsMC4xLDAuNSwwLjIsMC44LDAuMmwwLDBjMS4yLDAuMywyLDEuNiwxLjcsMi44TDI3LDI4eiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTEsMTZsMTMuNywxMy43YzAuOCwwLjgsMiwxLjMsMy4yLDEuM0gyNyIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTAuNSIgY3k9IjE1LjUiIHI9IjEuNSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjE1IiB5MT0iMTkiIHgyPSIxOS41IiB5Mj0iMTkiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxNyIgeTE9IjIyIiB4Mj0iMjIuNSIgeTI9IjIyIi8+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjgsMWwtNy4zLDcuM0MxOSwxMCwxOC40LDEyLjQsMTksMTQuN2wwLDAiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMCw3TDEwLDdjMS45LTAuNiwzLjYtMiw0LjYtMy43TDE2LDEiLz4NCjwvc3ZnPg0K", + "name": "Jump3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Sports and Fitness/29b5c1893f81031cca98c9a1c447464b433717bdf3569ce5fac7c7cb0a8a2b82_Sports and Fitness_gym_running_foot_run.svg", + "shortDescription": "Jump and fall along Z axis.", + "version": "0.1.0", + "description": "It handles basic collisions with 3D boxes but rotations around X and Y axes are not supported.", + "origin": { + "identifier": "Jump3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "jump", + "platform", + "platformer", + "collision" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "toILhIv6WWNwz59xMtlGMijOZ1t2", + "PEzPAaWHgYgk5UwIPppsL6f2ugp2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "the top of the object on Z axis", + "fullName": "Top on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "TopZ", + "private": true, + "sentence": "the top on Z axis of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (objects.length === 0) {", + " return;", + "}", + "const object = objects[0];", + "eventsFunctionContext.returnValue = object.getDrawableZ ? object.getDrawableZ() + object.getDepth() : 0;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TopZ", + "name": "SetTopZ", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (objects.length === 0) {", + " return;", + "}", + "const object = objects[0];", + "if (!object.getDrawableZ) {", + " return;", + "}", + "const newTop = eventsFunctionContext.getArgument(\"Value\");", + "const oldTop = object.getDrawableZ() + object.getDepth();", + "object.setZ(object.getZ() - oldTop + newTop);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "the bottom of the object on Z axis", + "fullName": "Bottom on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "BottomZ", + "private": true, + "sentence": "the bottom on Z axis of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (objects.length === 0) {", + " return;", + "}", + "const object = objects[0];", + "eventsFunctionContext.returnValue = object.getDrawableZ ? object.getDrawableZ() : 0;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "BottomZ", + "name": "SetBottomZ", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (objects.length === 0) {", + " return;", + "}", + "const object = objects[0];", + "if (!object.getDrawableZ) {", + " return;", + "}", + "const newBottom = eventsFunctionContext.getArgument(\"Value\");", + "const oldBottom = object.getDrawableZ();", + "object.setZ(object.getZ() - oldBottom + newBottom);", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is overlapping a range on Z axis.", + "fullName": "Overlap Z range", + "functionType": "Condition", + "group": "Collision", + "name": "IsWithinZ", + "private": true, + "sentence": "_PARAM1_ overlap the range from _PARAM3_ to _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const bottom = eventsFunctionContext.getArgument(\"BottomZ\");", + "const top = eventsFunctionContext.getArgument(\"TopZ\");", + "", + "if (top <= bottom) {", + " return false;", + "}", + "", + "let isAnyObjectPicked = false;", + "for (const object of objects) {", + " object.pick = object.getZ() < top && object.getZ() + object.getDepth() > bottom;", + " isAnyObjectPicked = isAnyObjectPicked || object.pick;", + "}", + "", + "const objectsLists = eventsFunctionContext.getObjectsLists(\"Object\");", + "for (const name in objectsLists.items) {", + " if (objectsLists.items.hasOwnProperty(name)) {", + " const objectsList = objectsLists.items[name];", + " gdjs.evtTools.object.filterPickedObjectsList(objectsList);", + " }", + "}", + "eventsFunctionContext.returnValue = isAnyObjectPicked;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Bottom Z", + "name": "BottomZ", + "type": "expression" + }, + { + "description": "Top Z", + "name": "TopZ", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Jump and fall along Z axis.", + "fullName": "3D jump", + "name": "Jump3D", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetJumpHeight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::PropertyJumpHeight()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Jump height", + "functionType": "ActionWithOperator", + "getterName": "JumpHeight", + "name": "SetJumpHeight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyJumpHeight" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::JumpSpeedToReach(Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + }, + { + "description": "Jump height", + "name": "JumpHeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the jump height of the object. Its value is always positive.", + "fullName": "Jump height", + "functionType": "ExpressionAndCondition", + "group": "3D jump configuration", + "name": "JumpHeight", + "sentence": "the jump height", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "JumpHeight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the jump speed to reach a given height.", + "fullName": "Jump height", + "functionType": "Expression", + "name": "JumpSpeedToReach", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// Formulas used in this extension were generated from a math model.", + "// They are probably not understandable on their own.", + "// If you need to modify them or need to write new feature,", + "// please take a look to the platformer extension documentation:", + "// https://github.com/4ian/GDevelop/tree/master/Extensions/PlatformBehavior#readme", + "", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = objects[0].getBehavior(behaviorName);", + "/** @type {float} */", + "const jumpHeight = -Math.abs(eventsFunctionContext.getArgument(\"JumpHeight\"));", + "", + "/** @type {float} */", + "const gravity = behavior._getGravity();", + "/** @type {float} */", + "const maxFallingSpeed = behavior._getMaxFallingSpeed();", + "/** @type {float} */", + "const jumpSustainTime = behavior._getJumpSustainDurationMax();", + "", + "const maxFallingSpeedReachedTime = maxFallingSpeed / gravity;", + "", + "// The implementation jumps from one quadratic resolution to another", + "// to find the right formula to use as the time is unknown.", + "", + "const sustainCase = (jumpHeight) => Math.sqrt(-jumpHeight * gravity * 2);", + "const maxFallingCase = (jumpHeight) => -gravity * jumpSustainTime + maxFallingSpeed", + " + Math.sqrt(gravity * gravity * jumpSustainTime * jumpSustainTime - 2 * jumpHeight * gravity - maxFallingSpeed * maxFallingSpeed);", + "", + "let jumpSpeed = 0;", + "let peakTime = 0;", + "if (maxFallingSpeedReachedTime > jumpSustainTime) {", + " // common case", + " jumpSpeed = -gravity * jumpSustainTime + Math.sqrt(2 * gravity * gravity * jumpSustainTime * jumpSustainTime - 4 * jumpHeight * gravity);", + " peakTime = (gravity * jumpSustainTime + jumpSpeed) / (2 * gravity);", + " if (peakTime < jumpSustainTime) {", + " jumpSpeed = sustainCase(jumpHeight);", + " }", + " else if (peakTime > maxFallingSpeedReachedTime) {", + " jumpSpeed = maxFallingCase(jumpHeight);", + " }", + "}", + "else {", + " // affine case can't have a maximum", + "", + " // sustain case", + " jumpSpeed = sustainCase(jumpHeight);", + " peakTime = jumpSpeed / gravity;", + " if (peakTime > maxFallingSpeedReachedTime) {", + " jumpSpeed = maxFallingCase(jumpHeight);", + " }", + "}", + "", + "eventsFunctionContext.returnValue = jumpSpeed;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + }, + { + "description": "Jump height", + "name": "JumpHeight", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Start to jump", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyHasPressedJumpKey" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentFallSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"_Jump3DExtension.SustainJump\"" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"InTheAir\"" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "JumpSpeed" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentFallSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"_Jump3DExtension.SustainJump\"", + ">", + "JumpSustainDurationMax" + ] + } + ], + "actions": [ + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"_Jump3DExtension.SustainJump\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Jump3D::Jump3D::PropertyHasPressedJumpKey" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"_Jump3DExtension.SustainJump\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyHasPressedJumpKey" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyPreviousJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CurrentJumpSpeed" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyPreviousFallSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CurrentFallSpeed" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "State" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make the object fall every frame to check the floor." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::CurrentVerticalSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::Fall" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Jump speed", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"_Jump3DExtension.SustainJump\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, CurrentJumpSpeed - Gravity * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Verlet integration" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "(PreviousJumpSpeed + CurrentJumpSpeed) / 2 * TimeDelta()" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Fall speed", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Verlet integration" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentFallSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentFallSpeed + Gravity * TimeDelta(), MaxFallingSpeed)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "-", + "(PreviousFallSpeed + CurrentFallSpeed) / 2 * TimeDelta()" + ] + } + ] + } + ], + "parameters": [] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Fall on the floor", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyShouldStopAtZero" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "Jump3D::BottomZ" + }, + "parameters": [ + "Object", + "<", + "0", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::Land" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Jump3D::SetBottomZ" + }, + "parameters": [ + "Object", + "=", + "0", + "Object", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the jump key.", + "fullName": "Simulate jump key press", + "functionType": "Action", + "group": "3D jump state", + "name": "SimulateJumpKey", + "sentence": "Simulate pressing Jump key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyHasPressedJumpKey" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Separate from walls and land on platforms. 3D boxes rotated around X and Y axes are not supported.", + "fullName": "Separate from platforms", + "functionType": "Action", + "group": "3D jump state", + "name": "SeparateFromPlatforms", + "sentence": "Separate _PARAM0_ from platform _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Check platforms to land on." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionNP" + }, + "parameters": [ + "Object", + "Platform", + "", + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Platform", + "conditions": [ + { + "type": { + "value": "Jump3D::TopZ" + }, + "parameters": [ + "Object", + ">", + "Jump3D::BottomZ(Platform)", + "Object", + "" + ] + }, + { + "type": { + "value": "Jump3D::TopZ" + }, + "parameters": [ + "Object", + "<", + "Jump3D::BottomZ(Platform) + Object.Behavior::VerticalSpeed() * TimeDelta()", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::AbortJump" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Jump3D::SetTopZ" + }, + "parameters": [ + "Object", + "=", + "Jump3D::BottomZ(Platform)", + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Platform", + "conditions": [ + { + "type": { + "value": "Jump3D::BottomZ" + }, + "parameters": [ + "Object", + "<", + "Jump3D::TopZ(Platform)", + "Object", + "" + ] + }, + { + "type": { + "value": "Jump3D::BottomZ" + }, + "parameters": [ + "Object", + ">", + "Jump3D::TopZ(Platform) + Object.Behavior::VerticalSpeed() * TimeDelta()", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::Land" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Jump3D::SetBottomZ" + }, + "parameters": [ + "Object", + "=", + "Jump3D::TopZ(Platform)", + "Object", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Separate from walls" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::IsWithinZ" + }, + "parameters": [ + "", + "Platform", + "Object3D", + "Jump3D::BottomZ(Object)", + "Jump3D::TopZ(Object)", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SeparateFromObjects" + }, + "parameters": [ + "Object", + "Platform", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + }, + { + "description": "Platform", + "name": "Platform", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop the object from falling and land on the floor. The object will start falling again the next frame.", + "fullName": "Land on the floor", + "functionType": "Action", + "group": "3D jump state", + "name": "Land", + "sentence": "Make _PARAM0_ land on the floor", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentFallSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make the object fall from the floor.", + "fullName": "Fall from the floor", + "functionType": "Action", + "group": "3D jump state", + "name": "Fall", + "private": true, + "sentence": "Make _PARAM0_ fall from the floor", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add a 1-frame delay in case collision checks are done after the simulate jump action." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"InTheAir\"" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Abort the current jump and stop the object vertically. This action doesn't have any effect when the character is not jumping.", + "fullName": "Abort jump", + "functionType": "Action", + "group": "3D jump state", + "name": "AbortJump", + "sentence": "Abort the current jump of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentFallSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "When this action is executed, the object is able to jump again, even if it is in the air: this can be useful to allow a double jump for example. This is not a permanent effect: you must call again this action everytime you want to allow the object to jump (apart if it's on the floor).", + "fullName": "Allow jumping again", + "functionType": "Action", + "group": "3D jump state", + "name": "SetCanJump", + "sentence": "Allow _PARAM0_ to jump again", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object can jump.", + "fullName": "Can jump", + "functionType": "Condition", + "group": "3D jump state", + "name": "CanJump", + "sentence": "_PARAM0_ can jump", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is falling.\\nNote that the object can be flagged as jumping and falling at the same time: at the end of a jump, the fall speed becomes higher than the jump speed.", + "fullName": "Is falling", + "functionType": "Condition", + "group": "3D jump state", + "name": "IsFalling", + "sentence": "_PARAM0_ is falling", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::CurrentVerticalSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is jumping.", + "fullName": "Is jumping", + "functionType": "Condition", + "group": "3D jump state", + "name": "IsJumping", + "sentence": "_PARAM0_ is jumping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyCurrentJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is on a platform.", + "fullName": "Is on floor", + "functionType": "Condition", + "group": "3D jump state", + "name": "IsOnFloor", + "sentence": "_PARAM0_ is on floor", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return the state from the previous frame because the actual state may change during the current frame according to collision." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the current jump speed of the object. Its value is always positive.", + "fullName": "Current jump speed", + "functionType": "ExpressionAndCondition", + "group": "3D jump state", + "name": "CurrentJumpSpeed", + "sentence": "the current jump speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return the speed from the previous frame because the actual speed may change during the current frame according to collision." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "PreviousJumpSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "CurrentJumpSpeed", + "name": "SetCurrentJumpSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentJumpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the current falling speed of the object. Its value is always positive.", + "fullName": "Current falling speed", + "functionType": "ExpressionAndCondition", + "group": "3D jump state", + "name": "CurrentFallSpeed", + "sentence": "the current falling speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return the speed from the previous frame because the actual speed may change during the current frame according to collision." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "PreviousFallSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "CurrentFallSpeed", + "name": "SetCurrentFallSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyCurrentFallSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the current speed of the object on Z axis. Its value is negative when the object falls.", + "fullName": "Current vertical speed", + "functionType": "ExpressionAndCondition", + "group": "3D jump state", + "name": "CurrentVerticalSpeed", + "sentence": "the current vertical speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return the speed from the previous frame because the actual speed may change during the current frame according to collision." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "PreviousJumpSpeed - PreviousFallSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the current speed of the object on Z axis. Its value is negative when the object falls.", + "fullName": "Actual current vertical speed", + "functionType": "ExpressionAndCondition", + "group": "3D jump state", + "name": "VerticalSpeed", + "private": true, + "sentence": "the actual current vertical speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CurrentJumpSpeed - CurrentFallSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum falling speed of the object. Its value is always positive.", + "fullName": "Maximum falling speed", + "functionType": "ExpressionAndCondition", + "group": "3D jump configuration", + "name": "MaxFallingSpeed", + "sentence": "the maximum falling speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MaxFallingSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxFallingSpeed", + "name": "SetMaxFallingSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyMaxFallingSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the gavity of the object. Its value is always positive.", + "fullName": "Gavity", + "functionType": "ExpressionAndCondition", + "group": "3D jump configuration", + "name": "Gravity", + "sentence": "the gavity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Gravity" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Gravity", + "name": "SetGravity", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyGravity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the jump sustain time of the object. Maximum time (in seconds) during which the jump strength is sustained if the jump key is held - allowing variable height jumps.", + "fullName": "Jump sustain time", + "functionType": "ExpressionAndCondition", + "group": "3D jump configuration", + "name": "JumpSustainDurationMax", + "sentence": "the jump sustain time", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "JumpSustainDurationMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JumpSustainDurationMax", + "name": "SetJumpSustainDurationMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyJumpSustainDurationMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if stop falling when Z equals 0.", + "fullName": "Stop falling when Z equals 0", + "functionType": "Condition", + "group": "3D jump configuration", + "name": "ShouldStopAtZero", + "sentence": "_PARAM0_ stop falling when Z equals 0", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Jump3D::Jump3D::PropertyShouldStopAtZero" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change if stop falling when Z equals 0.", + "fullName": "Stop falling when Z equals 0", + "functionType": "Action", + "group": "3D jump configuration", + "name": "SetShouldStopAtZero", + "sentence": "_PARAM0_ stop falling when Z equals 0: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyShouldStopAtZero" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Jump3D::Jump3D::SetPropertyShouldStopAtZero" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Jump3D::Jump3D", + "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "StopAtZero", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "150", + "type": "Number", + "label": "Jump height", + "description": "Its value is always positive.", + "group": "", + "extraInformation": [], + "name": "JumpHeight" + }, + { + "value": "700", + "type": "Number", + "unit": "PixelSpeed", + "label": "Maximum falling speed", + "description": "Its value is always positive.", + "group": "", + "extraInformation": [], + "name": "MaxFallingSpeed" + }, + { + "value": "1000", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Gavity", + "description": "Its value is always positive.", + "group": "", + "extraInformation": [], + "name": "Gravity" + }, + { + "value": "600", + "type": "Number", + "label": "Jump speed", + "description": "Its value is always positive.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JumpSpeed" + }, + { + "value": "0.2", + "type": "Number", + "unit": "Second", + "label": "Jump sustain time", + "description": "Maximum time (in seconds) during which the jump strength is sustained if the jump key is held - allowing variable height jumps.", + "group": "", + "extraInformation": [], + "name": "JumpSustainDurationMax" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "SustainJump", + "InTheAir" + ], + "hidden": true, + "name": "State" + }, + { + "value": "", + "type": "Number", + "unit": "PixelSpeed", + "label": "Current jump speed", + "description": "Its value is always positive.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentJumpSpeed" + }, + { + "value": "", + "type": "Number", + "unit": "PixelSpeed", + "label": "Current falling speed", + "description": "Its value is always positive.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentFallSpeed" + }, + { + "value": "", + "type": "Number", + "unit": "PixelSpeed", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousJumpSpeed" + }, + { + "value": "", + "type": "Number", + "unit": "PixelSpeed", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousFallSpeed" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedJumpKey" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CanJump" + }, + { + "value": "true", + "type": "Boolean", + "label": "Stop falling when Z equals 0", + "description": "", + "group": "", + "extraInformation": [], + "name": "ShouldStopAtZero" + }, + { + "value": "Idle", + "type": "String", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousState" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "3D particle emitter (experimental)", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZpcmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTcuNjYgMTEuMkMxNy40MyAxMC45IDE3LjE1IDEwLjY0IDE2Ljg5IDEwLjM4QzE2LjIyIDkuNzggMTUuNDYgOS4zNSAxNC44MiA4LjcyQzEzLjMzIDcuMjYgMTMgNC44NSAxMy45NSAzQzEzIDMuMjMgMTIuMTcgMy43NSAxMS40NiA0LjMyQzguODcgNi40IDcuODUgMTAuMDcgOS4wNyAxMy4yMkM5LjExIDEzLjMyIDkuMTUgMTMuNDIgOS4xNSAxMy41NUM5LjE1IDEzLjc3IDkgMTMuOTcgOC44IDE0LjA1QzguNTcgMTQuMTUgOC4zMyAxNC4wOSA4LjE0IDEzLjkzQzguMDggMTMuODggOC4wNCAxMy44MyA4IDEzLjc2QzYuODcgMTIuMzMgNi42OSAxMC4yOCA3LjQ1IDguNjRDNS43OCAxMCA0Ljg3IDEyLjMgNSAxNC40N0M1LjA2IDE0Ljk3IDUuMTIgMTUuNDcgNS4yOSAxNS45N0M1LjQzIDE2LjU3IDUuNyAxNy4xNyA2IDE3LjdDNy4wOCAxOS40MyA4Ljk1IDIwLjY3IDEwLjk2IDIwLjkyQzEzLjEgMjEuMTkgMTUuMzkgMjAuOCAxNy4wMyAxOS4zMkMxOC44NiAxNy42NiAxOS41IDE1IDE4LjU2IDEyLjcyTDE4LjQzIDEyLjQ2QzE4LjIyIDEyIDE3LjY2IDExLjIgMTcuNjYgMTEuMk0xNC41IDE3LjVDMTQuMjIgMTcuNzQgMTMuNzYgMTggMTMuNCAxOC4xQzEyLjI4IDE4LjUgMTEuMTYgMTcuOTQgMTAuNSAxNy4yOEMxMS42OSAxNyAxMi40IDE2LjEyIDEyLjYxIDE1LjIzQzEyLjc4IDE0LjQzIDEyLjQ2IDEzLjc3IDEyLjMzIDEzQzEyLjIxIDEyLjI2IDEyLjIzIDExLjYzIDEyLjUgMTAuOTRDMTIuNjkgMTEuMzIgMTIuODkgMTEuNyAxMy4xMyAxMkMxMy45IDEzIDE1LjExIDEzLjQ0IDE1LjM3IDE0LjhDMTUuNDEgMTQuOTQgMTUuNDMgMTUuMDggMTUuNDMgMTUuMjNDMTUuNDYgMTYuMDUgMTUuMSAxNi45NSAxNC41IDE3LjVIMTQuNVoiIC8+PC9zdmc+", + "name": "ParticleEmitter3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f2e5a34bf465f781866677762d385d6c8e9e8d203383f2df9a3b7e0fad6a2cb5_fire.svg", + "shortDescription": "Display a large number of particles to create visual effects.", + "version": "1.2.0", + "description": [ + "Particle emitters can be used to display:", + "- Fire", + "- Smoke", + "- Splashes", + "- Lights", + "", + "Breaking change from 1.0.0:", + "- Particles were 3 times too small" + ], + "origin": { + "identifier": "ParticleEmitter3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "particle", + "explosion", + "fire", + "smoke", + "splash", + "light" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GlobalVariableAsBoolean" + }, + "parameters": [ + "_ParticleEmmiter3DExtension_ClassesDefined", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetGlobalVariableAsBoolean" + }, + "parameters": [ + "_ParticleEmmiter3DExtension_ClassesDefined", + "True" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs.__particleEmmiter3DExtension = gdjs.__particleEmmiter3DExtension || {};", + "", + "/**", + " * @param {string} colorString", + " * @param {THREE.Vector4} threeColor", + " */", + "const setThreeColor = (colorString, threeColor = new THREE.Vector4()) => {", + " const integerColor = gdjs.rgbOrHexToRGBColor(colorString);", + " threeColor.x = integerColor[0] / 255;", + " threeColor.y = integerColor[1] / 255;", + " threeColor.z = integerColor[2] / 255;", + "};", + "", + "/**", + " * @param {string} integerOpacity", + " * @param {THREE.Vector4} threeColor", + " */", + "const setThreeOpacity = (integerOpacity, threeColor = new THREE.Vector4()) => {", + " threeColor.w = integerOpacity / 255;", + "};", + "", + "class ParticleEmitterAdapter {", + " /**", + " * @param particleSystem {ParticleSystem}", + " * @param colorOverLife {ColorOverLife}", + " * @param sizeOverLife {SizeOverLife}", + " * @param applyForce {ApplyForce}", + " */", + " constructor(particleSystem, colorOverLife, sizeOverLife, applyForce) {", + " this.particleSystem = particleSystem;", + " this.colorOverLife = colorOverLife;", + " this.sizeOverLife = sizeOverLife;", + " this.applyForce = applyForce;", + " }", + "", + " /**", + " * @param startColor {string}", + " */", + " setStartColor(startColor) {", + " setThreeColor(startColor, this.colorOverLife.color.color.keys[0][0]);", + " }", + "", + " /**", + " * @param endColor {string}", + " */", + " setEndColor(endColor) {", + " setThreeColor(endColor, this.colorOverLife.color.color.keys[1][0]);", + " }", + "", + " /**", + " * @param startOpacity {number}", + " */", + " setStartOpacity(startOpacity) {", + " this.colorOverLife.color.alpha.keys[0][0] = startOpacity / 255;", + " }", + "", + " /**", + " * @param endOpacity {number}", + " */", + " setEndOpacity(endOpacity) {", + " this.colorOverLife.color.alpha.keys[1][0] = endOpacity / 255;", + " }", + "", + " /**", + " * @param flow {number}", + " */", + " setFlow(flow) {", + " this.particleSystem.emissionOverTime.value = flow;", + " }", + "", + " /**", + " * @param startMinSize {number}", + " */", + " setStartMinSize(startMinSize) {", + " this.particleSystem.startSize.a = startMinSize;", + " }", + "", + " /**", + " * @param startMaxSize {number}", + " */", + " setStartMaxSize(startMaxSize) {", + " this.particleSystem.startSize.b = startMaxSize;", + " }", + "", + " /**", + " * @param endScale {number}", + " */", + " setEndScale(endScale) {", + " /** @type Bezier */", + " const bezier = this.sizeOverLife.size.functions[0][0];", + " bezier.p[0] = 1;", + " bezier.p[1] = gdjs.evtTools.common.lerp(1, endScale, 1 / 3);", + " bezier.p[2] = gdjs.evtTools.common.lerp(1, endScale, 2 / 3);", + " bezier.p[3] = endScale;", + " }", + "", + " /**", + " * @param startSpeedMin {number}", + " */", + " setStartSpeedMin(startSpeedMin) {", + " this.particleSystem.startSpeed.a = startSpeedMin;", + " }", + "", + " /**", + " * @param startSpeedMax {number}", + " */", + " setStartSpeedMax(startSpeedMax) {", + " this.particleSystem.startSpeed.b = startSpeedMax;", + " }", + "", + " /**", + " * @param lifespanMin {number}", + " */", + " setLifespanMin(lifespanMin) {", + " this.particleSystem.startLife.a = lifespanMin;", + " }", + "", + " /**", + " * @param lifespanMax {number}", + " */", + " setLifespanMax(lifespanMax) {", + " this.particleSystem.startLife.b = lifespanMax;", + " }", + "", + " /**", + " * @param duration {number}", + " */", + " setDuration(duration) {", + " this.particleSystem.duration = duration || Number.POSITIVE_INFINITY;", + " }", + "", + " /**", + " * @param areParticlesRelative {boolean}", + " */", + " setParticlesRelative(areParticlesRelative) {", + " this.particleSystem.worldSpace = !areParticlesRelative;", + " }", + "", + " /**", + " * @param sprayConeAngle {number}", + " */", + " setSprayConeAngle(sprayConeAngle) {", + " if (0 < sprayConeAngle && sprayConeAngle <= 180) {", + " if (!this.particleSystem.emitterShape.angle) {", + " this.particleSystem.emitterShape = new ConeEmitter({ radius: 0.1, angle: Math.PI / 8 });", + " }", + " this.particleSystem.emitterShape.angle = sprayConeAngle * Math.PI / 180;", + " }", + " else {", + " if (this.particleSystem.emitterShape.angle) {", + " this.particleSystem.emitterShape = new PointEmitter();", + " }", + " }", + " }", + "", + " /**", + " * @param blending {string}", + " */", + " setBlending(blendingString) {", + " const blending =", + " blendingString === \"Additive\" ? THREE.AdditiveBlending :", + " blendingString === \"Normal\" ? THREE.NormalBlending :", + " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", + " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", + " blendingString === \"None\" ? THREE.NoBlending :", + " THREE.AdditiveBlending;", + " // TODO This doesn't work.", + " this.particleSystem.blending = blending;", + " }", + "", + " /**", + " * @param gravity {number}", + " */", + " setGravity(gravity) {", + " this.applyForce.magnitude.value = gravity;", + " }", + "", + " /**", + " * @param gravityTop {string}", + " */", + " setGravityTop(gravityTop) {", + " // TODO Make gravity absolute even when \"relative\" is enabled. ", + " switch (gravityTop) {", + " case \"Z+\":", + " this.applyForce.direction.set(0, 0, -1);", + " break;", + "", + " case \"Y-\":", + " this.applyForce.direction.set(0, 1, 0);", + " break;", + " }", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension.ParticleEmitterAdapter = ParticleEmitterAdapter;", + "", + "", + "", + "", + "", + "/**", + " * three.quarks v0.11.2 build Mon Jan 22 2024", + " * https://github.com/Alchemist0823/three.quarks#readme", + " * Copyright 2024 Alchemist0823 , MIT", + " */", + "", + "class ParticleEmitter extends THREE.Object3D {", + " constructor(system) {", + " super();", + " this.type = 'ParticleEmitter';", + " this.system = system;", + " }", + " clone() {", + " const system = this.system.clone();", + " system.emitter.copy(this, true);", + " return system.emitter;", + " }", + " dispose() { }", + " extractFromCache(cache) {", + " const values = [];", + " for (const key in cache) {", + " const data = cache[key];", + " delete data.metadata;", + " values.push(data);", + " }", + " return values;", + " }", + " toJSON(meta, options = {}) {", + " const isRootObject = meta === undefined || typeof meta === 'string';", + " const output = {};", + " if (isRootObject) {", + " meta = {", + " geometries: {},", + " materials: {},", + " textures: {},", + " images: {},", + " shapes: {},", + " skeletons: {},", + " animations: {},", + " nodes: {},", + " };", + " output.metadata = {", + " version: 4.5,", + " type: 'Object',", + " generator: 'Object3D.toJSON',", + " };", + " }", + " const object = {};", + " object.uuid = this.uuid;", + " object.type = this.type;", + " if (this.name !== '')", + " object.name = this.name;", + " if (this.castShadow === true)", + " object.castShadow = true;", + " if (this.receiveShadow === true)", + " object.receiveShadow = true;", + " if (this.visible === false)", + " object.visible = false;", + " if (this.frustumCulled === false)", + " object.frustumCulled = false;", + " if (this.renderOrder !== 0)", + " object.renderOrder = this.renderOrder;", + " if (JSON.stringify(this.userData) !== '{}')", + " object.userData = this.userData;", + " object.layers = this.layers.mask;", + " object.matrix = this.matrix.toArray();", + " if (this.matrixAutoUpdate === false)", + " object.matrixAutoUpdate = false;", + " if (this.system !== null)", + " object.ps = this.system.toJSON(meta, options);", + " if (this.children.length > 0) {", + " object.children = [];", + " for (let i = 0; i < this.children.length; i++) {", + " if (this.children[i].type !== 'ParticleSystemPreview') {", + " object.children.push(this.children[i].toJSON(meta).object);", + " }", + " }", + " }", + " if (isRootObject) {", + " const geometries = this.extractFromCache(meta.geometries);", + " const materials = this.extractFromCache(meta.materials);", + " const textures = this.extractFromCache(meta.textures);", + " const images = this.extractFromCache(meta.images);", + " if (geometries.length > 0)", + " output.geometries = geometries;", + " if (materials.length > 0)", + " output.materials = materials;", + " if (textures.length > 0)", + " output.textures = textures;", + " if (images.length > 0)", + " output.images = images;", + " }", + " output.object = object;", + " return output;", + " }", + "}", + "", + "class LinkedListNode {", + " constructor(data) {", + " this.data = data;", + " this.next = null;", + " this.prev = null;", + " }", + " hasPrev() {", + " return this.prev !== null;", + " }", + " hasNext() {", + " return this.next !== null;", + " }", + "}", + "class LinkedList {", + " constructor() {", + " this.length = 0;", + " this.head = this.tail = null;", + " }", + " isEmpty() {", + " return this.head === null;", + " }", + " clear() {", + " this.length = 0;", + " this.head = this.tail = null;", + " }", + " front() {", + " if (this.head === null)", + " return null;", + " return this.head.data;", + " }", + " back() {", + " if (this.tail === null)", + " return null;", + " return this.tail.data;", + " }", + " dequeue() {", + " if (this.head) {", + " const value = this.head.data;", + " this.head = this.head.next;", + " if (!this.head) {", + " this.tail = null;", + " }", + " else {", + " this.head.prev = null;", + " }", + " this.length--;", + " return value;", + " }", + " return undefined;", + " }", + " pop() {", + " if (this.tail) {", + " const value = this.tail.data;", + " this.tail = this.tail.prev;", + " if (!this.tail) {", + " this.head = null;", + " }", + " else {", + " this.tail.next = null;", + " }", + " this.length--;", + " return value;", + " }", + " return undefined;", + " }", + " queue(data) {", + " const node = new LinkedListNode(data);", + " if (!this.tail) {", + " this.tail = node;", + " }", + " if (this.head) {", + " this.head.prev = node;", + " node.next = this.head;", + " }", + " this.head = node;", + " this.length++;", + " }", + " push(data) {", + " const node = new LinkedListNode(data);", + " if (!this.head) {", + " this.head = node;", + " }", + " if (this.tail) {", + " this.tail.next = node;", + " node.prev = this.tail;", + " }", + " this.tail = node;", + " this.length++;", + " }", + " insertBefore(node, data) {", + " const newNode = new LinkedListNode(data);", + " newNode.next = node;", + " newNode.prev = node.prev;", + " if (newNode.prev !== null) {", + " newNode.prev.next = newNode;", + " }", + " newNode.next.prev = newNode;", + " if (node == this.head) {", + " this.head = newNode;", + " }", + " this.length++;", + " }", + " remove(data) {", + " if (this.head === null || this.tail === null) {", + " return;", + " }", + " let tempNode = this.head;", + " if (data === this.head.data) {", + " this.head = this.head.next;", + " }", + " if (data === this.tail.data) {", + " this.tail = this.tail.prev;", + " }", + " while (tempNode.next !== null && tempNode.data !== data) {", + " tempNode = tempNode.next;", + " }", + " if (tempNode.data === data) {", + " if (tempNode.prev !== null)", + " tempNode.prev.next = tempNode.next;", + " if (tempNode.next !== null)", + " tempNode.next.prev = tempNode.prev;", + " this.length--;", + " }", + " }", + " *values() {", + " let current = this.head;", + " while (current !== null) {", + " yield current.data;", + " current = current.next;", + " }", + " }", + "}", + "", + "class NodeParticle {", + " constructor() {", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.rotation = 0;", + " this.color = new THREE.Vector4(1, 1, 1, 1);", + " this.uvTile = 0;", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + " reset() {", + " this.position.set(0, 0, 0);", + " this.velocity.set(0, 0, 0);", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.rotation = 0;", + " this.color.set(1, 1, 1, 1);", + " this.uvTile = 0;", + " }", + "}", + "class SpriteParticle {", + " constructor() {", + " this.startSpeed = 0;", + " this.startColor = new THREE.Vector4();", + " this.startSize = 1;", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.speedModifier = 1;", + " this.rotation = 0;", + " this.color = new THREE.Vector4();", + " this.uvTile = 0;", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + "}", + "class RecordState {", + " constructor(position, size, color) {", + " this.position = position;", + " this.size = size;", + " this.color = color;", + " }", + "}", + "class TrailParticle {", + " constructor() {", + " this.startSpeed = 0;", + " this.startColor = new THREE.Vector4();", + " this.startSize = 1;", + " this.position = new THREE.Vector3();", + " this.velocity = new THREE.Vector3();", + " this.age = 0;", + " this.life = 1;", + " this.size = 1;", + " this.length = 100;", + " this.speedModifier = 1;", + " this.color = new THREE.Vector4();", + " this.previous = new LinkedList();", + " this.uvTile = 0;", + " }", + " update() {", + " if (this.age <= this.life) {", + " this.previous.push(new RecordState(this.position.clone(), this.size, this.color.clone()));", + " }", + " else {", + " if (this.previous.length > 0) {", + " this.previous.dequeue();", + " }", + " }", + " while (this.previous.length > this.length) {", + " this.previous.dequeue();", + " }", + " }", + " get died() {", + " return this.age >= this.life;", + " }", + " reset() {", + " this.previous.clear();", + " }", + "}", + "", + "class Bezier {", + " constructor(p1, p2, p3, p4) {", + " this.p = [p1, p2, p3, p4];", + " }", + " genValue(t) {", + " const t2 = t * t;", + " const t3 = t * t * t;", + " const mt = 1 - t;", + " const mt2 = mt * mt;", + " const mt3 = mt2 * mt;", + " return this.p[0] * mt3 + this.p[1] * mt2 * t * 3 + this.p[2] * mt * t2 * 3 + this.p[3] * t3;", + " }", + " derivativeCoefficients(points) {", + " const dpoints = [];", + " for (let p = points, c = p.length - 1; c > 0; c--) {", + " const list = [];", + " for (let j = 0; j < c; j++) {", + " const dpt = c * (p[j + 1] - p[j]);", + " list.push(dpt);", + " }", + " dpoints.push(list);", + " p = list;", + " }", + " return dpoints;", + " }", + " getSlope(t) {", + " const p = this.derivativeCoefficients(this.p)[0];", + " const mt = 1 - t;", + " const a = mt * mt;", + " const b = mt * t * 2;", + " const c = t * t;", + " return a * p[0] + b * p[1] + c * p[2];", + " }", + " controlCurve(d0, d1) {", + " this.p[1] = d0 / 3 + this.p[0];", + " this.p[2] = this.p[3] - d1 / 3;", + " }", + " hull(t) {", + " let p = this.p;", + " let _p = [], pt, idx = 0, i = 0, l = 0;", + " const q = [];", + " q[idx++] = p[0];", + " q[idx++] = p[1];", + " q[idx++] = p[2];", + " q[idx++] = p[3];", + " while (p.length > 1) {", + " _p = [];", + " for (i = 0, l = p.length - 1; i < l; i++) {", + " pt = t * p[i] + (1 - t) * p[i + 1];", + " q[idx++] = pt;", + " _p.push(pt);", + " }", + " p = _p;", + " }", + " return q;", + " }", + " split(t) {", + " const q = this.hull(t);", + " const result = {", + " left: new Bezier(q[0], q[4], q[7], q[9]),", + " right: new Bezier(q[9], q[8], q[6], q[3]),", + " span: q", + " };", + " return result;", + " }", + " clone() {", + " return new Bezier(this.p[0], this.p[1], this.p[2], this.p[3]);", + " }", + " toJSON() {", + " return {", + " p0: this.p[0],", + " p1: this.p[1],", + " p2: this.p[2],", + " p3: this.p[3],", + " };", + " }", + " static fromJSON(json) {", + " return new Bezier(json.p0, json.p1, json.p2, json.p3);", + " }", + "}", + "", + "const ColorToJSON = (color) => {", + " return { r: color.x, g: color.y, b: color.z, a: color.w };", + "};", + "const JSONToColor = (json) => {", + " return new THREE.Vector4(json.r, json.g, json.b, json.a);", + "};", + "const JSONToValue = (json, type) => {", + " switch (type) {", + " case 'Vector3':", + " return new THREE.Vector3(json.x, json.y, json.z);", + " case 'Vector4':", + " return new THREE.Vector4(json.x, json.y, json.z, json.w);", + " case 'Color':", + " return new THREE.Vector3(json.r, json.g, json.b);", + " case 'Number':", + " return json;", + " default:", + " return json;", + " }", + "};", + "const ValueToJSON = (value, type) => {", + " switch (type) {", + " case 'Vector3':", + " return { x: value.x, y: value.y, z: value.z };", + " case 'Vector4':", + " return { x: value.x, y: value.y, z: value.z, w: value.w };", + " case 'Color':", + " return { r: value.x, g: value.y, b: value.z };", + " case 'Number':", + " return value;", + " default:", + " return value;", + " }", + "};", + "", + "class RandomColor {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = \"value\";", + " }", + " genColor(color) {", + " const rand = Math.random();", + " return color.copy(this.a).lerp(this.b, rand);", + " }", + " toJSON() {", + " return {", + " type: \"RandomColor\",", + " a: ColorToJSON(this.a),", + " b: ColorToJSON(this.b),", + " };", + " }", + " static fromJSON(json) {", + " return new RandomColor(JSONToColor(json.a), JSONToColor(json.b));", + " }", + " clone() {", + " return new RandomColor(this.a.clone(), this.b.clone());", + " }", + "}", + "", + "class ColorRange {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = 'value';", + " }", + " genColor(color, t) {", + " return color.copy(this.a).lerp(this.b, Math.random());", + " }", + " toJSON() {", + " return {", + " type: 'ColorRange',", + " a: ColorToJSON(this.a),", + " b: ColorToJSON(this.b),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorRange(JSONToColor(json.a), JSONToColor(json.b));", + " }", + " clone() {", + " return new ColorRange(this.a.clone(), this.b.clone());", + " }", + "}", + "", + "class ContinuousLinearFunction {", + " constructor(keys, subType) {", + " this.subType = subType;", + " this.type = 'function';", + " this.keys = keys;", + " }", + " findKey(t) {", + " let mid = 0;", + " let left = 0, right = this.keys.length - 1;", + " while (left + 1 < right) {", + " mid = Math.floor((left + right) / 2);", + " if (t < this.getStartX(mid))", + " right = mid - 1;", + " else if (t > this.getEndX(mid))", + " left = mid + 1;", + " else", + " return mid;", + " }", + " for (let i = left; i <= right; i++) {", + " if (t >= this.getStartX(i) && t <= this.getEndX(i))", + " return i;", + " }", + " return -1;", + " }", + " getStartX(index) {", + " return this.keys[index][1];", + " }", + " getEndX(index) {", + " if (index + 1 < this.keys.length)", + " return this.keys[index + 1][1];", + " return 1;", + " }", + " genValue(value, t) {", + " const index = this.findKey(t);", + " if (this.subType === 'Number') {", + " if (index === -1) {", + " return this.keys[0][0];", + " }", + " else if (index + 1 >= this.keys.length) {", + " return this.keys[this.keys.length - 1][0];", + " }", + " return ((this.keys[index + 1][0] - this.keys[index][0]) *", + " ((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index))) +", + " this.keys[index][0]);", + " }", + " else {", + " if (index === -1) {", + " return value.copy(this.keys[0][0]);", + " }", + " if (index + 1 >= this.keys.length) {", + " return value.copy(this.keys[this.keys.length - 1][0]);", + " }", + " return value", + " .copy(this.keys[index][0])", + " .lerp(this.keys[index + 1][0], (t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", + " }", + " }", + " toJSON() {", + " this.keys[0][0].constructor.name;", + " return {", + " type: 'CLinearFunction',", + " subType: this.subType,", + " keys: this.keys.map(([color, pos]) => ({ value: ValueToJSON(color, this.subType), pos: pos })),", + " };", + " }", + " static fromJSON(json) {", + " return new ContinuousLinearFunction(json.keys.map((pair) => [JSONToValue(pair.value, json.subType), pair.pos]), json.subType);", + " }", + " clone() {", + " if (this.subType === 'Number') {", + " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value, pos]), this.subType);", + " }", + " else {", + " return new ContinuousLinearFunction(this.keys.map(([value, pos]) => [value.clone(), pos]), this.subType);", + " }", + " }", + "}", + "", + "const tempVec3 = new THREE.Vector3();", + "class Gradient {", + " constructor(color = [", + " [new THREE.Vector3(0, 0, 0), 0],", + " [new THREE.Vector3(1, 1, 1), 0],", + " ], alpha = [", + " [1, 0],", + " [1, 1],", + " ]) {", + " this.type = 'function';", + " this.color = new ContinuousLinearFunction(color, 'Color');", + " this.alpha = new ContinuousLinearFunction(alpha, 'Number');", + " }", + " genColor(color, t) {", + " this.color.genValue(tempVec3, t);", + " return color.set(tempVec3.x, tempVec3.y, tempVec3.z, this.alpha.genValue(1, t));", + " }", + " toJSON() {", + " return {", + " type: 'Gradient',", + " color: this.color.toJSON(),", + " alpha: this.alpha.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " if (json.functions) {", + " const keys = json.functions.map((func) => [ColorRange.fromJSON(func.function).a, func.start]);", + " if (json.functions.length > 0) {", + " keys.push([ColorRange.fromJSON(json.functions[json.functions.length - 1].function).b, 1]);", + " }", + " return new Gradient(keys.map((key) => [new THREE.Vector3(key[0].x, key[0].y, key[0].z), key[1]]), keys.map((key) => [key[0].w, key[1]]));", + " }", + " else {", + " const gradient = new Gradient();", + " gradient.alpha = ContinuousLinearFunction.fromJSON(json.alpha);", + " gradient.color = ContinuousLinearFunction.fromJSON(json.color);", + " return gradient;", + " }", + " }", + " clone() {", + " const gradient = new Gradient();", + " gradient.alpha = this.alpha.clone();", + " gradient.color = this.color.clone();", + " return gradient;", + " }", + "}", + "", + "const tempColor = new THREE.Vector4();", + "class RandomColorBetweenGradient {", + " constructor(gradient1, gradient2) {", + " this.type = 'memorizedFunction';", + " this.gradient1 = gradient1;", + " this.gradient2 = gradient2;", + " }", + " startGen(memory) {", + " memory.rand = Math.random();", + " }", + " genColor(color, t, memory) {", + " this.gradient1.genColor(color, t);", + " this.gradient2.genColor(tempColor, t);", + " if (memory && memory.rand) {", + " color.lerp(tempColor, memory.rand);", + " }", + " else {", + " color.lerp(tempColor, Math.random());", + " }", + " return color;", + " }", + " toJSON() {", + " return {", + " type: 'RandomColorBetweenGradient',", + " gradient1: this.gradient1.toJSON(),", + " gradient2: this.gradient2.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RandomColorBetweenGradient(Gradient.fromJSON(json.gradient1), Gradient.fromJSON(json.gradient2));", + " }", + " clone() {", + " return new RandomColorBetweenGradient(this.gradient1.clone(), this.gradient2.clone());", + " }", + "}", + "", + "class ConstantColor {", + " constructor(color) {", + " this.color = color;", + " this.type = 'value';", + " }", + " genColor(color) {", + " return color.copy(this.color);", + " }", + " toJSON() {", + " return {", + " type: 'ConstantColor',", + " color: ColorToJSON(this.color),", + " };", + " }", + " static fromJSON(json) {", + " return new ConstantColor(JSONToColor(json.color));", + " }", + " clone() {", + " return new ConstantColor(this.color.clone());", + " }", + "}", + "function ColorGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantColor':", + " return ConstantColor.fromJSON(json);", + " case 'ColorRange':", + " return ColorRange.fromJSON(json);", + " case 'RandomColor':", + " return RandomColor.fromJSON(json);", + " case 'Gradient':", + " return Gradient.fromJSON(json);", + " case 'RandomColorBetweenGradient':", + " return RandomColorBetweenGradient.fromJSON(json);", + " default:", + " return new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", + " }", + "}", + "", + "class ConstantValue {", + " constructor(value) {", + " this.value = value;", + " this.type = 'value';", + " }", + " genValue() {", + " return this.value;", + " }", + " toJSON() {", + " return {", + " type: \"ConstantValue\",", + " value: this.value", + " };", + " }", + " static fromJSON(json) {", + " return new ConstantValue(json.value);", + " }", + " clone() {", + " return new ConstantValue(this.value);", + " }", + "}", + "", + "class IntervalValue {", + " constructor(a, b) {", + " this.a = a;", + " this.b = b;", + " this.type = 'value';", + " }", + " genValue() {", + " return THREE.MathUtils.lerp(this.a, this.b, Math.random());", + " }", + " toJSON() {", + " return {", + " type: 'IntervalValue',", + " a: this.a,", + " b: this.b,", + " };", + " }", + " static fromJSON(json) {", + " return new IntervalValue(json.a, json.b);", + " }", + " clone() {", + " return new IntervalValue(this.a, this.b);", + " }", + "}", + "", + "class PiecewiseFunction {", + " constructor() {", + " this.functions = new Array();", + " }", + " findFunction(t) {", + " let mid = 0;", + " let left = 0, right = this.functions.length - 1;", + " while (left + 1 < right) {", + " mid = Math.floor((left + right) / 2);", + " if (t < this.getStartX(mid))", + " right = mid - 1;", + " else if (t > this.getEndX(mid))", + " left = mid + 1;", + " else", + " return mid;", + " }", + " for (let i = left; i <= right; i++) {", + " if (t >= this.functions[i][1] && t <= this.getEndX(i))", + " return i;", + " }", + " return -1;", + " }", + " getStartX(index) {", + " return this.functions[index][1];", + " }", + " setStartX(index, x) {", + " if (index > 0)", + " this.functions[index][1] = x;", + " }", + " getEndX(index) {", + " if (index + 1 < this.functions.length)", + " return this.functions[index + 1][1];", + " return 1;", + " }", + " setEndX(index, x) {", + " if (index + 1 < this.functions.length)", + " this.functions[index + 1][1] = x;", + " }", + " insertFunction(t, func) {", + " const index = this.findFunction(t);", + " this.functions.splice(index + 1, 0, [func, t]);", + " }", + " removeFunction(index) {", + " return this.functions.splice(index, 1)[0][0];", + " }", + " getFunction(index) {", + " return this.functions[index][0];", + " }", + " setFunction(index, func) {", + " this.functions[index][0] = func;", + " }", + " get numOfFunctions() {", + " return this.functions.length;", + " }", + "}", + "", + "class PiecewiseBezier extends PiecewiseFunction {", + " constructor(curves = [[new Bezier(0, 1.0 / 3, 1.0 / 3 * 2, 1), 0]]) {", + " super();", + " this.type = \"function\";", + " this.functions = curves;", + " }", + " genValue(t = 0) {", + " const index = this.findFunction(t);", + " if (index === -1) {", + " return 0;", + " }", + " return this.functions[index][0].genValue((t - this.getStartX(index)) / (this.getEndX(index) - this.getStartX(index)));", + " }", + " toSVG(length, segments) {", + " if (segments < 1)", + " return \"\";", + " let result = [\"M\", 0, this.functions[0][0].p[0]].join(\" \");", + " for (let i = 1.0 / segments; i <= 1; i += 1.0 / segments) {", + " result = [result, \"L\", i * length, this.genValue(i)].join(\" \");", + " }", + " return result;", + " }", + " toJSON() {", + " return {", + " type: \"PiecewiseBezier\",", + " functions: this.functions.map(([bezier, start]) => ({ function: bezier.toJSON(), start: start })),", + " };", + " }", + " static fromJSON(json) {", + " return new PiecewiseBezier(json.functions.map((piecewiseFunction) => ([Bezier.fromJSON(piecewiseFunction.function), piecewiseFunction.start])));", + " }", + " clone() {", + " return new PiecewiseBezier(this.functions.map(([bezier, start]) => ([bezier.clone(), start])));", + " }", + "}", + "", + "function ValueGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantValue':", + " return ConstantValue.fromJSON(json);", + " case 'IntervalValue':", + " return IntervalValue.fromJSON(json);", + " case 'PiecewiseBezier':", + " return PiecewiseBezier.fromJSON(json);", + " default:", + " return new ConstantValue(0);", + " }", + "}", + "", + "class RandomQuatGenerator {", + " constructor() {", + " this.type = \"rotation\";", + " }", + " genValue(quat, t) {", + " let x, y, z, u, v, w;", + " do {", + " x = Math.random() * 2 - 1;", + " y = Math.random() * 2 - 1;", + " z = x * x + y * y;", + " } while (z > 1);", + " do {", + " u = Math.random() * 2 - 1;", + " v = Math.random() * 2 - 1;", + " w = u * u + v * v;", + " } while (w > 1);", + " const s = Math.sqrt((1 - z) / w);", + " quat.set(x, y, s * u, s * v);", + " return quat;", + " }", + " toJSON() {", + " return {", + " type: \"RandomQuat\"", + " };", + " }", + " static fromJSON(json) {", + " return new RandomQuatGenerator();", + " }", + " clone() {", + " return new RandomQuatGenerator();", + " }", + "}", + "", + "class AxisAngleGenerator {", + " constructor(axis, angle) {", + " this.axis = axis;", + " this.angle = angle;", + " this.type = 'rotation';", + " }", + " genValue(quat, t) {", + " return quat.setFromAxisAngle(this.axis, this.angle.genValue(t));", + " }", + " toJSON() {", + " return {", + " type: 'AxisAngle',", + " axis: { x: this.axis.x, y: this.axis.y, z: this.axis.z },", + " angle: this.angle.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new AxisAngleGenerator(new THREE.Vector3(json.axis.x, json.axis.y, json.axis.z), ValueGeneratorFromJSON(json.angle));", + " }", + " clone() {", + " return new AxisAngleGenerator(this.axis.clone(), this.angle.clone());", + " }", + "}", + "", + "class EulerGenerator {", + " constructor(angleX, angleY, angleZ, eulerOrder) {", + " this.angleX = angleX;", + " this.angleY = angleY;", + " this.angleZ = angleZ;", + " this.type = 'rotation';", + " this.eular = new THREE.Euler(0, 0, 0, eulerOrder);", + " }", + " genValue(quat, t) {", + " this.eular.set(this.angleX.genValue(t), this.angleY.genValue(t), this.angleZ.genValue(t));", + " return quat.setFromEuler(this.eular);", + " }", + " toJSON() {", + " return {", + " type: 'Euler',", + " angleX: this.angleX.toJSON(),", + " angleY: this.angleY.toJSON(),", + " angleZ: this.angleZ.toJSON(),", + " eulerOrder: this.eular.order,", + " };", + " }", + " static fromJSON(json) {", + " return new EulerGenerator(ValueGeneratorFromJSON(json.angleX), ValueGeneratorFromJSON(json.angleY), ValueGeneratorFromJSON(json.angleZ), json.eulerOrder);", + " }", + " clone() {", + " return new EulerGenerator(this.angleX, this.angleY, this.angleZ, this.eular.order);", + " }", + "}", + "", + "function RotationGeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'AxisAngle':", + " return AxisAngleGenerator.fromJSON(json);", + " case 'Euler':", + " return EulerGenerator.fromJSON(json);", + " case 'RandomQuat':", + " return RandomQuatGenerator.fromJSON(json);", + " default:", + " return new RandomQuatGenerator();", + " }", + "}", + "", + "function GeneratorFromJSON(json) {", + " switch (json.type) {", + " case 'ConstantValue':", + " case 'IntervalValue':", + " case 'PiecewiseBezier':", + " return ValueGeneratorFromJSON(json);", + " case 'AxisAngle':", + " case 'RandomQuat':", + " case 'Euler':", + " return RotationGeneratorFromJSON(json);", + " default:", + " return new ConstantValue(0);", + " }", + "}", + "", + "class ColorOverLife {", + " constructor(color) {", + " this.color = color;", + " this.type = 'ColorOverLife';", + " }", + " initialize(particle) {", + " if (this.color.type === 'memorizedFunction') {", + " particle.colorOverLifeMemory = {};", + " this.color.startGen(particle.colorOverLifeMemory);", + " }", + " }", + " update(particle, delta) {", + " if (this.color.type === 'memorizedFunction') {", + " this.color.genColor(particle.color, particle.age / particle.life, particle.colorOverLifeMemory);", + " }", + " else {", + " this.color.genColor(particle.color, particle.age / particle.life);", + " }", + " particle.color.x *= particle.startColor.x;", + " particle.color.y *= particle.startColor.y;", + " particle.color.z *= particle.startColor.z;", + " particle.color.w *= particle.startColor.w;", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " color: this.color.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorOverLife(ColorGeneratorFromJSON(json.color));", + " }", + " clone() {", + " return new ColorOverLife(this.color.clone());", + " }", + " reset() { }", + "}", + "", + "class RotationOverLife {", + " constructor(angularVelocity) {", + " this.angularVelocity = angularVelocity;", + " this.type = 'RotationOverLife';", + " this.dynamic = !(angularVelocity instanceof ConstantValue || angularVelocity instanceof IntervalValue);", + " }", + " initialize(particle) {", + " this.dynamic = !(this.angularVelocity instanceof ConstantValue || this.angularVelocity instanceof IntervalValue);", + " if (!this.dynamic && typeof particle.rotation === 'number') {", + " particle.angularVelocity = this.angularVelocity.genValue();", + " }", + " }", + " update(particle, delta) {", + " if (!this.dynamic) {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation += delta * particle.angularVelocity;", + " }", + " }", + " else {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation +=", + " delta * this.angularVelocity.genValue(particle.age / particle.life);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RotationOverLife(ValueGeneratorFromJSON(json.angularVelocity));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new RotationOverLife(this.angularVelocity.clone());", + " }", + " reset() { }", + "}", + "", + "const IdentityQuaternion = new THREE.Quaternion();", + "class Rotation3DOverLife {", + " constructor(angularVelocity) {", + " this.angularVelocity = angularVelocity;", + " this.type = 'Rotation3DOverLife';", + " this.tempQuat = new THREE.Quaternion();", + " this.dynamic = !(angularVelocity instanceof RandomQuatGenerator);", + " }", + " initialize(particle) {", + " this.dynamic = !(this.angularVelocity instanceof RandomQuatGenerator);", + " if (particle.rotation instanceof THREE.Quaternion) {", + " particle.angularVelocity = new THREE.Quaternion();", + " this.angularVelocity.genValue(particle.angularVelocity);", + " }", + " }", + " update(particle, delta) {", + " if (particle.rotation instanceof THREE.Quaternion) {", + " if (!this.dynamic) {", + " this.tempQuat.slerpQuaternions(IdentityQuaternion, particle.angularVelocity, delta);", + " particle.rotation.multiply(this.tempQuat);", + " }", + " else {", + " this.angularVelocity.genValue(this.tempQuat, particle.age / particle.life);", + " this.tempQuat.slerpQuaternions(IdentityQuaternion, this.tempQuat, delta);", + " particle.rotation.multiply(this.tempQuat);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new Rotation3DOverLife(RotationGeneratorFromJSON(json.angularVelocity));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new Rotation3DOverLife(this.angularVelocity.clone());", + " }", + " reset() { }", + "}", + "", + "class ForceOverLife {", + " initialize(particle) { }", + " constructor(x, y, z) {", + " this.x = x;", + " this.y = y;", + " this.z = z;", + " this.type = 'ForceOverLife';", + " this._temp = new THREE.Vector3();", + " }", + " update(particle, delta) {", + " this._temp.set(this.x.genValue(particle.age / particle.life), this.y.genValue(particle.age / particle.life), this.z.genValue(particle.age / particle.life));", + " particle.velocity.addScaledVector(this._temp, delta);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " x: this.x.toJSON(),", + " y: this.y.toJSON(),", + " z: this.z.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ForceOverLife(ValueGeneratorFromJSON(json.x), ValueGeneratorFromJSON(json.y), ValueGeneratorFromJSON(json.z));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new ForceOverLife(this.x.clone(), this.y.clone(), this.z.clone());", + " }", + " reset() { }", + "}", + "", + "class SizeOverLife {", + " initialize(particle) {", + " }", + " constructor(size) {", + " this.size = size;", + " this.type = 'SizeOverLife';", + " }", + " update(particle) {", + " particle.size = particle.startSize * this.size.genValue(particle.age / particle.life);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " size: this.size.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SizeOverLife(ValueGeneratorFromJSON(json.size));", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new SizeOverLife(this.size.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class SpeedOverLife {", + " initialize(particle) {", + " }", + " constructor(speed) {", + " this.speed = speed;", + " this.type = 'SpeedOverLife';", + " }", + " update(particle) {", + " particle.speedModifier = this.speed.genValue(particle.age / particle.life);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SpeedOverLife(ValueGeneratorFromJSON(json.speed));", + " }", + " frameUpdate(delta) {", + " }", + " clone() {", + " return new SpeedOverLife(this.speed.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class FrameOverLife {", + " constructor(frame) {", + " this.frame = frame;", + " this.type = 'FrameOverLife';", + " }", + " initialize(particle) {", + " if (!(this.frame instanceof PiecewiseBezier)) {", + " particle.uvTile = Math.floor(this.frame.genValue(0) + 0.001);", + " }", + " }", + " update(particle, delta) {", + " if (this.frame instanceof PiecewiseBezier) {", + " particle.uvTile = Math.floor(this.frame.genValue(particle.age / particle.life) + 0.001);", + " }", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " frame: this.frame.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new FrameOverLife(ValueGeneratorFromJSON(json.frame));", + " }", + " clone() {", + " return new FrameOverLife(this.frame.clone());", + " }", + " reset() { }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class OrbitOverLife {", + " constructor(orbitSpeed, axis = new THREE.Vector3(0, 1, 0)) {", + " this.orbitSpeed = orbitSpeed;", + " this.axis = axis;", + " this.type = 'OrbitOverLife';", + " this.temp = new THREE.Vector3();", + " this.rotation = new THREE.Quaternion();", + " this.line = new THREE.Line3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " this.line.set(new THREE.Vector3(0, 0, 0), this.axis);", + " this.line.closestPointToPoint(particle.position, false, this.temp);", + " this.rotation.setFromAxisAngle(this.axis, this.orbitSpeed.genValue(particle.age / particle.life) * delta);", + " particle.position.sub(this.temp);", + " particle.position.applyQuaternion(this.rotation);", + " particle.position.add(this.temp);", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " orbitSpeed: this.orbitSpeed.toJSON(),", + " axis: [this.axis.x, this.axis.y, this.axis.z],", + " };", + " }", + " static fromJSON(json) {", + " return new OrbitOverLife(ValueGeneratorFromJSON(json.orbitSpeed), json.axis ? new THREE.Vector3(json.axis[0], json.axis[1], json.axis[2]) : undefined);", + " }", + " clone() {", + " return new OrbitOverLife(this.orbitSpeed.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class WidthOverLength {", + " initialize(particle) {", + " }", + " constructor(width) {", + " this.width = width;", + " this.type = 'WidthOverLength';", + " }", + " update(particle) {", + " if (particle instanceof TrailParticle) {", + " const iter = particle.previous.values();", + " for (let i = 0; i < particle.previous.length; i++) {", + " const cur = iter.next();", + " cur.value.size = this.width.genValue((particle.previous.length - i) / particle.length);", + " }", + " }", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " width: this.width.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new WidthOverLength(ValueGeneratorFromJSON(json.width));", + " }", + " clone() {", + " return new WidthOverLength(this.width.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class ApplyForce {", + " constructor(direction, magnitude) {", + " this.direction = direction;", + " this.magnitude = magnitude;", + " this.type = 'ApplyForce';", + " this.magnitudeValue = this.magnitude.genValue();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " particle.velocity.addScaledVector(this.direction, this.magnitudeValue * delta);", + " }", + " frameUpdate(delta) {", + " this.magnitudeValue = this.magnitude.genValue();", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " direction: [this.direction.x, this.direction.y, this.direction.z],", + " magnitude: this.magnitude.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " var _a;", + " return new ApplyForce(new THREE.Vector3(json.direction[0], json.direction[1], json.direction[2]), ValueGeneratorFromJSON((_a = json.magnitude) !== null && _a !== void 0 ? _a : json.force));", + " }", + " clone() {", + " return new ApplyForce(this.direction.clone(), this.magnitude.clone());", + " }", + " reset() {", + " }", + "}", + "", + "class GravityForce {", + " constructor(center, magnitude) {", + " this.center = center;", + " this.magnitude = magnitude;", + " this.type = 'GravityForce';", + " this.temp = new THREE.Vector3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " this.temp.copy(this.center).sub(particle.position).normalize();", + " particle.velocity.addScaledVector(this.temp, this.magnitude / particle.position.distanceToSquared(this.center) * delta);", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " center: [this.center.x, this.center.y, this.center.z],", + " magnitude: this.magnitude,", + " };", + " }", + " static fromJSON(json) {", + " return new GravityForce(new THREE.Vector3(json.center[0], json.center[1], json.center[2]), json.magnitude);", + " }", + " clone() {", + " return new GravityForce(this.center.clone(), this.magnitude);", + " }", + " reset() {", + " }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class ChangeEmitDirection {", + " constructor(angle) {", + " this.angle = angle;", + " this.type = 'ChangeEmitDirection';", + " this._temp = new THREE.Vector3();", + " this._q = new THREE.Quaternion();", + " }", + " initialize(particle) {", + " const len = particle.velocity.length();", + " if (len == 0)", + " return;", + " particle.velocity.normalize();", + " if (particle.velocity.x === 0 && particle.velocity.y === 0) {", + " this._temp.set(0, particle.velocity.z, 0);", + " }", + " else {", + " this._temp.set(-particle.velocity.y, particle.velocity.x, 0);", + " }", + " this._q.setFromAxisAngle(this._temp.normalize(), this.angle.genValue());", + " this._temp.copy(particle.velocity);", + " particle.velocity.applyQuaternion(this._q);", + " this._q.setFromAxisAngle(this._temp, Math.random() * Math.PI * 2);", + " particle.velocity.applyQuaternion(this._q);", + " particle.velocity.setLength(len);", + " }", + " update(particle, delta) {", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angle: this.angle.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ChangeEmitDirection(ValueGeneratorFromJSON(json.angle));", + " }", + " clone() {", + " return new ChangeEmitDirection(this.angle);", + " }", + " reset() {", + " }", + "}", + "", + "const VECTOR_ONE = new THREE.Vector3(1, 1, 1);", + "const VECTOR_Z = new THREE.Vector3(0, 0, 1);", + "gdjs.__particleEmmiter3DExtension.SubParticleEmitMode = void 0;", + "(function (SubParticleEmitMode) {", + " SubParticleEmitMode[SubParticleEmitMode[\"Death\"] = 0] = \"Death\";", + " SubParticleEmitMode[SubParticleEmitMode[\"Birth\"] = 1] = \"Birth\";", + " SubParticleEmitMode[SubParticleEmitMode[\"Frame\"] = 2] = \"Frame\";", + "})(gdjs.__particleEmmiter3DExtension.SubParticleEmitMode || (gdjs.__particleEmmiter3DExtension.SubParticleEmitMode = {}));", + "class EmitSubParticleSystem {", + " constructor(particleSystem, useVelocityAsBasis, subParticleSystem, mode = gdjs.__particleEmmiter3DExtension.SubParticleEmitMode.Frame, emitProbability = 1) {", + " this.particleSystem = particleSystem;", + " this.useVelocityAsBasis = useVelocityAsBasis;", + " this.subParticleSystem = subParticleSystem;", + " this.mode = mode;", + " this.emitProbability = emitProbability;", + " this.type = 'EmitSubParticleSystem';", + " this.q_ = new THREE.Quaternion();", + " this.v_ = new THREE.Vector3();", + " this.v2_ = new THREE.Vector3();", + " this.subEmissions = new Array();", + " if (this.subParticleSystem && this.subParticleSystem.system) {", + " this.subParticleSystem.system.onlyUsedByOther = true;", + " }", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " if (this.mode === gdjs.__particleEmmiter3DExtension.SubParticleEmitMode.Frame) {", + " this.emit(particle, delta);", + " }", + " else if (this.mode === gdjs.__particleEmmiter3DExtension.SubParticleEmitMode.Birth && particle.age === 0) {", + " this.emit(particle, delta);", + " }", + " else if (this.mode === gdjs.__particleEmmiter3DExtension.SubParticleEmitMode.Death && particle.age + delta >= particle.life) {", + " this.emit(particle, delta);", + " }", + " }", + " emit(particle, delta) {", + " if (!this.subParticleSystem)", + " return;", + " if (Math.random() > this.emitProbability) {", + " return;", + " }", + " const m = new THREE.Matrix4();", + " this.setMatrixFromParticle(m, particle);", + " this.subEmissions.push({", + " burstIndex: 0,", + " burstWaveIndex: 0,", + " time: 0,", + " waitEmiting: 0,", + " matrix: m,", + " travelDistance: 0,", + " particle: particle,", + " });", + " }", + " frameUpdate(delta) {", + " if (!this.subParticleSystem)", + " return;", + " for (let i = 0; i < this.subEmissions.length; i++) {", + " if (this.subEmissions[i].time >= this.subParticleSystem.system.duration) {", + " this.subEmissions[i] = this.subEmissions[this.subEmissions.length - 1];", + " this.subEmissions.length = this.subEmissions.length - 1;", + " i--;", + " }", + " else {", + " let subEmissionState = this.subEmissions[i];", + " if (subEmissionState.particle && subEmissionState.particle.age < subEmissionState.particle.life) {", + " this.setMatrixFromParticle(subEmissionState.matrix, subEmissionState.particle);", + " }", + " else {", + " subEmissionState.particle = undefined;", + " }", + " this.subParticleSystem.system.emit(delta, subEmissionState, subEmissionState.matrix);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " subParticleSystem: this.subParticleSystem ? this.subParticleSystem.uuid : '',", + " useVelocityAsBasis: this.useVelocityAsBasis,", + " mode: this.mode,", + " emitProbability: this.emitProbability,", + " };", + " }", + " static fromJSON(json, particleSystem) {", + " return new EmitSubParticleSystem(particleSystem, json.useVelocityAsBasis, json.subParticleSystem, json.mode, json.emitProbability);", + " }", + " clone() {", + " return new EmitSubParticleSystem(this.particleSystem, this.useVelocityAsBasis, this.subParticleSystem, this.mode, this.emitProbability);", + " }", + " reset() { }", + " setMatrixFromParticle(m, particle) {", + " let rotation;", + " if (particle.rotation === undefined || this.useVelocityAsBasis) {", + " if (particle.velocity.x === 0 &&", + " particle.velocity.y === 0 &&", + " (particle.velocity.z === 1 || particle.velocity.z === 0)) {", + " m.set(1, 0, 0, particle.position.x, 0, 1, 0, particle.position.y, 0, 0, 1, particle.position.z, 0, 0, 0, 1);", + " }", + " else {", + " this.v_.copy(VECTOR_Z).cross(particle.velocity);", + " this.v2_.copy(particle.velocity).cross(this.v_);", + " const len = this.v_.length();", + " const len2 = this.v2_.length();", + " m.set(this.v_.x / len, this.v2_.x / len2, particle.velocity.x, particle.position.x, this.v_.y / len, this.v2_.y / len2, particle.velocity.y, particle.position.y, this.v_.z / len, this.v2_.z / len2, particle.velocity.z, particle.position.z, 0, 0, 0, 1);", + " }", + " }", + " else {", + " if (particle.rotation instanceof THREE.Quaternion) {", + " rotation = particle.rotation;", + " }", + " else {", + " this.q_.setFromAxisAngle(VECTOR_Z, particle.rotation);", + " rotation = this.q_;", + " }", + " m.compose(particle.position, rotation, VECTOR_ONE);", + " }", + " if (!this.particleSystem.worldSpace) {", + " m.multiplyMatrices(this.particleSystem.emitter.matrixWorld, m);", + " }", + " }", + "}", + "", + "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", + "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", + "const F3 = 1.0 / 3.0;", + "const G3 = 1.0 / 6.0;", + "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", + "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", + "const grad3 = new Float32Array([1, 1, 0,", + " -1, 1, 0,", + " 1, -1, 0,", + " -1, -1, 0,", + " 1, 0, 1,", + " -1, 0, 1,", + " 1, 0, -1,", + " -1, 0, -1,", + " 0, 1, 1,", + " 0, -1, 1,", + " 0, 1, -1,", + " 0, -1, -1]);", + "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", + " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", + " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", + " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", + " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", + " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", + " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", + " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", + "class SimplexNoise {", + " constructor(randomOrSeed = Math.random) {", + " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", + " this.p = buildPermutationTable(random);", + " this.perm = new Uint8Array(512);", + " this.permMod12 = new Uint8Array(512);", + " for (let i = 0; i < 512; i++) {", + " this.perm[i] = this.p[i & 255];", + " this.permMod12[i] = this.perm[i] % 12;", + " }", + " }", + " noise2D(x, y) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0 = 0;", + " let n1 = 0;", + " let n2 = 0;", + " const s = (x + y) * F2;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const t = (i + j) * G2;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " let i1, j1;", + " if (x0 > y0) {", + " i1 = 1;", + " j1 = 0;", + " }", + " else {", + " i1 = 0;", + " j1 = 1;", + " }", + " const x1 = x0 - i1 + G2;", + " const y1 = y0 - j1 + G2;", + " const x2 = x0 - 1.0 + 2.0 * G2;", + " const y2 = y0 - 1.0 + 2.0 * G2;", + " const ii = i & 255;", + " const jj = j & 255;", + " let t0 = 0.5 - x0 * x0 - y0 * y0;", + " if (t0 >= 0) {", + " const gi0 = permMod12[ii + perm[jj]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0);", + " }", + " let t1 = 0.5 - x1 * x1 - y1 * y1;", + " if (t1 >= 0) {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", + " }", + " let t2 = 0.5 - x2 * x2 - y2 * y2;", + " if (t2 >= 0) {", + " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", + " }", + " return 70.0 * (n0 + n1 + n2);", + " }", + " noise3D(x, y, z) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0, n1, n2, n3;", + " const s = (x + y + z) * F3;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const t = (i + j + k) * G3;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " let i1, j1, k1;", + " let i2, j2, k2;", + " if (x0 >= y0) {", + " if (y0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " }", + " else if (x0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " }", + " else {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " }", + " }", + " else {", + " if (y0 < z0) {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 0;", + " j2 = 1;", + " k2 = 1;", + " }", + " else if (x0 < z0) {", + " i1 = 0;", + " j1 = 1;", + " k1 = 0;", + " i2 = 0;", + " j2 = 1;", + " k2 = 1;", + " }", + " else {", + " i1 = 0;", + " j1 = 1;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " }", + " }", + " const x1 = x0 - i1 + G3;", + " const y1 = y0 - j1 + G3;", + " const z1 = z0 - k1 + G3;", + " const x2 = x0 - i2 + 2.0 * G3;", + " const y2 = y0 - j2 + 2.0 * G3;", + " const z2 = z0 - k2 + 2.0 * G3;", + " const x3 = x0 - 1.0 + 3.0 * G3;", + " const y3 = y0 - 1.0 + 3.0 * G3;", + " const z3 = z0 - 1.0 + 3.0 * G3;", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = permMod12[ii + perm[jj + perm[kk]]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0 + grad3[gi0 + 2] * z0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1 + grad3[gi1 + 2] * z1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2 + grad3[gi2 + 2] * z2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]] * 3;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad3[gi3] * x3 + grad3[gi3 + 1] * y3 + grad3[gi3 + 2] * z3);", + " }", + " return 32.0 * (n0 + n1 + n2 + n3);", + " }", + " noise4D(x, y, z, w) {", + " const perm = this.perm;", + " let n0, n1, n2, n3, n4;", + " const s = (x + y + z + w) * F4;", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const l = Math.floor(w + s);", + " const t = (i + j + k + l) * G4;", + " const X0 = i - t;", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const W0 = l - t;", + " const x0 = x - X0;", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " const w0 = w - W0;", + " let rankx = 0;", + " let ranky = 0;", + " let rankz = 0;", + " let rankw = 0;", + " if (x0 > y0)", + " rankx++;", + " else", + " ranky++;", + " if (x0 > z0)", + " rankx++;", + " else", + " rankz++;", + " if (x0 > w0)", + " rankx++;", + " else", + " rankw++;", + " if (y0 > z0)", + " ranky++;", + " else", + " rankz++;", + " if (y0 > w0)", + " ranky++;", + " else", + " rankw++;", + " if (z0 > w0)", + " rankz++;", + " else", + " rankw++;", + " const i1 = rankx >= 3 ? 1 : 0;", + " const j1 = ranky >= 3 ? 1 : 0;", + " const k1 = rankz >= 3 ? 1 : 0;", + " const l1 = rankw >= 3 ? 1 : 0;", + " const i2 = rankx >= 2 ? 1 : 0;", + " const j2 = ranky >= 2 ? 1 : 0;", + " const k2 = rankz >= 2 ? 1 : 0;", + " const l2 = rankw >= 2 ? 1 : 0;", + " const i3 = rankx >= 1 ? 1 : 0;", + " const j3 = ranky >= 1 ? 1 : 0;", + " const k3 = rankz >= 1 ? 1 : 0;", + " const l3 = rankw >= 1 ? 1 : 0;", + " const x1 = x0 - i1 + G4;", + " const y1 = y0 - j1 + G4;", + " const z1 = z0 - k1 + G4;", + " const w1 = w0 - l1 + G4;", + " const x2 = x0 - i2 + 2.0 * G4;", + " const y2 = y0 - j2 + 2.0 * G4;", + " const z2 = z0 - k2 + 2.0 * G4;", + " const w2 = w0 - l2 + 2.0 * G4;", + " const x3 = x0 - i3 + 3.0 * G4;", + " const y3 = y0 - j3 + 3.0 * G4;", + " const z3 = z0 - k3 + 3.0 * G4;", + " const w3 = w0 - l3 + 3.0 * G4;", + " const x4 = x0 - 1.0 + 4.0 * G4;", + " const y4 = y0 - 1.0 + 4.0 * G4;", + " const z4 = z0 - 1.0 + 4.0 * G4;", + " const w4 = w0 - 1.0 + 4.0 * G4;", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " const ll = l & 255;", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", + " }", + " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", + " if (t4 < 0)", + " n4 = 0.0;", + " else {", + " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", + " t4 *= t4;", + " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", + " }", + " return 27.0 * (n0 + n1 + n2 + n3 + n4);", + " }", + "}", + "function buildPermutationTable(random) {", + " const p = new Uint8Array(256);", + " for (let i = 0; i < 256; i++) {", + " p[i] = i;", + " }", + " for (let i = 0; i < 255; i++) {", + " const r = i + ~~(random() * (256 - i));", + " const aux = p[i];", + " p[i] = p[r];", + " p[r] = aux;", + " }", + " return p;", + "}", + "function alea(seed) {", + " let s0 = 0;", + " let s1 = 0;", + " let s2 = 0;", + " let c = 1;", + " const mash = masher();", + " s0 = mash(' ');", + " s1 = mash(' ');", + " s2 = mash(' ');", + " s0 -= mash(seed);", + " if (s0 < 0) {", + " s0 += 1;", + " }", + " s1 -= mash(seed);", + " if (s1 < 0) {", + " s1 += 1;", + " }", + " s2 -= mash(seed);", + " if (s2 < 0) {", + " s2 += 1;", + " }", + " return function () {", + " const t = 2091639 * s0 + c * 2.3283064365386963e-10;", + " s0 = s1;", + " s1 = s2;", + " return s2 = t - (c = t | 0);", + " };", + "}", + "function masher() {", + " let n = 0xefc8249d;", + " return function (data) {", + " data = data.toString();", + " for (let i = 0; i < data.length; i++) {", + " n += data.charCodeAt(i);", + " let h = 0.02519603282416938 * n;", + " n = h >>> 0;", + " h -= n;", + " h *= n;", + " n = h >>> 0;", + " h -= n;", + " n += h * 0x100000000;", + " }", + " return (n >>> 0) * 2.3283064365386963e-10;", + " };", + "}", + "", + "class TurbulenceField {", + " constructor(scale, octaves, velocityMultiplier, timeScale) {", + " this.scale = scale;", + " this.octaves = octaves;", + " this.velocityMultiplier = velocityMultiplier;", + " this.timeScale = timeScale;", + " this.type = 'TurbulenceField';", + " this.generator = new SimplexNoise();", + " this.timeOffset = new THREE.Vector3();", + " this.temp = new THREE.Vector3();", + " this.temp2 = new THREE.Vector3();", + " this.timeOffset.x = Math.random() / this.scale.x * this.timeScale.x;", + " this.timeOffset.y = Math.random() / this.scale.y * this.timeScale.y;", + " this.timeOffset.z = Math.random() / this.scale.z * this.timeScale.z;", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " const x = particle.position.x / this.scale.x;", + " const y = particle.position.y / this.scale.y;", + " const z = particle.position.z / this.scale.z;", + " this.temp.set(0, 0, 0);", + " let lvl = 1;", + " for (let i = 0; i < this.octaves; i++) {", + " this.temp2.set(this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.x * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.y * lvl) / lvl, this.generator.noise4D(x * lvl, y * lvl, z * lvl, this.timeOffset.z * lvl) / lvl);", + " this.temp.add(this.temp2);", + " lvl *= 2;", + " }", + " this.temp.multiply(this.velocityMultiplier);", + " particle.velocity.addScaledVector(this.temp, delta);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " scale: [this.scale.x, this.scale.y, this.scale.z],", + " octaves: this.octaves,", + " velocityMultiplier: [this.velocityMultiplier.x, this.velocityMultiplier.y, this.velocityMultiplier.z],", + " timeScale: [this.timeScale.x, this.timeScale.y, this.timeScale.z],", + " };", + " }", + " frameUpdate(delta) {", + " this.timeOffset.x += delta * this.timeScale.x;", + " this.timeOffset.y += delta * this.timeScale.y;", + " this.timeOffset.z += delta * this.timeScale.z;", + " }", + " static fromJSON(json) {", + " return new TurbulenceField(new THREE.Vector3(json.scale[0], json.scale[1], json.scale[2]), json.octaves, new THREE.Vector3(json.velocityMultiplier[0], json.velocityMultiplier[1], json.velocityMultiplier[2]), new THREE.Vector3(json.timeScale[0], json.timeScale[1], json.timeScale[2]));", + " }", + " clone() {", + " return new TurbulenceField(this.scale.clone(), this.octaves, this.velocityMultiplier.clone(), this.timeScale.clone());", + " }", + " reset() {", + " }", + "}", + "", + "function randomInt(a, b) {", + " return Math.floor(Math.random() * (b - a)) + a;", + "}", + "", + "const generators = [];", + "const tempV$2 = new THREE.Vector3();", + "const tempQ$2 = new THREE.Quaternion();", + "class Noise {", + " constructor(frequency, power, positionAmount = new ConstantValue(1), rotationAmount = new ConstantValue(0)) {", + " this.frequency = frequency;", + " this.power = power;", + " this.positionAmount = positionAmount;", + " this.rotationAmount = rotationAmount;", + " this.type = 'Noise';", + " this.duration = 0;", + " if (generators.length === 0) {", + " for (let i = 0; i < 100; i++) {", + " generators.push(new SimplexNoise());", + " }", + " }", + " }", + " initialize(particle) {", + " particle.lastPosNoise = new THREE.Vector3();", + " if (typeof particle.rotation === 'number') {", + " particle.lastRotNoise = 0;", + " }", + " else {", + " particle.lastRotNoise = new THREE.Quaternion();", + " }", + " particle.generatorIndex = [randomInt(0, 100), randomInt(0, 100), randomInt(0, 100), randomInt(0, 100)];", + " }", + " update(particle, _) {", + " let frequency = this.frequency.genValue(particle.age / particle.life);", + " let power = this.power.genValue(particle.age / particle.life);", + " let positionAmount = this.positionAmount.genValue(particle.age / particle.life);", + " let rotationAmount = this.rotationAmount.genValue(particle.age / particle.life);", + " if (positionAmount > 0 && particle.lastPosNoise !== undefined) {", + " particle.position.sub(particle.lastPosNoise);", + " tempV$2.set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", + " power *", + " positionAmount);", + " particle.position.add(tempV$2);", + " particle.lastPosNoise.copy(tempV$2);", + " }", + " if (rotationAmount > 0 && particle.lastRotNoise !== undefined) {", + " if (typeof particle.rotation === 'number') {", + " particle.rotation -= particle.lastRotNoise;", + " particle.rotation +=", + " generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", + " Math.PI *", + " power *", + " rotationAmount;", + " }", + " else {", + " particle.lastRotNoise.invert();", + " particle.rotation.multiply(particle.lastRotNoise);", + " tempQ$2", + " .set(generators[particle.generatorIndex[0]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[1]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[2]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount, generators[particle.generatorIndex[3]].noise2D(0, particle.age * frequency) *", + " power *", + " rotationAmount)", + " .normalize();", + " particle.rotation.multiply(tempQ$2);", + " particle.lastRotNoise.copy(tempQ$2);", + " }", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " frequency: this.frequency.toJSON(),", + " power: this.power.toJSON(),", + " positionAmount: this.positionAmount.toJSON(),", + " rotationAmount: this.rotationAmount.toJSON(),", + " };", + " }", + " frameUpdate(delta) {", + " this.duration += delta;", + " }", + " static fromJSON(json) {", + " return new Noise(ValueGeneratorFromJSON(json.frequency), ValueGeneratorFromJSON(json.power), ValueGeneratorFromJSON(json.positionAmount), ValueGeneratorFromJSON(json.rotationAmount));", + " }", + " clone() {", + " return new Noise(this.frequency.clone(), this.power.clone(), this.positionAmount.clone(), this.rotationAmount.clone());", + " }", + " reset() { }", + "}", + "", + "class TextureSequencer {", + " constructor(scaleX = 0, scaleY = 0, position = new THREE.Vector3()) {", + " this.scaleX = scaleX;", + " this.scaleY = scaleY;", + " this.position = position;", + " this.locations = [];", + " }", + " transform(position, index) {", + " position.x = this.locations[index % this.locations.length].x * this.scaleX + this.position.x;", + " position.y = this.locations[index % this.locations.length].y * this.scaleY + this.position.y;", + " position.z = this.position.z;", + " }", + " static fromJSON(json) {", + " const textureSequencer = new TextureSequencer(json.scaleX, json.scaleY, new THREE.Vector3(json.position[0], json.position[1], json.position[2]));", + " textureSequencer.locations = json.locations.map((loc) => new THREE.Vector2(loc.x, loc.y));", + " return textureSequencer;", + " }", + " clone() {", + " const textureSequencer = new TextureSequencer(this.scaleX, this.scaleY, this.position.clone());", + " textureSequencer.locations = this.locations.map(loc => loc.clone());", + " return textureSequencer;", + " }", + " toJSON() {", + " return {", + " scaleX: this.scaleX,", + " scaleY: this.scaleY,", + " position: this.position,", + " locations: this.locations.map(loc => ({", + " x: loc.x,", + " y: loc.y,", + " }))", + " };", + " }", + " fromImage(img, threshold) {", + " const canvas = document.createElement(\"canvas\");", + " canvas.width = img.width;", + " canvas.height = img.height;", + " const ctx = canvas.getContext(\"2d\");", + " if (!ctx) {", + " return;", + " }", + " ctx.drawImage(img, 0, 0);", + " const data = ctx.getImageData(0, 0, canvas.width, canvas.height, { colorSpace: \"srgb\" });", + " canvas.remove();", + " this.locations.length = 0;", + " for (let i = 0; i < data.height; i++) {", + " for (let j = 0; j < data.width; j++) {", + " if (data.data[(i * data.width + j) * 4 + 3] > threshold) {", + " this.locations.push(new THREE.Vector2(j, data.height - i));", + " }", + " }", + " }", + " }", + "}", + "", + "function SequencerFromJSON(json) {", + " switch (json.type) {", + " case 'TextureSequencer':", + " return TextureSequencer.fromJSON(json);", + " default:", + " return new TextureSequencer();", + " }", + "}", + "", + "class ApplySequences {", + " constructor(delayBetweenParticles) {", + " this.type = 'ApplySequences';", + " this.sequencers = [];", + " this.time = 0;", + " this.index = 0;", + " this.pCount = 0;", + " this.tempV = new THREE.Vector3();", + " this.delay = delayBetweenParticles;", + " }", + " initialize(particle) {", + " particle.id = this.pCount;", + " particle.dst = new THREE.Vector3();", + " particle.begin = new THREE.Vector3();", + " particle.inMotion = false;", + " this.pCount++;", + " }", + " reset() {", + " this.time = 0;", + " this.index = 0;", + " this.pCount = 0;", + " }", + " update(particle, delta) {", + " const sequencer = this.sequencers[this.index];", + " const delay = particle.id * this.delay;", + " if (this.time >= sequencer[0].a + delay && this.time <= sequencer[0].b + delay) {", + " if (!particle.inMotion) {", + " particle.inMotion = true;", + " particle.begin.copy(particle.position);", + " sequencer[1].transform(particle.dst, particle.id);", + " }", + " particle.position.lerpVectors(particle.begin, particle.dst, ApplySequences.BEZIER.genValue((this.time - sequencer[0].a - delay) / (sequencer[0].b - sequencer[0].a)));", + " }", + " else if (this.time > sequencer[0].b + delay) {", + " particle.inMotion = false;", + " }", + " }", + " frameUpdate(delta) {", + " while (this.index + 1 < this.sequencers.length && this.time >= this.sequencers[this.index + 1][0].a) {", + " this.index++;", + " }", + " this.time += delta;", + " }", + " appendSequencer(range, sequencer) {", + " this.sequencers.push([range, sequencer]);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " delay: this.delay,", + " sequencers: this.sequencers.map(([range, sequencer]) => ({", + " range: range.toJSON(),", + " sequencer: sequencer.toJSON(),", + " })),", + " };", + " }", + " static fromJSON(json) {", + " const seq = new ApplySequences(json.delay);", + " json.sequencers.forEach((sequencerJson) => {", + " seq.sequencers.push([ValueGeneratorFromJSON(sequencerJson.range), SequencerFromJSON(sequencerJson.sequencer)]);", + " });", + " return seq;", + " }", + " clone() {", + " const applySequences = new ApplySequences(this.delay);", + " applySequences.sequencers = this.sequencers.map(seq => [seq[0].clone(), seq[1].clone()]);", + " return applySequences;", + " }", + "}", + "ApplySequences.BEZIER = new Bezier(0, 0, 1, 1);", + "", + "let physicsResolver;", + "function setPhysicsResolver(resolver) {", + " physicsResolver = resolver;", + "}", + "function getPhysicsResolver() {", + " return physicsResolver;", + "}", + "class ApplyCollision {", + " constructor(resolver, bounce) {", + " this.resolver = resolver;", + " this.bounce = bounce;", + " this.type = 'ApplyCollision';", + " this.tempV = new THREE.Vector3();", + " }", + " initialize(particle) {", + " }", + " update(particle, delta) {", + " if (this.resolver.resolve(particle.position, this.tempV)) {", + " particle.velocity.reflect(this.tempV).multiplyScalar(this.bounce);", + " }", + " }", + " frameUpdate(delta) {", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " bounce: this.bounce,", + " };", + " }", + " static fromJSON(json) {", + " return new ApplyCollision(getPhysicsResolver(), json.bounce);", + " }", + " clone() {", + " return new ApplyCollision(this.resolver, this.bounce);", + " }", + " reset() {", + " }", + "}", + "", + "class ColorBySpeed {", + " constructor(color, speedRange) {", + " this.color = color;", + " this.speedRange = speedRange;", + " this.type = 'ColorBySpeed';", + " }", + " initialize(particle) {", + " if (this.color.type === 'memorizedFunction') {", + " particle.colorOverLifeMemory = {};", + " this.color.startGen(particle.colorOverLifeMemory);", + " }", + " }", + " update(particle, delta) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " if (this.color.type === 'memorizedFunction') {", + " this.color.genColor(particle.color, t, particle.colorOverLifeMemory);", + " }", + " else {", + " this.color.genColor(particle.color, t);", + " }", + " particle.color.x *= particle.startColor.x;", + " particle.color.y *= particle.startColor.y;", + " particle.color.z *= particle.startColor.z;", + " particle.color.w *= particle.startColor.w;", + " }", + " frameUpdate(delta) { }", + " toJSON() {", + " return {", + " type: this.type,", + " color: this.color.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ColorBySpeed(ColorGeneratorFromJSON(json.color), IntervalValue.fromJSON(json.speedRange));", + " }", + " clone() {", + " return new ColorBySpeed(this.color.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class SizeBySpeed {", + " initialize(particle) { }", + " constructor(size, speedRange) {", + " this.size = size;", + " this.speedRange = speedRange;", + " this.type = 'SizeBySpeed';", + " }", + " update(particle) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " particle.size = particle.startSize * this.size.genValue(t);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " size: this.size.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SizeBySpeed(ValueGeneratorFromJSON(json.size), IntervalValue.fromJSON(json.speedRange));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new SizeBySpeed(this.size.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class RotationBySpeed {", + " constructor(angularVelocity, speedRange) {", + " this.angularVelocity = angularVelocity;", + " this.speedRange = speedRange;", + " this.type = 'RotationBySpeed';", + " this.tempQuat = new THREE.Quaternion();", + " }", + " initialize(particle) { }", + " update(particle, delta) {", + " const t = (particle.startSpeed - this.speedRange.a) / (this.speedRange.b - this.speedRange.a);", + " particle.rotation += delta * this.angularVelocity.genValue(t);", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " angularVelocity: this.angularVelocity.toJSON(),", + " speedRange: this.speedRange.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new RotationBySpeed(ValueGeneratorFromJSON(json.angularVelocity), IntervalValue.fromJSON(json.speedRange));", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new RotationBySpeed(this.angularVelocity.clone(), this.speedRange.clone());", + " }", + " reset() { }", + "}", + "", + "class LimitSpeedOverLife {", + " initialize(particle) { }", + " constructor(speed, dampen) {", + " this.speed = speed;", + " this.dampen = dampen;", + " this.type = 'LimitSpeedOverLife';", + " }", + " update(particle, delta) {", + " let speed = particle.velocity.length();", + " let limit = this.speed.genValue(particle.age / particle.life);", + " if (speed > limit) {", + " const percent = (speed - limit) / speed;", + " particle.velocity.multiplyScalar(1 - percent * this.dampen * delta * 20);", + " }", + " }", + " toJSON() {", + " return {", + " type: this.type,", + " speed: this.speed.toJSON(),", + " dampen: this.dampen,", + " };", + " }", + " static fromJSON(json) {", + " return new LimitSpeedOverLife(ValueGeneratorFromJSON(json.speed), json.dampen);", + " }", + " frameUpdate(delta) { }", + " clone() {", + " return new LimitSpeedOverLife(this.speed.clone(), this.dampen);", + " }", + " reset() { }", + "}", + "", + "const BehaviorTypes = {", + " ApplyForce: {", + " type: 'ApplyForce',", + " constructor: ApplyForce,", + " params: [", + " ['direction', 'vec3'],", + " ['magnitude', 'value'],", + " ],", + " loadJSON: ApplyForce.fromJSON,", + " },", + " Noise: {", + " type: 'Noise',", + " constructor: Noise,", + " params: [", + " ['frequency', 'value'],", + " ['power', 'value'],", + " ['positionAmount', 'value'],", + " ['rotationAmount', 'value'],", + " ],", + " loadJSON: Noise.fromJSON,", + " },", + " TurbulenceField: {", + " type: 'TurbulenceField',", + " constructor: TurbulenceField,", + " params: [", + " ['scale', 'vec3'],", + " ['octaves', 'number'],", + " ['velocityMultiplier', 'vec3'],", + " ['timeScale', 'vec3'],", + " ],", + " loadJSON: TurbulenceField.fromJSON,", + " },", + " GravityForce: {", + " type: 'GravityForce',", + " constructor: GravityForce,", + " params: [", + " ['center', 'vec3'],", + " ['magnitude', 'number'],", + " ],", + " loadJSON: GravityForce.fromJSON,", + " },", + " ColorOverLife: {", + " type: 'ColorOverLife',", + " constructor: ColorOverLife,", + " params: [['color', 'colorFunc']],", + " loadJSON: ColorOverLife.fromJSON,", + " },", + " RotationOverLife: {", + " type: 'RotationOverLife',", + " constructor: RotationOverLife,", + " params: [['angularVelocity', 'valueFunc']],", + " loadJSON: RotationOverLife.fromJSON,", + " },", + " Rotation3DOverLife: {", + " type: 'Rotation3DOverLife',", + " constructor: Rotation3DOverLife,", + " params: [['angularVelocity', 'rotationFunc']],", + " loadJSON: Rotation3DOverLife.fromJSON,", + " },", + " SizeOverLife: {", + " type: 'SizeOverLife',", + " constructor: SizeOverLife,", + " params: [['size', 'valueFunc']],", + " loadJSON: SizeOverLife.fromJSON,", + " },", + " ColorBySpeed: {", + " type: 'ColorBySpeed',", + " constructor: ColorBySpeed,", + " params: [", + " ['color', 'colorFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: ColorBySpeed.fromJSON,", + " },", + " RotationBySpeed: {", + " type: 'RotationBySpeed',", + " constructor: RotationBySpeed,", + " params: [", + " ['angularVelocity', 'valueFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: RotationBySpeed.fromJSON,", + " },", + " SizeBySpeed: {", + " type: 'SizeBySpeed',", + " constructor: SizeBySpeed,", + " params: [", + " ['size', 'valueFunc'],", + " ['speedRange', 'range'],", + " ],", + " loadJSON: SizeBySpeed.fromJSON,", + " },", + " SpeedOverLife: {", + " type: 'SpeedOverLife',", + " constructor: SpeedOverLife,", + " params: [['speed', 'valueFunc']],", + " loadJSON: SpeedOverLife.fromJSON,", + " },", + " FrameOverLife: {", + " type: 'FrameOverLife',", + " constructor: FrameOverLife,", + " params: [['frame', 'valueFunc']],", + " loadJSON: FrameOverLife.fromJSON,", + " },", + " ForceOverLife: {", + " type: 'ForceOverLife',", + " constructor: ForceOverLife,", + " params: [", + " ['x', 'valueFunc'],", + " ['y', 'valueFunc'],", + " ['z', 'valueFunc'],", + " ],", + " loadJSON: ForceOverLife.fromJSON,", + " },", + " OrbitOverLife: {", + " type: 'OrbitOverLife',", + " constructor: OrbitOverLife,", + " params: [", + " ['orbitSpeed', 'valueFunc'],", + " ['axis', 'vec3'],", + " ],", + " loadJSON: OrbitOverLife.fromJSON,", + " },", + " WidthOverLength: {", + " type: 'WidthOverLength',", + " constructor: WidthOverLength,", + " params: [['width', 'valueFunc']],", + " loadJSON: WidthOverLength.fromJSON,", + " },", + " ChangeEmitDirection: {", + " type: 'ChangeEmitDirection',", + " constructor: ChangeEmitDirection,", + " params: [['angle', 'value']],", + " loadJSON: ChangeEmitDirection.fromJSON,", + " },", + " EmitSubParticleSystem: {", + " type: 'EmitSubParticleSystem',", + " constructor: EmitSubParticleSystem,", + " params: [", + " ['particleSystem', 'self'],", + " ['useVelocityAsBasis', 'boolean'],", + " ['subParticleSystem', 'particleSystem'],", + " ['mode', 'number'],", + " ['emitProbability', 'number'],", + " ],", + " loadJSON: EmitSubParticleSystem.fromJSON,", + " },", + " LimitSpeedOverLife: {", + " type: 'LimitSpeedOverLife',", + " constructor: LimitSpeedOverLife,", + " params: [", + " ['speed', 'valueFunc'],", + " ['dampen', 'number'],", + " ],", + " loadJSON: LimitSpeedOverLife.fromJSON,", + " },", + "};", + "function BehaviorFromJSON(json, particleSystem) {", + " return BehaviorTypes[json.type].loadJSON(json, particleSystem);", + "}", + "", + "gdjs.__particleEmmiter3DExtension.EmitterMode = void 0;", + "(function (EmitterMode) {", + " EmitterMode[EmitterMode[\"Random\"] = 0] = \"Random\";", + " EmitterMode[EmitterMode[\"Loop\"] = 1] = \"Loop\";", + " EmitterMode[EmitterMode[\"PingPong\"] = 2] = \"PingPong\";", + " EmitterMode[EmitterMode[\"Burst\"] = 3] = \"Burst\";", + "})(gdjs.__particleEmmiter3DExtension.EmitterMode || (gdjs.__particleEmmiter3DExtension.EmitterMode = {}));", + "function getValueFromEmitterMode(mode, currentValue, spread) {", + " let u;", + " if (gdjs.__particleEmmiter3DExtension.EmitterMode.Random === mode) {", + " currentValue = Math.random();", + " }", + " if (spread > 0) {", + " u = Math.floor(currentValue / spread) * spread;", + " }", + " else {", + " u = currentValue;", + " }", + " switch (mode) {", + " case gdjs.__particleEmmiter3DExtension.EmitterMode.Loop:", + " u = u % 1;", + " break;", + " case gdjs.__particleEmmiter3DExtension.EmitterMode.PingPong:", + " u = Math.abs((u % 2) - 1);", + " break;", + " }", + " return u;", + "}", + "", + "class ConeEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.type = 'cone';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.angle = (_d = parameters.angle) !== null && _d !== void 0 ? _d : Math.PI / 6;", + " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : gdjs.__particleEmmiter3DExtension.EmitterMode.Random;", + " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", + " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (gdjs.__particleEmmiter3DExtension.EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const r = Math.sqrt(rand);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " p.position.x = r * cosTheta;", + " p.position.y = r * sinTheta;", + " p.position.z = 0;", + " const angle = this.angle * r;", + " p.velocity.set(0, 0, Math.cos(angle)).addScaledVector(p.position, Math.sin(angle)).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius);", + " }", + " toJSON() {", + " return {", + " type: 'cone',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new ConeEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " angle: json.angle,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new ConeEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " angle: this.angle,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class CircleEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'circle';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : gdjs.__particleEmmiter3DExtension.EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const r = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " p.position.x = Math.cos(theta);", + " p.position.y = Math.sin(theta);", + " p.position.z = 0;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * r);", + " }", + " toJSON() {", + " return {", + " type: 'circle',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new CircleEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new CircleEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class DonutEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.type = 'donut';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.donutRadius = (_d = parameters.donutRadius) !== null && _d !== void 0 ? _d : this.radius * 0.2;", + " this.mode = (_e = parameters.mode) !== null && _e !== void 0 ? _e : gdjs.__particleEmmiter3DExtension.EmitterMode.Random;", + " this.spread = (_f = parameters.spread) !== null && _f !== void 0 ? _f : 0;", + " this.speed = (_g = parameters.speed) !== null && _g !== void 0 ? _g : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (gdjs.__particleEmmiter3DExtension.EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = v * Math.PI * 2;", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " p.position.x = this.radius * cosTheta;", + " p.position.y = this.radius * sinTheta;", + " p.position.z = 0;", + " p.velocity.z = this.donutRadius * rand * Math.sin(phi);", + " p.velocity.x = this.donutRadius * rand * Math.cos(phi) * cosTheta;", + " p.velocity.y = this.donutRadius * rand * Math.cos(phi) * sinTheta;", + " p.position.add(p.velocity);", + " p.velocity.normalize().multiplyScalar(p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'donut',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " donutRadius: this.donutRadius,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new DonutEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " donutRadius: json.donutRadius,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new DonutEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " donutRadius: this.donutRadius,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class PointEmitter {", + " constructor() {", + " this.type = 'point';", + " }", + " update(system, delta) { }", + " initialize(p) {", + " const u = Math.random();", + " const v = Math.random();", + " const theta = u * Math.PI * 2;", + " const phi = Math.acos(2.0 * v - 1.0);", + " const r = Math.cbrt(Math.random());", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.velocity.x = r * sinPhi * cosTheta;", + " p.velocity.y = r * sinPhi * sinTheta;", + " p.velocity.z = r * cosPhi;", + " p.velocity.multiplyScalar(p.startSpeed);", + " p.position.setScalar(0);", + " }", + " toJSON() {", + " return {", + " type: 'point',", + " };", + " }", + " static fromJSON(json) {", + " return new PointEmitter();", + " }", + " clone() {", + " return new PointEmitter();", + " }", + "}", + "", + "class SphereEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'sphere';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : gdjs.__particleEmmiter3DExtension.EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (gdjs.__particleEmmiter3DExtension.EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = Math.acos(2.0 * v - 1.0);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.position.x = sinPhi * cosTheta;", + " p.position.y = sinPhi * sinTheta;", + " p.position.z = cosPhi;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * rand);", + " }", + " toJSON() {", + " return {", + " type: 'sphere',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new SphereEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new SphereEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class HemisphereEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d, _e, _f;", + " this.type = 'sphere';", + " this.currentValue = 0;", + " this.radius = (_a = parameters.radius) !== null && _a !== void 0 ? _a : 10;", + " this.arc = (_b = parameters.arc) !== null && _b !== void 0 ? _b : 2.0 * Math.PI;", + " this.thickness = (_c = parameters.thickness) !== null && _c !== void 0 ? _c : 1;", + " this.mode = (_d = parameters.mode) !== null && _d !== void 0 ? _d : gdjs.__particleEmmiter3DExtension.EmitterMode.Random;", + " this.spread = (_e = parameters.spread) !== null && _e !== void 0 ? _e : 0;", + " this.speed = (_f = parameters.speed) !== null && _f !== void 0 ? _f : new ConstantValue(1);", + " }", + " update(system, delta) {", + " if (gdjs.__particleEmmiter3DExtension.EmitterMode.Random != this.mode) {", + " this.currentValue += this.speed.genValue(system.emissionState.time / system.duration) * delta;", + " }", + " }", + " initialize(p) {", + " const u = getValueFromEmitterMode(this.mode, this.currentValue, this.spread);", + " const v = Math.random();", + " const rand = THREE.MathUtils.lerp(1 - this.thickness, 1, Math.random());", + " const theta = u * this.arc;", + " const phi = Math.acos(v);", + " const sinTheta = Math.sin(theta);", + " const cosTheta = Math.cos(theta);", + " const sinPhi = Math.sin(phi);", + " const cosPhi = Math.cos(phi);", + " p.position.x = sinPhi * cosTheta;", + " p.position.y = sinPhi * sinTheta;", + " p.position.z = cosPhi;", + " p.velocity.copy(p.position).multiplyScalar(p.startSpeed);", + " p.position.multiplyScalar(this.radius * rand);", + " }", + " toJSON() {", + " return {", + " type: 'hemisphere',", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " spread: this.spread,", + " speed: this.speed.toJSON(),", + " };", + " }", + " static fromJSON(json) {", + " return new HemisphereEmitter({", + " radius: json.radius,", + " arc: json.arc,", + " thickness: json.thickness,", + " mode: json.mode,", + " speed: json.speed ? ValueGeneratorFromJSON(json.speed) : undefined,", + " spread: json.spread,", + " });", + " }", + " clone() {", + " return new HemisphereEmitter({", + " radius: this.radius,", + " arc: this.arc,", + " thickness: this.thickness,", + " mode: this.mode,", + " speed: this.speed.clone(),", + " spread: this.spread,", + " });", + " }", + "}", + "", + "class GridEmitter {", + " constructor(parameters = {}) {", + " var _a, _b, _c, _d;", + " this.type = 'grid';", + " this.width = (_a = parameters.width) !== null && _a !== void 0 ? _a : 1;", + " this.height = (_b = parameters.height) !== null && _b !== void 0 ? _b : 1;", + " this.column = (_c = parameters.column) !== null && _c !== void 0 ? _c : 10;", + " this.row = (_d = parameters.row) !== null && _d !== void 0 ? _d : 10;", + " }", + " initialize(p) {", + " const r = Math.floor(Math.random() * this.row);", + " const c = Math.floor(Math.random() * this.column);", + " p.position.x = (c * this.width) / this.column - this.width / 2;", + " p.position.y = (r * this.height) / this.row - this.height / 2;", + " p.position.z = 0;", + " p.velocity.set(0, 0, p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'grid',", + " width: this.width,", + " height: this.height,", + " column: this.column,", + " row: this.row,", + " };", + " }", + " static fromJSON(json) {", + " return new GridEmitter(json);", + " }", + " clone() {", + " return new GridEmitter({", + " width: this.width,", + " height: this.height,", + " column: this.column,", + " row: this.row,", + " });", + " }", + " update(system, delta) { }", + "}", + "", + "class MeshSurfaceEmitter {", + " get geometry() {", + " return this._geometry;", + " }", + " set geometry(geometry) {", + " this._geometry = geometry;", + " if (geometry === undefined) {", + " return;", + " }", + " if (typeof geometry === 'string') {", + " return;", + " }", + " const tri = new THREE.Triangle();", + " this._triangleIndexToArea.length = 0;", + " let area = 0;", + " if (!geometry.getIndex()) {", + " return;", + " }", + " const array = geometry.getIndex().array;", + " const triCount = array.length / 3;", + " this._triangleIndexToArea.push(0);", + " for (let i = 0; i < triCount; i++) {", + " tri.setFromAttributeAndIndices(geometry.getAttribute('position'), array[i * 3], array[i * 3 + 1], array[i * 3 + 2]);", + " area += tri.getArea();", + " this._triangleIndexToArea.push(area);", + " }", + " geometry.userData.triangleIndexToArea = this._triangleIndexToArea;", + " }", + " constructor(geometry) {", + " this.type = 'mesh_surface';", + " this._triangleIndexToArea = [];", + " this._tempA = new THREE.Vector3();", + " this._tempB = new THREE.Vector3();", + " this._tempC = new THREE.Vector3();", + " if (!geometry) {", + " return;", + " }", + " this.geometry = geometry;", + " }", + " initialize(p) {", + " const geometry = this._geometry;", + " if (!geometry || geometry.getIndex() === null) {", + " p.position.set(0, 0, 0);", + " p.velocity.set(0, 0, 1).multiplyScalar(p.startSpeed);", + " return;", + " }", + " const triCount = this._triangleIndexToArea.length - 1;", + " let left = 0, right = triCount;", + " const target = Math.random() * this._triangleIndexToArea[triCount];", + " while (left + 1 < right) {", + " const mid = Math.floor((left + right) / 2);", + " if (target < this._triangleIndexToArea[mid]) {", + " right = mid;", + " }", + " else {", + " left = mid;", + " }", + " }", + " let u1 = Math.random();", + " let u2 = Math.random();", + " if (u1 + u2 > 1) {", + " u1 = 1 - u1;", + " u2 = 1 - u2;", + " }", + " const index1 = geometry.getIndex().array[left * 3];", + " const index2 = geometry.getIndex().array[left * 3 + 1];", + " const index3 = geometry.getIndex().array[left * 3 + 2];", + " const positionBuffer = geometry.getAttribute('position');", + " this._tempA.fromBufferAttribute(positionBuffer, index1);", + " this._tempB.fromBufferAttribute(positionBuffer, index2);", + " this._tempC.fromBufferAttribute(positionBuffer, index3);", + " this._tempB.sub(this._tempA);", + " this._tempC.sub(this._tempA);", + " this._tempA.addScaledVector(this._tempB, u1).addScaledVector(this._tempC, u2);", + " p.position.copy(this._tempA);", + " this._tempA.copy(this._tempB).cross(this._tempC).normalize();", + " p.velocity.copy(this._tempA).normalize().multiplyScalar(p.startSpeed);", + " }", + " toJSON() {", + " return {", + " type: 'mesh_surface',", + " mesh: this._geometry ? this._geometry.uuid : '',", + " };", + " }", + " static fromJSON(json, meta) {", + " return new MeshSurfaceEmitter(meta.geometries[json.geometry]);", + " }", + " clone() {", + " return new MeshSurfaceEmitter(this._geometry);", + " }", + " update(system, delta) { }", + "}", + "", + "const EmitterShapes = {", + " circle: {", + " type: 'circle',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: CircleEmitter,", + " loadJSON: CircleEmitter.fromJSON,", + " },", + " cone: {", + " type: 'cone',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: ConeEmitter,", + " loadJSON: ConeEmitter.fromJSON,", + " },", + " donut: {", + " type: 'donut',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['donutRadius', 'number'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: DonutEmitter,", + " loadJSON: DonutEmitter.fromJSON,", + " },", + " point: { type: 'point', params: [], constructor: PointEmitter, loadJSON: PointEmitter.fromJSON },", + " sphere: {", + " type: 'sphere',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: SphereEmitter,", + " loadJSON: SphereEmitter.fromJSON,", + " },", + " hemisphere: {", + " type: 'hemisphere',", + " params: [", + " ['radius', 'number'],", + " ['arc', 'radian'],", + " ['thickness', 'number'],", + " ['angle', 'radian'],", + " ['mode', 'emitterMode'],", + " ['spread', 'number'],", + " ['speed', 'valueFunc'],", + " ],", + " constructor: HemisphereEmitter,", + " loadJSON: HemisphereEmitter.fromJSON,", + " },", + " grid: {", + " type: 'grid',", + " params: [", + " ['width', 'number'],", + " ['height', 'number'],", + " ['rows', 'number'],", + " ['column', 'number'],", + " ],", + " constructor: GridEmitter,", + " loadJSON: GridEmitter.fromJSON,", + " },", + " mesh_surface: {", + " type: 'mesh_surface',", + " params: [['geometry', 'geometry']],", + " constructor: MeshSurfaceEmitter,", + " loadJSON: MeshSurfaceEmitter.fromJSON,", + " },", + "};", + "function EmitterFromJSON(json, meta) {", + " return EmitterShapes[json.type].loadJSON(json, meta);", + "}", + "", + "gdjs.__particleEmmiter3DExtension.RenderMode = void 0;", + "(function (RenderMode) {", + " RenderMode[RenderMode[\"BillBoard\"] = 0] = \"BillBoard\";", + " RenderMode[RenderMode[\"StretchedBillBoard\"] = 1] = \"StretchedBillBoard\";", + " RenderMode[RenderMode[\"Mesh\"] = 2] = \"Mesh\";", + " RenderMode[RenderMode[\"Trail\"] = 3] = \"Trail\";", + " RenderMode[RenderMode[\"HorizontalBillBoard\"] = 4] = \"HorizontalBillBoard\";", + " RenderMode[RenderMode[\"VerticalBillBoard\"] = 5] = \"VerticalBillBoard\";", + "})(gdjs.__particleEmmiter3DExtension.RenderMode || (gdjs.__particleEmmiter3DExtension.RenderMode = {}));", + "class VFXBatch extends THREE.Mesh {", + " constructor(settings) {", + " super();", + " this.type = 'VFXBatch';", + " this.maxParticles = 1000;", + " this.systems = new Set();", + " const layers = new THREE.Layers();", + " layers.mask = settings.layers.mask;", + " const newMat = settings.material.clone();", + " newMat.defines = {};", + " Object.assign(newMat.defines, settings.material.defines);", + " this.settings = {", + " instancingGeometry: settings.instancingGeometry,", + " renderMode: settings.renderMode,", + " renderOrder: settings.renderOrder,", + " material: newMat,", + " uTileCount: settings.uTileCount,", + " vTileCount: settings.vTileCount,", + " layers: layers,", + " };", + " this.frustumCulled = false;", + " this.renderOrder = this.settings.renderOrder;", + " }", + " addSystem(system) {", + " this.systems.add(system);", + " }", + " removeSystem(system) {", + " this.systems.delete(system);", + " }", + "}", + "", + "const UP = new THREE.Vector3(0, 0, 1);", + "const tempQ$1 = new THREE.Quaternion();", + "const tempV$1 = new THREE.Vector3();", + "const tempV2$1 = new THREE.Vector3();", + "new THREE.Vector3();", + "const PREWARM_FPS$1 = 60;", + "const DEFAULT_GEOMETRY$1 = new THREE.PlaneGeometry(1, 1, 1, 1);", + "class ParticleSystem {", + " set time(time) {", + " this.emissionState.time = time;", + " }", + " get time() {", + " return this.emissionState.time;", + " }", + " get layers() {", + " return this.rendererSettings.layers;", + " }", + " get texture() {", + " return this.rendererSettings.material.map;", + " }", + " set texture(texture) {", + " this.rendererSettings.material.map = texture;", + " this.neededToUpdateRender = true;", + " }", + " get material() {", + " return this.rendererSettings.material;", + " }", + " set material(material) {", + " this.rendererSettings.material = material;", + " this.neededToUpdateRender = true;", + " }", + " get uTileCount() {", + " return this.rendererSettings.uTileCount;", + " }", + " set uTileCount(u) {", + " this.rendererSettings.uTileCount = u;", + " this.neededToUpdateRender = true;", + " }", + " get vTileCount() {", + " return this.rendererSettings.vTileCount;", + " }", + " set vTileCount(v) {", + " this.rendererSettings.vTileCount = v;", + " this.neededToUpdateRender = true;", + " }", + " get instancingGeometry() {", + " return this.rendererSettings.instancingGeometry;", + " }", + " set instancingGeometry(geometry) {", + " this.restart();", + " this.particles.length = 0;", + " this.rendererSettings.instancingGeometry = geometry;", + " this.neededToUpdateRender = true;", + " }", + " get renderMode() {", + " return this.rendererSettings.renderMode;", + " }", + " set renderMode(renderMode) {", + " if ((this.rendererSettings.renderMode != gdjs.__particleEmmiter3DExtension.RenderMode.Trail && renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) ||", + " (this.rendererSettings.renderMode == gdjs.__particleEmmiter3DExtension.RenderMode.Trail && renderMode !== gdjs.__particleEmmiter3DExtension.RenderMode.Trail)) {", + " this.restart();", + " this.particles.length = 0;", + " }", + " if (this.rendererSettings.renderMode !== renderMode) {", + " switch (renderMode) {", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Trail:", + " this.rendererEmitterSettings = {", + " startLength: new ConstantValue(30),", + " followLocalOrigin: false,", + " };", + " break;", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Mesh:", + " this.rendererEmitterSettings = {", + " geometry: new THREE.PlaneGeometry(1, 1),", + " };", + " this.startRotation = new AxisAngleGenerator(new THREE.Vector3(0, 1, 0), new ConstantValue(0));", + " break;", + " case gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard:", + " this.rendererEmitterSettings = { speedFactor: 0, lengthFactor: 2 };", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " this.startRotation = new ConstantValue(0);", + " }", + " break;", + " case gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard:", + " this.rendererEmitterSettings = {};", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " this.startRotation = new ConstantValue(0);", + " }", + " break;", + " }", + " }", + " this.rendererSettings.renderMode = renderMode;", + " this.neededToUpdateRender = true;", + " }", + " get renderOrder() {", + " return this.rendererSettings.renderOrder;", + " }", + " set renderOrder(renderOrder) {", + " this.rendererSettings.renderOrder = renderOrder;", + " this.neededToUpdateRender = true;", + " }", + " get blending() {", + " return this.rendererSettings.material.blending;", + " }", + " set blending(blending) {", + " this.rendererSettings.material.blending = blending;", + " this.neededToUpdateRender = true;", + " }", + " constructor(parameters) {", + " var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;", + " this.temp = new THREE.Vector3();", + " this.travelDistance = 0;", + " this.normalMatrix = new THREE.Matrix3();", + " this.firstTimeUpdate = true;", + " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", + " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", + " this.looping = parameters.looping === undefined ? true : parameters.looping;", + " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", + " this.startLife = (_b = parameters.startLife) !== null && _b !== void 0 ? _b : new ConstantValue(5);", + " this.startSpeed = (_c = parameters.startSpeed) !== null && _c !== void 0 ? _c : new ConstantValue(0);", + " this.startRotation = (_d = parameters.startRotation) !== null && _d !== void 0 ? _d : new ConstantValue(0);", + " this.startSize = (_e = parameters.startSize) !== null && _e !== void 0 ? _e : new ConstantValue(1);", + " this.startColor = (_f = parameters.startColor) !== null && _f !== void 0 ? _f : new ConstantColor(new THREE.Vector4(1, 1, 1, 1));", + " this.emissionOverTime = (_g = parameters.emissionOverTime) !== null && _g !== void 0 ? _g : new ConstantValue(10);", + " this.emissionOverDistance = (_h = parameters.emissionOverDistance) !== null && _h !== void 0 ? _h : new ConstantValue(0);", + " this.emissionBursts = (_j = parameters.emissionBursts) !== null && _j !== void 0 ? _j : [];", + " this.onlyUsedByOther = (_k = parameters.onlyUsedByOther) !== null && _k !== void 0 ? _k : false;", + " this.emitterShape = (_l = parameters.shape) !== null && _l !== void 0 ? _l : new SphereEmitter();", + " this.behaviors = (_m = parameters.behaviors) !== null && _m !== void 0 ? _m : new Array();", + " this.worldSpace = (_o = parameters.worldSpace) !== null && _o !== void 0 ? _o : false;", + " this.rendererEmitterSettings = (_p = parameters.rendererEmitterSettings) !== null && _p !== void 0 ? _p : {};", + " if (parameters.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " const stretchedBillboardSettings = this.rendererEmitterSettings;", + " if (parameters.speedFactor !== undefined) {", + " stretchedBillboardSettings.speedFactor = parameters.speedFactor;", + " }", + " stretchedBillboardSettings.speedFactor = (_q = stretchedBillboardSettings.speedFactor) !== null && _q !== void 0 ? _q : 0;", + " stretchedBillboardSettings.lengthFactor = (_r = stretchedBillboardSettings.lengthFactor) !== null && _r !== void 0 ? _r : 0;", + " }", + " this.rendererSettings = {", + " instancingGeometry: (_s = parameters.instancingGeometry) !== null && _s !== void 0 ? _s : DEFAULT_GEOMETRY$1,", + " renderMode: (_t = parameters.renderMode) !== null && _t !== void 0 ? _t : gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard,", + " renderOrder: (_u = parameters.renderOrder) !== null && _u !== void 0 ? _u : 0,", + " material: parameters.material,", + " uTileCount: (_v = parameters.uTileCount) !== null && _v !== void 0 ? _v : 1,", + " vTileCount: (_w = parameters.vTileCount) !== null && _w !== void 0 ? _w : 1,", + " layers: (_x = parameters.layers) !== null && _x !== void 0 ? _x : new THREE.Layers(),", + " };", + " this.neededToUpdateRender = true;", + " this.particles = new Array();", + " this.startTileIndex = parameters.startTileIndex || new ConstantValue(0);", + " this.emitter = new ParticleEmitter(this);", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState = {", + " burstIndex: 0,", + " burstWaveIndex: 0,", + " time: 0,", + " waitEmiting: 0,", + " travelDistance: 0,", + " };", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " pause() {", + " this.paused = true;", + " }", + " play() {", + " this.paused = false;", + " }", + " spawn(count, emissionState, matrix) {", + " tempQ$1.setFromRotationMatrix(matrix);", + " const translation = tempV$1;", + " const quaternion = tempQ$1;", + " const scale = tempV2$1;", + " matrix.decompose(translation, quaternion, scale);", + " for (let i = 0; i < count; i++) {", + " this.particleNum++;", + " while (this.particles.length < this.particleNum) {", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " this.particles.push(new TrailParticle());", + " }", + " else {", + " this.particles.push(new SpriteParticle());", + " }", + " }", + " const particle = this.particles[this.particleNum - 1];", + " particle.speedModifier = 1;", + " this.startColor.genColor(particle.startColor, this.emissionState.time, {});", + " particle.color.copy(particle.startColor);", + " particle.startSpeed = this.startSpeed.genValue(emissionState.time / this.duration);", + " particle.life = this.startLife.genValue(emissionState.time / this.duration);", + " particle.age = 0;", + " particle.startSize = this.startSize.genValue(emissionState.time / this.duration);", + " particle.uvTile = Math.floor(this.startTileIndex.genValue() + 0.001);", + " particle.size = particle.startSize;", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh ||", + " this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard ||", + " this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard ||", + " this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard ||", + " this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " const sprite = particle;", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " if (!(sprite.rotation instanceof THREE.Quaternion)) {", + " sprite.rotation = new THREE.Quaternion();", + " }", + " if (this.startRotation.type === 'rotation') {", + " this.startRotation.genValue(sprite.rotation, emissionState.time / this.duration);", + " }", + " else {", + " sprite.rotation.setFromAxisAngle(UP, this.startRotation.genValue((emissionState.time / this.duration)));", + " }", + " }", + " else {", + " if (this.startRotation.type === 'rotation') {", + " sprite.rotation = 0;", + " }", + " else {", + " sprite.rotation = this.startRotation.genValue(emissionState.time / this.duration);", + " }", + " }", + " }", + " else if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " const trail = particle;", + " trail.length = this.rendererEmitterSettings.startLength.genValue(emissionState.time / this.duration);", + " }", + " this.emitterShape.initialize(particle);", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail &&", + " this.rendererEmitterSettings.followLocalOrigin) {", + " const trail = particle;", + " trail.localPosition = new THREE.Vector3().copy(trail.position);", + " }", + " if (this.worldSpace) {", + " particle.position.applyMatrix4(matrix);", + " particle.startSize =", + " (particle.startSize * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3;", + " particle.size = particle.startSize;", + " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", + " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", + " particle.rotation.multiplyQuaternions(tempQ$1, particle.rotation);", + " }", + " }", + " else {", + " if (this.onlyUsedByOther) {", + " particle.parentMatrix = matrix;", + " }", + " }", + " for (let j = 0; j < this.behaviors.length; j++) {", + " this.behaviors[j].initialize(particle);", + " }", + " }", + " }", + " endEmit() {", + " this.emitEnded = true;", + " if (this.autoDestroy) {", + " this.markForDestroy = true;", + " }", + " }", + " dispose() {", + " if (this._renderer)", + " this._renderer.deleteSystem(this);", + " this.emitter.dispose();", + " if (this.emitter.parent)", + " this.emitter.parent.remove(this.emitter);", + " }", + " restart() {", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState.burstIndex = 0;", + " this.emissionState.burstWaveIndex = 0;", + " this.emissionState.time = 0;", + " this.emissionState.waitEmiting = 0;", + " this.behaviors.forEach((behavior) => {", + " behavior.reset();", + " });", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " update(delta) {", + " if (this.paused)", + " return;", + " let currentParent = this.emitter;", + " while (currentParent.parent) {", + " currentParent = currentParent.parent;", + " }", + " if (currentParent.type !== 'Scene') {", + " this.dispose();", + " return;", + " }", + " if (this.firstTimeUpdate) {", + " this.firstTimeUpdate = false;", + " this.emitter.updateWorldMatrix(true, false);", + " }", + " if (this.emitEnded && this.particleNum === 0) {", + " if (this.markForDestroy && this.emitter.parent)", + " this.dispose();", + " return;", + " }", + " if (this.looping && this.prewarm && !this.prewarmed) {", + " this.prewarmed = true;", + " for (let i = 0; i < this.duration * PREWARM_FPS$1; i++) {", + " this.update(1.0 / PREWARM_FPS$1);", + " }", + " }", + " if (delta > 0.1) {", + " delta = 0.1;", + " }", + " if (this.neededToUpdateRender) {", + " if (this._renderer)", + " this._renderer.updateSystem(this);", + " this.neededToUpdateRender = false;", + " }", + " if (!this.onlyUsedByOther) {", + " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", + " }", + " this.emitterShape.update(this, delta);", + " for (let j = 0; j < this.behaviors.length; j++) {", + " for (let i = 0; i < this.particleNum; i++) {", + " if (!this.particles[i].died) {", + " this.behaviors[j].update(this.particles[i], delta);", + " }", + " }", + " this.behaviors[j].frameUpdate(delta);", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " if (this.rendererEmitterSettings.followLocalOrigin &&", + " this.particles[i].localPosition) {", + " this.particles[i].position.copy(this.particles[i].localPosition);", + " if (this.particles[i].parentMatrix) {", + " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", + " }", + " else {", + " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", + " }", + " }", + " else {", + " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta * this.particles[i].speedModifier);", + " }", + " this.particles[i].age += delta;", + " }", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " particle.update();", + " }", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", + " this.particles[i] = this.particles[this.particleNum - 1];", + " this.particles[this.particleNum - 1] = particle;", + " this.particleNum--;", + " i--;", + " }", + " }", + " }", + " emit(delta, emissionState, emitterMatrix) {", + " if (emissionState.time > this.duration) {", + " if (this.looping) {", + " emissionState.time -= this.duration;", + " emissionState.burstIndex = 0;", + " this.behaviors.forEach((behavior) => {", + " behavior.reset();", + " });", + " }", + " else {", + " if (!this.emitEnded && !this.onlyUsedByOther) {", + " this.endEmit();", + " }", + " }", + " }", + " this.normalMatrix.getNormalMatrix(emitterMatrix);", + " const totalSpawn = Math.ceil(emissionState.waitEmiting);", + " this.spawn(totalSpawn, emissionState, emitterMatrix);", + " emissionState.waitEmiting -= totalSpawn;", + " while (emissionState.burstIndex < this.emissionBursts.length &&", + " this.emissionBursts[emissionState.burstIndex].time <= emissionState.time) {", + " if (Math.random() < this.emissionBursts[emissionState.burstIndex].probability) {", + " const count = this.emissionBursts[emissionState.burstIndex].count.genValue(this.time);", + " this.spawn(count, emissionState, emitterMatrix);", + " }", + " emissionState.burstIndex++;", + " }", + " if (!this.emitEnded) {", + " emissionState.waitEmiting += delta * this.emissionOverTime.genValue(emissionState.time / this.duration);", + " if (emissionState.previousWorldPos != undefined) {", + " this.temp.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", + " emissionState.travelDistance += emissionState.previousWorldPos.distanceTo(this.temp);", + " const emitPerMeter = this.emissionOverDistance.genValue(emissionState.time / this.duration);", + " if (emissionState.travelDistance * emitPerMeter > 0) {", + " const count = Math.floor(emissionState.travelDistance * emitPerMeter);", + " emissionState.travelDistance -= count / emitPerMeter;", + " emissionState.waitEmiting += count;", + " }", + " }", + " }", + " if (emissionState.previousWorldPos === undefined)", + " emissionState.previousWorldPos = new THREE.Vector3();", + " emissionState.previousWorldPos.set(emitterMatrix.elements[12], emitterMatrix.elements[13], emitterMatrix.elements[14]);", + " emissionState.time += delta;", + " }", + " toJSON(meta, options = {}) {", + " const isRootObject = meta === undefined || typeof meta === 'string';", + " if (isRootObject) {", + " meta = {", + " geometries: {},", + " materials: {},", + " textures: {},", + " images: {},", + " shapes: {},", + " skeletons: {},", + " animations: {},", + " nodes: {},", + " };", + " }", + " meta.materials[this.rendererSettings.material.uuid] = this.rendererSettings.material.toJSON(meta);", + " if (options.useUrlForImage) {", + " if (this.texture.source !== undefined) {", + " const image = this.texture.source;", + " meta.images[image.uuid] = {", + " uuid: image.uuid,", + " url: this.texture.image.url,", + " };", + " }", + " }", + " let rendererSettingsJSON;", + " if (this.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " rendererSettingsJSON = {", + " startLength: this.rendererEmitterSettings.startLength.toJSON(),", + " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else if (this.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " rendererSettingsJSON = {};", + " }", + " else if (this.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " rendererSettingsJSON = {", + " speedFactor: this.rendererEmitterSettings.speedFactor,", + " lengthFactor: this.rendererEmitterSettings.lengthFactor,", + " };", + " }", + " else {", + " rendererSettingsJSON = {};", + " }", + " const geometry = this.rendererSettings.instancingGeometry;", + " if (meta.geometries && !meta.geometries[geometry.uuid]) {", + " meta.geometries[geometry.uuid] = geometry.toJSON();", + " }", + " return {", + " version: '2.0',", + " autoDestroy: this.autoDestroy,", + " looping: this.looping,", + " prewarm: this.prewarm,", + " duration: this.duration,", + " shape: this.emitterShape.toJSON(),", + " startLife: this.startLife.toJSON(),", + " startSpeed: this.startSpeed.toJSON(),", + " startRotation: this.startRotation.toJSON(),", + " startSize: this.startSize.toJSON(),", + " startColor: this.startColor.toJSON(),", + " emissionOverTime: this.emissionOverTime.toJSON(),", + " emissionOverDistance: this.emissionOverDistance.toJSON(),", + " emissionBursts: this.emissionBursts.map((burst) => ({", + " time: burst.time,", + " count: burst.count.toJSON(),", + " probability: burst.probability,", + " interval: burst.interval,", + " cycle: burst.cycle,", + " })),", + " onlyUsedByOther: this.onlyUsedByOther,", + " instancingGeometry: this.rendererSettings.instancingGeometry.uuid,", + " renderOrder: this.renderOrder,", + " renderMode: this.renderMode,", + " rendererEmitterSettings: rendererSettingsJSON,", + " material: this.rendererSettings.material.uuid,", + " layers: this.layers.mask,", + " startTileIndex: this.startTileIndex.toJSON(),", + " uTileCount: this.uTileCount,", + " vTileCount: this.vTileCount,", + " behaviors: this.behaviors.map((behavior) => behavior.toJSON()),", + " worldSpace: this.worldSpace,", + " };", + " }", + " static fromJSON(json, meta, dependencies) {", + " var _a, _b;", + " const shape = EmitterFromJSON(json.shape, meta);", + " let rendererEmitterSettings;", + " if (json.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " let trailSettings = json.rendererEmitterSettings;", + " rendererEmitterSettings = {", + " startLength: trailSettings.startLength != undefined", + " ? ValueGeneratorFromJSON(trailSettings.startLength)", + " : new ConstantValue(30),", + " followLocalOrigin: trailSettings.followLocalOrigin,", + " };", + " }", + " else if (json.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " rendererEmitterSettings = {};", + " }", + " else if (json.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " rendererEmitterSettings = json.rendererEmitterSettings;", + " if (json.speedFactor != undefined) {", + " rendererEmitterSettings.speedFactor = json.speedFactor;", + " }", + " }", + " else {", + " rendererEmitterSettings = {};", + " }", + " const layers = new THREE.Layers();", + " if (json.layers) {", + " layers.mask = json.layers;", + " }", + " const ps = new ParticleSystem({", + " autoDestroy: json.autoDestroy,", + " looping: json.looping,", + " prewarm: json.prewarm,", + " duration: json.duration,", + " shape: shape,", + " startLife: ValueGeneratorFromJSON(json.startLife),", + " startSpeed: ValueGeneratorFromJSON(json.startSpeed),", + " startRotation: GeneratorFromJSON(json.startRotation),", + " startSize: ValueGeneratorFromJSON(json.startSize),", + " startColor: ColorGeneratorFromJSON(json.startColor),", + " emissionOverTime: ValueGeneratorFromJSON(json.emissionOverTime),", + " emissionOverDistance: ValueGeneratorFromJSON(json.emissionOverDistance),", + " emissionBursts: (_a = json.emissionBursts) === null || _a === void 0 ? void 0 : _a.map((burst) => ({", + " time: burst.time,", + " count: typeof burst.count === 'number'", + " ? new ConstantValue(burst.count)", + " : ValueGeneratorFromJSON(burst.count),", + " probability: burst.probability,", + " interval: burst.interval,", + " cycle: burst.cycle,", + " })),", + " onlyUsedByOther: json.onlyUsedByOther,", + " instancingGeometry: meta.geometries[json.instancingGeometry],", + " renderMode: json.renderMode,", + " rendererEmitterSettings: rendererEmitterSettings,", + " renderOrder: json.renderOrder,", + " layers: layers,", + " material: json.material", + " ? meta.materials[json.material]", + " : json.texture", + " ? new THREE.MeshBasicMaterial({", + " map: meta.textures[json.texture],", + " transparent: (_b = json.transparent) !== null && _b !== void 0 ? _b : true,", + " blending: json.blending,", + " side: THREE.DoubleSide,", + " })", + " : new THREE.MeshBasicMaterial({", + " color: 0xffffff,", + " transparent: true,", + " blending: THREE.AdditiveBlending,", + " side: THREE.DoubleSide,", + " }),", + " startTileIndex: typeof json.startTileIndex === 'number'", + " ? new ConstantValue(json.startTileIndex)", + " : ValueGeneratorFromJSON(json.startTileIndex),", + " uTileCount: json.uTileCount,", + " vTileCount: json.vTileCount,", + " behaviors: [],", + " worldSpace: json.worldSpace,", + " });", + " ps.behaviors = json.behaviors.map((behaviorJson) => {", + " const behavior = BehaviorFromJSON(behaviorJson, ps);", + " if (behavior.type === 'EmitSubParticleSystem') {", + " dependencies[behaviorJson.subParticleSystem] = behavior;", + " }", + " return behavior;", + " });", + " return ps;", + " }", + " addBehavior(behavior) {", + " this.behaviors.push(behavior);", + " }", + " getRendererSettings() {", + " return this.rendererSettings;", + " }", + " clone() {", + " const newEmissionBursts = [];", + " for (const emissionBurst of this.emissionBursts) {", + " const newEmissionBurst = {};", + " Object.assign(newEmissionBurst, emissionBurst);", + " newEmissionBursts.push(newEmissionBurst);", + " }", + " const newBehaviors = [];", + " for (const behavior of this.behaviors) {", + " newBehaviors.push(behavior.clone());", + " }", + " let rendererEmitterSettings;", + " if (this.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " rendererEmitterSettings = {", + " startLength: this.rendererEmitterSettings.startLength.clone(),", + " followLocalOrigin: this.rendererEmitterSettings.followLocalOrigin,", + " };", + " }", + " else {", + " rendererEmitterSettings = {};", + " }", + " const layers = new THREE.Layers();", + " layers.mask = this.layers.mask;", + " return new ParticleSystem({", + " autoDestroy: this.autoDestroy,", + " looping: this.looping,", + " duration: this.duration,", + " shape: this.emitterShape.clone(),", + " startLife: this.startLife.clone(),", + " startSpeed: this.startSpeed.clone(),", + " startRotation: this.startRotation.clone(),", + " startSize: this.startSize.clone(),", + " startColor: this.startColor.clone(),", + " emissionOverTime: this.emissionOverTime.clone(),", + " emissionOverDistance: this.emissionOverDistance.clone(),", + " emissionBursts: newEmissionBursts,", + " onlyUsedByOther: this.onlyUsedByOther,", + " instancingGeometry: this.rendererSettings.instancingGeometry,", + " renderMode: this.renderMode,", + " renderOrder: this.renderOrder,", + " rendererEmitterSettings: rendererEmitterSettings,", + " material: this.rendererSettings.material,", + " startTileIndex: this.startTileIndex,", + " uTileCount: this.uTileCount,", + " vTileCount: this.vTileCount,", + " behaviors: newBehaviors,", + " worldSpace: this.worldSpace,", + " layers: layers,", + " });", + " }", + "}", + "", + "var particle_frag = `", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + "", + " #include ", + " ", + " vec3 outgoingLight = vec3( 0.0 );", + " vec4 diffuseColor = vColor;", + " ", + " #include ", + " ", + " #ifdef USE_MAP", + " diffuseColor *= texture2D( map, vMapUv);", + " #endif", + " ", + " #include ", + "", + " outgoingLight = diffuseColor.rgb;", + " ", + " #ifdef USE_COLOR_AS_ALPHA", + " gl_FragColor = vec4( outgoingLight, diffuseColor.r );", + " #else", + " gl_FragColor = vec4( outgoingLight, diffuseColor.a );", + " #endif", + " ", + " ", + " #include ", + "", + "}", + "`;", + "", + "var particle_physics_frag = `", + "#define STANDARD", + "#ifdef PHYSICAL", + "#define IOR", + "#define SPECULAR", + "#endif", + "uniform vec3 diffuse;", + "uniform vec3 emissive;", + "uniform float roughness;", + "uniform float metalness;", + "uniform float opacity;", + "#ifdef IOR", + "uniform float ior;", + "#endif", + "#ifdef SPECULAR", + "uniform float specularIntensity;", + "uniform vec3 specularColor;", + "#ifdef USE_SPECULARINTENSITYMAP", + "uniform sampler2D specularIntensityMap;", + "#endif", + "#ifdef USE_SPECULARCOLORMAP", + "uniform sampler2D specularColorMap;", + "#endif", + "#endif", + "#ifdef USE_CLEARCOAT", + "uniform float clearcoat;", + "uniform float clearcoatRoughness;", + "#endif", + "#ifdef USE_IRIDESCENCE", + "uniform float iridescence;", + "uniform float iridescenceIOR;", + "uniform float iridescenceThicknessMinimum;", + "uniform float iridescenceThicknessMaximum;", + "#endif", + "#ifdef USE_SHEEN", + "uniform vec3 sheenColor;", + "uniform float sheenRoughness;", + "#ifdef USE_SHEENCOLORMAP", + "uniform sampler2D sheenColorMap;", + "#endif", + "#ifdef USE_SHEENROUGHNESSMAP", + "uniform sampler2D sheenRoughnessMap;", + "#endif", + "#endif", + "", + "varying vec3 vViewPosition;", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + " #include ", + " vec4 diffuseColor = vec4( diffuse, opacity );", + " ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );", + " vec3 totalEmissiveRadiance = emissive;", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " // accumulation", + " #include ", + " #include ", + " #include ", + " #include ", + " // modulation", + " #include ", + " vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;", + " vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;", + " #include ", + " vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;", + " #ifdef USE_SHEEN", + " // Sheen energy compensation approximation calculation can be found at the end of", + " // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing", + " float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );", + " outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;", + " #endif", + " #ifdef USE_CLEARCOAT", + " float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );", + " vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );", + " outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;", + " #endif", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + " #include ", + "}`;", + "", + "var uv_vertex_tile = `", + "", + " #ifdef UV_TILE", + " float col = mod(uvTile, tileCount.x);", + " float row = (tileCount.y - floor(uvTile / tileCount.x) - 1.0);", + " ", + " mat3 tileTransform = mat3(", + " 1.0 / tileCount.x, 0.0, 0.0,", + " 0.0, 1.0 / tileCount.y, 0.0, ", + " col / tileCount.x, row / tileCount.y, 1.0);", + " #else", + " mat3 tileTransform = mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);", + " #endif", + "", + "#if defined( USE_UV ) || defined( USE_ANISOTROPY )", + "", + "vUv = (tileTransform *vec3( uv, 1 )).xy;", + "", + "#endif", + "#ifdef USE_MAP", + "", + "vMapUv = ( tileTransform * (mapTransform * vec3( MAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ALPHAMAP", + "", + "vAlphaMapUv = ( tileTransform * (alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_LIGHTMAP", + "", + "vLightMapUv = ( tileTransform * (lightMapTransform * vec3( LIGHTMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_AOMAP", + "", + "vAoMapUv = ( tileTransform * (aoMapTransform * vec3( AOMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_BUMPMAP", + "", + "vBumpMapUv = ( tileTransform * (bumpMapTransform * vec3( BUMPMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_NORMALMAP", + "", + "vNormalMapUv = ( tileTransform * (normalMapTransform * vec3( NORMALMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_DISPLACEMENTMAP", + "", + "vDisplacementMapUv = ( tileTransform * (displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_EMISSIVEMAP", + "", + "vEmissiveMapUv = ( tileTransform * (emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_METALNESSMAP", + "", + "vMetalnessMapUv = ( tileTransform * (metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ROUGHNESSMAP", + "", + "vRoughnessMapUv = ( tileTransform * (roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_ANISOTROPYMAP", + "", + "vAnisotropyMapUv = ( tileTransform * (anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOATMAP", + "", + "vClearcoatMapUv = ( tileTransform * (clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOAT_NORMALMAP", + "", + "vClearcoatNormalMapUv = ( tileTransform * (clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_CLEARCOAT_ROUGHNESSMAP", + "", + "vClearcoatRoughnessMapUv = ( tileTransform * (clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_IRIDESCENCEMAP", + "", + "vIridescenceMapUv = ( tileTransform * (iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_IRIDESCENCE_THICKNESSMAP", + "", + "vIridescenceThicknessMapUv = ( tileTransform * (iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SHEEN_COLORMAP", + "", + "vSheenColorMapUv = ( tileTransform * (sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SHEEN_ROUGHNESSMAP", + "", + "vSheenRoughnessMapUv = ( tileTransform * (sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULARMAP", + "", + "vSpecularMapUv = ( tileTransform * (specularMapTransform * vec3( SPECULARMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULAR_COLORMAP", + "", + "vSpecularColorMapUv = ( tileTransform * (specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_SPECULAR_INTENSITYMAP", + "", + "vSpecularIntensityMapUv = ( tileTransform * (specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_TRANSMISSIONMAP", + "", + "vTransmissionMapUv = ( tileTransform * transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) )).xy;", + "", + "#endif", + "#ifdef USE_THICKNESSMAP", + "", + "vThicknessMapUv = ( tileTransform * thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) )).xy;", + "", + "#endif", + "`;", + "", + "var particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute float rotation;", + "attribute float size;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + "\t", + " vec2 alignedPosition = ( position.xy ) * size;", + " ", + " vec2 rotatedPosition;", + " rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", + " rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", + "#ifdef HORIZONTAL", + " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", + " mvPosition.x += rotatedPosition.x;", + " mvPosition.z -= rotatedPosition.y;", + " mvPosition = viewMatrix * mvPosition;", + "#elif defined(VERTICAL)", + " vec4 mvPosition = modelMatrix * vec4( offset, 1.0 );", + " mvPosition.y += rotatedPosition.y;", + " mvPosition = viewMatrix * mvPosition;", + " mvPosition.x += rotatedPosition.x;", + "#else", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " mvPosition.xy += rotatedPosition;", + "#endif", + "", + "\tvColor = color;", + "", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "", + "}", + "`;", + "", + "var local_particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute vec4 rotation;", + "attribute float size;", + "// attribute vec4 color;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", + " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", + " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", + " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", + " float sx = size, sy = size, sz = size;", + " ", + " mat4 matrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", + " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", + " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", + " offset.x, offset.y, offset.z, 1.0);", + " ", + " vec4 mvPosition = modelViewMatrix * (matrix * vec4( position, 1.0 ));", + "", + "\tvColor = color;", + "", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "", + "}", + "`;", + "", + "var local_particle_physics_vert = `", + "#define STANDARD", + "varying vec3 vViewPosition;", + "#ifdef USE_TRANSMISSION", + "\tvarying vec3 vWorldPosition;", + "#endif", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute vec4 rotation;", + "attribute float size;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "void main() {", + " ${uv_vertex_tile}", + "", + " float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;", + " float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;", + " float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;", + " float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;", + " float sx = size, sy = size, sz = size;", + "", + " mat4 particleMatrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column", + " ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column", + " ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column", + " offset.x, offset.y, offset.z, 1.0);", + "", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "", + "\t// replace defaultnormal_vertex", + "\tvec3 transformedNormal = objectNormal;", + " mat3 m = mat3( particleMatrix );", + " transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );", + " transformedNormal = m * transformedNormal;", + " transformedNormal = normalMatrix * transformedNormal;", + " #ifdef FLIP_SIDED", + " transformedNormal = - transformedNormal;", + " #endif", + " #ifdef USE_TANGENT", + " vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;", + " #ifdef FLIP_SIDED", + " transformedTangent = - transformedTangent;", + " #endif", + " #endif", + "", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "\t#include ", + "", + "\t// replace include ", + " vec4 mvPosition = vec4( transformed, 1.0 );", + " mvPosition = modelViewMatrix * (particleMatrix * mvPosition);", + "\tgl_Position = projectionMatrix * mvPosition;", + "", + "\t#include ", + "\t#include ", + "\t", + "\tvViewPosition = - mvPosition.xyz;", + "\t", + "\t#include ", + "\t#include ", + "\t#include ", + "#ifdef USE_TRANSMISSION", + "\tvWorldPosition = worldPosition.xyz;", + "#endif", + "}", + "`;", + "", + "var stretched_bb_particle_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 offset;", + "attribute float rotation;", + "attribute float size;", + "attribute vec4 velocity;", + "attribute float uvTile;", + "", + "#ifdef UV_TILE", + "uniform vec2 tileCount;", + "#endif", + "", + "uniform float speedFactor;", + "", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float lengthFactor = velocity.w;", + "#ifdef USE_SKEW", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " vec3 viewVelocity = normalMatrix * velocity.xyz;", + "", + " vec3 scaledPos = vec3(position.xy * size, position.z);", + " float vlength = length(viewVelocity);", + " vec3 projVelocity = dot(scaledPos, viewVelocity) * viewVelocity / vlength;", + " mvPosition.xyz += scaledPos + projVelocity * (speedFactor / size + lengthFactor / vlength);", + "#else", + " vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );", + " vec3 viewVelocity = normalMatrix * velocity.xyz;", + " float vlength = length(viewVelocity); ", + " mvPosition.xyz += position.y * normalize(cross(mvPosition.xyz, viewVelocity)) * size; // switch the cross to match unity implementation", + " mvPosition.xyz -= (position.x + 0.5) * viewVelocity * (1.0 + lengthFactor / vlength) * size; // minus position.x to match unity implementation", + "#endif", + "\tvColor = color;", + "\tgl_Position = projectionMatrix * mvPosition;", + "\t#include ", + "\t#include ", + "}", + "`;", + "", + "function getMaterialUVChannelName(value) {", + " if (value === 0)", + " return 'uv';", + " return `uv${value}`;", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "class SpriteBatch extends VFXBatch {", + " constructor(settings) {", + " super(settings);", + " this.vector_ = new THREE.Vector3();", + " this.vector2_ = new THREE.Vector3();", + " this.vector3_ = new THREE.Vector3();", + " this.quaternion_ = new THREE.Quaternion();", + " this.quaternion2_ = new THREE.Quaternion();", + " this.quaternion3_ = new THREE.Quaternion();", + " this.rotationMat_ = new THREE.Matrix3();", + " this.rotationMat2_ = new THREE.Matrix3();", + " this.maxParticles = 1000;", + " this.setupBuffers();", + " this.rebuildMaterial();", + " }", + " buildExpandableBuffers() {", + " this.offsetBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 3), 3);", + " this.offsetBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('offset', this.offsetBuffer);", + " this.colorBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('color', this.colorBuffer);", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('rotation', this.rotationBuffer);", + " }", + " else if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " this.rotationBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.rotationBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('rotation', this.rotationBuffer);", + " }", + " this.sizeBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.sizeBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('size', this.sizeBuffer);", + " this.uvTileBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles), 1);", + " this.uvTileBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('uvTile', this.uvTileBuffer);", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " this.velocityBuffer = new THREE.InstancedBufferAttribute(new Float32Array(this.maxParticles * 4), 4);", + " this.velocityBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('velocity', this.velocityBuffer);", + " }", + " }", + " setupBuffers() {", + " if (this.geometry)", + " this.geometry.dispose();", + " this.geometry = new THREE.InstancedBufferGeometry();", + " this.geometry.setIndex(this.settings.instancingGeometry.getIndex());", + " if (this.settings.instancingGeometry.hasAttribute('normal')) {", + " this.geometry.setAttribute('normal', this.settings.instancingGeometry.getAttribute('normal'));", + " }", + " this.geometry.setAttribute('position', this.settings.instancingGeometry.getAttribute('position'));", + " this.geometry.setAttribute('uv', this.settings.instancingGeometry.getAttribute('uv'));", + " this.buildExpandableBuffers();", + " }", + " expandBuffers(target) {", + " while (target >= this.maxParticles) {", + " this.maxParticles *= 2;", + " }", + " this.setupBuffers();", + " }", + " rebuildMaterial() {", + " this.layers.mask = this.settings.layers.mask;", + " let uniforms;", + " const defines = {};", + " if (this.settings.material.type === 'MeshStandardMaterial' ||", + " this.settings.material.type === 'MeshPhysicalMaterial') {", + " const mat = this.settings.material;", + " uniforms = THREE.UniformsUtils.merge([", + " THREE.UniformsLib.common,", + " THREE.UniformsLib.envmap,", + " THREE.UniformsLib.aomap,", + " THREE.UniformsLib.lightmap,", + " THREE.UniformsLib.emissivemap,", + " THREE.UniformsLib.bumpmap,", + " THREE.UniformsLib.normalmap,", + " THREE.UniformsLib.displacementmap,", + " THREE.UniformsLib.roughnessmap,", + " THREE.UniformsLib.metalnessmap,", + " THREE.UniformsLib.fog,", + " THREE.UniformsLib.lights,", + " {", + " emissive: { value: new THREE.Color(0x000000) },", + " roughness: { value: 1.0 },", + " metalness: { value: 0.0 },", + " envMapIntensity: { value: 1 },", + " },", + " ]);", + " uniforms['diffuse'].value = mat.color;", + " uniforms['opacity'].value = mat.opacity;", + " uniforms['emissive'].value = mat.emissive;", + " uniforms['roughness'].value = mat.roughness;", + " uniforms['metalness'].value = mat.metalness;", + " if (mat.envMap) {", + " uniforms['envMap'].value = mat.envMap;", + " uniforms['envMapIntensity'].value = mat.envMapIntensity;", + " }", + " if (mat.normalMap) {", + " uniforms['normalMap'].value = mat.normalMap;", + " uniforms['normalScale'].value = mat.normalScale;", + " }", + " if (mat.roughnessMap) {", + " uniforms['roughnessMap'].value = mat.roughnessMap;", + " }", + " if (mat.metalnessMap) {", + " uniforms['metalnessMap'].value = mat.metalnessMap;", + " }", + " if (mat.map) {", + " uniforms['map'] = new THREE.Uniform(mat.map);", + " }", + " }", + " else {", + " uniforms = {};", + " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", + " }", + " if (this.settings.material.alphaTest) {", + " defines['USE_ALPHATEST'] = '';", + " uniforms['alphaTest'] = new THREE.Uniform(this.settings.material.alphaTest);", + " }", + " defines['USE_UV'] = '';", + " const uTileCount = this.settings.uTileCount;", + " const vTileCount = this.settings.vTileCount;", + " if (uTileCount > 1 || vTileCount > 1) {", + " defines['UV_TILE'] = '';", + " uniforms['tileCount'] = new THREE.Uniform(new THREE.Vector2(uTileCount, vTileCount));", + " }", + " if (this.settings.material.defines &&", + " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", + " defines['USE_COLOR_AS_ALPHA'] = '';", + " }", + " if (this.settings.material.normalMap) {", + " defines['USE_NORMALMAP'] = '';", + " defines['NORMALMAP_UV'] = getMaterialUVChannelName(this.settings.material.normalMap.channel);", + " uniforms['normalMapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.normalMap.matrix));", + " }", + " if (this.settings.material.map) {", + " defines['USE_MAP'] = '';", + " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", + " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", + " }", + " defines['USE_COLOR_ALPHA'] = '';", + " let needLights = false;", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " let vertexShader;", + " let fragmentShader;", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " if (this.settings.material.type === 'MeshStandardMaterial' ||", + " this.settings.material.type === 'MeshPhysicalMaterial') {", + " defines['USE_COLOR'] = '';", + " vertexShader = local_particle_physics_vert;", + " fragmentShader = particle_physics_frag;", + " needLights = true;", + " }", + " else {", + " vertexShader = local_particle_vert;", + " fragmentShader = particle_frag;", + " }", + " }", + " else {", + " vertexShader = particle_vert;", + " fragmentShader = particle_frag;", + " }", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard) {", + " defines['VERTICAL'] = '';", + " }", + " else if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard) {", + " defines['HORIZONTAL'] = '';", + " }", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: vertexShader,", + " fragmentShader: fragmentShader,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " blending: this.settings.material.blending,", + " side: this.settings.material.side,", + " alphaTest: this.settings.material.alphaTest,", + " lights: needLights,", + " });", + " }", + " else if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard) {", + " uniforms['speedFactor'] = new THREE.Uniform(1.0);", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: stretched_bb_particle_vert,", + " fragmentShader: particle_frag,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " blending: this.settings.material.blending,", + " side: this.settings.material.side,", + " alphaTest: this.settings.material.alphaTest,", + " });", + " }", + " else {", + " throw new Error('render mode unavailable');", + " }", + " }", + " update() {", + " let index = 0;", + " let particleCount = 0;", + " this.systems.forEach((system) => {", + " particleCount += system.particleNum;", + " });", + " if (particleCount > this.maxParticles) {", + " this.expandBuffers(particleCount);", + " }", + " this.systems.forEach((system) => {", + " const particles = system.particles;", + " const particleNum = system.particleNum;", + " const rotation = this.quaternion2_;", + " const translation = this.vector2_;", + " const scale = this.vector3_;", + " system.emitter.matrixWorld.decompose(translation, rotation, scale);", + " this.rotationMat_.setFromMatrix4(system.emitter.matrixWorld);", + " for (let j = 0; j < particleNum; j++ , index++) {", + " const particle = particles[j];", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " let q;", + " if (system.worldSpace) {", + " q = particle.rotation;", + " }", + " else {", + " let parentQ;", + " if (particle.parentMatrix) {", + " parentQ = this.quaternion3_.setFromRotationMatrix(particle.parentMatrix);", + " }", + " else {", + " parentQ = rotation;", + " }", + " q = this.quaternion_;", + " q.copy(particle.rotation).multiply(parentQ);", + " }", + " this.rotationBuffer.setXYZW(index, q.x, q.y, q.z, q.w);", + " }", + " else if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard) {", + " this.rotationBuffer.setX(index, particle.rotation);", + " }", + " let vec;", + " if (system.worldSpace) {", + " vec = particle.position;", + " }", + " else {", + " vec = this.vector_;", + " if (particle.parentMatrix) {", + " vec.copy(particle.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " vec.copy(particle.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " }", + " this.offsetBuffer.setXYZ(index, vec.x, vec.y, vec.z);", + " this.colorBuffer.setXYZW(index, particle.color.x, particle.color.y, particle.color.z, particle.color.w);", + " if (system.worldSpace) {", + " this.sizeBuffer.setX(index, particle.size);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.sizeBuffer.setX(index, particle.size);", + " }", + " else {", + " this.sizeBuffer.setX(index, (particle.size * (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z))) / 3);", + " }", + " }", + " this.uvTileBuffer.setX(index, particle.uvTile);", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " let speedFactor = system.rendererEmitterSettings.speedFactor;", + " if (speedFactor === 0)", + " speedFactor = 0.001;", + " const lengthFactor = system.rendererEmitterSettings.lengthFactor;", + " let vec;", + " if (system.worldSpace) {", + " vec = particle.velocity;", + " }", + " else {", + " vec = this.vector_;", + " if (particle.parentMatrix) {", + " this.rotationMat2_.setFromMatrix4(particle.parentMatrix);", + " vec.copy(particle.velocity).applyMatrix3(this.rotationMat2_);", + " }", + " else {", + " vec.copy(particle.velocity).applyMatrix3(this.rotationMat_);", + " }", + " }", + " this.velocityBuffer.setXYZW(index, vec.x * speedFactor, vec.y * speedFactor, vec.z * speedFactor, lengthFactor);", + " }", + " }", + " });", + " this.geometry.instanceCount = index;", + " if (index > 0) {", + " this.offsetBuffer.updateRange.count = index * 3;", + " this.offsetBuffer.needsUpdate = true;", + " this.sizeBuffer.updateRange.count = index;", + " this.sizeBuffer.needsUpdate = true;", + " this.colorBuffer.updateRange.count = index * 4;", + " this.colorBuffer.needsUpdate = true;", + " this.uvTileBuffer.updateRange.count = index;", + " this.uvTileBuffer.needsUpdate = true;", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard && this.velocityBuffer) {", + " this.velocityBuffer.updateRange.count = index * 4;", + " this.velocityBuffer.needsUpdate = true;", + " }", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Mesh) {", + " this.rotationBuffer.updateRange.count = index * 4;", + " this.rotationBuffer.needsUpdate = true;", + " }", + " else if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard ||", + " this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard) {", + " this.rotationBuffer.updateRange.count = index;", + " this.rotationBuffer.needsUpdate = true;", + " }", + " }", + " }", + " dispose() {", + " this.geometry.dispose();", + " }", + "}", + "", + "var trail_frag = `", + "", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "uniform sampler2D alphaMap;", + "uniform float useAlphaMap;", + "uniform float visibility;", + "uniform float alphaTest;", + "uniform vec2 repeat;", + "", + "varying vec4 vColor;", + " ", + "void main() {", + " #include ", + " #include ", + "", + " vec4 c = vColor;", + " ", + " #ifdef USE_MAP", + " #ifdef USE_COLOR_AS_ALPHA", + " vec4 tex = texture2D( map, vUv * repeat );", + " c *= vec4(tex.rgb, tex.r);", + " #else", + " c *= texture2D( map, vUv * repeat );", + " #endif", + " #endif", + " if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUv * repeat ).a;", + " if( c.a < alphaTest ) discard;", + " gl_FragColor = c;", + "", + " #include ", + " #include ", + "}`;", + "", + "var trail_vert = `", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "#include ", + "", + "attribute vec3 previous;", + "attribute vec3 next;", + "attribute float side;", + "attribute float width;", + "", + "uniform vec2 resolution;", + "uniform float lineWidth;", + "uniform float sizeAttenuation;", + " ", + "vec2 fix(vec4 i, float aspect) {", + " vec2 res = i.xy / i.w;", + " res.x *= aspect;", + " return res;", + "}", + " ", + "void main() {", + "", + " ${uv_vertex_tile}", + " ", + " float aspect = resolution.x / resolution.y;", + "", + " vColor = color;", + "", + " mat4 m = projectionMatrix * modelViewMatrix;", + " vec4 finalPosition = m * vec4( position, 1.0 );", + " vec4 prevPos = m * vec4( previous, 1.0 );", + " vec4 nextPos = m * vec4( next, 1.0 );", + "", + " vec2 currentP = fix( finalPosition, aspect );", + " vec2 prevP = fix( prevPos, aspect );", + " vec2 nextP = fix( nextPos, aspect );", + "", + " float w = lineWidth * width;", + "", + " vec2 dir;", + " if( nextP == currentP ) dir = normalize( currentP - prevP );", + " else if( prevP == currentP ) dir = normalize( nextP - currentP );", + " else {", + " vec2 dir1 = normalize( currentP - prevP );", + " vec2 dir2 = normalize( nextP - currentP );", + " dir = normalize( dir1 + dir2 );", + "", + " vec2 perp = vec2( -dir1.y, dir1.x );", + " vec2 miter = vec2( -dir.y, dir.x );", + " //w = clamp( w / dot( miter, perp ), 0., 4., * lineWidth * width );", + "", + " }", + "", + " //vec2 normal = ( cross( vec3( dir, 0. ) vec3( 0., 0., 1. ) ) ).xy;", + " vec4 normal = vec4( -dir.y, dir.x, 0., 1. );", + " normal.xy *= .5 * w;", + " normal *= projectionMatrix;", + " if( sizeAttenuation == 0. ) {", + " normal.xy *= finalPosition.w;", + " normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;", + " }", + "", + " finalPosition.xy += normal.xy * side;", + "", + " gl_Position = finalPosition;", + "", + "\t#include ", + "\t#include ", + "\t", + " vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", + " ", + "\t#include ", + "}`;", + "", + "new THREE.Vector3(0, 0, 1);", + "class TrailBatch extends VFXBatch {", + " constructor(settings) {", + " super(settings);", + " this.vector_ = new THREE.Vector3();", + " this.vector2_ = new THREE.Vector3();", + " this.vector3_ = new THREE.Vector3();", + " this.quaternion_ = new THREE.Quaternion();", + " this.maxParticles = 10000;", + " this.setupBuffers();", + " this.rebuildMaterial();", + " }", + " setupBuffers() {", + " if (this.geometry)", + " this.geometry.dispose();", + " this.geometry = new THREE.BufferGeometry();", + " this.indexBuffer = new THREE.BufferAttribute(new Uint32Array(this.maxParticles * 6), 1);", + " this.indexBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setIndex(this.indexBuffer);", + " this.positionBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.positionBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('position', this.positionBuffer);", + " this.previousBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.previousBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('previous', this.previousBuffer);", + " this.nextBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 6), 3);", + " this.nextBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('next', this.nextBuffer);", + " this.widthBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", + " this.widthBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('width', this.widthBuffer);", + " this.sideBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 2), 1);", + " this.sideBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('side', this.sideBuffer);", + " this.uvBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 4), 2);", + " this.uvBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('uv', this.uvBuffer);", + " this.colorBuffer = new THREE.BufferAttribute(new Float32Array(this.maxParticles * 8), 4);", + " this.colorBuffer.setUsage(THREE.DynamicDrawUsage);", + " this.geometry.setAttribute('color', this.colorBuffer);", + " }", + " expandBuffers(target) {", + " while (target >= this.maxParticles) {", + " this.maxParticles *= 2;", + " }", + " this.setupBuffers();", + " }", + " rebuildMaterial() {", + " this.layers.mask = this.settings.layers.mask;", + " const uniforms = {", + " lineWidth: { value: 1 },", + " map: { value: null },", + " useMap: { value: 0 },", + " alphaMap: { value: null },", + " useAlphaMap: { value: 0 },", + " resolution: { value: new THREE.Vector2(1, 1) },", + " sizeAttenuation: { value: 1 },", + " visibility: { value: 1 },", + " alphaTest: { value: 0 },", + " repeat: { value: new THREE.Vector2(1, 1) },", + " };", + " const defines = {};", + " defines['USE_UV'] = '';", + " defines['USE_COLOR_ALPHA'] = '';", + " if (this.settings.material.map) {", + " defines['USE_MAP'] = '';", + " defines['MAP_UV'] = getMaterialUVChannelName(this.settings.material.map.channel);", + " uniforms['map'] = new THREE.Uniform(this.settings.material.map);", + " uniforms['mapTransform'] = new THREE.Uniform(new THREE.Matrix3().copy(this.settings.material.map.matrix));", + " }", + " if (this.settings.material.defines &&", + " this.settings.material.defines['USE_COLOR_AS_ALPHA'] !== undefined) {", + " defines['USE_COLOR_AS_ALPHA'] = '';", + " }", + " if (this.settings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " this.material = new THREE.ShaderMaterial({", + " uniforms: uniforms,", + " defines: defines,", + " vertexShader: trail_vert,", + " fragmentShader: trail_frag,", + " transparent: this.settings.material.transparent,", + " depthWrite: !this.settings.material.transparent,", + " side: this.settings.material.side,", + " blending: this.settings.material.blending || THREE.AdditiveBlending,", + " });", + " }", + " else {", + " throw new Error('render mode unavailable');", + " }", + " }", + " update() {", + " let index = 0;", + " let triangles = 0;", + " let particleCount = 0;", + " this.systems.forEach((system) => {", + " for (let j = 0; j < system.particleNum; j++) {", + " particleCount += system.particles[j].previous.length * 2;", + " }", + " });", + " if (particleCount > this.maxParticles) {", + " this.expandBuffers(particleCount);", + " }", + " this.systems.forEach((system) => {", + " const rotation = this.quaternion_;", + " const translation = this.vector2_;", + " const scale = this.vector3_;", + " system.emitter.matrixWorld.decompose(translation, rotation, scale);", + " const particles = system.particles;", + " const particleNum = system.particleNum;", + " const uTileCount = this.settings.uTileCount;", + " const vTileCount = this.settings.vTileCount;", + " const tileWidth = 1 / uTileCount;", + " const tileHeight = 1 / vTileCount;", + " for (let j = 0; j < particleNum; j++) {", + " const particle = particles[j];", + " const col = particle.uvTile % vTileCount;", + " const row = Math.floor(particle.uvTile / vTileCount + 0.001);", + " const iter = particle.previous.values();", + " let curIter = iter.next();", + " let previous = curIter.value;", + " let current = previous;", + " if (!curIter.done)", + " curIter = iter.next();", + " let next;", + " if (curIter.value !== undefined) {", + " next = curIter.value;", + " }", + " else {", + " next = current;", + " }", + " for (let i = 0; i < particle.previous.length; i++ , index += 2) {", + " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", + " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", + " if (system.worldSpace) {", + " this.positionBuffer.setXYZ(index, current.position.x, current.position.y, current.position.z);", + " this.positionBuffer.setXYZ(index + 1, current.position.x, current.position.y, current.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(current.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(current.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.positionBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.positionBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " if (system.worldSpace) {", + " this.previousBuffer.setXYZ(index, previous.position.x, previous.position.y, previous.position.z);", + " this.previousBuffer.setXYZ(index + 1, previous.position.x, previous.position.y, previous.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(previous.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(previous.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.previousBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.previousBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " if (system.worldSpace) {", + " this.nextBuffer.setXYZ(index, next.position.x, next.position.y, next.position.z);", + " this.nextBuffer.setXYZ(index + 1, next.position.x, next.position.y, next.position.z);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.vector_.copy(next.position).applyMatrix4(particle.parentMatrix);", + " }", + " else {", + " this.vector_.copy(next.position).applyMatrix4(system.emitter.matrixWorld);", + " }", + " this.nextBuffer.setXYZ(index, this.vector_.x, this.vector_.y, this.vector_.z);", + " this.nextBuffer.setXYZ(index + 1, this.vector_.x, this.vector_.y, this.vector_.z);", + " }", + " this.sideBuffer.setX(index, -1);", + " this.sideBuffer.setX(index + 1, 1);", + " if (system.worldSpace) {", + " this.widthBuffer.setX(index, current.size);", + " this.widthBuffer.setX(index + 1, current.size);", + " }", + " else {", + " if (particle.parentMatrix) {", + " this.widthBuffer.setX(index, current.size);", + " this.widthBuffer.setX(index + 1, current.size);", + " }", + " else {", + " const objectScale = (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", + " this.widthBuffer.setX(index, current.size * objectScale);", + " this.widthBuffer.setX(index + 1, current.size * objectScale);", + " }", + " }", + " this.uvBuffer.setXY(index, (i / particle.previous.length + col) * tileWidth, (vTileCount - row - 1) * tileHeight);", + " this.uvBuffer.setXY(index + 1, (i / particle.previous.length + col) * tileWidth, (vTileCount - row) * tileHeight);", + " this.colorBuffer.setXYZW(index, current.color.x, current.color.y, current.color.z, current.color.w);", + " this.colorBuffer.setXYZW(index + 1, current.color.x, current.color.y, current.color.z, current.color.w);", + " if (i + 1 < particle.previous.length) {", + " this.indexBuffer.setX(triangles * 3, index);", + " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", + " this.indexBuffer.setX(triangles * 3 + 2, index + 2);", + " triangles++;", + " this.indexBuffer.setX(triangles * 3, index + 2);", + " this.indexBuffer.setX(triangles * 3 + 1, index + 1);", + " this.indexBuffer.setX(triangles * 3 + 2, index + 3);", + " triangles++;", + " }", + " previous = current;", + " current = next;", + " if (!curIter.done) {", + " curIter = iter.next();", + " if (curIter.value !== undefined) {", + " next = curIter.value;", + " }", + " }", + " }", + " }", + " });", + " this.positionBuffer.updateRange.count = index * 3;", + " this.positionBuffer.needsUpdate = true;", + " this.previousBuffer.updateRange.count = index * 3;", + " this.previousBuffer.needsUpdate = true;", + " this.nextBuffer.updateRange.count = index * 3;", + " this.nextBuffer.needsUpdate = true;", + " this.sideBuffer.updateRange.count = index;", + " this.sideBuffer.needsUpdate = true;", + " this.widthBuffer.updateRange.count = index;", + " this.widthBuffer.needsUpdate = true;", + " this.uvBuffer.updateRange.count = index * 2;", + " this.uvBuffer.needsUpdate = true;", + " this.colorBuffer.updateRange.count = index * 4;", + " this.colorBuffer.needsUpdate = true;", + " this.indexBuffer.updateRange.count = triangles * 3;", + " this.indexBuffer.needsUpdate = true;", + " this.geometry.setDrawRange(0, triangles * 3);", + " }", + " dispose() {", + " this.geometry.dispose();", + " }", + "}", + "", + "class BatchedRenderer extends THREE.Object3D {", + " constructor() {", + " super();", + " this.batches = [];", + " this.systemToBatchIndex = new Map();", + " this.type = 'BatchedRenderer';", + " }", + " static equals(a, b) {", + " return (a.material.side === b.material.side &&", + " a.material.blending === b.material.blending &&", + " a.material.transparent === b.material.transparent &&", + " a.material.type === b.material.type &&", + " a.material.alphaTest === b.material.alphaTest &&", + " a.material.map === b.material.map &&", + " a.renderMode === b.renderMode &&", + " a.uTileCount === b.uTileCount &&", + " a.vTileCount === b.vTileCount &&", + " a.instancingGeometry === b.instancingGeometry &&", + " a.renderOrder === b.renderOrder &&", + " a.layers.mask === b.layers.mask);", + " }", + " addSystem(system) {", + " system._renderer = this;", + " const settings = system.getRendererSettings();", + " for (let i = 0; i < this.batches.length; i++) {", + " if (BatchedRenderer.equals(this.batches[i].settings, settings)) {", + " this.batches[i].addSystem(system);", + " this.systemToBatchIndex.set(system, i);", + " return;", + " }", + " }", + " let batch;", + " switch (settings.renderMode) {", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Trail:", + " batch = new TrailBatch(settings);", + " break;", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Mesh:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard:", + " batch = new SpriteBatch(settings);", + " break;", + " }", + " batch.addSystem(system);", + " this.batches.push(batch);", + " this.systemToBatchIndex.set(system, this.batches.length - 1);", + " this.add(batch);", + " }", + " deleteSystem(system) {", + " const batchIndex = this.systemToBatchIndex.get(system);", + " if (batchIndex != undefined) {", + " this.batches[batchIndex].removeSystem(system);", + " this.systemToBatchIndex.delete(system);", + " }", + " }", + " updateSystem(system) {", + " this.deleteSystem(system);", + " this.addSystem(system);", + " }", + " update(delta) {", + " this.systemToBatchIndex.forEach((value, ps) => {", + " ps.update(delta);", + " });", + " for (let i = 0; i < this.batches.length; i++) {", + " this.batches[i].update();", + " }", + " }", + "}", + "", + "const BatchedParticleRenderer = BatchedRenderer;", + "", + "class QuarksLoader extends THREE.ObjectLoader {", + " constructor(manager) {", + " super(manager);", + " }", + " linkReference(object) {", + " const objectsMap = {};", + " object.traverse(function (child) {", + " objectsMap[child.uuid] = child;", + " });", + " object.traverse(function (child) {", + " if (child.type === 'ParticleEmitter') {", + " const system = child.system;", + " system.emitterShape;", + " for (let i = 0; i < system.behaviors.length; i++) {", + " if (system.behaviors[i] instanceof EmitSubParticleSystem) {", + " system.behaviors[i].subParticleSystem = objectsMap[system.behaviors[i].subParticleSystem];", + " }", + " }", + " }", + " });", + " }", + " parse(json, onLoad) {", + " const object = super.parse(json, onLoad);", + " this.linkReference(object);", + " return object;", + " }", + " parseObject(data, geometries, materials, textures, animations) {", + " let object;", + " function getGeometry(name) {", + " if (geometries[name] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined geometry', name);", + " }", + " return geometries[name];", + " }", + " function getMaterial(name) {", + " if (name === undefined)", + " return undefined;", + " if (Array.isArray(name)) {", + " const array = [];", + " for (let i = 0, l = name.length; i < l; i++) {", + " const uuid = name[i];", + " if (materials[uuid] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined material', uuid);", + " }", + " array.push(materials[uuid]);", + " }", + " return array;", + " }", + " if (materials[name] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined material', name);", + " }", + " return materials[name];", + " }", + " function getTexture(uuid) {", + " if (textures[uuid] === undefined) {", + " console.warn('THREE.ObjectLoader: Undefined texture', uuid);", + " }", + " return textures[uuid];", + " }", + " let geometry, material;", + " const meta = {", + " textures: textures,", + " geometries: geometries,", + " materials: materials,", + " };", + " const dependencies = {};", + " switch (data.type) {", + " case 'ParticleEmitter':", + " object = ParticleSystem.fromJSON(data.ps, meta, dependencies).emitter;", + " break;", + " case 'Scene':", + " object = new THREE.Scene();", + " if (data.background !== undefined) {", + " if (Number.isInteger(data.background)) {", + " object.background = new THREE.Color(data.background);", + " }", + " else {", + " object.background = getTexture(data.background);", + " }", + " }", + " if (data.environment !== undefined) {", + " object.environment = getTexture(data.environment);", + " }", + " if (data.fog !== undefined) {", + " if (data.fog.type === 'Fog') {", + " object.fog = new THREE.Fog(data.fog.color, data.fog.near, data.fog.far);", + " }", + " else if (data.fog.type === 'FogExp2') {", + " object.fog = new THREE.FogExp2(data.fog.color, data.fog.density);", + " }", + " }", + " if (data.backgroundBlurriness !== undefined)", + " object.backgroundBlurriness = data.backgroundBlurriness;", + " break;", + " case 'PerspectiveCamera':", + " object = new THREE.PerspectiveCamera(data.fov, data.aspect, data.near, data.far);", + " if (data.focus !== undefined)", + " object.focus = data.focus;", + " if (data.zoom !== undefined)", + " object.zoom = data.zoom;", + " if (data.filmGauge !== undefined)", + " object.filmGauge = data.filmGauge;", + " if (data.filmOffset !== undefined)", + " object.filmOffset = data.filmOffset;", + " if (data.view !== undefined)", + " object.view = Object.assign({}, data.view);", + " break;", + " case 'OrthographicCamera':", + " object = new THREE.OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);", + " if (data.zoom !== undefined)", + " object.zoom = data.zoom;", + " if (data.view !== undefined)", + " object.view = Object.assign({}, data.view);", + " break;", + " case 'AmbientLight':", + " object = new THREE.AmbientLight(data.color, data.intensity);", + " break;", + " case 'DirectionalLight':", + " object = new THREE.DirectionalLight(data.color, data.intensity);", + " break;", + " case 'PointLight':", + " object = new THREE.PointLight(data.color, data.intensity, data.distance, data.decay);", + " break;", + " case 'RectAreaLight':", + " object = new THREE.RectAreaLight(data.color, data.intensity, data.width, data.height);", + " break;", + " case 'SpotLight':", + " object = new THREE.SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay);", + " break;", + " case 'HemisphereLight':", + " object = new THREE.HemisphereLight(data.color, data.groundColor, data.intensity);", + " break;", + " case 'LightProbe':", + " object = new THREE.LightProbe().fromJSON(data);", + " break;", + " case 'SkinnedMesh':", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " object = new THREE.SkinnedMesh(geometry, material);", + " if (data.bindMode !== undefined)", + " object.bindMode = data.bindMode;", + " if (data.bindMatrix !== undefined)", + " object.bindMatrix.fromArray(data.bindMatrix);", + " if (data.skeleton !== undefined)", + " object.skeleton = data.skeleton;", + " break;", + " case 'Mesh':", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " object = new THREE.Mesh(geometry, material);", + " break;", + " case 'InstancedMesh': {", + " geometry = getGeometry(data.geometry);", + " material = getMaterial(data.material);", + " const count = data.count;", + " const instanceMatrix = data.instanceMatrix;", + " const instanceColor = data.instanceColor;", + " object = new THREE.InstancedMesh(geometry, material, count);", + " object.instanceMatrix = new THREE.InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16);", + " if (instanceColor !== undefined)", + " object.instanceColor = new THREE.InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize);", + " break;", + " }", + " case 'LOD':", + " object = new THREE.LOD();", + " break;", + " case 'Line':", + " object = new THREE.Line(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'LineLoop':", + " object = new THREE.LineLoop(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'LineSegments':", + " object = new THREE.LineSegments(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'PointCloud':", + " case 'Points':", + " object = new THREE.Points(getGeometry(data.geometry), getMaterial(data.material));", + " break;", + " case 'Sprite':", + " object = new THREE.Sprite(getMaterial(data.material));", + " break;", + " case 'Group':", + " object = new THREE.Group();", + " break;", + " case 'Bone':", + " object = new THREE.Bone();", + " break;", + " default:", + " object = new THREE.Object3D();", + " }", + " object.uuid = data.uuid;", + " if (data.name !== undefined)", + " object.name = data.name;", + " if (data.matrix !== undefined) {", + " object.matrix.fromArray(data.matrix);", + " if (data.matrixAutoUpdate !== undefined)", + " object.matrixAutoUpdate = data.matrixAutoUpdate;", + " if (object.matrixAutoUpdate)", + " object.matrix.decompose(object.position, object.quaternion, object.scale);", + " }", + " else {", + " if (data.position !== undefined)", + " object.position.fromArray(data.position);", + " if (data.rotation !== undefined)", + " object.rotation.fromArray(data.rotation);", + " if (data.quaternion !== undefined)", + " object.quaternion.fromArray(data.quaternion);", + " if (data.scale !== undefined)", + " object.scale.fromArray(data.scale);", + " }", + " if (data.castShadow !== undefined)", + " object.castShadow = data.castShadow;", + " if (data.receiveShadow !== undefined)", + " object.receiveShadow = data.receiveShadow;", + " if (data.shadow) {", + " if (data.shadow.bias !== undefined)", + " object.shadow.bias = data.shadow.bias;", + " if (data.shadow.normalBias !== undefined)", + " object.normalBias = data.shadow.normalBias;", + " if (data.shadow.radius !== undefined)", + " object.radius = data.shadow.radius;", + " if (data.shadow.mapSize !== undefined)", + " object.mapSize.fromArray(data.shadow.mapSize);", + " if (data.shadow.camera !== undefined) {", + " object.camera = this.parseObject(data.shadow.camera);", + " }", + " }", + " if (data.visible !== undefined)", + " object.visible = data.visible;", + " if (data.frustumCulled !== undefined)", + " object.frustumCulled = data.frustumCulled;", + " if (data.renderOrder !== undefined)", + " object.renderOrder = data.renderOrder;", + " if (data.userData !== undefined)", + " object.userData = data.userData;", + " if (data.layers !== undefined)", + " object.layers.mask = data.layers;", + " if (data.children !== undefined) {", + " const children = data.children;", + " for (let i = 0; i < children.length; i++) {", + " object.add(this.parseObject(children[i], geometries, materials, textures, animations));", + " }", + " }", + " if (data.animations !== undefined) {", + " const objectAnimations = data.animations;", + " for (let i = 0; i < objectAnimations.length; i++) {", + " const uuid = objectAnimations[i];", + " object.animations.push(animations[uuid]);", + " }", + " }", + " if (data.type === 'LOD') {", + " if (data.autoUpdate !== undefined)", + " object.autoUpdate = data.autoUpdate;", + " const levels = data.levels;", + " for (let l = 0; l < levels.length; l++) {", + " const level = levels[l];", + " const child = object.getObjectByProperty('uuid', level.object);", + " if (child !== undefined) {", + " object.addLevel(child, level.distance);", + " }", + " }", + " }", + " return object;", + " }", + "}", + "", + "const Plugins = [];", + "function loadPlugin(plugin) {", + " const existing = Plugins.find((item) => item.id === plugin.id);", + " if (!existing) {", + " plugin.initialize();", + " for (const emitterShape of plugin.emitterShapes) {", + " if (!EmitterShapes[emitterShape.type]) {", + " EmitterShapes[emitterShape.type] = emitterShape;", + " }", + " }", + " for (const behavior of plugin.behaviors) {", + " if (!BehaviorTypes[behavior.type]) {", + " BehaviorTypes[behavior.type] = behavior;", + " }", + " }", + " }", + "}", + "function unloadPlugin(pluginId) {", + " const plugin = Plugins.find((item) => item.id === pluginId);", + " if (plugin) {", + " for (const emitterShape of plugin.emitterShapes) {", + " if (EmitterShapes[emitterShape.type]) {", + " delete EmitterShapes[emitterShape.type];", + " }", + " }", + " for (const behavior of plugin.behaviors) {", + " if (BehaviorTypes[behavior.type]) {", + " delete BehaviorTypes[behavior.type];", + " }", + " }", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension.NodeValueType = void 0;", + "(function (NodeValueType) {", + " NodeValueType[NodeValueType[\"Number\"] = 0] = \"Number\";", + " NodeValueType[NodeValueType[\"Vec2\"] = 1] = \"Vec2\";", + " NodeValueType[NodeValueType[\"Vec3\"] = 2] = \"Vec3\";", + " NodeValueType[NodeValueType[\"Vec4\"] = 3] = \"Vec4\";", + " NodeValueType[NodeValueType[\"Boolean\"] = 4] = \"Boolean\";", + " NodeValueType[NodeValueType[\"AnyType\"] = 5] = \"AnyType\";", + " NodeValueType[NodeValueType[\"NullableAnyType\"] = 6] = \"NullableAnyType\";", + " NodeValueType[NodeValueType[\"EventStream\"] = 7] = \"EventStream\";", + "})(gdjs.__particleEmmiter3DExtension.NodeValueType || (gdjs.__particleEmmiter3DExtension.NodeValueType = {}));", + "const genDefaultForNodeValueType = (type) => {", + " switch (type) {", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean:", + " return false;", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Number:", + " return 0;", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2:", + " return new THREE.Vector2();", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3:", + " return new THREE.Vector3();", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4:", + " return new THREE.Vector4();", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType:", + " return 0;", + " case gdjs.__particleEmmiter3DExtension.NodeValueType.NullableAnyType:", + " return undefined;", + " }", + "};", + "", + "class Node {", + " constructor(type, signatureIndex = -1, data = {}) {", + " this.inputs = [];", + " this.outputs = [];", + " this.signatureIndex = -1;", + " this.position = new THREE.Vector2();", + " this.outputValues = [];", + " this.id = '' + Math.round(Math.random() * 100000);", + " this.type = type;", + " this.signatureIndex = signatureIndex;", + " this.data = data;", + " const realIndex = signatureIndex === -1 ? 0 : signatureIndex;", + " for (let i = 0; i < type.nodeTypeSignatures[realIndex].inputTypes.length; i++) {", + " this.inputs.push(undefined);", + " }", + " for (let i = 0; i < type.nodeTypeSignatures[realIndex].outputTypes.length; i++) {", + " this.outputs.push([]);", + " this.outputValues.push(genDefaultForNodeValueType(type.nodeTypeSignatures[realIndex].outputTypes[i]));", + " }", + " }", + " get inputTypes() {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " return this.type.nodeTypeSignatures[signatureIndex].inputTypes;", + " }", + " get outputTypes() {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " return this.type.nodeTypeSignatures[signatureIndex].outputTypes;", + " }", + " func(context, inputs, outputs) {", + " const signatureIndex = this.signatureIndex === -1 ? 0 : this.signatureIndex;", + " this.type.nodeTypeSignatures[signatureIndex].func(context, this.data, inputs, outputs);", + " }", + "}", + "class Wire {", + " constructor(input, inputIndex, output, outputIndex) {", + " this.input = input;", + " this.inputIndex = inputIndex;", + " this.input.outputs[inputIndex].push(this);", + " this.output = output;", + " this.outputIndex = outputIndex;", + " this.output.inputs[outputIndex] = this;", + " }", + "}", + "", + "class BaseCompiler {", + " constructor() {", + " this.visited = new Set();", + " BaseCompiler.Instance = this;", + " }", + " buildExecutionOrder(graph, context) {", + " graph.nodesInOrder.length = 0;", + " this.visited.clear();", + " for (let i = 0; i < graph.outputNodes.length; i++) {", + " const node = graph.outputNodes[i];", + " if (node.inputs[0] !== undefined) {", + " this._traverse(node, graph, context);", + " }", + " }", + " graph.compiled = true;", + " }", + " _traverse(node, graph, context) {", + " this.visited.add(node.id);", + " for (let i = 0; i < node.inputs.length; i++) {", + " if (node.inputs[i] instanceof Wire) {", + " const inputNode = node.inputs[i].input;", + " if (!this.visited.has(inputNode.id)) {", + " this._traverse(inputNode, graph, context);", + " }", + " }", + " else if (node.inputs[i] !== undefined);", + " else;", + " }", + " graph.nodesInOrder.push(node);", + " }", + "}", + "", + "class Interpreter extends BaseCompiler {", + " constructor() {", + " super();", + " }", + " executeCompiledGraph(graph, context) {", + " const nodes = graph.nodesInOrder;", + " for (let i = 0; i < nodes.length; i++) {", + " const inputValues = [];", + " const node = nodes[i];", + " for (let j = 0; j < node.inputs.length; j++) {", + " if (node.inputs[j] instanceof Wire) {", + " inputValues.push(node.inputs[j].input.outputValues[node.inputs[j].inputIndex]);", + " }", + " else if (node.inputs[j] !== undefined) {", + " inputValues.push(node.inputs[j].getValue(context));", + " }", + " else {", + " inputValues.push(undefined);", + " }", + " }", + " node.func(context, inputValues, node.outputValues);", + " }", + " }", + " run(graph, context) {", + " if (!graph.compiled) {", + " this.buildExecutionOrder(graph, context);", + " }", + " this.executeCompiledGraph(graph, context);", + " }", + "}", + "", + "class NodeType {", + " constructor(name) {", + " this.nodeTypeSignatures = [];", + " this.name = name;", + " }", + " addSignature(inputTypes, outputTypes, func) {", + " this.nodeTypeSignatures.push({", + " inputTypes: inputTypes,", + " outputTypes: outputTypes,", + " func: func,", + " });", + " }", + "}", + "class GraphNodeType extends NodeType {", + " constructor(nodeGraph) {", + " const inputTypes = [];", + " for (let i = 0; i < nodeGraph.inputNodes.length; i++) {", + " if (nodeGraph.inputNodes[i].type.name === 'input') {", + " inputTypes.push(nodeGraph.inputNodes[i].data.type);", + " }", + " }", + " const outputTypes = [];", + " for (let i = 0; i < nodeGraph.outputNodes.length; i++) {", + " if (nodeGraph.outputNodes[i].type.name === 'output') {", + " outputTypes.push(nodeGraph.outputNodes[i].data.type);", + " }", + " }", + " super(nodeGraph.name);", + " this.addSignature(inputTypes, outputTypes, (context, data, inputs, outputs) => {", + " context.inputs = inputs;", + " context.outputs = outputs;", + " Interpreter.Instance.run(nodeGraph, context);", + " });", + " this.nodeGraph = nodeGraph;", + " }", + "}", + "", + "const NodeTypes = {};", + "const addNode = new NodeType('add');", + "addNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] + inputs[1];", + "});", + "addNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "addNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "addNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].addVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['add'] = addNode;", + "const subNode = new NodeType('sub');", + "subNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] - inputs[1];", + "});", + "subNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "subNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "subNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].subVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['sub'] = subNode;", + "const mulNode = new NodeType('mul');", + "mulNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] * inputs[1];", + "});", + "mulNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "mulNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "mulNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).multiplyScalar(inputs[1]);", + "});", + "NodeTypes['mul'] = mulNode;", + "const divNode = new NodeType('div');", + "divNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] / inputs[1];", + "});", + "divNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "divNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "divNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).divideScalar(inputs[1]);", + "});", + "NodeTypes['div'] = divNode;", + "const sinNode = new NodeType('sin');", + "sinNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.sin(inputs[0]);", + "});", + "NodeTypes['sin'] = sinNode;", + "const cosNode = new NodeType('cos');", + "cosNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.cos(inputs[0]);", + "});", + "NodeTypes['cos'] = cosNode;", + "const tanNode = new NodeType('tan');", + "tanNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.tan(inputs[0]);", + "});", + "NodeTypes['tan'] = tanNode;", + "const absNode = new NodeType('abs');", + "absNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.abs(inputs[0]);", + "});", + "NodeTypes['abs'] = absNode;", + "const minNode = new NodeType('min');", + "minNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.min(inputs[0], inputs[1]);", + "});", + "NodeTypes['min'] = minNode;", + "const maxNode = new NodeType('max');", + "maxNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.max(inputs[0], inputs[1]);", + "});", + "NodeTypes['max'] = maxNode;", + "const dot = new NodeType('dot');", + "dot.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "dot.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "dot.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].dot(inputs[1]);", + "});", + "NodeTypes['dot'] = dot;", + "const cross = new NodeType('cross');", + "cross.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].crossVectors(inputs[0], inputs[1]);", + "});", + "NodeTypes['cross'] = cross;", + "const length = new NodeType('length');", + "length.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "length.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "length.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].length();", + "});", + "NodeTypes['length'] = length;", + "const lengthSq = new NodeType('lengthSq');", + "lengthSq.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "lengthSq.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "lengthSq.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].lengthSq();", + "});", + "NodeTypes['lengthSq'] = lengthSq;", + "const normalize = new NodeType('normalize');", + "normalize.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "normalize.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "normalize.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].copy(inputs[0]).normalize();", + "});", + "NodeTypes['normalize'] = normalize;", + "const distance = new NodeType('distance');", + "distance.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].distanceTo(inputs[1]);", + "});", + "distance.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].distanceTo(inputs[1]);", + "});", + "NodeTypes['distance'] = distance;", + "const andNode = new NodeType('and');", + "andNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean, gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] && inputs[1];", + "});", + "NodeTypes['and'] = andNode;", + "const orNode = new NodeType('or');", + "orNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean, gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] || inputs[1];", + "});", + "NodeTypes['or'] = orNode;", + "const notNode = new NodeType('not');", + "notNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = !inputs[0];", + "});", + "NodeTypes['not'] = notNode;", + "const equalNode = new NodeType('equal');", + "equalNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] === inputs[1];", + "});", + "equalNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "equalNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "equalNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].equals(inputs[1]);", + "});", + "NodeTypes['equal'] = equalNode;", + "const lessThanNode = new NodeType('lessThan');", + "lessThanNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] < inputs[1];", + "});", + "NodeTypes['lessThan'] = lessThanNode;", + "const greaterThanNode = new NodeType('greaterThan');", + "greaterThanNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] > inputs[1];", + "});", + "NodeTypes['greaterThan'] = greaterThanNode;", + "const lessThanOrEqualNode = new NodeType('lessThanOrEqual');", + "lessThanOrEqualNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] <= inputs[1];", + "});", + "NodeTypes['lessThanOrEqual'] = lessThanOrEqualNode;", + "const greaterThanOrEqualNode = new NodeType('greaterThanOrEqual');", + "greaterThanOrEqualNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] >= inputs[1];", + "});", + "NodeTypes['greaterThanOrEqual'] = greaterThanOrEqualNode;", + "const ifNode = new NodeType('if');", + "ifNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean, gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType, gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.AnyType], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0] ? inputs[1] : inputs[2];", + "});", + "NodeTypes['if'] = ifNode;", + "const numberNode = new NodeType('number');", + "numberNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = data.value;", + "});", + "NodeTypes['number'] = numberNode;", + "const vec2Node = new NodeType('vec2');", + "vec2Node.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + "});", + "NodeTypes['vec2'] = vec2Node;", + "const vec3Node = new NodeType('vec3');", + "vec3Node.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + " outputs[0].z = inputs[2];", + "});", + "NodeTypes['vec3'] = vec3Node;", + "const vec4Node = new NodeType('vec4');", + "vec4Node.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].x = inputs[0];", + " outputs[0].y = inputs[1];", + " outputs[0].z = inputs[2];", + " outputs[0].w = inputs[3];", + "});", + "NodeTypes['vec4'] = vec4Node;", + "const splitVec2Node = new NodeType('splitVec2');", + "splitVec2Node.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + "});", + "NodeTypes['splitVec2'] = splitVec2Node;", + "const splitVec3Node = new NodeType('splitVec3');", + "splitVec3Node.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + " outputs[2] = inputs[0].z;", + "});", + "NodeTypes['splitVec3'] = splitVec3Node;", + "const splitVec4Node = new NodeType('splitVec4');", + "splitVec4Node.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0].x;", + " outputs[1] = inputs[0].y;", + " outputs[2] = inputs[0].z;", + " outputs[3] = inputs[0].w;", + "});", + "NodeTypes['splitVec4'] = splitVec4Node;", + "const boolNode = new NodeType('bool');", + "boolNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = data.value;", + "});", + "NodeTypes['bool'] = boolNode;", + "const particlePropertyNode = new NodeType('particleProperty');", + "particlePropertyNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.NullableAnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", + " if (inputs[0] !== undefined) {", + " if (typeof inputs[0] === 'object') {", + " context.particle[data.property].copy(inputs[0]);", + " }", + " else {", + " context.particle[data.property] = inputs[0];", + " }", + " }", + " if (context.particle[data.property] !== undefined) {", + " if (typeof outputs[0] === 'object') {", + " outputs[0].copy(context.particle[data.property]);", + " }", + " else {", + " outputs[0] = context.particle[data.property];", + " }", + " }", + "});", + "NodeTypes['particleProperty'] = particlePropertyNode;", + "const emitNode = new NodeType('emit');", + "emitNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.EventStream], [], (context, data, inputs, outputs) => {", + " const arr = inputs[0];", + " for (let i = 0; i < arr.length; i++) {", + " context.signal(i, arr[i]);", + " }", + "});", + "NodeTypes['emit'] = emitNode;", + "const graphPropertyNode = new NodeType('graphProperty');", + "graphPropertyNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.NullableAnyType], [gdjs.__particleEmmiter3DExtension.NodeValueType.NullableAnyType], (context, data, inputs, outputs) => {", + " if (inputs[0] !== undefined) {", + " if (typeof inputs[0] === 'object') {", + " context.graph[data.property].copy(inputs[0]);", + " }", + " else {", + " context.graph[data.property] = inputs[0];", + " }", + " }", + " if (context.graph[data.property] !== undefined) {", + " if (typeof outputs[0] === 'object') {", + " outputs[0].copy(context.graph[data.property]);", + " }", + " else {", + " outputs[0] = context.graph[data.property];", + " }", + " }", + "});", + "NodeTypes['graphProperty'] = graphPropertyNode;", + "const startEventNode = new NodeType('startEvent');", + "startEventNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.EventStream], (context, data, inputs, outputs) => {", + " outputs[0] = [{ type: 'start' }];", + "});", + "NodeTypes['startEvent'] = startEventNode;", + "const repeaterNode = new NodeType('repeater');", + "repeaterNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.EventStream, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.EventStream], (context, data, inputs, outputs) => {", + " const arr = inputs[0];", + " const count = inputs[1];", + " const result = [];", + " for (let j = 0; j < arr.length; j++) {", + " for (let i = 0; i < count; i++) {", + " result.push(arr[j]);", + " }", + " }", + " outputs[0] = result;", + "});", + "NodeTypes['repeater'] = repeaterNode;", + "const timeNode = new NodeType('time');", + "timeNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = context.emissionState.time;", + "});", + "NodeTypes['time'] = timeNode;", + "const deltaNode = new NodeType('delta');", + "deltaNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = context.delta;", + "});", + "NodeTypes['delta'] = deltaNode;", + "const outputNode = new NodeType('output');", + "outputNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "outputNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], [gdjs.__particleEmmiter3DExtension.NodeValueType.Boolean], (context, data, inputs, outputs) => {", + " outputs[0] = inputs[0];", + "});", + "NodeTypes['output'] = outputNode;", + "const lerpNode = new NodeType('lerp');", + "lerpNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] =", + " inputs[0] * (1 - inputs[2]) + inputs[1] * inputs[2];", + "});", + "lerpNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "lerpNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "lerpNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " outputs[0].lerpVectors(inputs[0], inputs[1], inputs[2]);", + "});", + "NodeTypes['lerp'] = lerpNode;", + "const normalD = (x) => {", + " return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(x * x * -0.5);", + "};", + "const normalDistributionNode = new NodeType('normDistrib');", + "normalDistributionNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = normalD(inputs[0]);", + "});", + "NodeTypes['normDistrib'] = normalDistributionNode;", + "const normcdfNode = new NodeType('normcdf');", + "normcdfNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " let x = inputs[0];", + " const a1 = 0.254829592;", + " const a2 = -0.284496736;", + " const a3 = 1.421413741;", + " const a4 = -1.453152027;", + " const a5 = 1.061405429;", + " const p = 0.3275911;", + " let sign = 1;", + " if (x < 0)", + " sign = -1;", + " x = Math.abs(x) / Math.sqrt(2.0);", + " const t = 1.0 / (1.0 + p * x);", + " const y = 1.0 - ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);", + " outputs[0] = 0.5 * (1.0 + sign * y);", + "});", + "NodeTypes['normcdf'] = normcdfNode;", + "const normcdfInvNode = new NodeType('normcdfInv');", + "const rationalApproximation = (t) => {", + " const c = [2.515517, 0.802853, 0.010328];", + " const d = [1.432788, 0.189269, 0.001308];", + " return t - ((c[2] * t + c[1]) * t + c[0]) / (((d[2] * t + d[1]) * t + d[0]) * t + 1.0);", + "};", + "const normcdfInv = (p) => {", + " if (p < 0.5) {", + " return -rationalApproximation(Math.sqrt(-2.0 * Math.log(p)));", + " }", + " else {", + " return rationalApproximation(Math.sqrt(-2.0 * Math.log(1 - p)));", + " }", + "};", + "normcdfInvNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = normcdfInv(inputs[0]);", + "});", + "NodeTypes['normcdfInv'] = normcdfInvNode;", + "const clampNode = new NodeType('clamp');", + "clampNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", + "});", + "NodeTypes['clamp'] = clampNode;", + "const smoothstepNode = new NodeType('smoothstep');", + "smoothstepNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " const x = Math.max(Math.min(inputs[0], inputs[2]), inputs[1]);", + " outputs[0] = x * x * (3 - 2 * x);", + "});", + "NodeTypes['smoothstep'] = smoothstepNode;", + "const randomNode = new NodeType('random');", + "randomNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Number, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [gdjs.__particleEmmiter3DExtension.NodeValueType.Number], (context, data, inputs, outputs) => {", + " outputs[0] = Math.random() * (inputs[1] - inputs[0]) + inputs[0];", + "});", + "randomNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "randomNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "randomNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " let random = Math.random();", + " outputs[0].lerpVectors(inputs[0], inputs[1], random);", + "});", + "NodeTypes['random'] = randomNode;", + "const vrandNode = new NodeType('vrand');", + "vrandNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec2], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y);", + " outputs[0].set(x / mag, y / mag);", + "});", + "vrandNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " let z = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y + z * z);", + " outputs[0].set(x / mag, y / mag, z / mag);", + "});", + "vrandNode.addSignature([], [gdjs.__particleEmmiter3DExtension.NodeValueType.Vec4], (context, data, inputs, outputs) => {", + " let x = normcdfInv(Math.random());", + " let y = normcdfInv(Math.random());", + " let z = normcdfInv(Math.random());", + " let w = normcdfInv(Math.random());", + " const mag = Math.sqrt(x * x + y * y + z * z + w * w);", + " outputs[0].set(x / mag, y / mag, z / mag, w / mag);", + "});", + "NodeTypes['vrand'] = vrandNode;", + "const bsdfNode = new NodeType('bsdf');", + "bsdfNode.addSignature([gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Vec3, gdjs.__particleEmmiter3DExtension.NodeValueType.Number], [], (context, data, inputs, outputs) => { });", + "NodeTypes['bsdf'] = bsdfNode;", + "const OutputNodeTypeNames = new Set(['output', 'particleProperty', 'graphProperty', 'emit']);", + "", + "class NodeGraph {", + " constructor(name) {", + " this.inputNodes = [];", + " this.outputNodes = [];", + " this.allNodes = new Map();", + " this.wires = [];", + " this.compiled = false;", + " this.nodesInOrder = [];", + " this.version = '1.0';", + " this.uuid = THREE.MathUtils.generateUUID();", + " this.name = name;", + " this.revision = 0;", + " }", + " addWire(wire) {", + " this.wires.push(wire);", + " this.revision++;", + " }", + " addNode(node) {", + " this.allNodes.set(node.id, node);", + " if (node.type === NodeTypes['input']) {", + " this.inputNodes.push(node);", + " }", + " else if (OutputNodeTypeNames.has(node.type.name)) {", + " this.outputNodes.push(node);", + " }", + " this.revision++;", + " }", + " getNode(id) {", + " return this.allNodes.get(id);", + " }", + " deleteNode(node) {", + " this.allNodes.delete(node.id);", + " this.revision++;", + " }", + " deleteWire(wire) {", + " let index = wire.input.outputs[wire.inputIndex].indexOf(wire);", + " if (index !== -1) {", + " wire.input.outputs[wire.inputIndex].splice(index, 1);", + " }", + " wire.output.inputs[wire.outputIndex] = undefined;", + " index = this.wires.indexOf(wire);", + " if (index != -1) {", + " this.wires[index] = this.wires[this.wires.length - 1];", + " this.wires.pop();", + " }", + " this.revision++;", + " }", + " toJSON() {", + " throw new Error('not implemented');", + " }", + " clone() {", + " throw new Error('not implemented');", + " }", + "}", + "", + "new THREE.Vector3(0, 0, 1);", + "const tempQ = new THREE.Quaternion();", + "const tempV = new THREE.Vector3();", + "const tempV2 = new THREE.Vector3();", + "const PREWARM_FPS = 60;", + "const DEFAULT_GEOMETRY = new THREE.PlaneGeometry(1, 1, 1, 1);", + "class NodeVFX {", + " set time(time) {", + " this.emissionState.time = time;", + " }", + " get time() {", + " return this.emissionState.time;", + " }", + " get layers() {", + " return this.rendererSettings.layers;", + " }", + " get texture() {", + " return this.rendererSettings.material.map;", + " }", + " set texture(texture) {", + " this.rendererSettings.material.map = texture;", + " this.neededToUpdateRender = true;", + " }", + " get material() {", + " return this.rendererSettings.material;", + " }", + " set material(material) {", + " this.rendererSettings.material = material;", + " this.neededToUpdateRender = true;", + " }", + " get instancingGeometry() {", + " return this.rendererSettings.instancingGeometry;", + " }", + " set instancingGeometry(geometry) {", + " this.restart();", + " this.particles.length = 0;", + " this.rendererSettings.instancingGeometry = geometry;", + " this.neededToUpdateRender = true;", + " }", + " get renderMode() {", + " return this.rendererSettings.renderMode;", + " }", + " set renderMode(renderMode) {", + " if ((this.rendererSettings.renderMode != gdjs.__particleEmmiter3DExtension.RenderMode.Trail && renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) ||", + " (this.rendererSettings.renderMode == gdjs.__particleEmmiter3DExtension.RenderMode.Trail && renderMode !== gdjs.__particleEmmiter3DExtension.RenderMode.Trail)) {", + " this.restart();", + " this.particles.length = 0;", + " }", + " if (this.rendererSettings.renderMode !== renderMode) {", + " switch (renderMode) {", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Trail:", + " this.rendererEmitterSettings = {", + " startLength: 30,", + " followLocalOrigin: false,", + " };", + " break;", + " case gdjs.__particleEmmiter3DExtension.RenderMode.Mesh:", + " this.rendererEmitterSettings = {", + " geometry: new THREE.PlaneGeometry(1, 1),", + " };", + " break;", + " case gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.VerticalBillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.HorizontalBillBoard:", + " case gdjs.__particleEmmiter3DExtension.RenderMode.StretchedBillBoard:", + " this.rendererEmitterSettings = {};", + " break;", + " }", + " }", + " this.rendererSettings.renderMode = renderMode;", + " this.neededToUpdateRender = true;", + " }", + " get renderOrder() {", + " return this.rendererSettings.renderOrder;", + " }", + " set renderOrder(renderOrder) {", + " this.rendererSettings.renderOrder = renderOrder;", + " this.neededToUpdateRender = true;", + " }", + " get blending() {", + " return this.rendererSettings.material.blending;", + " }", + " set blending(blending) {", + " this.rendererSettings.material.blending = blending;", + " this.neededToUpdateRender = true;", + " }", + " constructor(parameters) {", + " var _a, _b, _c, _d, _e, _f, _g;", + " this.temp = new THREE.Vector3();", + " this.travelDistance = 0;", + " this.normalMatrix = new THREE.Matrix3();", + " this.speedFactor = 0;", + " this.autoDestroy = parameters.autoDestroy === undefined ? false : parameters.autoDestroy;", + " this.duration = (_a = parameters.duration) !== null && _a !== void 0 ? _a : 1;", + " this.looping = parameters.looping === undefined ? true : parameters.looping;", + " this.prewarm = parameters.prewarm === undefined ? false : parameters.prewarm;", + " this.worldSpace = (_b = parameters.worldSpace) !== null && _b !== void 0 ? _b : false;", + " this.rendererEmitterSettings = (_c = parameters.rendererEmitterSettings) !== null && _c !== void 0 ? _c : {};", + " this.emissionGraph = parameters.emissionGraph;", + " this.updateGraph = parameters.updateGraph;", + " this.interpreter = new Interpreter();", + " this.rendererSettings = {", + " instancingGeometry: (_d = parameters.instancingGeometry) !== null && _d !== void 0 ? _d : DEFAULT_GEOMETRY,", + " renderMode: (_e = parameters.renderMode) !== null && _e !== void 0 ? _e : gdjs.__particleEmmiter3DExtension.RenderMode.BillBoard,", + " renderOrder: (_f = parameters.renderOrder) !== null && _f !== void 0 ? _f : 0,", + " material: parameters.material,", + " layers: (_g = parameters.layers) !== null && _g !== void 0 ? _g : new THREE.Layers(),", + " uTileCount: 1,", + " vTileCount: 1,", + " };", + " this.neededToUpdateRender = true;", + " this.particles = new Array();", + " this.emitter = new ParticleEmitter(this);", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState = {", + " time: 0,", + " };", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " pause() {", + " this.paused = true;", + " }", + " play() {", + " this.paused = false;", + " }", + " spawn(emissionState, matrix) {", + " tempQ.setFromRotationMatrix(matrix);", + " const translation = tempV;", + " const quaternion = tempQ;", + " const scale = tempV2;", + " matrix.decompose(translation, quaternion, scale);", + " this.particleNum++;", + " while (this.particles.length < this.particleNum) {", + " this.particles.push(new NodeParticle());", + " }", + " const particle = this.particles[this.particleNum - 1];", + " particle.reset();", + " this.interpreter.run(this.updateGraph, { particle: particle, emissionState: this.emissionState });", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail &&", + " this.rendererEmitterSettings.followLocalOrigin) {", + " const trail = particle;", + " trail.localPosition = new THREE.Vector3().copy(trail.position);", + " }", + " if (this.worldSpace) {", + " particle.position.applyMatrix4(matrix);", + " particle.size *= (Math.abs(scale.x) + Math.abs(scale.y) + Math.abs(scale.z)) / 3;", + " particle.velocity.multiply(scale).applyMatrix3(this.normalMatrix);", + " if (particle.rotation && particle.rotation instanceof THREE.Quaternion) {", + " particle.rotation.multiplyQuaternions(tempQ, particle.rotation);", + " }", + " }", + " }", + " endEmit() {", + " this.emitEnded = true;", + " if (this.autoDestroy) {", + " this.markForDestroy = true;", + " }", + " }", + " dispose() {", + " if (this._renderer)", + " this._renderer.deleteSystem(this);", + " this.emitter.dispose();", + " if (this.emitter.parent)", + " this.emitter.parent.remove(this.emitter);", + " }", + " restart() {", + " this.paused = false;", + " this.particleNum = 0;", + " this.emissionState.time = 0;", + " this.emitEnded = false;", + " this.markForDestroy = false;", + " this.prewarmed = false;", + " }", + " update(delta) {", + " if (this.paused)", + " return;", + " let currentParent = this.emitter;", + " while (currentParent.parent) {", + " currentParent = currentParent.parent;", + " }", + " if (currentParent.type !== 'Scene') {", + " this.dispose();", + " return;", + " }", + " if (this.emitEnded && this.particleNum === 0) {", + " if (this.markForDestroy && this.emitter.parent)", + " this.dispose();", + " return;", + " }", + " if (this.looping && this.prewarm && !this.prewarmed) {", + " this.prewarmed = true;", + " for (let i = 0; i < this.duration * PREWARM_FPS; i++) {", + " this.update(1.0 / PREWARM_FPS);", + " }", + " }", + " if (delta > 0.1) {", + " delta = 0.1;", + " }", + " if (this.neededToUpdateRender) {", + " if (this._renderer)", + " this._renderer.updateSystem(this);", + " this.neededToUpdateRender = false;", + " }", + " this.emit(delta, this.emissionState, this.emitter.matrixWorld);", + " const context = { particle: undefined, emissionState: this.emissionState, delta };", + " for (let i = 0; i < this.particleNum; i++) {", + " context.particle = this.particles[i];", + " this.interpreter.run(this.updateGraph, context);", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " if (this.rendererEmitterSettings.followLocalOrigin &&", + " this.particles[i].localPosition) {", + " this.particles[i].position.copy(this.particles[i].localPosition);", + " if (this.particles[i].parentMatrix) {", + " this.particles[i].position.applyMatrix4(this.particles[i].parentMatrix);", + " }", + " else {", + " this.particles[i].position.applyMatrix4(this.emitter.matrixWorld);", + " }", + " }", + " else {", + " this.particles[i].position.addScaledVector(this.particles[i].velocity, delta);", + " }", + " this.particles[i].age += delta;", + " }", + " if (this.rendererSettings.renderMode === gdjs.__particleEmmiter3DExtension.RenderMode.Trail) {", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " particle.update();", + " }", + " }", + " for (let i = 0; i < this.particleNum; i++) {", + " const particle = this.particles[i];", + " if (particle.died && (!(particle instanceof TrailParticle) || particle.previous.length === 0)) {", + " this.particles[i] = this.particles[this.particleNum - 1];", + " this.particles[this.particleNum - 1] = particle;", + " this.particleNum--;", + " i--;", + " }", + " }", + " }", + " emit(delta, emissionState, emitterMatrix) {", + " if (emissionState.time > this.duration) {", + " if (this.looping) {", + " emissionState.time -= this.duration;", + " }", + " else {", + " if (!this.emitEnded) {", + " this.endEmit();", + " }", + " }", + " }", + " this.normalMatrix.getNormalMatrix(emitterMatrix);", + " const context = {", + " signal: () => {", + " this.spawn(emissionState, emitterMatrix);", + " },", + " emissionState,", + " delta,", + " };", + " if (!this.emitEnded) {", + " this.interpreter.run(this.emissionGraph, context);", + " }", + " if (this.previousWorldPos === undefined)", + " this.previousWorldPos = new THREE.Vector3();", + " this.emitter.getWorldPosition(this.previousWorldPos);", + " emissionState.time += delta;", + " }", + " toJSON(meta, options = {}) {", + " return {};", + " }", + " getRendererSettings() {", + " return this.rendererSettings;", + " }", + " clone() {", + " return this;", + " }", + "}", + "", + "gdjs.__particleEmmiter3DExtension.ApplyCollision = ApplyCollision;", + "gdjs.__particleEmmiter3DExtension.ApplyForce = ApplyForce;", + "gdjs.__particleEmmiter3DExtension.ApplySequences = ApplySequences;", + "gdjs.__particleEmmiter3DExtension.AxisAngleGenerator = AxisAngleGenerator;", + "gdjs.__particleEmmiter3DExtension.BatchedParticleRenderer = BatchedParticleRenderer;", + "gdjs.__particleEmmiter3DExtension.BatchedRenderer = BatchedRenderer;", + "gdjs.__particleEmmiter3DExtension.BehaviorFromJSON = BehaviorFromJSON;", + "gdjs.__particleEmmiter3DExtension.BehaviorTypes = BehaviorTypes;", + "gdjs.__particleEmmiter3DExtension.Bezier = Bezier;", + "gdjs.__particleEmmiter3DExtension.ChangeEmitDirection = ChangeEmitDirection;", + "gdjs.__particleEmmiter3DExtension.ColorGeneratorFromJSON = ColorGeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.ColorOverLife = ColorOverLife;", + "gdjs.__particleEmmiter3DExtension.ColorRange = ColorRange;", + "gdjs.__particleEmmiter3DExtension.ConeEmitter = ConeEmitter;", + "gdjs.__particleEmmiter3DExtension.ConstantColor = ConstantColor;", + "gdjs.__particleEmmiter3DExtension.ConstantValue = ConstantValue;", + "gdjs.__particleEmmiter3DExtension.DonutEmitter = DonutEmitter;", + "gdjs.__particleEmmiter3DExtension.EmitSubParticleSystem = EmitSubParticleSystem;", + "gdjs.__particleEmmiter3DExtension.EmitterFromJSON = EmitterFromJSON;", + "gdjs.__particleEmmiter3DExtension.EmitterShapes = EmitterShapes;", + "gdjs.__particleEmmiter3DExtension.EulerGenerator = EulerGenerator;", + "gdjs.__particleEmmiter3DExtension.ForceOverLife = ForceOverLife;", + "gdjs.__particleEmmiter3DExtension.FrameOverLife = FrameOverLife;", + "gdjs.__particleEmmiter3DExtension.GeneratorFromJSON = GeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.Gradient = Gradient;", + "gdjs.__particleEmmiter3DExtension.GraphNodeType = GraphNodeType;", + "gdjs.__particleEmmiter3DExtension.GravityForce = GravityForce;", + "gdjs.__particleEmmiter3DExtension.GridEmitter = GridEmitter;", + "gdjs.__particleEmmiter3DExtension.Interpreter = Interpreter;", + "gdjs.__particleEmmiter3DExtension.IntervalValue = IntervalValue;", + "gdjs.__particleEmmiter3DExtension.MeshSurfaceEmitter = MeshSurfaceEmitter;", + "gdjs.__particleEmmiter3DExtension.Node = Node;", + "gdjs.__particleEmmiter3DExtension.NodeGraph = NodeGraph;", + "gdjs.__particleEmmiter3DExtension.NodeType = NodeType;", + "gdjs.__particleEmmiter3DExtension.NodeTypes = NodeTypes;", + "gdjs.__particleEmmiter3DExtension.Noise = Noise;", + "gdjs.__particleEmmiter3DExtension.OrbitOverLife = OrbitOverLife;", + "gdjs.__particleEmmiter3DExtension.ParticleEmitter = ParticleEmitter;", + "gdjs.__particleEmmiter3DExtension.ParticleSystem = ParticleSystem;", + "gdjs.__particleEmmiter3DExtension.PiecewiseBezier = PiecewiseBezier;", + "gdjs.__particleEmmiter3DExtension.PiecewiseFunction = PiecewiseFunction;", + "gdjs.__particleEmmiter3DExtension.Plugins = Plugins;", + "gdjs.__particleEmmiter3DExtension.PointEmitter = PointEmitter;", + "gdjs.__particleEmmiter3DExtension.QuarksLoader = QuarksLoader;", + "gdjs.__particleEmmiter3DExtension.RandomColor = RandomColor;", + "gdjs.__particleEmmiter3DExtension.RandomColorBetweenGradient = RandomColorBetweenGradient;", + "gdjs.__particleEmmiter3DExtension.RandomQuatGenerator = RandomQuatGenerator;", + "gdjs.__particleEmmiter3DExtension.RecordState = RecordState;", + "gdjs.__particleEmmiter3DExtension.Rotation3DOverLife = Rotation3DOverLife;", + "gdjs.__particleEmmiter3DExtension.RotationGeneratorFromJSON = RotationGeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.RotationOverLife = RotationOverLife;", + "gdjs.__particleEmmiter3DExtension.SequencerFromJSON = SequencerFromJSON;", + "gdjs.__particleEmmiter3DExtension.SizeOverLife = SizeOverLife;", + "gdjs.__particleEmmiter3DExtension.SpeedOverLife = SpeedOverLife;", + "gdjs.__particleEmmiter3DExtension.SphereEmitter = SphereEmitter;", + "gdjs.__particleEmmiter3DExtension.SpriteBatch = SpriteBatch;", + "gdjs.__particleEmmiter3DExtension.SpriteParticle = SpriteParticle;", + "gdjs.__particleEmmiter3DExtension.TextureSequencer = TextureSequencer;", + "gdjs.__particleEmmiter3DExtension.TrailBatch = TrailBatch;", + "gdjs.__particleEmmiter3DExtension.TrailParticle = TrailParticle;", + "gdjs.__particleEmmiter3DExtension.TurbulenceField = TurbulenceField;", + "gdjs.__particleEmmiter3DExtension.VFXBatch = VFXBatch;", + "gdjs.__particleEmmiter3DExtension.ValueGeneratorFromJSON = ValueGeneratorFromJSON;", + "gdjs.__particleEmmiter3DExtension.WidthOverLength = WidthOverLength;", + "gdjs.__particleEmmiter3DExtension.Wire = Wire;", + "gdjs.__particleEmmiter3DExtension.genDefaultForNodeValueType = genDefaultForNodeValueType;", + "gdjs.__particleEmmiter3DExtension.getPhysicsResolver = getPhysicsResolver;", + "gdjs.__particleEmmiter3DExtension.loadPlugin = loadPlugin;", + "gdjs.__particleEmmiter3DExtension.setPhysicsResolver = setPhysicsResolver;", + "gdjs.__particleEmmiter3DExtension.unloadPlugin = unloadPlugin;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "// See doStepPostEvents\r", + "runtimeScene.__particleEmmiter3DExtension = runtimeScene.__particleEmmiter3DExtension || {};\r", + "runtimeScene.__particleEmmiter3DExtension.emittersStepped = 0;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "defaultName": "ParticleEmitter", + "description": "Display a large number of particles to create visual effects.", + "fullName": "3D particle emitter", + "is3D": true, + "name": "ParticleEmitter3D", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const BatchedRenderer = gdjs.__particleEmmiter3DExtension.BatchedRenderer;", + "const ParticleSystem = gdjs.__particleEmmiter3DExtension.ParticleSystem;", + "const TextureLoader = gdjs.__particleEmmiter3DExtension.TextureLoader;", + "const IntervalValue = gdjs.__particleEmmiter3DExtension.IntervalValue;", + "const ConstantValue = gdjs.__particleEmmiter3DExtension.ConstantValue;", + "const ConstantColor = gdjs.__particleEmmiter3DExtension.ConstantColor;", + "const ColorOverLife = gdjs.__particleEmmiter3DExtension.ColorOverLife;", + "const SizeOverLife = gdjs.__particleEmmiter3DExtension.SizeOverLife;", + "const ApplyForce = gdjs.__particleEmmiter3DExtension.ApplyForce;", + "const Gradient = gdjs.__particleEmmiter3DExtension.Gradient;", + "const PiecewiseBezier = gdjs.__particleEmmiter3DExtension.PiecewiseBezier;", + "const Bezier = gdjs.__particleEmmiter3DExtension.Bezier;", + "const PointEmitter = gdjs.__particleEmmiter3DExtension.PointEmitter;", + "const ConeEmitter = gdjs.__particleEmmiter3DExtension.ConeEmitter;", + "const RenderMode = gdjs.__particleEmmiter3DExtension.RenderMode;", + "", + "const ParticleEmitterAdapter = gdjs.__particleEmmiter3DExtension.ParticleEmitterAdapter;", + "", + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "", + "/** @type {SpriteObjectDataType} */", + "const particleSpriteData = object._instanceContainer._objects.get(\"Particle\");", + "const resourceName = particleSpriteData.animations[0].directions[0].sprites[0].image;", + "const texture = object", + " .getInstanceContainer()", + " .getGame()", + " .getImageManager().getThreeTexture(resourceName);", + "", + "// Set the blending here because changes are not applied after the emitter creation.", + "const blendingString = object._getBlending();", + "const blending =", + " blendingString === \"Additive\" ? THREE.AdditiveBlending :", + " blendingString === \"Normal\" ? THREE.NormalBlending :", + " blendingString === \"Subtractive\" ? THREE.SubtractiveBlending :", + " blendingString === \"Multiply\" ? THREE.MultiplyBlending :", + " blendingString === \"None\" ? THREE.NoBlending :", + " THREE.AdditiveBlending;", + "", + "", + "// Build a configuration with the right kind of objects.", + "// These values are not important as they are overrided by the object properties values.", + "const muzzle = {", + " duration: 10,", + " looping: false,", + " startLife: new IntervalValue(1, 2),", + " startSpeed: new IntervalValue(100, 200),", + " startSize: new IntervalValue(20, 50),", + " startColor: new ConstantColor(new THREE.Vector4(1, 1, 1, 1)),", + " worldSpace: true,", + "", + " maxParticle: 5,", + " emissionOverTime: new ConstantValue(50),", + " emissionBursts: [{", + " time: 0,", + " count: new ConstantValue(1),", + " cycle: 1,", + " interval: 0.01,", + " probability: 1,", + " }],", + "", + " shape: new PointEmitter(),", + " material: new THREE.MeshBasicMaterial({", + " map: texture,", + " blending: blending,", + " transparent: true,", + " side: THREE.DoubleSide", + " }),", + " startTileIndex: 0,", + " uTileCount: 1,", + " vTileCount: 1,", + " renderOrder: 2,", + " renderMode: RenderMode.BillBoard", + "};", + "const particleSystem = new ParticleSystem(muzzle);", + "", + "const colorOverLife = new ColorOverLife(", + " new Gradient(", + " [", + " [new THREE.Vector3(1, 0, 0), 0],", + " [new THREE.Vector3(1, 0, 0), 1],", + " ],", + " [", + " [1, 0],", + " [1, 1],", + " ]", + " ));", + "particleSystem.addBehavior(colorOverLife);", + "const sizeOverLife = new SizeOverLife(new PiecewiseBezier([[new Bezier(1, 2 / 3, 1 / 3, 0), 0]]));", + "particleSystem.addBehavior(sizeOverLife);", + "const applyForce = new ApplyForce(new THREE.Vector3(0, 0, -1), new ConstantValue(0));", + "particleSystem.addBehavior(applyForce);", + "", + "particleSystem.emitter.rotation.order = 'ZYX';", + "particleSystem.emitter.name = object.getName() + object.getNameId();", + "", + "object.__particleEmitterAdapter = new ParticleEmitterAdapter(particleSystem, colorOverLife, sizeOverLife, applyForce);", + "object.__particleSystem = particleSystem;", + "", + "// This is a hack that may break in future releases.", + "// Replace the group that would hold children objects by the emmiter.", + "const layer = gameScene.getLayer(object.getLayer());", + "layer.getRenderer().remove3DRendererObject(object.getRenderer()._threeGroup);", + "object.getRenderer()._threeGroup = particleSystem.emitter;", + "layer.getRenderer().add3DRendererObject(particleSystem.emitter);", + "", + "// See doStepPostEvents", + "gameScene.__particleEmmiter3DExtension = gameScene.__particleEmmiter3DExtension || {};", + "gameScene.__particleEmmiter3DExtension.emittersCount = gameScene.__particleEmmiter3DExtension.emittersCount || 0;", + "gameScene.__particleEmmiter3DExtension.emittersCount++;", + "", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "", + "object.__particleSystem.dispose();", + "", + "// See doStepPostEvents", + "gameScene.__particleEmmiter3DExtension.emittersCount--;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::UpdateFromProperties" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update from properties.", + "fullName": "Update from properties", + "functionType": "Action", + "name": "UpdateFromProperties", + "private": true, + "sentence": "Update from properties of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetZ" + }, + "parameters": [ + "Object", + "=", + "Object.Z()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationX" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyRotationX()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetRotationY" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyRotationY()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartColor" + }, + "parameters": [ + "Object", + "=", + "Object.StartColor()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndColor" + }, + "parameters": [ + "Object", + "=", + "Object.EndColor()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartOpacity" + }, + "parameters": [ + "Object", + "=", + "Object.StartOpacity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndOpacity" + }, + "parameters": [ + "Object", + "=", + "Object.EndOpacity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetFlow" + }, + "parameters": [ + "Object", + "=", + "Object.Flow()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMin" + }, + "parameters": [ + "Object", + "=", + "Object.StartSizeMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSizeMax" + }, + "parameters": [ + "Object", + "=", + "Object.StartSizeMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetEndScale" + }, + "parameters": [ + "Object", + "=", + "Object.EndScale()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMin" + }, + "parameters": [ + "Object", + "=", + "Object.StartSpeedMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetStartSpeedMax" + }, + "parameters": [ + "Object", + "=", + "Object.StartSpeedMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMin" + }, + "parameters": [ + "Object", + "=", + "Object.LifespanMin()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetLifespanMax" + }, + "parameters": [ + "Object", + "=", + "Object.LifespanMax()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetDuration" + }, + "parameters": [ + "Object", + "=", + "Object.Duration()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetSpayConeAngle" + }, + "parameters": [ + "Object", + "=", + "Object.SpayConeAngle()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravity" + }, + "parameters": [ + "Object", + "=", + "Object.Gravity()", + "" + ] + }, + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetGravityTop" + }, + "parameters": [ + "Object", + "=", + "Object.GravityTop()", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyAreParticlesRelative" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetAreParticlesRelative" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyAreParticlesRelative" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetAreParticlesRelative" + }, + "parameters": [ + "Object", + "yes", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO: Blending can't be changed." + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetBlending" + }, + "parameters": [ + "Object", + "=", + "Object.Blending()", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::Delete" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ParticleEmitter3D::ParticleEmitter3D::HasEnded" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::RegisterInLayer" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "// Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + "const gameScene = object.getRuntimeScene();", + "const layer = gameScene.getLayer(object.getLayer());", + "", + "const emitter = object.__particleSystem.emitter;", + "const objectRotationZ = -object.getAngle() * Math.PI / 180;", + "if (emitter.position.x !== object.getX()", + " || emitter.position.y !== -object.getY()", + " || emitter.position.z !== object._getZ()", + " || emitter.rotation.z !== objectRotationZ) {", + " emitter.position.x = object.getX();", + " emitter.position.y = -object.getY();", + " emitter.position.z = object._getZ();", + " emitter.rotation.z = objectRotationZ;", + " emitter.updateMatrixWorld(true);", + "}", + "", + "// Update batch system after having moved every emitter.", + "// See onScenePreEvents", + "gameScene.__particleEmmiter3DExtension.emittersStepped++;", + "if (gameScene.__particleEmmiter3DExtension.emittersStepped === gameScene.__particleEmmiter3DExtension.emittersCount) {", + " gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];", + " const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;", + " gameScene.getAllLayerNames(layerNames);", + " for (const layerName of layerNames) {", + " const layer = gameScene.getLayer(layerName);", + " if (layer.__particleEmmiter3DExtension) {", + " layer.__particleEmmiter3DExtension.batchSystem.update(object.getElapsedTime() / 1000);", + " }", + " }", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Register in layer", + "functionType": "Action", + "name": "RegisterInLayer", + "private": true, + "sentence": "Register _PARAM0_ in layer", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */", + "const object = objects[0];", + "", + "// TODO Handle layer changes?", + "if (object.__emitterLayerName === undefined) {", + " // Here runtimeScene is the gdjs.CustomRuntimeObjectInstanceContainer inside the custom object.", + " const gameScene = object.getRuntimeScene();", + "", + " const layer = gameScene.getLayer(object.getLayer());", + " layer.__particleEmmiter3DExtension = layer.__particleEmmiter3DExtension || {};", + " if (!layer.__particleEmmiter3DExtension.batchSystem) {", + " const batchSystem = new gdjs.__particleEmmiter3DExtension.BatchedRenderer();", + " const threeScene = layer.getRenderer().getThreeScene();", + " if (threeScene) {", + " threeScene.add(batchSystem);", + " }", + " layer.__particleEmmiter3DExtension.batchSystem = batchSystem;", + " }", + " layer.__particleEmmiter3DExtension.batchSystem.addSystem(object.__particleSystem);", + " object.__emitterLayerName = layer.getName();", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Delete itself", + "fullName": "Delete itself", + "functionType": "Action", + "name": "Delete", + "private": true, + "sentence": "Delete _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "", + "object.deleteFromScene(object.getParent());", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check that emission has ended and no particle is alive anymore.", + "fullName": "Emission has ended", + "functionType": "Condition", + "name": "HasEnded", + "sentence": "Emission from _PARAM0_ has ended", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "eventsFunctionContext.returnValue =\r", + " object._getShouldAutodestruct()\r", + " && object.__particleSystem.emitEnded\r", + " && object.__particleSystem.particleNum === 0;\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Restart particule emission from the beginning.", + "fullName": "Restart", + "functionType": "Action", + "name": "Restart", + "sentence": "Restart particule emission from _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.CustomRuntimeObject} */\r", + "const object = objects[0];\r", + "\r", + "object.__particleSystem.restart();\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the Z position of the emitter.", + "fullName": "Z (elevation)", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "Z", + "sentence": "the Z position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyZ()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Z", + "name": "SetZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyZ" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation on X axis of the emitter.", + "fullName": "Rotation on X axis", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationX", + "sentence": "the rotation on X axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyRotationX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationX", + "name": "SetRotationX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyRotationX" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "object.__particleSystem.emitter.rotation.x = eventsFunctionContext.getArgument(\"Value\") * Math.PI / 180;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation on Y axis of the emitter.", + "fullName": "Rotation on Y axis", + "functionType": "ExpressionAndCondition", + "group": "Angle", + "name": "RotationY", + "sentence": "the rotation on Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyRotationY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationY", + "name": "SetRotationY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyRotationY" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "\r", + "object.__particleSystem.emitter.rotation.y = (90 + eventsFunctionContext.getArgument(\"Value\")) * Math.PI / 180;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start color of the object.", + "fullName": "Start color", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "StartColor", + "sentence": "the start color", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyStartColor()" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartColor", + "name": "SetStartColor", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartColor" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startColor = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartColor(startColor);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the end color of the object.", + "fullName": "End color", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "EndColor", + "sentence": "the end color", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyEndColor()" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "EndColor", + "name": "SetEndColor", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyEndColor" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const endColor = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setEndColor(endColor);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start opacity of the object.", + "fullName": "Start opacity", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "StartOpacity", + "sentence": "the start opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartOpacity()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartOpacity", + "name": "SetStartOpacity", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartOpacity" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startOpacity = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartOpacity(startOpacity);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the end opacity of the object.", + "fullName": "End opacity", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "EndOpacity", + "sentence": "the end opacity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyEndOpacity()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "EndOpacity", + "name": "SetEndOpacity", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyEndOpacity" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const endOpacity = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setEndOpacity(endOpacity);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the flow of particles of the object (particles per second).", + "fullName": "Flow of particles", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "Flow", + "sentence": "the flow of particles", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyFlow()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Flow", + "name": "SetFlow", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyFlow" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const flow = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setFlow(flow);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start min size of the object.", + "fullName": "Start min size", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "StartSizeMin", + "sentence": "the start min size", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSizeMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSizeMin", + "name": "SetStartSizeMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSizeMin" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startMinSize = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartMinSize(startMinSize);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the start max size of the object.", + "fullName": "Start max size", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "StartSizeMax", + "sentence": "the start max size", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSizeMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSizeMax", + "name": "SetStartSizeMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSizeMax" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startMaxSize = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartMaxSize(startMaxSize);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the end scale of the object.", + "fullName": "End scale", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "EndScale", + "sentence": "the end scale", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyEndScale()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "EndScale", + "name": "SetEndScale", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyEndScale" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const endScale = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setEndScale(endScale);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the min start speed of the object.", + "fullName": "Min start speed", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "StartSpeedMin", + "sentence": "the min start speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSpeedMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSpeedMin", + "name": "SetStartSpeedMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSpeedMin" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startSpeedMin = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartSpeedMin(startSpeedMin);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the max start speed of the object.", + "fullName": "Max start speed", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "StartSpeedMax", + "sentence": "the max start speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyStartSpeedMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "StartSpeedMax", + "name": "SetStartSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyStartSpeedMax" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const startSpeedMax = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setStartSpeedMax(startSpeedMax);" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the min lifespan of the object.", + "fullName": "Min lifespan", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "LifespanMin", + "sentence": "the min lifespan", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyLifespanMin()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LifespanMin", + "name": "SetLifespanMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyLifespanMin" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const lifespanMin = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setLifespanMin(lifespanMin);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the max lifespan of the object.", + "fullName": "Max lifespan", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "LifespanMax", + "sentence": "the max lifespan", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyLifespanMax()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LifespanMax", + "name": "SetLifespanMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyLifespanMax" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const lifespanMax = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setLifespanMax(lifespanMax);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the emission duration of the object.", + "fullName": "Emission duration", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "Duration", + "sentence": "the emission duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Duration", + "name": "SetDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyDuration" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const duration = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setDuration(duration);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if particles move with the emitter.", + "fullName": "Particles move with the emitter", + "functionType": "Condition", + "group": "3D particle emitter speed configuration", + "name": "AreParticlesRelative", + "sentence": "_PARAM0_ particles move with the emitter", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyAreParticlesRelative" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change if particles move with the emitter.", + "fullName": "Particles move with the emitter", + "functionType": "Action", + "group": "3D particle emitter speed configuration", + "name": "SetAreParticlesRelative", + "sentence": "_PARAM0_ particles move with the emitter: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyAreParticlesRelative" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyAreParticlesRelative" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const areParticlesRelative = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setParticlesRelative(areParticlesRelative);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "AreParticlesRelative", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "the spay cone angle of the object.", + "fullName": "Spay cone angle", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter configuration", + "name": "SpayConeAngle", + "sentence": "the spay cone angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertySpayConeAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "SpayConeAngle", + "name": "SetSpayConeAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertySpayConeAngle" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const sprayConeAngle = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setSprayConeAngle(sprayConeAngle);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the blending of the object.", + "fullName": "Blending", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter color configuration", + "name": "Blending", + "sentence": "the blending", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyBlending()" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"Normal\",\"Additive\",\"Substractive\",\"Multiply\",\"None\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Blending", + "name": "SetBlending", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyBlending" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const blending = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setBlending(blending);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the gravity top of the object.", + "fullName": "Gravity top", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "GravityTop", + "sentence": "the gravity top", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.PropertyGravityTop()" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"Y-\",\"Z+\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "GravityTop", + "name": "SetGravityTop", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyGravityTop" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const gravityTop = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setGravityTop(gravityTop);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the gravity of the object.", + "fullName": "Gravity", + "functionType": "ExpressionAndCondition", + "group": "3D particle emitter speed configuration", + "name": "Gravity", + "sentence": "the gravity", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.PropertyGravity()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Gravity", + "name": "SetGravity", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyGravity" + }, + "parameters": [ + "Object", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];\r", + "const gravity = eventsFunctionContext.getArgument(\"Value\");\r", + "\r", + "object.__particleEmitterAdapter.setGravity(gravity);\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if delete when emission ends.", + "fullName": "Delete when emission ends", + "functionType": "Condition", + "group": "3D particle emitter configuration", + "name": "ShouldAutodestruct", + "sentence": "_PARAM0_ delete when emission ends", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::PropertyShouldAutodestruct" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Change if delete when emission ends.", + "fullName": "Delete when emission ends", + "functionType": "Action", + "group": "3D particle emitter configuration", + "name": "SetShouldAutodestruct", + "sentence": "_PARAM0_ delete when emission ends: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyShouldAutodestruct" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ParticleEmitter3D::ParticleEmitter3D::SetPropertyShouldAutodestruct" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ParticleEmitter3D::ParticleEmitter3D", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "ShouldAutodestruct", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "255;0;0", + "type": "Color", + "label": "Start color", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "StartColor" + }, + { + "value": "255;255;0", + "type": "Color", + "label": "End color", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "EndColor" + }, + { + "value": "255", + "type": "Number", + "unit": "Dimensionless", + "label": "Start opacity", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "StartOpacity" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End opacity", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "EndOpacity" + }, + { + "value": "50", + "type": "Number", + "label": "Flow of particles (particles per second)", + "description": "", + "group": "", + "extraInformation": [], + "name": "Flow" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Start min size", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "StartSizeMin" + }, + { + "value": "20", + "type": "Number", + "unit": "Pixel", + "label": "Start max size", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "StartSizeMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "End scale", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "EndScale" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start min speed", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "StartSpeedMin" + }, + { + "value": "100", + "type": "Number", + "unit": "PixelSpeed", + "label": "Start max speed", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "StartSpeedMax" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Min lifespan", + "description": "", + "group": "", + "extraInformation": [], + "name": "LifespanMin" + }, + { + "value": "2", + "type": "Number", + "unit": "Second", + "label": "Max lifespan", + "description": "", + "group": "", + "extraInformation": [], + "name": "LifespanMax" + }, + { + "value": "5", + "type": "Number", + "unit": "Second", + "label": "Emission duration", + "description": "", + "group": "", + "extraInformation": [], + "name": "Duration" + }, + { + "value": "", + "type": "Boolean", + "label": "Particles move with the emitter", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "AreParticlesRelative" + }, + { + "value": "30", + "type": "Number", + "unit": "DegreeAngle", + "label": "Spay cone angle", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "SpayConeAngle" + }, + { + "value": "Additive", + "type": "Choice", + "label": "Blending", + "description": "", + "group": "Color", + "extraInformation": [ + "Normal", + "Additive", + "Subtractive", + "Multiply", + "None" + ], + "name": "Blending" + }, + { + "value": "Y-", + "type": "Choice", + "label": "Gravity top", + "description": "", + "group": "Speed", + "extraInformation": [ + "Y-", + "Z+" + ], + "name": "GravityTop" + }, + { + "value": "0", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Gravity", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "Gravity" + }, + { + "value": "true", + "type": "Boolean", + "label": "Delete when emission ends", + "description": "", + "group": "", + "extraInformation": [], + "name": "ShouldAutodestruct" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z (elevation)", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "Z" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on X axis", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "RotationX" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Rotation on Y axis", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "RotationY" + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Particle", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Image", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Particle" + } + ] + } + } + ] + }, + { + "author": "Bouh", + "category": "Input", + "extensionNamespace": "", + "fullName": "Gamepads (controllers)", + "helpPath": "/all-features/gamepad", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdhbWVwYWQtdmFyaWFudC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYsOUg4VjExSDEwVjEzSDhWMTVINlYxM0g0VjExSDZWOU0xOC41LDlBMS41LDEuNSAwIDAsMSAyMCwxMC41QTEuNSwxLjUgMCAwLDEgMTguNSwxMkExLjUsMS41IDAgMCwxIDE3LDEwLjVBMS41LDEuNSAwIDAsMSAxOC41LDlNMTUuNSwxMkExLjUsMS41IDAgMCwxIDE3LDEzLjVBMS41LDEuNSAwIDAsMSAxNS41LDE1QTEuNSwxLjUgMCAwLDEgMTQsMTMuNUExLjUsMS41IDAgMCwxIDE1LjUsMTJNMTcsNUE3LDcgMCAwLDEgMjQsMTJBNyw3IDAgMCwxIDE3LDE5QzE1LjA0LDE5IDEzLjI3LDE4LjIgMTIsMTYuOUMxMC43MywxOC4yIDguOTYsMTkgNywxOUE3LDcgMCAwLDEgMCwxMkE3LDcgMCAwLDEgNyw1SDE3TTcsN0E1LDUgMCAwLDAgMiwxMkE1LDUgMCAwLDAgNywxN0M4LjY0LDE3IDEwLjA5LDE2LjIxIDExLDE1SDEzQzEzLjkxLDE2LjIxIDE1LjM2LDE3IDE3LDE3QTUsNSAwIDAsMCAyMiwxMkE1LDUgMCAwLDAgMTcsN0g3WiIgLz48L3N2Zz4=", + "name": "Gamepads", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", + "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", + "version": "0.6.1", + "description": [ + "Add support for gamepads (or other controllers).", + "", + "It gives access to:", + "- button presses", + "- axis positions and force", + "- trigger pressure", + "- configurable deadzone", + "- vibration", + "- automatic mappers for platformer characters and top-down movement", + "", + "The Bomberman-like example handles 4 players with gamepads ([open the project online](https://editor.gdevelop.io/?project=example://goose-bomberman))." + ], + "origin": { + "identifier": "Gamepads", + "name": "gdevelop-extension-store" + }, + "tags": [ + "controllers", + "gamepads", + "joysticks", + "axis", + "xbox", + "ps4" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", + "taRwmWxwAFYFL9yyBwB3cwBw0BO2", + "mnImQKdn8nQxwzkS5D6a1JB27V23" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Get the value of the pressure on a gamepad trigger.", + "fullName": "Pressure on a gamepad trigger", + "functionType": "Expression", + "name": "TriggerPressure", + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (trigger != \"LT\" && trigger != \"RT\" && trigger != \"L2\" && trigger != \"R2\") {\r", + " console.error('Parameter trigger is not valid in expression: \"Pressure on a gamepad trigger\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (trigger) {\r", + " case 'LT':\r", + " case 'L2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\r", + " break;\r", + "\r", + " case 'RT':\r", + " case 'R2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Trigger button", + "name": "trigger", + "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the force of gamepad stick (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the gamepad _PARAM1_ _PARAM2_ stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the rotation value of a gamepad stick.\nIf the deadzone value is high, the angle value is rounded to main axes, left, left, up, down.\nAn zero deadzone value give a total freedom on the angle value.", + "fullName": "Value of a stick rotation (deprecated)", + "functionType": "Expression", + "name": "StickRotationValue", + "private": true, + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Gamepads::StickAngle(GetArgumentAsNumber(\"player_ID\"), GetArgumentAsString(\"stick\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle of a gamepad stick.\nIf the deadzone value is high, the angle value is rounded to main axes, left, left, up, down.\nAn zero deadzone value give a total freedom on the angle value.", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the value of axis of a gamepad stick.", + "fullName": "Value of a gamepad axis (deprecated)", + "functionType": "Expression", + "name": "AxisValue", + "private": true, + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", + " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let parameterError = false;\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Horizontal\",\"Vertical\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the gamepad stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "const axisIndex = stick === 'right' ? 2 : 0;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Gamepad", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the gamepad stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "const axisIndex = stick === 'right' ? 3 : 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Gamepad", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Test if a button is released on a gamepad. Buttons can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Other: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Gamepad button released", + "functionType": "Condition", + "name": "C_Button_released", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button released\" is not valid.');\r", + " break;\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//Define default value on pressed button or use previous value\r", + "gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "//Get state of button at previous frame\r", + "const previousStateButton = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "//When previousStateButton is true and actual button state is not pressed\r", + "//Player have release the button\r", + "if (previousStateButton === true && gamepad.buttons[buttonId].pressed === false) {\r", + " // Save the last button used for the player \r", + " gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + " eventsFunctionContext.returnValue = true;\r", + "\r", + "} else {\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + " eventsFunctionContext.returnValue = false;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Name of the button", + "name": "button", + "supplementaryInformation": "[\"A\",\"Cross\",\"B\",\"Circle\",\"X\",\"Square\",\"Y\",\"Triangle\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"Up\",\"Down\",\"Left\",\"Right\",\"Back\",\"Share\",\"Start\",\"Options\",\"Click_Stick_Left\",\"Click_Stick_Right\",\"PS_Button\",\"Click_Touchpad\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the index of the last pressed button of a gamepad.", + "fullName": "Last pressed button (id)", + "functionType": "Expression", + "name": "LastButtonID", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "//Player id is not valid\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Last pressed button (id)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "//Return the last button used by the player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].lastButtonUsed;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if any button is pressed on a gamepad.", + "fullName": "Any gamepad button pressed", + "functionType": "Condition", + "name": "C_Any_Button_pressed", + "sentence": "Any button of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Any gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "for (let i = 0; i < gamepad.buttons.length; i++) { //For each buttons\r", + " if (gamepad.buttons[i].pressed) { //One of them is pressed\r", + " buttonId = i; //Save the button pressed\r", + " break;\r", + " }\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " // No buttons are pressed.\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Any gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the last button pressed. \nButtons for Xbox and PS4 can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Both: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Last pressed button (string)", + "functionType": "StringExpression", + "name": "LastButtonString", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in string expression: \"Last pressed button (LastButtonString)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (controllerType === \"\") {\r", + " console.error('Parameter controller type is not valid in string expression: \"Last pressed button (LastButtonString)\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "if (gamepad !== null) { //Gamepad exist\r", + " //Get last btn id\r", + " const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed;\r", + "\r", + " //Return last button as string \r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", + "\r", + "} else { //Gamepad dosen't exist\r", + " console.error('Your controller is not supported or the gamepad wasn\\'t detected in string expression: \"Last pressed button (LastButtonString)\"');\r", + " eventsFunctionContext.returnValue = \"Gamepad not connected\";\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Controller type", + "name": "controller_type", + "supplementaryInformation": "[\"Xbox\",\"PS4\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the number of gamepads.", + "fullName": "Gamepad count", + "functionType": "Expression", + "name": "GamepadCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get the last activated controller\r", + "const controllerId = gdjs._extensionController.lastActiveController;\r", + "\r", + "// Check if controller is active\r", + "const gamepad = gamepads[controllerId];\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = 0;\r", + "} else {\r", + " // Return active controller id\r", + " eventsFunctionContext.returnValue = controllerId + 1;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if a button is pressed on a gamepad. \nButtons can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Other: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Gamepad button pressed", + "functionType": "Condition", + "name": "C_Button_pressed", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button pressed\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Name of the button", + "name": "button", + "supplementaryInformation": "[\"A\",\"Cross\",\"B\",\"Circle\",\"X\",\"Square\",\"Y\",\"Triangle\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"Up\",\"Down\",\"Left\",\"Right\",\"Back\",\"Share\",\"Start\",\"Options\",\"Click_Stick_Left\",\"Click_Stick_Right\",\"PS_Button\",\"Click_Touchpad\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the value of the deadzone applied to a gamepad sticks, between 0 and 1.", + "fullName": "Gamepad deadzone for sticks", + "functionType": "Expression", + "name": "Deadzone", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Gamepad deadzone for sticks\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "///Return the deadzone value for a given player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].deadzone;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set the deadzone for sticks of the gamepad. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved). Deadzone is between 0 and 1, and is by default 0.2.", + "fullName": "Set gamepad deadzone for sticks", + "functionType": "Action", + "name": "A_Set_deadzone", + "sentence": "Set deadzone for sticks on gamepad: _PARAM1_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in action: \"Set gamepad deadzone for sticks\", is not valid, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "// clamp the newDeadzone in range [0, 1].\r", + "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", + "gdjs._extensionController.players[playerId].deadzone = gdjs.evtTools.common.clamp(newDeadzone, 0, 1);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Deadzone for sticks, 0.2 by default (0 to 1)", + "name": "deadzone", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick of a gamepad is pushed in a given direction.", + "fullName": "Gamepad stick pushed (axis)", + "functionType": "Condition", + "name": "C_Axis_pushed", + "sentence": "_PARAM2_ stick of gamepad _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad stick pushed (axis)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick in condition: \"Gamepad stick pushed (axis)\", is not valid, must be LEFT or RIGHT');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"ANY\") {\r", + " console.error('Parameter deadzone in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "\r", + "//Define in onFirstSceneLoaded function\r", + "const getNormalizedAxisValue = gdjs._extensionController.getNormalizedAxisValue;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[0], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[0], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Left on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[2], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[2], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Right on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Stick on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "eventsFunctionContext.returnValue = false;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Any\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the number of connected gamepads.", + "fullName": "Connected gamepads number", + "functionType": "Expression", + "name": "ConnectedGamepadsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "// Gamepads can be disconnected and become null, so we have to filter them.\r", + "eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return a string containing informations about the specified gamepad.", + "fullName": "Gamepad type", + "functionType": "StringExpression", + "name": "GamepadType", + "sentence": "Player _PARAM1_ use _PARAM2_ controller", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in string expression: \"Gamepad type\", is not valid number, must be between 0 and 4');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "eventsFunctionContext.returnValue = (gamepad && gamepad.id) ? gamepad.id : \"No information for player \" + (playerId + 1)", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the specified gamepad has the specified information in its description. Useful to know if the gamepad is a Xbox or PS4 controller.", + "fullName": "Gamepad type", + "functionType": "Condition", + "name": "C_Controller_type", + "sentence": "Gamepad _PARAM1_ is a _PARAM2_ controller", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad type\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (controllerType === \"\") {", + " console.error('Parameter type in condition: \"Gamepad type\", is not a string.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "", + "if (controllerType == \"XBOX\") {", + " eventsFunctionContext.returnValue = gdjs._extensionController.isXbox(gamepad);", + "} else {", + " eventsFunctionContext.returnValue = gamepad ? gamepad.id.toUpperCase().indexOf(controllerType) !== -1 : false;", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Type: \"Xbox\", \"PS4\", \"Steam\" or \"PS3\" (among other)", + "name": "controller_type", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a gamepad is connected.", + "fullName": "Gamepad connected", + "functionType": "Condition", + "name": "C_Controller_X_is_connected", + "sentence": "Gamepad _PARAM1_ is plugged and connected", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "// If gamepad was disconnected it will be null (so this will return false)", + "// If gamepad was never connected it will be undefined (so this will return false)", + "eventsFunctionContext.returnValue = !!gamepads[playerId];" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a vibration on the specified controller. Might only work if the game is running in a recent web browser.", + "fullName": "Gamepad vibration", + "functionType": "Action", + "name": "A_Vibrate_controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: 1.0,", + " strongMagnitude: 1.0", + " });", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate an advanced vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Advanced gamepad vibration", + "functionType": "Action", + "name": "A_Advanced_Vibration_Controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds with the vibration magnitude of _PARAM3_ and _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.duration = duration;", + "gdjs._extensionController.players[playerId].rumble.elapsedTime = 0;", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change a vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Change gamepad active vibration", + "functionType": "Action", + "name": "A_Change_Vibration_Magnitude", + "sentence": "Change the vibration magnitude of _PARAM2_ & _PARAM3_ on gamepad _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const elapsedTime = gdjs._extensionController.players[playerId].rumble.elapsedTime || 0;", + "const originalDuration = gdjs._extensionController.players[playerId].rumble.duration || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (originalDuration - elapsedTime <= 0) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: 1000 * (originalDuration - elapsedTime),", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Define an new private object javascript for the gamepad extension\r", + "gdjs._extensionController = {\r", + " players: {\r", + " 0: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 1: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 2: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 3: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " },\r", + " lastActiveController: -1, // Last active controller\r", + " controllerButtonNames: { //Map associating controller button ids to button names\r", + " \"XBOX\": {\r", + " 0: \"A\",\r", + " 1: \"B\",\r", + " 2: \"X\",\r", + " 3: \"Y\",\r", + " 4: \"LB\",\r", + " 5: \"RB\",\r", + " 6: \"LT\",\r", + " 7: \"RT\",\r", + " 8: \"BACK\",\r", + " 9: \"START\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"NONE\",\r", + " 17: \"NONE\"\r", + " },\r", + " \"PS4\": {\r", + " 0: \"CROSS\",\r", + " 1: \"CIRCLE\",\r", + " 2: \"SQUARE\",\r", + " 3: \"TRIANGLE\",\r", + " 4: \"L1\",\r", + " 5: \"R1\",\r", + " 6: \"L2\",\r", + " 7: \"R2\",\r", + " 8: \"SHARE\",\r", + " 9: \"OPTIONS\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"PS_BUTTON\",\r", + " 17: \"CLICK_TOUCHPAD\"\r", + " }\r", + " }\r", + "};\r", + "\r", + "gdjs._extensionController.getInputString = function (type, buttonId) {\r", + " const controllerButtonNames = gdjs._extensionController.controllerButtonNames;\r", + " if (controllerButtonNames[type] !== undefined) {\r", + " return controllerButtonNames[type][buttonId];\r", + " }\r", + "\r", + " return \"UNKNOWN_BUTTON\";\r", + "}\r", + "\r", + "gdjs._extensionController.axisToAngle = function (deltaX, deltaY) {\r", + " const rad = Math.atan2(deltaY, deltaX);\r", + " const deg = rad * (180 / Math.PI);\r", + " return deg;\r", + "}\r", + "\r", + "gdjs._extensionController.isXbox = function (gamepad) {\r", + " return (gamepad ? (\r", + " gamepad.id.toUpperCase().indexOf(\"XBOX\") !== -1\r", + " // \"XINPUT\" cannot be used to check if it is a xbox controller is just a generic\r", + " // name reported in Firefox corresponding to the driver being used by the controller\r", + " // https://gamefaqs.gamespot.com/boards/916373-pc/73341312?page=1\r", + " ) : false);\r", + "}\r", + "\r", + "//Returns the new value taking into account the dead zone for the player_ID given\r", + "gdjs._extensionController.getNormalizedAxisValue = function (v, player_ID) {\r", + " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", + "\r", + " // Anything smaller than this is assumed to be 0,0\r", + " const DEADZONE = gdjs._extensionController.players[player_ID].deadzone;\r", + "\r", + " if (Math.abs(v) < DEADZONE) {\r", + " // In the dead zone, set to 0\r", + " v = 0;\r", + "\r", + " if (v == null) {\r", + " return 0;\r", + " } else {\r", + " return v;\r", + " }\r", + "\r", + " } else {\r", + " // We're outside the dead zone, but we'd like to smooth\r", + " // this value out so it still runs nicely between 0..1.\r", + " // That is, we don't want it to jump suddenly from 0 to\r", + " // DEADZONE.\r", + "\r", + " // Remap v from\r", + " // DEADZONE..1 to 0..(1-DEADZONE)\r", + " // or from\r", + " // -1..-DEADZONE to -(1-DEADZONE)..0\r", + "\r", + " v = v - Math.sign(v) * DEADZONE;\r", + "\r", + " // Remap v from\r", + " // 0..(1-DEADZONE) to 0..1\r", + " // or from\r", + " // -(1-DEADZONE)..0 to -1..0\r", + "\r", + " return v / (1 - DEADZONE);\r", + " }\r", + "};" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Each time a player press a button i save the last button pressed for the next frame", + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "let countPlayers = Object.keys(gdjs._extensionController.players).length;", + "", + "//Repeat for each players", + "for (let i = 0; i < countPlayers; i++) {", + " let gamepad = gamepads[i]; // Get the gamepad of the player", + "", + " //We have to keep this condition because if the user hasn't plugged in his controller yet, we can't get the controller in the gamepad variable.", + " if (gamepad == null) {", + " continue;", + " }", + "", + " for (let b = 0; b < Object.keys(gamepad.buttons).length; b++) { //For each buttons", + " if (gamepad.buttons[b].pressed) { //One of them is pressed", + " gdjs._extensionController.players[i].lastButtonUsed = b; //Save the button pressed", + "", + " //Save the state of the button for the next frame.", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: true };", + "", + " // Update Last Active Controller", + " gdjs._extensionController.lastActiveController = i;", + " } else {", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: false };", + " }", + " }", + "", + "", + " gdjs._extensionController.players[i].rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;", + " if (", + " gdjs._extensionController.players[i].rumble.duration - gdjs._extensionController.players[i].rumble.elapsedTime <= 0 &&", + " (gdjs._extensionController.players[i].rumble.weakMagnitude || gdjs._extensionController.players[i].rumble.strongMagnitude)", + " ) {", + " gdjs._extensionController.players[i].rumble.weakMagnitude = 0;", + " gdjs._extensionController.players[i].rumble.strongMagnitude = 0;", + " }", + "", + "", + "}", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if any button is released on a gamepad.", + "fullName": "Any gamepad button released", + "functionType": "Condition", + "name": "C_any_button_released", + "sentence": "Any button of gamepad _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + "\tconsole.error('Parameter gamepad identifier in condition: \"Any gamepad button released\", is not valid number, must be between 0 and 4.');\r", + "\treturn;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\r", + "\r", + "\tif (buttonId === undefined) {\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t\treturn;\r", + "\t}\r", + "\r", + "\t//Get previous value or define value by default for the current button\r", + "\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "\t//Get state of the button at previous frame\r", + "\tconst previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "\t//Get the state of the button on the current frame.\r", + "\tconst currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\t//When previousStateButtonIsPressed is true and actual button state is not pressed\r", + "\t//Player have release the button\r", + "\tif (previousStateButtonIsPressed === true && currentFrameStateButtonIsPressed === false) {\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + "\t\teventsFunctionContext.returnValue = true;\r", + "\t\t//break;\r", + "\t\treturn;\r", + "\t} else {\r", + "\t\t//The player didn't released the button yet, the previous frame state is still true\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t}\r", + "\r", + "\tif (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the weak vibration motor on the gamepad of a player.", + "fullName": "Weak rumble magnitude", + "functionType": "Expression", + "name": "WeakVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.weakMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the strong vibration motor on the gamepad of a player.", + "fullName": "Strong rumble magnitude", + "functionType": "Expression", + "name": "StrongVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Control a platformer character with a gamepad.", + "fullName": "Platformer gamepad mapper", + "name": "PlatformerGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Up\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platformer character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "PlatformerCharacter" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseRightStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a gamepad.", + "fullName": "Top-down gamepad mapper", + "name": "TopDownGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Up\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", + "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", + "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\"))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Left\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")", + "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\"))", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyGamepadIdentifier()", + "\"Right\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::TopDownGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseRightStick" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Multitouch joystick and buttons (sprite)", + "helpPath": "/objects/multitouch-joystick", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", + "name": "SpriteMultitouchJoystick", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", + "shortDescription": "Joysticks or buttons for touchscreens.", + "version": "1.2.2", + "description": [ + "Multitouch joysticks can be used the same way as physical gamepads:", + "- 4 or 8 directions", + "- Analogus pads", + "- Player selection", + "- Controls mapping for top-down movement and platformer characters", + "", + "There are ready-to-use joysticks in the asset-store [multitouch joysticks pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=multitouch-joysticks-multitouch-joysticks)." + ], + "origin": { + "identifier": "SpriteMultitouchJoystick", + "name": "gdevelop-extension-store" + }, + "tags": [ + "multitouch", + "joystick", + "thumbstick", + "controller", + "touchscreen", + "twin stick", + "shooter", + "virtual", + "platformer", + "platform", + "top-down" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "1OgYzWp5UeVPbiWGJwI6vqfgZLC3", + "v0YRpdAnIucZFgiRCCecqVnGKno2", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Check if a button is pressed on a gamepad.", + "fullName": "Multitouch controller button pressed", + "functionType": "Condition", + "name": "IsButtonPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a button is released on a gamepad.", + "fullName": "Multitouch controller button released", + "functionType": "Condition", + "name": "IsButtonReleased", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarSceneTxt" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "=", + "\"Released\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change a button state for a multitouch controller.", + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarSceneTxt" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "=", + "GetArgumentAsString(\"ButtonState\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "type": "string" + }, + { + "description": "Button state", + "name": "ButtonState", + "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "Action", + "name": "SetDeadZone", + "private": true, + "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", + "=", + "GetArgumentAsNumber(\"DeadZoneRadius\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Dead zone radius", + "name": "DeadZoneRadius", + "supplementaryInformation": "[]", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "Expression", + "name": "DeadZone", + "private": true, + "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "the direction index (left = 1, bottom = 1, right = 2, top = 3) for an angle (in degrees).", + "fullName": "Angle to 4-way index", + "functionType": "ExpressionAndCondition", + "name": "AngleTo4Way", + "private": true, + "sentence": "The angle _PARAM1_ 4-way index", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the direction index (left = 1, bottom-left = 1... top-left = 7) for an angle (in degrees).", + "fullName": "Angle to 8-way index", + "functionType": "ExpressionAndCondition", + "name": "AngleTo8Way", + "private": true, + "sentence": "The angle _PARAM1_ 8-way index", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if angle is in a given direction.", + "fullName": "Angle 4-way direction", + "functionType": "Condition", + "name": "IsAngleIn4WayDirection", + "private": true, + "sentence": "The angle _PARAM1_ is the 4-way direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "0", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Down\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "1", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "2", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo4Way" + }, + "parameters": [ + "", + "=", + "3", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if angle is in a given direction.", + "fullName": "Angle 8-way direction", + "functionType": "Condition", + "name": "IsAngleIn8WayDirection", + "private": true, + "sentence": "The angle _PARAM1_ is the 8-way direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "0", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"DownRight\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "1", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Down\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "2", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"DownLeft\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "3", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "4", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"UpLeft\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "5", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"Up\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "6", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "GetArgumentAsString(\"Direction\")", + "=", + "\"UpRight\"" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::AngleTo8Way" + }, + "parameters": [ + "", + "=", + "7", + "GetArgumentAsNumber(\"Angle\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the joystick has moved from center" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::JoystickForce" + }, + "parameters": [ + "", + ">", + "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", + "GetArgumentAsNumber(\"ControllerIdentifier\")", + "GetArgumentAsString(\"JoystickIdentifier\")", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + }, + "parameters": [ + "", + "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", + "GetArgumentAsString(\"Direction\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the joystick has moved from center" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::JoystickForce" + }, + "parameters": [ + "", + ">", + "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", + "GetArgumentAsNumber(\"ControllerIdentifier\")", + "GetArgumentAsString(\"JoystickIdentifier\")", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + }, + "parameters": [ + "", + "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", + "GetArgumentAsString(\"Direction\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the force of multitouch contoller stick (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "multitouch controller _PARAM1_ _PARAM2_ stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Stick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", + "fullName": "Joystick force", + "functionType": "Action", + "name": "SetJoystickForce", + "private": true, + "sentence": "Change the force of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the multitouch controller stick is pointing towards (Range: -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Action", + "name": "SetJoystickAngle", + "private": true, + "sentence": "Change the angle of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the multitouch contoller stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the multitouch contoller stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Joystick that can be controlled by interacting with a touchscreen.", + "fullName": "Multitouch Joystick", + "name": "MultitouchJoystick", + "objectType": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "Object.Behavior::PropertyDeadZoneRadius()", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasGameJustResumed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Manage touches", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "Object.Behavior::PropertyTouchId()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Update joystick position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickAngle" + }, + "parameters": [ + "Object", + "Behavior", + "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", + "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyJoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickForce", + "name": "SetJoystickForce", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "Object.Behavior::PropertyJoystickForce()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Expression", + "name": "JoystickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyJoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Action", + "name": "SetJoystickAngle", + "private": true, + "sentence": "Change the joystick angle of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickAngle" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "Object.Behavior::PropertyJoystickAngle()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Angle", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::PropertyDeadZoneRadius()" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + }, + "parameters": [ + "", + "Object.Behavior::JoystickAngle()", + "GetArgumentAsString(\"Direction\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::PropertyDeadZoneRadius()" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + }, + "parameters": [ + "", + "Object.Behavior::JoystickAngle()", + "GetArgumentAsString(\"Direction\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a joystick is pressed.", + "fullName": "Joystick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Joystick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the joystick values (except for angle, which stays the same)", + "fullName": "Reset", + "functionType": "Action", + "name": "Reset", + "private": true, + "sentence": "Reset the joystick of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier.", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Object.Behavior::PropertyJoystickIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickIdentifier" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsString(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius (range: 0 to 1) of the joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::PropertyDeadZoneRadius()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "GetArgumentAsNumber(\"Value\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "String", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick angle (range: -180 to 180)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickAngle" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick force (range: 0 to 1)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickForce" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Detect button presses made on a touchscreen.", + "fullName": "Multitouch button", + "name": "MultitouchButton", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Idle\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(TouchIndex)" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Pressed\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "TouchId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Released\"", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if button is released.", + "fullName": "Button released", + "functionType": "Condition", + "name": "IsReleased", + "sentence": "Button _PARAM0_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if button is pressed.", + "fullName": "Button pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Button _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark the button _PARAM0_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetButtonState" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyButtonIdentifier()", + "GetArgumentAsString(\"ButtonState\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + }, + { + "description": "Button state", + "name": "ButtonState", + "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Button identifier", + "description": "", + "group": "", + "extraInformation": [], + "name": "ButtonIdentifier" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" + }, + { + "value": "", + "type": "Boolean", + "label": "Button released", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsReleased" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a platformer character with a multitouch controller.", + "fullName": "Platformer multitouch controller mapper", + "name": "PlatformerMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "Property" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJumpButton()", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platform character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "Property" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", + "SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", + "sign(SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"UpLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"UpRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"DownLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "Object.Behavior::PropertyControllerIdentifier()", + "Object.Behavior::PropertyJoystickIdentifier()", + "\"DownRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "defaultName": "Joystick", + "description": "Joystick for touchscreens.", + "fullName": "Multitouch Joystick", + "name": "SpriteMultitouchJoystick", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Border", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Thumb", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Border", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Thumb", + "=", + "2" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Border", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Thumb", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Thumb", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Pass the object property values to the behavior.", + "fullName": "Update configuration", + "functionType": "Action", + "name": "UpdateConfiguration", + "private": true, + "sentence": "Update the configuration of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Object.PropertyControllerIdentifier()", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Object.PropertyJoystickIdentifier()", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Object.PropertyDeadZoneRadius()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "De/activate control of the joystick.", + "fullName": "De/activate control", + "functionType": "Action", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick is pressed.", + "fullName": "Stick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Stick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "!=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the strick force (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "ExpressionAndCondition", + "name": "StickForceX", + "sentence": "the stick X force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "ExpressionAndCondition", + "name": "StickForceY", + "sentence": "the stick Y force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (from -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the stick is pointing towards (from -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "GetArgumentAsString(\"Direction\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "GetArgumentAsString(\"Direction\")", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier (1, 2, 3, 4...).", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name of the object.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "GetArgumentAsString(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius of the joystick (range: 0 to 1). The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "GetArgumentAsNumber(\"Value\")", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbAnchorOrigin" + }, + { + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbIsScaledProportionally" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ParentOrigin" + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Thumb", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Border", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchJoystick", + "type": "SpriteMultitouchJoystick::MultitouchJoystick", + "ControllerIdentifier": 1, + "JoystickIdentifier": "Primary", + "FloatingEnabled": false, + "DeadZoneRadius": 0.4, + "JoystickAngle": 0, + "JoystickForce": 0, + "TouchId": 0, + "TouchIndex": 0 + } + ], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Thumb" + }, + { + "objectName": "Border" + } + ] + } + } + ] + }, + { + "author": "PANDAKO-GitHub", + "category": "Input", + "extensionNamespace": "", + "fullName": "Mouse Pointer Lock", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMTksMTkgMjQsMTkgMjQsMjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSI2LDIzIDExLDIzIDExLDE4ICIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI0LDE5LjRjLTAuNywwLjgtMS40LDEuNi0yLjIsMi40Yy03LDctMTUuMywxMC4yLTE4LjUsN3MtMC4xLTExLjUsNy0xOC41czE1LjMtMTAuMiwxOC41LTcNCgljMS40LDEuNCwxLjYsMy42LDAuOCw2LjMiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMSwyMi41Yy0wLjMtMC4yLTAuNS0wLjUtMC44LTAuOGMtNy03LTEwLjItMTUuMy03LTE4LjVzMTEuNS0wLjEsMTguNSw3czEwLjIsMTUuMyw3LDE4LjUNCgljLTEuNywxLjctNC44LDEuNi04LjQsMC4xIi8+DQo8L3N2Zz4NCg==", + "name": "MousePointerLock", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Virtual Reality/Virtual Reality_360_rotate_vr_movement.svg", + "shortDescription": "This behavior removes the limit on the distance the mouse can move and hides the cursor.", + "version": "0.1.5", + "description": [ + "This behavior removes the limit on the distance the mouse can move and hides the cursor.", + "", + "For example, a user can rotate or continue to manipulate an object by moving the mouse endlessly ([open the project online](https://editor.gdevelop.io/?project=example://mouse-pointer-lock)).", + "Without the pointer lock, the rotation or operation will stop the moment the pointer reaches the edge of the browser or screen.", + "", + "Game players don't have to worry about leaving the gameplay area or accidentally clicking on another application that moves the mouse focus away from the game.", + "", + "Locking the pointer locks `CursorX()` and `CursorY()` expressions.", + "Use `MovementX()` and `MovementY()` instead.", + "" + ], + "origin": { + "identifier": "MousePointerLock", + "name": "gdevelop-extension-store" + }, + "tags": [ + "mouse", + "lock", + "cursor", + "pointer" + ], + "authorIds": [ + "Zu55H5hcb9YmZTltIVOTAFDJQyB2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const canvas = runtimeScene.getGame().getRenderer().getCanvas();", + "", + "gdjs._MousePointerLockExtension = {};", + "gdjs._MousePointerLockExtension.movement = { x: 0, y: 0 };", + "", + "canvas.addEventListener(\"pointermove\", (e) => {", + " gdjs._MousePointerLockExtension.movement.x += e.movementX || 0;", + " gdjs._MousePointerLockExtension.movement.y += e.movementY || 0;", + "}, false);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._MousePointerLockExtension.movement = { x: 0, y: 0 };", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get the movement of the pointer on the X-axis.", + "fullName": "Pointer X movement", + "functionType": "Expression", + "name": "MovementX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movement.x || 0;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Get the movement of the pointer on the Y-axis.", + "fullName": "Pointer Y movement", + "functionType": "Expression", + "name": "MovementY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movement.y || 0;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Lock the mouse pointer to hide it.", + "fullName": "Request Pointer Lock", + "functionType": "Action", + "name": "RequestPointerLock", + "sentence": "Request Pointer Lock", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const canvas = runtimeScene.getGame().getRenderer().getCanvas();\r", + "canvas.requestPointerLock({ unadjustedMovement: true });" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Unlocks the mouse pointer and show it.", + "fullName": "Exit pointer lock", + "functionType": "Action", + "name": "ExitPointerLock", + "sentence": "Exit pointer lock", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "document.exitPointerLock();", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if the mouse pointer is locked.", + "fullName": "Pointer is locked", + "functionType": "Condition", + "name": "isPointerLocked", + "sentence": "The mouse pointer is locked", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = document.pointerLockElement ? true : false;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "General", + "extensionNamespace": "", + "fullName": "3D raycast", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXJheS1zdGFydC1hcnJvdyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0yMywxMkwxOSwxNlYxM0g2LjgzQzYuNDIsMTQuMTcgNS4zMSwxNSA0LDE1QTMsMyAwIDAsMSAxLDEyQTMsMyAwIDAsMSA0LDlDNS4zMSw5IDYuNDIsOS44MyA2LjgzLDExSDE5VjhMMjMsMTJaIiAvPjwvc3ZnPg==", + "name": "Raycaster3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/8419f46b76bce482c14b4c03b4141a64d457e4cdc92686f3470381f5d2694abd_ray-start-arrow.svg", + "shortDescription": "Find 3D objects that cross a line.", + "version": "0.1.3", + "description": [ + "It can be useful to:", + "- Find 3D objects under the pointer", + "- Target objects from a 1st person view", + "- Make AI that detect objects in their field of view" + ], + "origin": { + "identifier": "Raycaster3D", + "name": "gdevelop-extension-store" + }, + "tags": [ + "3d", + "recast", + "collision" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Raycaster3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GlobalVariableAsBoolean" + }, + "parameters": [ + "_Raycaster3DExtension_ClassesDefined", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetGlobalVariableAsBoolean" + }, + "parameters": [ + "_Raycaster3DExtension_ClassesDefined", + "True" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs.__raycaster3DExtension = gdjs.__raycaster3DExtension || {};", + "", + "class Raycaster {", + " raycaster = new THREE.Raycaster();", + " pointer = new THREE.Vector2();", + " raycastResults = [];", + " lastDistance = 0;", + " lastPositionX = 0;", + " lastPositionY = 0;", + " lastPositionZ = 0;", + " lastNormalX = 0;", + " lastNormalY = 0;", + " lastNormalZ = 0;", + "", + " /**", + " * @param objectsLists {Hashtable}", + " * @param objects {gdjs.RuntimeObject[]}", + " * @param pointerX {number}", + " * @param pointerY {number}", + " * @param distanceMax {number}", + " */", + " recastFromCamera(objectsLists, objects, pointerX, pointerY, distanceMax) {", + " if (objects.length === 0) {", + " return false;", + " }", + " const object = objects[0];", + " const layer = object.getInstanceContainer().getLayer(object.getLayer());", + " const camera = layer.getRenderer().getThreeCamera();", + "", + " const raycaster = this.raycaster;", + " const pointer = this.pointer;", + " pointer.x = -1 + 2 * pointerX;", + " pointer.y = 1 - 2 * pointerY;", + " raycaster.setFromCamera(pointer, camera);", + " raycaster.far = distanceMax;", + "", + " return this._doRecast(objectsLists, objects);", + " }", + "", + " /**", + " * @param objectsLists {Hashtable}", + " * @param objects {gdjs.RuntimeObject[]}", + " * @param originX {number}", + " * @param originY {number}", + " * @param originZ {number}", + " * @param rotationAngle {number}", + " * @param elevationAngle {number}", + " * @param distanceMax {number}", + " */", + " recastWithAngle(", + " objectsLists,", + " objects,", + " originX,", + " originY,", + " originZ,", + " rotationAngle,", + " elevationAngle,", + " distanceMax", + " ) {", + " if (objects.length === 0) {", + " return false;", + " }", + " const raycaster = this.raycaster;", + " raycaster.ray.origin.set(", + " originX,", + " -originY,", + " originZ,", + " );", + " const rotation = rotationAngle * Math.PI / 180;", + " const elevation = elevationAngle * Math.PI / 180;", + " const cosElevation = Math.cos(elevation);", + " raycaster.ray.direction.set(", + " Math.cos(rotation) * cosElevation,", + " -Math.sin(rotation) * cosElevation,", + " Math.sin(elevation),", + " );", + " raycaster.far = distanceMax;", + "", + " return this._doRecast(objectsLists, objects);", + " }", + "", + " /**", + " * @param objectsLists {Hashtable}", + " * @param objects {gdjs.RuntimeObject[]}", + " * @param originX {number}", + " * @param originY {number}", + " * @param originZ {number}", + " * @param targetX {number}", + " * @param targetY {number}", + " * @param targetZ {number}", + " * @param distanceMax {number}", + " */", + " recastBetweenPosition(", + " objectsLists,", + " objects,", + " originX,", + " originY,", + " originZ,", + " targetX,", + " targetY,", + " targetZ", + " ) {", + " if (objects.length === 0) {", + " return false;", + " }", + " const raycaster = this.raycaster;", + " raycaster.ray.origin.set(", + " originX,", + " -originY,", + " originZ,", + " );", + " const deltaX = targetX - originX;", + " const deltaY = targetY - originY;", + " const deltaZ = targetZ - originZ;", + " const deltaLength = Math.hypot(deltaX, deltaY, deltaZ);", + " raycaster.ray.direction.set(", + " deltaX / deltaLength,", + " -deltaY / deltaLength,", + " deltaZ / deltaLength,", + " );", + " raycaster.far = deltaLength;", + "", + " return this._doRecast(objectsLists, objects);", + " }", + "", + " /**", + " * @param objectsLists {Hashtable}", + " * @param objects {gdjs.RuntimeObject[]}", + " */", + " _doRecast(objectsLists, objects) {", + " const raycastResults = this.raycastResults;", + " let distanceMin = Number.MAX_VALUE;", + " let nearestObject = null;", + " for (const object of objects) {", + " raycastResults.length = 0;", + " const threeObject = object.get3DRendererObject();", + " if (!threeObject) {", + " continue;", + " }", + " this.raycaster.intersectObject(threeObject, true, raycastResults);", + " if (raycastResults.length > 0 && raycastResults[0].distance < distanceMin) {", + " const raycastResult = raycastResults[0];", + " distanceMin = raycastResult.distance;", + " nearestObject = object;", + " this.lastDistance = raycastResult.distance;", + " this.lastPositionX = raycastResult.point.x;", + " this.lastPositionY = -raycastResult.point.y;", + " this.lastPositionZ = raycastResult.point.z;", + " this.lastNormalX = raycastResult.normal.x;", + " this.lastNormalY = raycastResult.normal.y;", + " this.lastNormalZ = raycastResult.normal.z;", + " }", + " }", + " if (!nearestObject) {", + " return false;", + " }", + " raycastResults.length = 0;", + " gdjs.evtTools.object.pickOnly(", + " objectsLists,", + " nearestObject", + " );", + " return true;", + " }", + "}", + "", + "gdjs.__raycaster3DExtension.Raycaster = Raycaster;", + "gdjs.__raycaster3DExtension.raycaster = new Raycaster();", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Sends a ray from the given source position and angle, intersecting the closest object. The intersected object will become the only one taken into account.", + "fullName": "Raycast", + "functionType": "Condition", + "group": "Collision", + "name": "RaycastWithAngle", + "sentence": "Cast a ray from _PARAM2_; _PARAM3_; _PARAM4_ toward a rotation of _PARAM5_°, an elevation of _PARAM6_° and max distance of _PARAM7_ against _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue =", + " gdjs.__raycaster3DExtension.raycaster.recastWithAngle(", + " eventsFunctionContext.getObjectsLists(\"Object\"),", + " objects,", + " eventsFunctionContext.getArgument(\"OriginX\"),", + " eventsFunctionContext.getArgument(\"OriginY\"),", + " eventsFunctionContext.getArgument(\"OriginZ\"),", + " eventsFunctionContext.getArgument(\"RotationAngle\"),", + " eventsFunctionContext.getArgument(\"ElevationAngle\"),", + " eventsFunctionContext.getArgument(\"DistanceMax\")", + " );", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Objects to test against the ray", + "name": "Object", + "type": "objectList" + }, + { + "description": "Ray source X position", + "name": "OriginX", + "type": "expression" + }, + { + "description": "Ray source Y position", + "name": "OriginY", + "type": "expression" + }, + { + "description": "Ray source Z position", + "name": "OriginZ", + "type": "expression" + }, + { + "description": "Rotation angle (in degrees)", + "name": "RotationAngle", + "type": "expression" + }, + { + "description": "Rotation angle (in degrees)", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Ray maximum distance (in pixels)", + "name": "DistanceMax", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Sends a ray from the given source position to the final point, intersecting the closest object. The intersected object will become the only one taken into account.", + "fullName": "Raycast to a position", + "functionType": "Condition", + "group": "Collision", + "name": "RaycastBetweenPosition", + "sentence": "Cast a ray from _PARAM2_; _PARAM3_; _PARAM4_ to _PARAM5_; _PARAM6_; _PARAM7_ against _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue =", + " gdjs.__raycaster3DExtension.raycaster.recastBetweenPosition(", + " eventsFunctionContext.getObjectsLists(\"Object\"),", + " objects,", + " eventsFunctionContext.getArgument(\"OriginX\"),", + " eventsFunctionContext.getArgument(\"OriginY\"),", + " eventsFunctionContext.getArgument(\"OriginZ\"),", + " eventsFunctionContext.getArgument(\"TargetX\"),", + " eventsFunctionContext.getArgument(\"TargetY\"),", + " eventsFunctionContext.getArgument(\"TargetZ\")", + " );", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Objects to test against the ray", + "name": "Object", + "type": "objectList" + }, + { + "description": "Ray source X position", + "name": "OriginX", + "type": "expression" + }, + { + "description": "Ray source Y position", + "name": "OriginY", + "type": "expression" + }, + { + "description": "Ray source Z position", + "name": "OriginZ", + "type": "expression" + }, + { + "description": "Ray target X position", + "name": "TargetX", + "type": "expression" + }, + { + "description": "Ray target Y position", + "name": "TargetY", + "type": "expression" + }, + { + "description": "Ray target Z position", + "name": "TargetZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Sends a ray from the center of the camera, intersecting the closest object. The intersected object will become the only one taken into account.", + "fullName": "Raycast from camera center", + "functionType": "Condition", + "group": "Collision", + "name": "RaycastFromCameraCenter", + "sentence": "Cast a ray from the camera center to a maximum distance of _PARAM2_ against _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue =", + " gdjs.__raycaster3DExtension.raycaster.recastFromCamera(", + " eventsFunctionContext.getObjectsLists(\"Object\"),", + " objects,", + " 0.5,", + " 0.5,", + " eventsFunctionContext.getArgument(\"DistanceMax\")", + " );", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Objects to test against the ray", + "name": "Object", + "type": "objectList" + }, + { + "description": "Ray maximum distance (in pixels)", + "name": "DistanceMax", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Sends a ray from the given source point on the camera screen, intersecting the closest object. The intersected object will become the only one taken into account.", + "fullName": "Raycast from a camera point", + "functionType": "Condition", + "group": "Collision", + "name": "RaycastFromCameraPoint", + "sentence": "Cast a ray from the camera point _PARAM2_; _PARAM3_ to a maximum distance of _PARAM4_ against _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue =", + " gdjs.__raycaster3DExtension.raycaster.recastFromCamera(", + " eventsFunctionContext.getObjectsLists(\"Object\"),", + " objects,", + " eventsFunctionContext.getArgument(\"PointerX\"),", + " eventsFunctionContext.getArgument(\"PointerY\"),", + " eventsFunctionContext.getArgument(\"DistanceMax\")", + " );", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Objects to test against the ray", + "name": "Object", + "type": "objectList" + }, + { + "description": "X position on the screen (from 0 to 1)", + "name": "PointerX", + "type": "expression" + }, + { + "description": "Y position on the screen (from 0 to 1)", + "name": "PointerY", + "type": "expression" + }, + { + "description": "Ray maximum distance (in pixels)", + "name": "DistanceMax", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the last recast intersection distance.", + "fullName": "Last recast distance", + "functionType": "ExpressionAndCondition", + "name": "Distance", + "sentence": "the last recast intersection distance", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs.__raycaster3DExtension.raycaster.lastDistance;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the last recast intersection position on X axis.", + "fullName": "Last recast X intersection", + "functionType": "Expression", + "name": "IntersectionX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs.__raycaster3DExtension.raycaster.lastPositionX;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the last recast intersection position on Y axis.", + "fullName": "Last recast Y intersection", + "functionType": "Expression", + "name": "IntersectionY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs.__raycaster3DExtension.raycaster.lastPositionY;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the last recast intersection position on Z axis.", + "fullName": "Last recast Z intersection", + "functionType": "Expression", + "name": "IntersectionZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs.__raycaster3DExtension.raycaster.lastPositionZ;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the last recast intersection normal on X axis.", + "fullName": "Last recast X normal", + "functionType": "Expression", + "name": "NormalX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs.__raycaster3DExtension.raycaster.lastNormalX;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the last recast intersection normal on X axis.", + "fullName": "Last recast X normal", + "functionType": "Expression", + "name": "NormalY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs.__raycaster3DExtension.raycaster.lastNormalY;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the last recast intersection normal on Z axis.", + "fullName": "Last recast Z normal", + "functionType": "Expression", + "name": "NormalZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs.__raycaster3DExtension.raycaster.lastNormalZ;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Movement", + "extensionNamespace": "", + "fullName": "3D walk", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXdhbGsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQuMTIsMTBIMTlWOC4ySDE1LjM4TDEzLjM4LDQuODdDMTMuMDgsNC4zNyAxMi41NCw0LjAzIDExLjkyLDQuMDNDMTEuNzQsNC4wMyAxMS41OCw0LjA2IDExLjQyLDQuMTFMNiw1LjhWMTFINy44VjcuMzNMOS45MSw2LjY3TDYsMjJINy44TDEwLjY3LDEzLjg5TDEzLDE3VjIySDE0LjhWMTUuNTlMMTIuMzEsMTEuMDVMMTMuMDQsOC4xOE0xNCwzLjhDMTUsMy44IDE1LjgsMyAxNS44LDJDMTUuOCwxIDE1LDAuMiAxNCwwLjJDMTMsMC4yIDEyLjIsMSAxMi4yLDJDMTIuMiwzIDEzLDMuOCAxNCwzLjhaIiAvPjwvc3ZnPg==", + "name": "Walk3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/941323cf01b837b2eb512ecbf0a95add8a195b3696eb6f5865dc090e526dc9b3_walk.svg", + "shortDescription": "Turn and move objects forward and sideways.", + "version": "0.1.0", + "description": "Move objects forward and sideways arrording to the direction they're facing.", + "tags": [ + "3D" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "oc974hW1zSYZfAnRbpKoXizqc1D3", + "3qThSVKAPdP03MXTWNpe2QaNxpv1" + ], + "dependencies": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Turn and move objects forward and sideways.", + "fullName": "3D walk", + "name": "Walk3D", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Rotation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyPreviousRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CurrentRotationSpeed" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedTurnLeftLast" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "-RotationSpeedMax" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedTurnLeftLast" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "RotationSpeedMax" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentRotationSpeed - RotationAcceleration * TimeDelta(), TargetedRotationSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentRotationSpeed - (RotationAcceleration + RotationDeceleration) * TimeDelta(), TargetedRotationSpeed)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentRotationSpeed + RotationAcceleration * TimeDelta(), TargetedRotationSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentRotationSpeed + (RotationAcceleration + RotationDeceleration) * TimeDelta(), TargetedRotationSpeed)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentRotationSpeed - RotationDeceleration * TimeDelta(), 0)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentRotationSpeed + RotationDeceleration * TimeDelta(), 0)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "(PreviousRotationSpeed + CurrentRotationSpeed) / 2 * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Translation", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Forward", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyPreviousForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CurrentForwardSpeed" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveBackwardLast" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "-TranslationSpeedMax" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveBackwardLast" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TranslationSpeedMax" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentForwardSpeed - TranslationAcceleration * TimeDelta(), TargetedForwardSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentForwardSpeed - (TranslationAcceleration + TranslationDeceleration) * TimeDelta(), TargetedForwardSpeed)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentForwardSpeed + TranslationAcceleration * TimeDelta(), TargetedForwardSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentForwardSpeed + (TranslationAcceleration + TranslationDeceleration) * TimeDelta(), TargetedForwardSpeed)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentForwardSpeed - TranslationDeceleration * TimeDelta(), 0)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentForwardSpeed + TranslationDeceleration * TimeDelta(), 0)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHadPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Sideways", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyPreviousSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CurrentSidewaysSpeed" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveLeftLast" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "-TranslationSpeedMax" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveLeftLast" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TranslationSpeedMax" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentSidewaysSpeed - TranslationAcceleration * TimeDelta(), TargetedSidewaysSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentSidewaysSpeed - (TranslationAcceleration + TranslationDeceleration) * TimeDelta(), TargetedSidewaysSpeed)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentSidewaysSpeed + TranslationAcceleration * TimeDelta(), TargetedSidewaysSpeed)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentSidewaysSpeed + (TranslationAcceleration + TranslationDeceleration) * TimeDelta(), TargetedSidewaysSpeed)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(CurrentSidewaysSpeed - TranslationDeceleration * TimeDelta(), 0)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyPreviousSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentSidewaysSpeed + TranslationDeceleration * TimeDelta(), 0)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHadPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Walk3D::Walk3D::PropertyHasPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHasPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHadPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Object", + "Object", + "(PreviousForwardSpeed + CurrentForwardSpeed) / 2 * TimeDelta()", + "Object.Angle()" + ] + }, + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Object", + "Object", + "(PreviousSidewaysSpeed + CurrentSidewaysSpeed) / 2 * TimeDelta()", + "Object.Angle() + 90" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the turn left key.", + "fullName": "Simulate turn left key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateTurnLeftKey", + "sentence": "Simulate pressing turn left key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedTurnLeftLast" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedTurnLeft" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the turn right key.", + "fullName": "Simulate turn right key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateTurnRightKey", + "sentence": "Simulate pressing turn right key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedTurnLeftLast" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedTurnRight" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the move backward key.", + "fullName": "Simulate move backward key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateMoveBackwardKey", + "sentence": "Simulate pressing move backward key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveBackwardLast" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveBackward" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the move forward key.", + "fullName": "Simulate move forward key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateMoveForwardKey", + "sentence": "Simulate pressing move forward key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveBackwardLast" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveForward" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the move left key.", + "fullName": "Simulate move left key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateMoveLeftKey", + "sentence": "Simulate pressing move left key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveLeftLast" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveLeft" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a press of the move right key.", + "fullName": "Simulate move right key press", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateMoveRightKey", + "sentence": "Simulate pressing move right key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Walk3D::Walk3D::PropertyHadPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveLeftLast" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyHasPressedMoveRight" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a stick control.", + "fullName": "Simulate stick control", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateMoveStick", + "sentence": "Simulate a stick control for _PARAM0_ with a _PARAM2_ angle and a _PARAM3_ force", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Denormilize the targeted speed.\nIt projects the circle on a square with sides length of the circle diameter." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetSharedPropertyCos" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "cos(ToRad(-Angle))" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetSharedPropertySin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "sin(ToRad(-Angle))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Cos)", + ">=", + "abs(Sin)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Force * TranslationSpeedMax * sign(Cos)" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Force * TranslationSpeedMax * Sin / abs(Cos)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Cos)", + "<=", + "abs(Sin)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Force * TranslationSpeedMax * Cos / abs(Sin)" + ] + }, + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Force * TranslationSpeedMax * sign(Sin)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + }, + { + "description": "Stick angle (in degrees)", + "name": "Angle", + "type": "expression" + }, + { + "description": "Stick force (between 0 and 1)", + "name": "Force", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Simulate a stick control for rotation.", + "fullName": "Simulate stick control for rotation", + "functionType": "Action", + "group": "Top-down walk state", + "name": "SimulateRotationStick", + "sentence": "Simulate a stick control for rotation of _PARAM0_ with an axis value of _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTargetedRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value * RotationSpeedMax" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + }, + { + "description": "Axis value (between -1 and 1)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the current rotation speed of the object.", + "fullName": "Current rotation speed", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk state", + "name": "CurrentRotationSpeed", + "sentence": "the current rotation speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CurrentRotationSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "CurrentRotationSpeed", + "name": "SetCurrentRotationSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentRotationSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the current forward speed of the object.", + "fullName": "Current forward speed", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk state", + "name": "CurrentForwardSpeed", + "sentence": "the current forward speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CurrentForwardSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "CurrentForwardSpeed", + "name": "SetCurrentForwardSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentForwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the current sideways speed of the object.", + "fullName": "Current sideways speed", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk state", + "name": "CurrentSidewaysSpeed", + "sentence": "the current sideways speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CurrentSidewaysSpeed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "CurrentSidewaysSpeed", + "name": "SetCurrentSidewaysSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyCurrentSidewaysSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum rotation speed of the object.", + "fullName": "Maximum rotation speed", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk configuration", + "name": "RotationSpeedMax", + "sentence": "the maximum rotation speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RotationSpeedMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationSpeedMax", + "name": "SetRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation acceleration of the object.", + "fullName": "Rotation acceleration", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk configuration", + "name": "RotationAcceleration", + "sentence": "the rotation acceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RotationAcceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationAcceleration", + "name": "SetRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the rotation deceleration of the object.", + "fullName": "Rotation deceleration", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk configuration", + "name": "RotationDeceleration", + "sentence": "the rotation deceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RotationDeceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RotationDeceleration", + "name": "SetRotationDeceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum speed of the object.", + "fullName": "Maximum speed", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk configuration", + "name": "TranslationSpeedMax", + "sentence": "the maximum speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TranslationSpeedMax" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TranslationSpeedMax", + "name": "SetTranslationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTranslationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the acceleration of the object.", + "fullName": "Acceleration", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk configuration", + "name": "TranslationAcceleration", + "sentence": "the acceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TranslationAcceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TranslationAcceleration", + "name": "SetTranslationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTranslationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the deceleration of the object.", + "fullName": "Deceleration", + "functionType": "ExpressionAndCondition", + "group": "Top-down walk configuration", + "name": "TranslationDeceleration", + "sentence": "the deceleration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TranslationDeceleration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TranslationDeceleration", + "name": "SetTranslationDeceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Walk3D::Walk3D::SetPropertyTranslationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Walk3D::Walk3D", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Rotation", + "extraInformation": [], + "name": "RotationSpeedMax" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Rotation", + "extraInformation": [], + "name": "RotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Rotation", + "extraInformation": [], + "name": "RotationDeceleration" + }, + { + "value": "400", + "type": "Number", + "unit": "PixelSpeed", + "label": "Maximum speed", + "description": "", + "group": "", + "extraInformation": [], + "name": "TranslationSpeedMax" + }, + { + "value": "1600", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Acceleration", + "description": "", + "group": "", + "extraInformation": [], + "name": "TranslationAcceleration" + }, + { + "value": "1600", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Deceleration", + "description": "", + "group": "", + "extraInformation": [], + "name": "TranslationDeceleration" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeed" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousRotationSpeed" + }, + { + "value": "0", + "type": "Number", + "unit": "PixelSpeed", + "label": "Current forward speed", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentForwardSpeed" + }, + { + "value": "0", + "type": "Number", + "unit": "PixelSpeed", + "label": "Current sideways speed", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentSidewaysSpeed" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousForwardSpeed" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousSidewaysSpeed" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedTurnLeft" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedTurnRight" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedTurnLeftLast" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HadPressedTurnLeft" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HadPressedTurnRight" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedMoveForward" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedMoveBackward" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HadPressedMoveForward" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HadPressedMoveBackward" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedMoveBackwardLast" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedMoveLeft" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedMoveRight" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HadPressedMoveLeft" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HadPressedMoveRight" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasPressedMoveLeftLast" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TargetedForwardSpeed" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TargetedSidewaysSpeed" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TargetedRotationSpeed" + } + ], + "sharedPropertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Cos" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "name": "Sin" + } + ] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "General", + "extensionNamespace": "", + "fullName": "3D collision", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1pbnRlcnNlY3Rpb24iIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMy4xNCwxQTIuMTQsMi4xNCAwIDAsMCAxLDMuMTRWNUgzVjNINVYxSDMuMTRNNywxVjNIMTBWMUg3TTEyLDFWM0gxNFY1SDE2VjMuMTRDMTYsMS45NiAxNS4wNCwxIDEzLjg2LDFIMTJNMSw3VjEwSDNWN0gxTTksN0M3Ljg5LDcgNyw3Ljg5IDcsOUM3LDExLjMzIDcsMTYgNywxNkM3LDE2IDExLjU3LDE2IDEzLjg2LDE2QTIuMTQsMi4xNCAwIDAsMCAxNiwxMy44NkMxNiwxMS41NyAxNiw3IDE2LDdDMTYsNyAxMS4zMyw3IDksN00xOCw3VjlIMjBWMTFIMjJWOUMyMiw3Ljg5IDIxLjExLDcgMjAsN0gxOE05LDlIMTRWMTRIOVY5TTEsMTJWMTMuODZDMSwxNS4wNCAxLjk2LDE2IDMuMTQsMTZINVYxNEgzVjEySDFNMjAsMTNWMTZIMjJWMTNIMjBNNywxOFYyMEM3LDIxLjExIDcuODksMjIgOSwyMkgxMVYyMEg5VjE4SDdNMjAsMThWMjBIMThWMjJIMjBDMjEuMTEsMjIgMjIsMjEuMTEgMjIsMjBWMThIMjBNMTMsMjBWMjJIMTZWMjBIMTNaIiAvPjwvc3ZnPg==", + "name": "Collision3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/7a5696a515bf40813692e118147568392a854f65f5b50750c9b9aaa967aba7df_vector-intersection.svg", + "shortDescription": "Check collision and distance between 3D objects.", + "version": "0.1.0", + "description": "Check collision and distance between 3D objects and separate them from each other.", + "tags": [ + "3d", + "collision" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "PEzPAaWHgYgk5UwIPppsL6f2ugp2" + ], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Define helper classes JavaScript code.", + "fullName": "Define helper classes", + "functionType": "Action", + "name": "DefineHelperClasses", + "private": true, + "sentence": "Define helper classes JavaScript code", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._collision3DExtension) {", + " return;", + "}", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {float} x", + " * @param {float} y", + " * @param {float} z", + " * @return {number}", + " */", + "const getSqDistanceToPosition = (object, x, y, z) => {", + " const deltaX = object.getCenterXInScene() - x;", + " const deltaY = object.getCenterYInScene() - y;", + " const deltaZ = (object.getCenterZInScene ? object.getCenterZInScene() : 0) - z;", + " return deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;", + "};", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {float} x", + " * @param {float} y", + " * @param {float} z", + " * @return {number}", + " */", + "const getDistanceToPosition = (object, x, y, z) => Math.sqrt(getSqDistanceToPosition(object, x, y, z));", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {gdjs.RuntimeObject} otherObject", + " * @return {number}", + " */", + "const getSqDistanceToObject = (object, otherObject) => {", + " return getSqDistanceToPosition(", + " object,", + " otherObject.getCenterXInScene(),", + " otherObject.getCenterYInScene(),", + " otherObject.getCenterZInScene ? otherObject.getCenterZInScene() : 0", + " );", + "};", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {gdjs.RuntimeObject} otherObject", + " * @return {number}", + " */", + "const getDistanceToObject = (object, otherObject) => Math.sqrt(getSqDistanceToObject(object, otherObject));", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @param {gdjs.RuntimeObject} otherObject", + " * @param {number} distanceSq", + " * @return {boolean}", + " */", + "const areObjectsWithinDistance = (object, otherObject, distanceSq) => {", + " return getSqDistanceToObject(object, otherObject) <= distanceSq;", + "};", + "", + "/**", + " * @param {gdjs.ObjectList} objectsLists1", + " * @param {gdjs.ObjectList} objectsLists2", + " * @param {number} distance", + " * @param {boolean} inverted", + " * @return {boolean}", + " */", + "const pickObjectsWithinDistance = (objectsLists1, objectsLists2, distance, inverted) => {", + " const distanceSq = distance * distance;", + " return gdjs.evtTools.object.twoListsTest(", + " areObjectsWithinDistance,", + " objectsLists1,", + " objectsLists2,", + " inverted,", + " distance * distance", + " );", + "}", + "", + "/**", + " * @param {gdjs.ObjectList} objectsLists", + " * @param {gdjs.ObjectList} objectsLists2", + " * @param {number} x", + " * @param {number} y", + " * @param {number} z", + " * @param {boolean} inverted", + " * @return {boolean}", + " */", + "const pickNearestObject = function (objectsLists, x, y, z, inverted) {", + " let bestObject = null;", + " let best = 0;", + " let first = true;", + " const lists = gdjs.staticArray(gdjs._collision3DExtension.pickNearestObject);", + " objectsLists.values(lists);", + " for (let i = 0, len = lists.length; i < len; ++i) {", + " const list = lists[i];", + " for (let j = 0; j < list.length; ++j) {", + " const object = list[j];", + " const distance = getSqDistanceToPosition(object, x, y, z);", + " // @ts-ignore", + " if (first || (distance < best) ^ inverted) {", + " best = distance;", + " bestObject = object;", + " }", + " first = false;", + " }", + " }", + " if (bestObject) {", + " gdjs.evtTools.object.pickOnly(objectsLists, bestObject);", + " }", + " return !!bestObject;", + "}", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @return {float}", + " */", + "const getObjectMinZ = (object) =>", + " object.getDrawableZ ? object.getDrawableZ() : 0", + "", + "/**", + " * @param {gdjs.RuntimeObject} object", + " * @return {float}", + " */", + "const getObjectMaxZ = (object) =>", + " object.getDrawableZ ? object.getDrawableZ() + object.getDepth() : 0;", + "", + "/**", + " * @param {gdjs.RuntimeObject} object1", + " * @param {gdjs.RuntimeObject} object2", + " * @param {boolean} ignoreTouchingEdges If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.", + " * @return {boolean}", + " */", + "const areObjectsInCollision = (", + " object1,", + " object2,", + " ignoreTouchingEdges,", + ") => {", + " const object1MinZ = getObjectMinZ(object1);", + " const object1MaxZ = getObjectMaxZ(object1);", + " const object2MinZ = getObjectMinZ(object2);", + " const object2MaxZ = getObjectMaxZ(object2);", + "", + " const canObjectsOverlapOnZ = ignoreTouchingEdges ?", + " (object1MinZ < object2MaxZ && object1MaxZ > object2MinZ) :", + " (object1MinZ <= object2MaxZ && object1MaxZ >= object2MinZ);", + "", + " return canObjectsOverlapOnZ &&", + " gdjs.RuntimeObject.collisionTest(", + " object1,", + " object2,", + " ignoreTouchingEdges", + " );", + "}", + "", + "/**", + " * @param {gdjs.ObjectList} objectsLists", + " * @param {gdjs.ObjectList} objectsLists2", + " * @param {boolean} inverted", + " * @return {boolean}", + " */", + "const pickObjectsInCollision = (", + " objectsLists1,", + " objectsLists2,", + " inverted,", + ") => {", + " return gdjs.evtTools.object.twoListsTest(", + " areObjectsInCollision,", + " objectsLists1,", + " objectsLists2,", + " inverted,", + " );", + "}", + "", + "/**", + " * @param {gdjs.RuntimeObject} movingObject", + " * @param {gdjs.RuntimeObject} object", + " * @return {float}", + " */", + "const getSeparationDeltaZ = (", + " movingObject,", + " object,", + ") => {", + " const movingObjectMinZ = getObjectMinZ(movingObject);", + " const movingObjectMaxZ = getObjectMaxZ(movingObject);", + " const objectMinZ = getObjectMinZ(object);", + " const objectMaxZ = getObjectMaxZ(object);", + "", + " const downwardDeltaZ = Math.min(0, objectMinZ - movingObjectMaxZ);", + " const upwardDeltaZ = Math.max(0, objectMaxZ - movingObjectMinZ);", + "", + " return -downwardDeltaZ < upwardDeltaZ ? downwardDeltaZ : upwardDeltaZ", + "}", + "", + "// This function is an exact copy from GDJS/Runtime/runtimeobject.ts", + "/**", + " * Move the object using the results from collisionTest call.", + " * This moves the object according to the direction of the longest vector,", + " * and projects the others on the orthogonal vector.", + " *", + " * See {@link RuntimeObject.separateFromObjects}", + " *", + " * @param {gdjs.RuntimeObject} object The object to move.", + " * @param {float[]} moveXArray The X coordinates of the vectors to move the object.", + " * @param {float[]} moveYArray The Y coordinates of the vectors to move the object.", + " * @return {boolean} true if the object was moved.", + " */", + "const moveFollowingSeparatingVectors = (", + " object,", + " moveXArray,", + " moveYArray", + ") => {", + " if (moveXArray.length === 0) {", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " return false;", + " }", + " if (moveXArray.length === 1) {", + " // Move according to the results returned by the collision algorithm.", + " object.setPosition(", + " object.getX() + moveXArray[0],", + " object.getY() + moveYArray[0]", + " );", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " return true;", + " }", + "", + " // Find the longest vector", + " let squaredDistanceMax = 0;", + " let distanceMaxIndex = 0;", + " for (let index = 0; index < moveXArray.length; index++) {", + " const moveX = moveXArray[index];", + " const moveY = moveYArray[index];", + "", + " const squaredDistance = moveX * moveX + moveY * moveY;", + " if (squaredDistance > squaredDistanceMax) {", + " squaredDistanceMax = squaredDistance;", + " distanceMaxIndex = index;", + " }", + " }", + "", + " const distanceMax = Math.sqrt(squaredDistanceMax);", + " // unit vector of the longest vector", + " const uX = moveXArray[distanceMaxIndex] / distanceMax;", + " const uY = moveYArray[distanceMaxIndex] / distanceMax;", + "", + " // normal vector of the longest vector", + " const vX = -uY;", + " const vY = uX;", + "", + " // Project other vectors on the normal", + " let scalarProductMin = 0;", + " let scalarProductMax = 0;", + " for (let index = 0; index < moveXArray.length; index++) {", + " const moveX = moveXArray[index];", + " const moveY = moveYArray[index];", + "", + " const scalarProduct = moveX * vX + moveY * vY;", + " scalarProductMin = Math.min(scalarProductMin, scalarProduct);", + " scalarProductMax = Math.max(scalarProductMax, scalarProduct);", + " }", + "", + " // Apply the longest vector", + " let deltaX = moveXArray[distanceMaxIndex];", + " let deltaY = moveYArray[distanceMaxIndex];", + "", + " // Apply the longest projected vector if they all are in the same direction", + " // Some projections could have rounding errors,", + " // they are considered negligible under a 1 for 1,000,000 ratio.", + " const scalarProductMinIsNegligible =", + " -scalarProductMin < scalarProductMax / 1048576;", + " const scalarProductMaxIsNegligible =", + " scalarProductMax < -scalarProductMin / 1048576;", + " if (scalarProductMinIsNegligible !== scalarProductMaxIsNegligible) {", + " if (scalarProductMaxIsNegligible) {", + " deltaX += scalarProductMin * vX;", + " deltaY += scalarProductMin * vY;", + " } else {", + " deltaX += scalarProductMax * vX;", + " deltaY += scalarProductMax * vY;", + " }", + " }", + " object.setPosition(object.getX() + deltaX, object.getY() + deltaY);", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " return true;", + "};", + "", + "/**", + " * Arrays and data structure that are (re)used by", + " * {@link separateFromObjects} to avoid any allocation.", + " * @type {moveXArray: float[], moveYArray: float[], moveZArray: float[]}", + " */", + "const separateFromObjectsStatics = {", + " moveXArray: [],", + " moveYArray: [],", + " moveZArray: [],", + "};", + "", + "/**", + " * Separate the object from others objects, using their hitboxes.", + " * @param {gdjs.RuntimeObject} object The object that moves.", + " * @param {gdjs.RuntimeObject[]} objects The objects that stay still.", + " * @return {boolean} true if the object was moved", + " */", + "const separateFromObjects = (", + " object,", + " objects", + ") => {", + " const moveXArray = separateFromObjectsStatics.moveXArray;", + " const moveYArray = separateFromObjectsStatics.moveYArray;", + " moveXArray.length = 0;", + " moveYArray.length = 0;", + " let moveZMax = 0;", + "", + " // We can assume that the moving object is not grid based,", + " // so there is no need for optimization:", + " // getHitBoxes can be called directly.", + " const hitBoxes = object.getHitBoxes();", + " /** @type {gdjs.AABB | null} */", + " let aabb = null;", + "", + " // Check if there is a collision with each object", + " for (const otherObject of objects) {", + " if (otherObject.id === object.id) {", + " continue;", + " }", + " const moveZ = getSeparationDeltaZ(object, otherObject);", + " if (moveZ === 0) {", + " continue;", + " }", + " const moveZSq = moveZ * moveZ;", + "", + " let otherHitBoxesArray = otherObject.getHitBoxes();", + " /** @type {Iterable} */", + " let otherHitBoxes = otherHitBoxesArray;", + " if (otherHitBoxesArray.length > 4) {", + " // The other object has a lot of hit boxes.", + " // Try to reduce the amount of hitboxes to check.", + " if (!aabb) {", + " aabb = object.getAABB();", + " }", + " otherHitBoxes = otherObject.getHitBoxesAround(", + " aabb.min[0],", + " aabb.min[1],", + " aabb.max[0],", + " aabb.max[1]", + " );", + " }", + " for (const hitBox of hitBoxes) {", + " for (const otherHitBox of otherHitBoxes) {", + " const result = gdjs.Polygon.collisionTest(", + " hitBox,", + " otherHitBox,", + " true", + " );", + " if (result.collision) {", + " const moveX = result.move_axis[0];", + " const moveY = result.move_axis[1];", + " if (moveZSq < moveX * moveX + moveY * moveY) {", + " if (Math.abs(moveZ) > Math.abs(moveZMax)) {", + " moveZMax = moveZ;", + " }", + " }", + " else {", + " moveXArray.push(moveX);", + " moveYArray.push(moveY);", + " }", + " }", + " }", + " }", + " }", + " const hasObjectMovedOnZ = moveZMax !== 0;", + " if (hasObjectMovedOnZ) {", + " object.setZ(object.getZ() + moveZMax);", + " }", + " const hasObjectMovedOnXY = moveFollowingSeparatingVectors(object, moveXArray, moveYArray);", + " return hasObjectMovedOnXY || hasObjectMovedOnZ;", + "}", + "", + "gdjs._collision3DExtension = {", + " getSqDistanceToPosition,", + " getDistanceToPosition,", + " getSqDistanceToObject,", + " getDistanceToObject,", + " pickObjectsWithinDistance,", + " pickNearestObject,", + " pickObjectsInCollision,", + " separateFromObjects", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Collision3D::DefineHelperClasses" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Compare the distance between two objects in 3D.", + "fullName": "Distance between two objects in 3D", + "functionType": "Condition", + "group": "Position", + "name": "AreWithinDistance", + "sentence": "_PARAM1_ distance to _PARAM2_ is below _PARAM3_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// TODO If condition is inverted, only objects that have a distance greater than specified to any other object will be picked.\r", + "const inverted = false;\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickObjectsWithinDistance(\r", + " eventsFunctionContext.getObjectsLists(\"Object\"),\r", + " eventsFunctionContext.getObjectsLists(\"OtherObject\"),\r", + " eventsFunctionContext.getArgument(\"Distance\"),\r", + " inverted\r", + ");\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + }, + { + "description": "Distance", + "name": "Distance", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Distance between two objects in 3D.", + "fullName": "Distance between two objects in 3D", + "functionType": "Expression", + "group": "Position", + "name": "Distance", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", + "\r", + "if (objects.length > 0 && otherObjects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getDistanceToObject(\r", + " objects[0],\r", + " otherObjects[0]\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Square distance between two objects in 3D.", + "fullName": "Square distance between two objects", + "functionType": "Expression", + "group": "Position", + "name": "SqDistance", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const otherObjects = eventsFunctionContext.getObjectsLists(\"OtherObject\");\r", + "\r", + "if (objects.length > 0 && otherObjects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getSqDistanceToObject(\r", + " objects[0],\r", + " otherObjects[0]\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Distance between an object and a position in 3D.", + "fullName": "Distance between an object and a position", + "functionType": "Expression", + "group": "Position", + "name": "DistanceToPosition", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "if (objects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getSqDistanceToPosition(\r", + " objects[0],\r", + " eventsFunctionContext.getArgument(\"PositionX\"),\r", + " eventsFunctionContext.getArgument(\"PositionY\"),\r", + " eventsFunctionContext.getArgument(\"PositionZ\"),\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "X position", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Y position", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Z position", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Square distance between an object and a position in 3D.", + "fullName": "Square distance between an object and a position", + "functionType": "Expression", + "group": "Position", + "name": "SqDistanceToPosition", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "if (objects.length > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._collision3DExtension.getDistanceToPosition(\r", + " objects[0],\r", + " eventsFunctionContext.getArgument(\"PositionX\"),\r", + " eventsFunctionContext.getArgument(\"PositionY\"),\r", + " eventsFunctionContext.getArgument(\"PositionZ\"),\r", + " );\r", + "}\r", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "X position", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Y position", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Z position", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Pick the object of this type that is nearest to the specified position in 3D.", + "fullName": "Pick nearest object in 3D", + "functionType": "Condition", + "group": "Objects", + "name": "PickNearest", + "sentence": "Pick the _PARAM1_ that is nearest to _PARAM2_ ; _PARAM3_ ; _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// TODO If the condition is inverted, the object farthest from the specified position is picked instead.\r", + "const inverted = false;\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickNearestObject(\r", + " eventsFunctionContext.getObjectsLists(\"Object\"),\r", + " eventsFunctionContext.getArgument(\"PositionX\"),\r", + " eventsFunctionContext.getArgument(\"PositionY\"),\r", + " eventsFunctionContext.getArgument(\"PositionZ\"),\r", + " inverted\r", + ");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "X position", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Y position", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Z position", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check the collision between two objects using their collision masks. Object rotation around X and Y axes are ignored.", + "fullName": "Collision in 3D", + "functionType": "Condition", + "group": "Collision", + "name": "AreInCollision", + "sentence": "_PARAM1_ is in collision with _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// TODO If the condition is inverted, the object farthest from the specified position is picked instead.\r", + "const inverted = false;\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._collision3DExtension.pickObjectsInCollision(\r", + " eventsFunctionContext.getObjectsLists(\"Object\"),\r", + " eventsFunctionContext.getObjectsLists(\"OtherObject\"),\r", + " eventsFunctionContext.getArgument(\"IgnoreEdges\"),\r", + " inverted\r", + ");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Other object", + "name": "OtherObject", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "OtherObjectCapability", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Ignore objects that are touching each other on their edges, but are not overlapping (default: no)", + "name": "IgnoreEdges", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Move an object away from another using their collision masks. Object rotation around X and Y axes are ignored.\nBe sure to call this action on a reasonable number of objects to avoid slowing down the game.", + "fullName": "Separate objects in 3D", + "functionType": "Action", + "group": "Position", + "name": "SeparateFromObjects", + "sentence": "Move _PARAM1_ away from _PARAM3_ (only _PARAM1_ will move)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const otherObjects = eventsFunctionContext.getObjects(\"OtherObject\");\r", + "\r", + "for (const object of objects) {\r", + " gdjs._collision3DExtension.separateFromObjects(\r", + " object,\r", + " otherObjects,\r", + " );\r", + "}" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Objects (won't move)", + "name": "OtherObject", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "OtherObject3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Model9Patch3D", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Create a 9-patch over a 3D box using 3D models for the parts.", + "fullName": "Create a 3D 9-patch", + "functionType": "Action", + "name": "Create9Patch", + "sentence": "Create a 9-patch with corners of _PARAM2_ pixels over _PARAM1_ with top: _PARAM3_ top corner: _PARAM4_ top side: _PARAM5_ center corner: _PARAM6_ center side: _PARAM7_ bottom corner: _PARAM8_ bottom side: _PARAM9_ bottom: _PARAM10_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Top", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "TopCenter", + "Object.Width() / 2", + "Object.Height() / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "TopCenter", + "Resizable", + "=", + "Object.Height() - 2 * Size" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "TopCenter", + "Resizable", + "=", + "Object.Width() - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "TopCenter", + "Object3D", + "=", + "Object.Object3D::Depth() - Size / 2" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "TopCenter", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Create9PatchSlice" + }, + "parameters": [ + "", + "Object", + "Size", + "TopCorner", + "TopSide", + "Object.Object3D::Depth() - Size / 2", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Bottom", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "BottomCenter", + "Object.Width() / 2", + "Object.Height() / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "BottomCenter", + "Resizable", + "=", + "Object.Height() - 2 * Size" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "BottomCenter", + "Resizable", + "=", + "Object.Width() - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "BottomCenter", + "Object3D", + "=", + "Size / 2" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "BottomCenter", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Create9PatchSlice" + }, + "parameters": [ + "", + "Object", + "Size", + "BottomCorner", + "BottomSide", + "Size / 2", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Center", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Box9Patch3DExtension.Z", + "=", + "Size / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "ceil(Object.Object3D::Depth() / Size) - 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Box9Patch3DExtension.Z", + "+", + "Size" + ] + }, + { + "type": { + "value": "Model9Patch3D::Create9PatchSlice" + }, + "parameters": [ + "", + "Object", + "Size", + "CenterCorner", + "CenterSide", + "Variable(_Box9Patch3DExtension.Z)", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Corner size", + "name": "Size", + "type": "expression" + }, + { + "description": "Top", + "name": "TopCenter", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Top corner", + "name": "TopCorner", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Top side", + "name": "TopSide", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Center corner", + "name": "CenterCorner", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Center side", + "name": "CenterSide", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Bottom corner", + "name": "BottomCorner", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Bottom side", + "name": "BottomSide", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Bottom", + "name": "BottomCenter", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + } + ], + "objectGroups": [ + { + "name": "Top", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + } + ] + }, + { + "name": "Part", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + }, + { + "name": "CenterCorner" + }, + { + "name": "CenterSide" + }, + { + "name": "BottomCorner" + }, + { + "name": "BottomSide" + }, + { + "name": "BottomCenter" + } + ] + } + ] + }, + { + "description": "Create a 9-patch over a 3D box using 3D models for the parts.", + "fullName": "Create a 3D 9-patch (single height)", + "functionType": "Action", + "name": "Create9PatchSingleHeight", + "sentence": "Create a 9-patch with corners of _PARAM2_ pixels over _PARAM1_ with top: _PARAM3_ corner: _PARAM4_ side: _PARAM5_ bottom: _PARAM6_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Create9PatchSlice" + }, + "parameters": [ + "", + "Object", + "Size", + "Corner", + "Side", + "Size / 2", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "TopCenter", + "Object.Width() / 2", + "Object.Height() / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "TopCenter", + "Resizable", + "=", + "Object.Height() - 2 * Size" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "TopCenter", + "Resizable", + "=", + "Object.Width() - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "TopCenter", + "Object3D", + "=", + "Object.Object3D::Depth() - Size / 2" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "TopCenter", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "BottomCenter", + "Object.Width() / 2", + "Object.Height() / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "BottomCenter", + "Resizable", + "=", + "Object.Height() - 2 * Size" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "BottomCenter", + "Resizable", + "=", + "Object.Width() - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "BottomCenter", + "Object3D", + "=", + "Size / 2" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "BottomCenter", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Corner size", + "name": "Size", + "type": "expression" + }, + { + "description": "Top", + "name": "TopCenter", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Top corner", + "name": "Corner", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Top side", + "name": "Side", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Bottom", + "name": "BottomCenter", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + } + ], + "objectGroups": [ + { + "name": "Top", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + } + ] + }, + { + "name": "Part", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + }, + { + "name": "CenterCorner" + }, + { + "name": "CenterSide" + }, + { + "name": "BottomCorner" + }, + { + "name": "BottomSide" + }, + { + "name": "BottomCenter" + } + ] + } + ] + }, + { + "description": "Create a 9-patch sliceover a 3D box using 3D models for the parts.", + "fullName": "Create a 3D 9-patch slice", + "functionType": "Action", + "name": "Create9PatchSlice", + "private": true, + "sentence": "Create a 9-patch slice with corners of _PARAM2_ pixels over _PARAM1_ with corner: _PARAM3_ side: _PARAM4_ at Z: _PARAM5_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Corners", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Object.Width() - Size / 2", + "Object.Height() - Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Corner", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Size / 2", + "Object.Height() - Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Corner", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Size / 2", + "Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipY" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Corner", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Object.Width() - Size / 2", + "Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipY" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Corner", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Sides", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Object.Width() - Size / 2", + "Object.Height() / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Object.Height() - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Side", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Size / 2", + "Object.Height() / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Object.Height() - 2 * Size" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Side", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Side", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Object.Width() / 2", + "Object.Height() - Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Object.Width() - 2 * Size" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Side", + "=", + "90" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Side", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Object.Width() / 2", + "Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Object.Width() - 2 * Size" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Side", + "=", + "90" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Side", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + }, + { + "type": { + "value": "Model9Patch3D::PutOnBox" + }, + "parameters": [ + "", + "Object", + "Side", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Corner size", + "name": "Size", + "type": "expression" + }, + { + "description": "Top corner", + "name": "Corner", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Top side", + "name": "Side", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Z", + "name": "Z", + "type": "expression" + } + ], + "objectGroups": [ + { + "name": "Top", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + } + ] + }, + { + "name": "Part", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + }, + { + "name": "CenterCorner" + }, + { + "name": "CenterSide" + }, + { + "name": "BottomCorner" + }, + { + "name": "BottomSide" + }, + { + "name": "BottomCenter" + } + ] + } + ] + }, + { + "description": "Rotate an object around a position.", + "fullName": "Rotate around a position", + "functionType": "Action", + "name": "RotateAroundPosition", + "private": true, + "sentence": "Rotate _PARAM1_ of _PARAM2_° around _PARAM3_ ; _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutourPos" + }, + "parameters": [ + "Object", + "X", + "Y", + "Object.DistanceToPosition(X, Y)", + "Angle + (180 + Object.AngleToPosition(X, Y))" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "Angle" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Rotation angle (in degree)", + "name": "Angle", + "type": "expression" + }, + { + "description": "X position", + "name": "X", + "type": "expression" + }, + { + "description": "Y position", + "name": "Y", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Put the part on the box", + "fullName": "Put on the box", + "functionType": "Action", + "name": "PutOnBox", + "private": true, + "sentence": "Put _PARAM2_ on the box _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Part", + "+", + "Object.X()" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Part", + "+", + "Object.Y()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Part", + "Object3D", + "+", + "Object.Object3D::Z()" + ] + }, + { + "type": { + "value": "Model9Patch3D::RotateAroundPosition" + }, + "parameters": [ + "", + "Part", + "Object.Angle()", + "Object.CenterX()", + "Object.CenterY()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scene3D::Cube3DObject", + "type": "objectList" + }, + { + "description": "Part", + "name": "Part", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "the top of the object on Z axis", + "fullName": "Top on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "TopZ", + "private": true, + "sentence": "the top on Z axis of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (objects.length === 0) {", + " return;", + "}", + "const object = objects[0];", + "eventsFunctionContext.returnValue = object.getDrawableZ ? object.getDrawableZ() + object.getDepth() : 0;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "the bottom of the object on Z axis", + "fullName": "Bottom on Z axis", + "functionType": "ExpressionAndCondition", + "group": "Position", + "name": "BottomZ", + "private": true, + "sentence": "the bottom on Z axis of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (objects.length === 0) {", + " return;", + "}", + "const object = objects[0];", + "eventsFunctionContext.returnValue = object.getDrawableZ ? object.getDrawableZ() : 0;", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "defaultName": "", + "description": "", + "fullName": "", + "is3D": true, + "name": "Model9Patch3D", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Placeholder", + "0", + "0", + "\"\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Placeholder" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Model9Patch3D::Model9Patch3D", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::Width" + }, + "parameters": [ + "Object", + "Resizable", + "!=", + "Width" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::Height" + }, + "parameters": [ + "Object", + "Resizable", + "!=", + "Height" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::Depth" + }, + "parameters": [ + "Object", + "Object3D", + "!=", + "Depth" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Model9Patch3D::SetPropertyWidth" + }, + "parameters": [ + "Object", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "Model9Patch3D::Model9Patch3D::SetPropertyHeight" + }, + "parameters": [ + "Object", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "Model9Patch3D::Model9Patch3D::SetPropertyDepth" + }, + "parameters": [ + "Object", + "=", + "Object.Object3D::Depth()" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "ToString(Width) + \" \" + ToString(Height) + \" \" + ToString(Depth)", + "\"info\"", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Patch", + "" + ] + }, + { + "type": { + "value": "Model9Patch3D::Model9Patch3D::Create9Patch" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Placeholder", + "Resizable", + "=", + "Width" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Placeholder", + "Resizable", + "=", + "Height" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetDepth" + }, + "parameters": [ + "Placeholder", + "Object3D", + "=", + "Depth" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Patch", + "no" + ] + }, + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "ToString(Object.Width()) + \" \" + ToString(Object.Height()) + \" \" + ToString(Object.Object3D::Depth())", + "\"info\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Model9Patch3D::Model9Patch3D", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Patch", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + }, + { + "name": "CenterSide" + }, + { + "name": "CenterCorner" + }, + { + "name": "BottomSide" + }, + { + "name": "BottomCorner" + }, + { + "name": "BottomCenter" + } + ] + } + ] + }, + { + "description": "Create a 9-patch over a 3D box using 3D models for the parts.", + "fullName": "Create a 3D 9-patch", + "functionType": "Action", + "name": "Create9Patch", + "sentence": "Create a 9-patch over _PARAM0_", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Top", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "TopCenter", + "Width / 2", + "Height / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "TopCenter", + "Resizable", + "=", + "Height - 2 * Size" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "TopCenter", + "Resizable", + "=", + "Width - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "TopCenter", + "Object3D", + "=", + "Depth - Size / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Model9Patch3D::Create9PatchSlice" + }, + "parameters": [ + "Object", + "TopCorner", + "TopSide", + "Depth - Size / 2", + "Object.Object3D::Depth() - Size / 2" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Bottom", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "BottomCenter", + "Width / 2", + "Height / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "BottomCenter", + "Resizable", + "=", + "Height - 2 * Size" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "BottomCenter", + "Resizable", + "=", + "Width - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "BottomCenter", + "Object3D", + "=", + "Size / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Model9Patch3D::Model9Patch3D::Create9PatchSlice" + }, + "parameters": [ + "Object", + "BottomCorner", + "BottomSide", + "Size / 2", + "Object.Object3D::Depth() - Size / 2" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Center", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Box9Patch3DExtension.Z", + "=", + "Size / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "ceil(Depth / Size) - 2", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_Box9Patch3DExtension.Z", + "+", + "Size" + ] + }, + { + "type": { + "value": "Model9Patch3D::Model9Patch3D::Create9PatchSlice" + }, + "parameters": [ + "Object", + "CenterCorner", + "CenterSide", + "Variable(_Box9Patch3DExtension.Z)", + "Object.Object3D::Depth() - Size / 2" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Model9Patch3D::Model9Patch3D", + "type": "object" + } + ], + "objectGroups": [ + { + "name": "Top", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + } + ] + }, + { + "name": "Part", + "objects": [ + { + "name": "TopCenter" + }, + { + "name": "TopSide" + }, + { + "name": "TopCorner" + }, + { + "name": "CenterCorner" + }, + { + "name": "CenterSide" + }, + { + "name": "BottomCorner" + }, + { + "name": "BottomSide" + }, + { + "name": "BottomCenter" + } + ] + } + ] + }, + { + "description": "Create a 9-patch sliceover a 3D box using 3D models for the parts.", + "fullName": "Create a 3D 9-patch slice", + "functionType": "Action", + "name": "Create9PatchSlice", + "private": true, + "sentence": "Create a 9-patch slice over _PARAM0_ with corner: _PARAM1_ side: _PARAM2_ at Z: _PARAM3_", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Corners", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Width - Size / 2", + "Height - Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Size / 2", + "Height - Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Size / 2", + "Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipY" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Corner", + "Width - Size / 2", + "Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipY" + }, + "parameters": [ + "Corner", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Corner", + "Object3D", + "=", + "Z" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Sides", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Width - Size / 2", + "Height / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Height - 2 * Size" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Size / 2", + "Height / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Height - 2 * Size" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Side", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Width / 2", + "Height - Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Width - 2 * Size" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Side", + "=", + "90" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Side", + "Width / 2", + "Size / 2", + "Object.Layer()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Side", + "Resizable", + "=", + "Width - 2 * Size" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Side", + "=", + "90" + ] + }, + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Side", + "Flippable", + "yes" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Side", + "Object3D", + "=", + "Z" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Model9Patch3D::Model9Patch3D", + "type": "object" + }, + { + "description": "Top corner", + "name": "Corner", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Top side", + "name": "Side", + "supplementaryInformation": "Scene3D::Model3DObject", + "type": "objectList" + }, + { + "description": "Z", + "name": "Z", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "100", + "type": "Number", + "unit": "Pixel", + "label": "Patch size", + "description": "", + "group": "", + "extraInformation": [], + "name": "Size" + }, + { + "value": "", + "type": "Boolean", + "label": "Tiled on X", + "description": "", + "group": "", + "extraInformation": [], + "name": "IsTiledOnX" + }, + { + "value": "", + "type": "Boolean", + "label": "Tiled on Y", + "description": "", + "group": "", + "extraInformation": [], + "name": "IsTiledOnY" + }, + { + "value": "", + "type": "Boolean", + "label": "Tiled on Z", + "description": "", + "group": "", + "extraInformation": [], + "name": "IsTiledOnZ" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "TopCenter" + ], + "hidden": true, + "name": "ShowTopCenter" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "TopSide" + ], + "hidden": true, + "name": "ShowTopSide" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "TopCorner" + ], + "hidden": true, + "name": "ShowTopCorner" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "CenterSide" + ], + "hidden": true, + "name": "ShowCenterSide" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "CenterCorner" + ], + "hidden": true, + "name": "ShowCenterCorner" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "BottomSide" + ], + "hidden": true, + "name": "ShowBottomSide" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "BottomCorner" + ], + "hidden": true, + "name": "ShowBottomCorner" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "BottomCenter" + ], + "hidden": true, + "name": "ShowBottomCenter" + }, + { + "value": "-1", + "type": "Number", + "unit": "Pixel", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Width" + }, + { + "value": "-1", + "type": "Number", + "unit": "Pixel", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Height" + }, + { + "value": "-1", + "type": "Number", + "unit": "Pixel", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Depth" + } + ], + "objects": [ + { + "assetStoreId": "", + "name": "TopCenter", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "TopSide", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "TopCorner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "CenterSide", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "CenterCorner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "BottomSide", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "BottomCorner", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "BottomCenter", + "type": "Scene3D::Model3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "centerLocation": "ModelOrigin", + "depth": 100, + "height": 100, + "keepAspectRatio": false, + "materialType": "StandardWithoutMetalness", + "modelResourceName": "", + "originLocation": "ModelOrigin", + "rotationX": 0, + "rotationY": 0, + "rotationZ": 0, + "width": 100, + "animations": [] + } + }, + { + "assetStoreId": "", + "name": "Placeholder", + "type": "Scene3D::Cube3DObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "width": 100, + "height": 100, + "depth": 100, + "enableTextureTransparency": false, + "facesOrientation": "Z", + "frontFaceResourceName": "", + "backFaceResourceName": "", + "backFaceUpThroughWhichAxisRotation": "X", + "leftFaceResourceName": "", + "rightFaceResourceName": "", + "topFaceResourceName": "", + "bottomFaceResourceName": "", + "frontFaceVisible": true, + "backFaceVisible": true, + "leftFaceVisible": true, + "rightFaceVisible": true, + "topFaceVisible": true, + "bottomFaceVisible": true, + "frontFaceResourceRepeat": false, + "backFaceResourceRepeat": false, + "leftFaceResourceRepeat": false, + "rightFaceResourceRepeat": false, + "topFaceResourceRepeat": false, + "bottomFaceResourceRepeat": false, + "materialType": "Basic" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "TopCenter" + }, + { + "objectName": "TopSide" + }, + { + "objectName": "TopCorner" + }, + { + "objectName": "CenterSide" + }, + { + "objectName": "CenterCorner" + }, + { + "objectName": "BottomSide" + }, + { + "objectName": "BottomCorner" + }, + { + "objectName": "BottomCenter" + }, + { + "objectName": "Placeholder" + } + ] + } + } + ] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Decorator", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "eventsFunctions": [ + { + "description": "Create an object in every cells at a random position.", + "fullName": "Create object on a random grid", + "functionType": "Action", + "name": "CreateRandomGrid", + "sentence": "Create _PARAM1_ in every cells of _PARAM2_ pixels over: _PARAM3_ with a margin of _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Platform", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_DecoratorExtension.CellSizeX", + "=", + "Platform.Width() / ceil(Platform.Width() / CellSize)" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_DecoratorExtension.CellSizeY", + "=", + "Platform.Height() / ceil(Platform.Height() / CellSize)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_DecoratorExtension.Y", + "=", + "Platform.Y()" + ] + } + ] + }, + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "VarScene" + }, + "parameters": [ + "_DecoratorExtension.Y", + "<", + "Platform.Y() + Platform.Height() - 0.1" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_DecoratorExtension.X", + "=", + "Platform.X()" + ] + } + ], + "events": [ + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "VarScene" + }, + "parameters": [ + "_DecoratorExtension.X", + "<", + "Platform.X() + Platform.Width() - 0.1" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Object", + "RandomFloatInRange(Variable(_DecoratorExtension.X) + Margin, Variable(_DecoratorExtension.X) + Variable(_DecoratorExtension.CellSizeX) - Margin)", + "RandomFloatInRange(Variable(_DecoratorExtension.Y) + Margin, Variable(_DecoratorExtension.Y) + Variable(_DecoratorExtension.CellSizeY) - Margin)", + "Platform.Layer()" + ] + }, + { + "type": { + "value": "Decorator::RotateAroundPosition" + }, + "parameters": [ + "", + "Object", + "Platform.Angle()", + "Platform.CenterX()", + "Platform.CenterY()", + "" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "RandomFloat(360)" + ] + }, + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_DecoratorExtension.X", + "+", + "Variable(_DecoratorExtension.CellSizeX)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarScene" + }, + "parameters": [ + "_DecoratorExtension.Y", + "+", + "Variable(_DecoratorExtension.CellSizeY)" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectListOrEmptyIfJustDeclared" + }, + { + "description": "Cell size", + "name": "CellSize", + "type": "expression" + }, + { + "description": "Platform", + "name": "Platform", + "type": "objectList" + }, + { + "description": "Margin", + "name": "Margin", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Rotate an object around a position.", + "fullName": "Rotate around a position", + "functionType": "Action", + "name": "RotateAroundPosition", + "private": true, + "sentence": "Rotate _PARAM1_ of _PARAM2_° around _PARAM3_ ; _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutourPos" + }, + "parameters": [ + "Object", + "X", + "Y", + "Object.DistanceToPosition(X, Y)", + "Angle + (180 + Object.AngleToPosition(X, Y))" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "Angle" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Rotation angle (in degree)", + "name": "Angle", + "type": "expression" + }, + { + "description": "X position", + "name": "X", + "type": "expression" + }, + { + "description": "Y position", + "name": "Y", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + } + ], + "externalLayouts": [], + "externalSourceFiles": [] +} \ No newline at end of file diff --git a/examples/3d-third-person/Camera.png b/examples/3d-third-person/Camera.png new file mode 100644 index 000000000..d816b1304 Binary files /dev/null and b/examples/3d-third-person/Camera.png differ diff --git a/examples/3d-third-person/Particle.png b/examples/3d-third-person/Particle.png new file mode 100644 index 000000000..1cec2451e Binary files /dev/null and b/examples/3d-third-person/Particle.png differ diff --git a/examples/3d-third-person/README.md b/examples/3d-third-person/README.md new file mode 100644 index 000000000..bb81a27e0 --- /dev/null +++ b/examples/3d-third-person/README.md @@ -0,0 +1 @@ +A 3D first person movement example featuring 3D first person movement on the X and Y planes, the pointer lock extension, and mobile controls \ No newline at end of file diff --git a/examples/3d-third-person/Shadow.png b/examples/3d-third-person/Shadow.png new file mode 100644 index 000000000..dae659a4f Binary files /dev/null and b/examples/3d-third-person/Shadow.png differ diff --git a/examples/3d-third-person/TAGS.md b/examples/3d-third-person/TAGS.md new file mode 100644 index 000000000..1d3af152f --- /dev/null +++ b/examples/3d-third-person/TAGS.md @@ -0,0 +1 @@ +game, simple diff --git a/examples/3d-third-person/Top arrow round button.png b/examples/3d-third-person/Top arrow round button.png new file mode 100644 index 000000000..8c585f1d2 Binary files /dev/null and b/examples/3d-third-person/Top arrow round button.png differ diff --git a/examples/3d-third-person/assets/Black.png b/examples/3d-third-person/assets/Black.png new file mode 100644 index 000000000..0619da1fa Binary files /dev/null and b/examples/3d-third-person/assets/Black.png differ diff --git a/examples/3d-third-person/assets/Bunny.glb b/examples/3d-third-person/assets/Bunny.glb new file mode 100644 index 000000000..38d594438 Binary files /dev/null and b/examples/3d-third-person/assets/Bunny.glb differ diff --git a/examples/3d-third-person/assets/Floor.png b/examples/3d-third-person/assets/Floor.png new file mode 100644 index 000000000..eccef3b95 Binary files /dev/null and b/examples/3d-third-person/assets/Floor.png differ diff --git a/examples/3d-third-person/assets/Grass.png b/examples/3d-third-person/assets/Grass.png new file mode 100644 index 000000000..37aac2fad Binary files /dev/null and b/examples/3d-third-person/assets/Grass.png differ diff --git a/examples/3d-third-person/assets/Shaded dark joystick border.png b/examples/3d-third-person/assets/Shaded dark joystick border.png new file mode 100644 index 000000000..3d6f08b35 Binary files /dev/null and b/examples/3d-third-person/assets/Shaded dark joystick border.png differ diff --git a/examples/3d-third-person/assets/Shaded dark joystick thumb.png b/examples/3d-third-person/assets/Shaded dark joystick thumb.png new file mode 100644 index 000000000..e91064672 Binary files /dev/null and b/examples/3d-third-person/assets/Shaded dark joystick thumb.png differ diff --git a/examples/3d-third-person/assets/SmoothParticle.png b/examples/3d-third-person/assets/SmoothParticle.png new file mode 100644 index 000000000..871c194cc Binary files /dev/null and b/examples/3d-third-person/assets/SmoothParticle.png differ diff --git a/examples/3d-third-person/assets/Soda Can.glb b/examples/3d-third-person/assets/Soda Can.glb new file mode 100644 index 000000000..0df5fc82f Binary files /dev/null and b/examples/3d-third-person/assets/Soda Can.glb differ diff --git a/examples/3d-third-person/assets/Soil.png b/examples/3d-third-person/assets/Soil.png new file mode 100644 index 000000000..fad1b34aa Binary files /dev/null and b/examples/3d-third-person/assets/Soil.png differ diff --git a/examples/3d-third-person/assets/Walls.png b/examples/3d-third-person/assets/Walls.png new file mode 100644 index 000000000..7f0213cd0 Binary files /dev/null and b/examples/3d-third-person/assets/Walls.png differ diff --git a/examples/3d-third-person/assets/Water.png b/examples/3d-third-person/assets/Water.png new file mode 100644 index 000000000..bcc43aa6a Binary files /dev/null and b/examples/3d-third-person/assets/Water.png differ diff --git a/examples/3d-third-person/assets/WoodBarrierTops.png b/examples/3d-third-person/assets/WoodBarrierTops.png new file mode 100644 index 000000000..a0444b4e6 Binary files /dev/null and b/examples/3d-third-person/assets/WoodBarrierTops.png differ diff --git a/examples/3d-third-person/assets/crosshair.png b/examples/3d-third-person/assets/crosshair.png new file mode 100644 index 000000000..20771b47f Binary files /dev/null and b/examples/3d-third-person/assets/crosshair.png differ