@directivegames/genesys.js 3.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -0
- package/assets/animation-profiles/mixamo.skeleton-profile.json +63 -0
- package/assets/animation-profiles/rigify.skeleton-profile.json +61 -0
- package/assets/character/SKM_SB_MediumHuman.glb +0 -0
- package/assets/character/config/AnimationStateMachineComponent.md +107 -0
- package/assets/character/config/mannequin-anim.json +53 -0
- package/assets/character/mannequin.glb +0 -0
- package/assets/character/mannequinG.glb +0 -0
- package/assets/default.genesys-scene +194 -0
- package/assets/models/PickupActors/SM_Pickup_Health.glb +0 -0
- package/assets/models/PickupActors/SM_Pickup_Station.glb +0 -0
- package/assets/models/SM_Capsule.glb +0 -0
- package/assets/models/SM_ChamferCube.glb +0 -0
- package/assets/models/SM_Cone.glb +0 -0
- package/assets/models/SM_Cube.glb +0 -0
- package/assets/models/SM_Cylinder.glb +0 -0
- package/assets/models/SM_Plane.glb +0 -0
- package/assets/models/SM_Pyramid.glb +0 -0
- package/assets/models/SM_Sphere.glb +0 -0
- package/assets/models/SM_Torus.glb +0 -0
- package/assets/models/SM_Wedge.glb +0 -0
- package/assets/models/Weapons/SM_ShotGun_01.glb +0 -0
- package/assets/models/demo/Characters/Knightdude.glb +0 -0
- package/assets/models/demo/Characters/Spacedude.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Bush01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Bush02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_GeneratedLandscape.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Mushroom01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Mushroom02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_MushroomCluster01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_MushroomCluster02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock04.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree04.glb +0 -0
- package/assets/models/demo/LowPoly/SM_TreeStump.glb +0 -0
- package/assets/models/demo/LowPoly/SM_TreeTrunk.glb +0 -0
- package/assets/models/demo/LowPoly/low_poly_ship_wreck.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Dirt.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Grass02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Grass02Patch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Gravel.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Lava.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_LavaStone.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Sand.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Stone.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_StoneA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_StoneC.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Wall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Water.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_Arachnids_Large_Spider.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Adventurer_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Adventurer_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aviator_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aviator_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aztec_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aztec_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_MediumHuman.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Shaman.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_05.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_06.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_07.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_SmallCloud01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_SmallCloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_AztecStatue.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_Broken_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_Broken_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Calendar_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Calendar_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Skull.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Goldpile_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Goldpile_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Rubble_Skeleton_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_TreasureChest.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_TreasureChestSmall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Wall_Deco_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_AngledWall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Arch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Beams.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Beams02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Corner.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_CornerB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor2.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor3.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_GrowingTree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_HalfFloor.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_IronBucket.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Pillar.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Railing.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_RoofWindow.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Stairs01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Statue.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall03B.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_WallB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_WallTrim.glb +0 -0
- package/assets/models/demo/SandboxAsset/Floors/SM_SB_Floor_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Floors/SM_SB_Floor_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower01_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower01_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower02_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower02_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower03_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower03_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Beach_Grass.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Birgaradier_Tree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Cactus_Long.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_ElephantEar01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Fern01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_GrassPatch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Growing_Plant.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Leaf_bush01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Middle_Moss.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Oracle_Tree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Plant01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Tree01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_plant.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Arrow_large_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Arrow_large_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeEnd_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeEnd_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeMiddle.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_MovingPlatform_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_MovingWall.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_ObsidianTrap.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Scull_Arrowshooter01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Scull_Arrowshooter02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Snakepit.glb +0 -0
- package/assets/models/demo/SandboxAsset/Rocks/SM_SB_Rock01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Rocks/SM_SB_Rock02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Corner_L.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Corner_R.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Edge.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_End01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Module.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CaribbeanPine_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CaribbeanPine_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CoconutTree01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CoconutTree02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_KapokTree_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_KapokTree_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_QueenPalm_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_QueenPalm_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_TreeTrunk.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimC.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimD.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimE.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimF.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimG.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimH.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimI.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimJ.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Aztec_Wall_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Aztec_Wall_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Brick01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_BrickBlock01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_BrickBlock02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Vineswall01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_WallDecoA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_01B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_01_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02C_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02D_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_03B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_03_128x96.glb +0 -0
- package/assets/prefabs/actors/demo_health_pickup.prefab.json +114 -0
- package/assets/prefabs/actors/demo_health_pickup_spawner.prefab.json +102 -0
- package/assets/prefabs/actors/test.prefab.json +87 -0
- package/assets/shaders/M_Anisotropy_Brushed.material.json +89 -0
- package/assets/shaders/M_Anisotropy_Radial.material.json +55 -0
- package/assets/shaders/M_Chrome.material.json +18 -0
- package/assets/shaders/M_Emissive_Blue.material.json +26 -0
- package/assets/shaders/M_Glass_Frosted.material.json +24 -0
- package/assets/shaders/M_Glass_ThinFilm.material.json +23 -0
- package/assets/shaders/M_Glossy_Grey.material.json +20 -0
- package/assets/shaders/M_Matte_White.material.json +20 -0
- package/assets/shaders/M_Metal_Anisotropic_Gold.material.json +31 -0
- package/assets/shaders/M_Metal_Anisotropic_Silver.material.json +31 -0
- package/assets/shaders/M_Metal_Brushed.material.json +61 -0
- package/assets/shaders/M_Paint_Clearcoat.material.json +28 -0
- package/assets/shaders/M_Stone_Mossy.material.json +153 -0
- package/assets/shaders/M_Stone_Mossy_Snow.material.json +151 -0
- package/assets/shaders/M_Toon_Anime.material.json +49 -0
- package/assets/shaders/M_Toon_Anime_5Step.material.json +45 -0
- package/assets/shaders/M_Toon_Cel.material.json +49 -0
- package/assets/shaders/M_Transmission.material.json +42 -0
- package/assets/shaders/M_Velvet_Blue.material.json +33 -0
- package/assets/shaders/M_Velvet_Purple.material.json +30 -0
- package/assets/shaders/M_Velvet_Red.material.json +33 -0
- package/assets/shaders/M_Wax_SSSLite.material.json +55 -0
- package/assets/shaders/matcap/M_Matcap_Blue.material.json +27 -0
- package/assets/shaders/matcap/M_Matcap_Rainbow.material.json +26 -0
- package/assets/shaders/matcap/M_Matcap_White.material.json +28 -0
- package/assets/sounds/birds.mp3 +0 -0
- package/assets/sounds/explosion.mp3 +0 -0
- package/assets/sounds/game-gun-short.mp3 +0 -0
- package/assets/sounds/laser.mp3 +0 -0
- package/assets/sounds/pickup.mp3 +0 -0
- package/assets/sounds/tuba.mp3 +0 -0
- package/assets/textures/Checkerboard.png +0 -0
- package/assets/textures/Grid_10x10.png +0 -0
- package/assets/textures/T_AnisotropyMap_Radial.png +0 -0
- package/assets/textures/T_Anisotropy_Roughness.png +0 -0
- package/assets/textures/T_Gradient.png +0 -0
- package/assets/textures/T_Grid_01.png +0 -0
- package/assets/textures/T_Grid_01.texture.json +7 -0
- package/assets/textures/T_Metal_Brushed_Normal.png +0 -0
- package/assets/textures/T_Normal.png +0 -0
- package/assets/textures/T_Stone_Mossy_AmbientOcclusion.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_BaseColor.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Normal.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Roughness.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_AmbientOcclusion.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_BaseColor.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_Normal.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_Roughness.jpg +0 -0
- package/assets/textures/T_Toon_Anime_4Step.png +0 -0
- package/assets/textures/T_Toon_Anime_5Step.png +0 -0
- package/assets/textures/T_Toon_Cel_2Step.png +0 -0
- package/assets/textures/T_Wax_Thickness.png +0 -0
- package/assets/textures/matcaps/T_Matcap_Rainbow.png.png +0 -0
- package/assets/textures/matcaps/beige.png +0 -0
- package/assets/textures/matcaps/black.png +0 -0
- package/assets/textures/matcaps/blue.png +0 -0
- package/assets/textures/matcaps/brown.png +0 -0
- package/assets/textures/matcaps/emeraldGreen.png +0 -0
- package/assets/textures/matcaps/gold.png +0 -0
- package/assets/textures/matcaps/gray.png +0 -0
- package/assets/textures/matcaps/green.png +0 -0
- package/assets/textures/matcaps/metal.png +0 -0
- package/assets/textures/matcaps/orange.png +0 -0
- package/assets/textures/matcaps/purple.png +0 -0
- package/assets/textures/matcaps/red.png +0 -0
- package/assets/textures/matcaps/white.png +0 -0
- package/assets/textures/matcaps/yellow.png +0 -0
- package/assets/textures/skybox/citrus_orchard_road_puresky_2k.hdr +0 -0
- package/assets/textures/skybox/venice_sunset_4k.hdr +0 -0
- package/assets/ui/styles/ammo-counter.css +58 -0
- package/assets/ui/styles/compass.css +54 -0
- package/assets/ui/styles/controls-help.css +21 -0
- package/assets/ui/styles/crosshair.css +51 -0
- package/assets/ui/styles/inventory-bar.css +112 -0
- package/assets/ui/styles/inventory-grid.css +257 -0
- package/assets/ui/styles/main-menu.css +59 -0
- package/assets/ui/styles/minimap.css +12 -0
- package/assets/ui/styles/number-display.css +18 -0
- package/assets/ui/styles/progress-bar.css +199 -0
- package/assets/ui/styles/reload-indicator.css +76 -0
- package/assets/ui/templates/ammo-counter.html +7 -0
- package/assets/ui/templates/compass.html +6 -0
- package/assets/ui/templates/controls-help.html +9 -0
- package/assets/ui/templates/crosshair.html +1 -0
- package/assets/ui/templates/inventory-bar.html +38 -0
- package/assets/ui/templates/inventory-grid.html +9 -0
- package/assets/ui/templates/main-menu.html +10 -0
- package/assets/ui/templates/minimap.html +3 -0
- package/assets/ui/templates/number-display.html +3 -0
- package/assets/ui/templates/progress-bar.html +7 -0
- package/assets/ui/templates/reload-indicator.html +13 -0
- package/dist/games/animation-demo.d.ts +21 -0
- package/dist/games/animation-demo.js +398 -0
- package/dist/games/animation-retarget-demo.d.ts +44 -0
- package/dist/games/animation-retarget-demo.js +574 -0
- package/dist/games/behavior-tree-demo.d.ts +100 -0
- package/dist/games/behavior-tree-demo.js +1656 -0
- package/dist/games/character_animation.d.ts +15 -0
- package/dist/games/character_animation.js +170 -0
- package/dist/games/collision-demo.d.ts +4 -0
- package/dist/games/collision-demo.js +134 -0
- package/dist/games/deprecated/advanced-grid-demo.d.ts +18 -0
- package/dist/games/deprecated/advanced-grid-demo.js +305 -0
- package/dist/games/deprecated/airplane-demo.d.ts +10 -0
- package/dist/games/deprecated/airplane-demo.js +136 -0
- package/dist/games/deprecated/character-controller.d.ts +6 -0
- package/dist/games/deprecated/character-controller.js +144 -0
- package/dist/games/deprecated/chase-game.d.ts +17 -0
- package/dist/games/deprecated/chase-game.js +269 -0
- package/dist/games/deprecated/collision-config.d.ts +7 -0
- package/dist/games/deprecated/collision-config.js +295 -0
- package/dist/games/deprecated/door-demo.d.ts +30 -0
- package/dist/games/deprecated/door-demo.js +562 -0
- package/dist/games/deprecated/fps-demo.d.ts +9 -0
- package/dist/games/deprecated/fps-demo.js +119 -0
- package/dist/games/deprecated/fps-shotgun-demo.d.ts +19 -0
- package/dist/games/deprecated/fps-shotgun-demo.js +221 -0
- package/dist/games/deprecated/index.d.ts +25 -0
- package/dist/games/deprecated/index.js +26 -0
- package/dist/games/deprecated/lightmapping-demo.d.ts +135 -0
- package/dist/games/deprecated/lightmapping-demo.js +1344 -0
- package/dist/games/deprecated/lights-demo.d.ts +93 -0
- package/dist/games/deprecated/lights-demo.js +815 -0
- package/dist/games/deprecated/matcap-demo.d.ts +54 -0
- package/dist/games/deprecated/matcap-demo.js +788 -0
- package/dist/games/deprecated/material-demo-2.d.ts +14 -0
- package/dist/games/deprecated/material-demo-2.js +521 -0
- package/dist/games/deprecated/material-demo.d.ts +8 -0
- package/dist/games/deprecated/material-demo.js +177 -0
- package/dist/games/deprecated/memory-leak-test.d.ts +6 -0
- package/dist/games/deprecated/memory-leak-test.js +20 -0
- package/dist/games/deprecated/model-stress-test.d.ts +10 -0
- package/dist/games/deprecated/model-stress-test.js +116 -0
- package/dist/games/deprecated/multiplayer-demo.d.ts +13 -0
- package/dist/games/deprecated/multiplayer-demo.js +377 -0
- package/dist/games/deprecated/physics-demo.d.ts +10 -0
- package/dist/games/deprecated/physics-demo.js +200 -0
- package/dist/games/deprecated/shadow-demo.d.ts +25 -0
- package/dist/games/deprecated/shadow-demo.js +402 -0
- package/dist/games/deprecated/shooting-demo.d.ts +19 -0
- package/dist/games/deprecated/shooting-demo.js +338 -0
- package/dist/games/deprecated/skybox-demo.d.ts +35 -0
- package/dist/games/deprecated/skybox-demo.js +323 -0
- package/dist/games/deprecated/sound-demo.d.ts +11 -0
- package/dist/games/deprecated/sound-demo.js +125 -0
- package/dist/games/deprecated/timer-demo.d.ts +11 -0
- package/dist/games/deprecated/timer-demo.js +150 -0
- package/dist/games/deprecated/voxel-demo.d.ts +5 -0
- package/dist/games/deprecated/voxel-demo.js +41 -0
- package/dist/games/deprecated/world-commands.d.ts +8 -0
- package/dist/games/deprecated/world-commands.js +168 -0
- package/dist/games/deprecated/world-loading.d.ts +6 -0
- package/dist/games/deprecated/world-loading.js +86 -0
- package/dist/games/examples/fps-advanced/const.d.ts +171 -0
- package/dist/games/examples/fps-advanced/const.js +116 -0
- package/dist/games/examples/fps-advanced/enemies.d.ts +21 -0
- package/dist/games/examples/fps-advanced/enemies.js +182 -0
- package/dist/games/examples/fps-advanced/game-mode.d.ts +53 -0
- package/dist/games/examples/fps-advanced/game-mode.js +353 -0
- package/dist/games/examples/fps-advanced/game.d.ts +9 -0
- package/dist/games/examples/fps-advanced/game.js +58 -0
- package/dist/games/examples/fps-advanced/pickups.d.ts +36 -0
- package/dist/games/examples/fps-advanced/pickups.js +225 -0
- package/dist/games/examples/fps-advanced/player.d.ts +12 -0
- package/dist/games/examples/fps-advanced/player.js +110 -0
- package/dist/games/examples/fps-advanced/ui/endgame-ui.d.ts +21 -0
- package/dist/games/examples/fps-advanced/ui/endgame-ui.js +291 -0
- package/dist/games/examples/fps-advanced/ui/game-hud.d.ts +17 -0
- package/dist/games/examples/fps-advanced/ui/game-hud.js +225 -0
- package/dist/games/examples/fps-advanced/ui/menu-ui.d.ts +13 -0
- package/dist/games/examples/fps-advanced/ui/menu-ui.js +224 -0
- package/dist/games/examples/fps-advanced/ui/weapon-hud.d.ts +27 -0
- package/dist/games/examples/fps-advanced/ui/weapon-hud.js +259 -0
- package/dist/games/examples/fps-advanced/weapons.d.ts +14 -0
- package/dist/games/examples/fps-advanced/weapons.js +173 -0
- package/dist/games/examples/index.d.ts +5 -0
- package/dist/games/examples/index.js +6 -0
- package/dist/games/examples/plugin-demo/game.d.ts +7 -0
- package/dist/games/examples/plugin-demo/game.js +168 -0
- package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.d.ts +8 -0
- package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.js +156 -0
- package/dist/games/examples/plugin-demo/plugins/instanced-forest.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/instanced-forest.js +194 -0
- package/dist/games/examples/plugin-demo/plugins/particle-fountain.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/particle-fountain.js +64 -0
- package/dist/games/examples/plugin-demo/plugins/physics-playground.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/physics-playground.js +185 -0
- package/dist/games/examples/plugin-demo/plugins/robot-follower.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/robot-follower.js +347 -0
- package/dist/games/examples/plugin-demo/plugins/scatter-models.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/scatter-models.js +70 -0
- package/dist/games/examples/plugin-demo/plugins/simple-cube.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/simple-cube.js +44 -0
- package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.d.ts +8 -0
- package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.js +526 -0
- package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.js +63 -0
- package/dist/games/examples/side-scroller-advanced/const.d.ts +97 -0
- package/dist/games/examples/side-scroller-advanced/const.js +82 -0
- package/dist/games/examples/side-scroller-advanced/game-mode.d.ts +54 -0
- package/dist/games/examples/side-scroller-advanced/game-mode.js +351 -0
- package/dist/games/examples/side-scroller-advanced/game.d.ts +9 -0
- package/dist/games/examples/side-scroller-advanced/game.js +70 -0
- package/dist/games/examples/side-scroller-advanced/level-generator.d.ts +68 -0
- package/dist/games/examples/side-scroller-advanced/level-generator.js +366 -0
- package/dist/games/examples/side-scroller-advanced/pickups.d.ts +18 -0
- package/dist/games/examples/side-scroller-advanced/pickups.js +147 -0
- package/dist/games/examples/side-scroller-advanced/player.d.ts +5 -0
- package/dist/games/examples/side-scroller-advanced/player.js +104 -0
- package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.d.ts +16 -0
- package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.js +290 -0
- package/dist/games/examples/side-scroller-advanced/ui/game-hud.d.ts +21 -0
- package/dist/games/examples/side-scroller-advanced/ui/game-hud.js +265 -0
- package/dist/games/examples/side-scroller-advanced/ui/menu-ui.d.ts +13 -0
- package/dist/games/examples/side-scroller-advanced/ui/menu-ui.js +222 -0
- package/dist/games/examples/vehicle/base-vehicle.d.ts +30 -0
- package/dist/games/examples/vehicle/base-vehicle.js +155 -0
- package/dist/games/examples/vehicle/game.d.ts +11 -0
- package/dist/games/examples/vehicle/game.js +140 -0
- package/dist/games/examples/vehicle/mesh-vehicle.d.ts +19 -0
- package/dist/games/examples/vehicle/mesh-vehicle.js +194 -0
- package/dist/games/examples/vehicle/player.d.ts +9 -0
- package/dist/games/examples/vehicle/player.js +87 -0
- package/dist/games/examples/vehicle/primitive-vehicle.d.ts +21 -0
- package/dist/games/examples/vehicle/primitive-vehicle.js +269 -0
- package/dist/games/examples/vr-game/VRAttachableCube.d.ts +8 -0
- package/dist/games/examples/vr-game/VRAttachableCube.js +41 -0
- package/dist/games/examples/vr-game/VRInteractableCylinder.d.ts +10 -0
- package/dist/games/examples/vr-game/VRInteractableCylinder.js +76 -0
- package/dist/games/examples/vr-game/VRPressableButton.d.ts +24 -0
- package/dist/games/examples/vr-game/VRPressableButton.js +135 -0
- package/dist/games/examples/vr-game/VRProjectileActor.d.ts +19 -0
- package/dist/games/examples/vr-game/VRProjectileActor.js +75 -0
- package/dist/games/examples/vr-game/VRRifleActor.d.ts +16 -0
- package/dist/games/examples/vr-game/VRRifleActor.js +142 -0
- package/dist/games/examples/vr-game/game.d.ts +9 -0
- package/dist/games/examples/vr-game/game.js +56 -0
- package/dist/games/examples/vr-game/index.d.ts +5 -0
- package/dist/games/examples/vr-game/index.js +9 -0
- package/dist/games/examples/vr-game/scene.d.ts +5 -0
- package/dist/games/examples/vr-game/scene.js +83 -0
- package/dist/games/hand-tracking-demo.d.ts +10 -0
- package/dist/games/hand-tracking-demo.js +65 -0
- package/dist/games/index.d.ts +21 -0
- package/dist/games/index.js +22 -0
- package/dist/games/instanced-mesh-demo.d.ts +45 -0
- package/dist/games/instanced-mesh-demo.js +416 -0
- package/dist/games/manifold-demo.d.ts +6 -0
- package/dist/games/manifold-demo.js +44 -0
- package/dist/games/navigation-demo.d.ts +30 -0
- package/dist/games/navigation-demo.js +336 -0
- package/dist/games/navmesh-primitives-demo.d.ts +167 -0
- package/dist/games/navmesh-primitives-demo.js +1105 -0
- package/dist/games/performance-test-demo.d.ts +13 -0
- package/dist/games/performance-test-demo.js +214 -0
- package/dist/games/postprocess-demo.d.ts +46 -0
- package/dist/games/postprocess-demo.js +829 -0
- package/dist/games/ragdoll-demo-simple.d.ts +34 -0
- package/dist/games/ragdoll-demo-simple.js +152 -0
- package/dist/games/ragdoll-demo.d.ts +30 -0
- package/dist/games/ragdoll-demo.js +258 -0
- package/dist/games/swipe-tap-demo.d.ts +24 -0
- package/dist/games/swipe-tap-demo.js +238 -0
- package/dist/games/tween-demo.d.ts +22 -0
- package/dist/games/tween-demo.js +122 -0
- package/dist/games/ui-demo.d.ts +75 -0
- package/dist/games/ui-demo.js +1054 -0
- package/dist/games/vfx-demo.d.ts +48 -0
- package/dist/games/vfx-demo.js +821 -0
- package/dist/games/vfx-wawa-demo.d.ts +7 -0
- package/dist/games/vfx-wawa-demo.js +471 -0
- package/dist/games/vr-ui-demo-minimal.d.ts +15 -0
- package/dist/games/vr-ui-demo-minimal.js +141 -0
- package/dist/games/vr-ui-demo.d.ts +32 -0
- package/dist/games/vr-ui-demo.js +871 -0
- package/dist/genesys.min.mjs +7035 -0
- package/dist/launcher.d.ts +1 -0
- package/dist/launcher.js +778 -0
- package/dist/scripts/build-browser-bundle.d.ts +5 -0
- package/dist/scripts/build-browser-bundle.js +69 -0
- package/dist/scripts/check-asset-path.d.ts +1 -0
- package/dist/scripts/check-asset-path.js +146 -0
- package/dist/scripts/dump-templates.d.ts +1 -0
- package/dist/scripts/dump-templates.js +16 -0
- package/dist/scripts/generate-dependencies.d.ts +1 -0
- package/dist/scripts/generate-dependencies.js +110 -0
- package/dist/scripts/generate-prefabs.d.ts +1 -0
- package/dist/scripts/generate-prefabs.js +106 -0
- package/dist/scripts/load-save-world.d.ts +2 -0
- package/dist/scripts/load-save-world.js +35 -0
- package/dist/scripts/loc.d.ts +1 -0
- package/dist/scripts/loc.js +80 -0
- package/dist/scripts/optimize-glb-wrapper.d.ts +1 -0
- package/dist/scripts/optimize-glb-wrapper.js +26 -0
- package/dist/scripts/optimize-glb.d.ts +41 -0
- package/dist/scripts/optimize-glb.js +296 -0
- package/dist/scripts/session-server.d.ts +117 -0
- package/dist/scripts/session-server.js +782 -0
- package/dist/scripts/test-world-loading.d.ts +14 -0
- package/dist/scripts/test-world-loading.js +19 -0
- package/dist/src/actors/Actor.d.ts +510 -0
- package/dist/src/actors/Actor.js +1180 -0
- package/dist/src/actors/GLTFMeshActor.d.ts +34 -0
- package/dist/src/actors/GLTFMeshActor.js +102 -0
- package/dist/src/actors/GlobalParticleManager.d.ts +154 -0
- package/dist/src/actors/GlobalParticleManager.js +365 -0
- package/dist/src/actors/Pawn.d.ts +191 -0
- package/dist/src/actors/Pawn.js +384 -0
- package/dist/src/actors/PlayerController.d.ts +177 -0
- package/dist/src/actors/PlayerController.js +763 -0
- package/dist/src/actors/PlayerStart.d.ts +8 -0
- package/dist/src/actors/PlayerStart.js +48 -0
- package/dist/src/actors/Projectile.d.ts +50 -0
- package/dist/src/actors/Projectile.js +157 -0
- package/dist/src/actors/RagdollTestActor.d.ts +31 -0
- package/dist/src/actors/RagdollTestActor.js +153 -0
- package/dist/src/actors/ThirdPersonCharacterPawn.d.ts +27 -0
- package/dist/src/actors/ThirdPersonCharacterPawn.js +149 -0
- package/dist/src/actors/index.d.ts +20 -0
- package/dist/src/actors/index.js +21 -0
- package/dist/src/animation/AnimationClipCache.d.ts +41 -0
- package/dist/src/animation/AnimationClipCache.js +97 -0
- package/dist/src/animation/AnimationRetargeting.d.ts +100 -0
- package/dist/src/animation/AnimationRetargeting.js +455 -0
- package/dist/src/animation/SkeletonProfile.d.ts +112 -0
- package/dist/src/animation/SkeletonProfile.js +84 -0
- package/dist/src/animation/index.d.ts +14 -0
- package/dist/src/animation/index.js +15 -0
- package/dist/src/animation/retargeting.d.ts +142 -0
- package/dist/src/animation/retargeting.js +834 -0
- package/dist/src/components/CharacterStatsComponent.d.ts +89 -0
- package/dist/src/components/CharacterStatsComponent.js +207 -0
- package/dist/src/components/CollisionShapeComponent.d.ts +102 -0
- package/dist/src/components/CollisionShapeComponent.js +232 -0
- package/dist/src/components/Component.d.ts +82 -0
- package/dist/src/components/Component.js +2 -0
- package/dist/src/components/FollowComponent.d.ts +67 -0
- package/dist/src/components/FollowComponent.js +128 -0
- package/dist/src/components/PrimitiveComponent.d.ts +183 -0
- package/dist/src/components/PrimitiveComponent.js +368 -0
- package/dist/src/components/ResetPositionComponent.d.ts +52 -0
- package/dist/src/components/ResetPositionComponent.js +161 -0
- package/dist/src/components/SceneComponent.d.ts +225 -0
- package/dist/src/components/SceneComponent.js +621 -0
- package/dist/src/components/audio/SoundComponent.d.ts +109 -0
- package/dist/src/components/audio/SoundComponent.js +353 -0
- package/dist/src/components/audio/index.d.ts +11 -0
- package/dist/src/components/audio/index.js +12 -0
- package/dist/src/components/csg/CSGCombiner.d.ts +87 -0
- package/dist/src/components/csg/CSGCombiner.js +240 -0
- package/dist/src/components/csg/CSGShapes.d.ts +173 -0
- package/dist/src/components/csg/CSGShapes.js +326 -0
- package/dist/src/components/csg/index.d.ts +12 -0
- package/dist/src/components/csg/index.js +13 -0
- package/dist/src/components/gameplay/BaseWeaponComponent.d.ts +175 -0
- package/dist/src/components/gameplay/BaseWeaponComponent.js +496 -0
- package/dist/src/components/gameplay/DoorComponent.d.ts +236 -0
- package/dist/src/components/gameplay/DoorComponent.js +928 -0
- package/dist/src/components/gameplay/Equipment.d.ts +22 -0
- package/dist/src/components/gameplay/Equipment.js +9 -0
- package/dist/src/components/gameplay/GenericEquipment.d.ts +37 -0
- package/dist/src/components/gameplay/GenericEquipment.js +90 -0
- package/dist/src/components/gameplay/InstantHitWeaponComponent.d.ts +96 -0
- package/dist/src/components/gameplay/InstantHitWeaponComponent.js +194 -0
- package/dist/src/components/gameplay/PickupComponent.d.ts +130 -0
- package/dist/src/components/gameplay/PickupComponent.js +429 -0
- package/dist/src/components/gameplay/ProjectileWeaponComponent.d.ts +49 -0
- package/dist/src/components/gameplay/ProjectileWeaponComponent.js +93 -0
- package/dist/src/components/gameplay/ShotgunComponent.d.ts +18 -0
- package/dist/src/components/gameplay/ShotgunComponent.js +216 -0
- package/dist/src/components/gameplay/SwitchComponent.d.ts +152 -0
- package/dist/src/components/gameplay/SwitchComponent.js +481 -0
- package/dist/src/components/gameplay/TriggerZoneComponent.d.ts +157 -0
- package/dist/src/components/gameplay/TriggerZoneComponent.js +312 -0
- package/dist/src/components/gameplay/index.d.ts +20 -0
- package/dist/src/components/gameplay/index.js +21 -0
- package/dist/src/components/index.d.ts +16 -0
- package/dist/src/components/index.js +18 -0
- package/dist/src/components/lights/AmbientLightComponent.d.ts +37 -0
- package/dist/src/components/lights/AmbientLightComponent.js +68 -0
- package/dist/src/components/lights/DirectionalLightComponent.d.ts +77 -0
- package/dist/src/components/lights/DirectionalLightComponent.js +146 -0
- package/dist/src/components/lights/HemisphereLightComponent.d.ts +67 -0
- package/dist/src/components/lights/HemisphereLightComponent.js +121 -0
- package/dist/src/components/lights/LightComponent.d.ts +145 -0
- package/dist/src/components/lights/LightComponent.js +315 -0
- package/dist/src/components/lights/PointLightComponent.d.ts +61 -0
- package/dist/src/components/lights/PointLightComponent.js +103 -0
- package/dist/src/components/lights/RectAreaLightComponent.d.ts +78 -0
- package/dist/src/components/lights/RectAreaLightComponent.js +135 -0
- package/dist/src/components/lights/SpotLightComponent.d.ts +100 -0
- package/dist/src/components/lights/SpotLightComponent.js +167 -0
- package/dist/src/components/lights/index.d.ts +17 -0
- package/dist/src/components/lights/index.js +18 -0
- package/dist/src/components/movement/AerialMovementComponent.d.ts +93 -0
- package/dist/src/components/movement/AerialMovementComponent.js +339 -0
- package/dist/src/components/movement/AirplaneMovementComponent.d.ts +59 -0
- package/dist/src/components/movement/AirplaneMovementComponent.js +215 -0
- package/dist/src/components/movement/BasePawnMovementComponent.d.ts +132 -0
- package/dist/src/components/movement/BasePawnMovementComponent.js +264 -0
- package/dist/src/components/movement/CharacterMovementComponent.d.ts +175 -0
- package/dist/src/components/movement/CharacterMovementComponent.js +448 -0
- package/dist/src/components/movement/DirectionalCharacterMovementComponent.d.ts +17 -0
- package/dist/src/components/movement/DirectionalCharacterMovementComponent.js +82 -0
- package/dist/src/components/movement/NpcMovementComponent.d.ts +232 -0
- package/dist/src/components/movement/NpcMovementComponent.js +890 -0
- package/dist/src/components/movement/PathMovementComponent.d.ts +54 -0
- package/dist/src/components/movement/PathMovementComponent.js +211 -0
- package/dist/src/components/movement/TopDownMovementComponent.d.ts +25 -0
- package/dist/src/components/movement/TopDownMovementComponent.js +79 -0
- package/dist/src/components/movement/TweenMovementComponent.d.ts +59 -0
- package/dist/src/components/movement/TweenMovementComponent.js +362 -0
- package/dist/src/components/movement/VehicleMovementComponent.d.ts +98 -0
- package/dist/src/components/movement/VehicleMovementComponent.js +402 -0
- package/dist/src/components/movement/index.d.ts +19 -0
- package/dist/src/components/movement/index.js +20 -0
- package/dist/src/components/physics/RagdollComponent.d.ts +118 -0
- package/dist/src/components/physics/RagdollComponent.js +671 -0
- package/dist/src/components/visual/AnimationComponent.d.ts +29 -0
- package/dist/src/components/visual/AnimationComponent.js +234 -0
- package/dist/src/components/visual/AnimationStateMachineComponent.d.ts +235 -0
- package/dist/src/components/visual/AnimationStateMachineComponent.js +1048 -0
- package/dist/src/components/visual/BaseInstancedMeshComponent.d.ts +253 -0
- package/dist/src/components/visual/BaseInstancedMeshComponent.js +763 -0
- package/dist/src/components/visual/BillboardComponent.d.ts +26 -0
- package/dist/src/components/visual/BillboardComponent.js +143 -0
- package/dist/src/components/visual/EditorOnlyMeshComponent.d.ts +17 -0
- package/dist/src/components/visual/EditorOnlyMeshComponent.js +53 -0
- package/dist/src/components/visual/FogComponent.d.ts +32 -0
- package/dist/src/components/visual/FogComponent.js +131 -0
- package/dist/src/components/visual/GLTFMeshComponent.d.ts +138 -0
- package/dist/src/components/visual/GLTFMeshComponent.js +411 -0
- package/dist/src/components/visual/InstancedGltfMeshComponent.d.ts +75 -0
- package/dist/src/components/visual/InstancedGltfMeshComponent.js +217 -0
- package/dist/src/components/visual/InstancedMeshComponent.d.ts +57 -0
- package/dist/src/components/visual/InstancedMeshComponent.js +114 -0
- package/dist/src/components/visual/MeshComponent.d.ts +71 -0
- package/dist/src/components/visual/MeshComponent.js +208 -0
- package/dist/src/components/visual/ParticleEmitterComponent.d.ts +145 -0
- package/dist/src/components/visual/ParticleEmitterComponent.js +569 -0
- package/dist/src/components/visual/SkyboxComponent.d.ts +135 -0
- package/dist/src/components/visual/SkyboxComponent.js +342 -0
- package/dist/src/components/visual/TerrainMeshComponent.d.ts +119 -0
- package/dist/src/components/visual/TerrainMeshComponent.js +309 -0
- package/dist/src/components/visual/UI3DComponent.d.ts +60 -0
- package/dist/src/components/visual/UI3DComponent.js +248 -0
- package/dist/src/components/visual/index.d.ts +23 -0
- package/dist/src/components/visual/index.js +24 -0
- package/dist/src/components/voxel/MagicaVoxelLoader.d.ts +18 -0
- package/dist/src/components/voxel/MagicaVoxelLoader.js +151 -0
- package/dist/src/components/voxel/VoxelMeshComponent.d.ts +66 -0
- package/dist/src/components/voxel/VoxelMeshComponent.js +246 -0
- package/dist/src/components/voxel/index.d.ts +2 -0
- package/dist/src/components/voxel/index.js +3 -0
- package/dist/src/const.d.ts +61 -0
- package/dist/src/const.js +62 -0
- package/dist/src/csg/CSGUtils.d.ts +118 -0
- package/dist/src/csg/CSGUtils.js +805 -0
- package/dist/src/csg/ManifoldWrapper.d.ts +172 -0
- package/dist/src/csg/ManifoldWrapper.js +629 -0
- package/dist/src/csg/index.d.ts +13 -0
- package/dist/src/csg/index.js +14 -0
- package/dist/src/dependencies.d.ts +125 -0
- package/dist/src/dependencies.js +72 -0
- package/dist/src/game/GameBuilder.d.ts +104 -0
- package/dist/src/game/GameBuilder.js +263 -0
- package/dist/src/game/GameLoop.d.ts +204 -0
- package/dist/src/game/GameLoop.js +545 -0
- package/dist/src/game/GameMode.d.ts +58 -0
- package/dist/src/game/GameMode.js +131 -0
- package/dist/src/game/Playable.d.ts +38 -0
- package/dist/src/game/Playable.js +83 -0
- package/dist/src/game/World.d.ts +512 -0
- package/dist/src/game/World.js +1467 -0
- package/dist/src/game/index.d.ts +18 -0
- package/dist/src/game/index.js +19 -0
- package/dist/src/index.d.ts +39 -0
- package/dist/src/index.js +40 -0
- package/dist/src/materials.d.ts +49 -0
- package/dist/src/materials.js +177 -0
- package/dist/src/multiplayer/MovementPrediction.d.ts +28 -0
- package/dist/src/multiplayer/MovementPrediction.js +204 -0
- package/dist/src/multiplayer/NetWorld.d.ts +125 -0
- package/dist/src/multiplayer/NetWorld.js +960 -0
- package/dist/src/multiplayer/implementations/MemorySession.d.ts +18 -0
- package/dist/src/multiplayer/implementations/MemorySession.js +112 -0
- package/dist/src/multiplayer/implementations/WebSocketSession.d.ts +134 -0
- package/dist/src/multiplayer/implementations/WebSocketSession.js +439 -0
- package/dist/src/multiplayer/implementations/index.d.ts +14 -0
- package/dist/src/multiplayer/implementations/index.js +15 -0
- package/dist/src/multiplayer/index.d.ts +16 -0
- package/dist/src/multiplayer/index.js +17 -0
- package/dist/src/multiplayer/interface.d.ts +134 -0
- package/dist/src/multiplayer/interface.js +87 -0
- package/dist/src/navigation/NavigationServer.d.ts +134 -0
- package/dist/src/navigation/NavigationServer.js +47 -0
- package/dist/src/navigation/RecastNavigationServer.d.ts +82 -0
- package/dist/src/navigation/RecastNavigationServer.js +325 -0
- package/dist/src/navigation/index.d.ts +16 -0
- package/dist/src/navigation/index.js +17 -0
- package/dist/src/npc/behavior-tree/BehaviorNode.d.ts +95 -0
- package/dist/src/npc/behavior-tree/BehaviorNode.js +177 -0
- package/dist/src/npc/behavior-tree/BehaviorTreeComponent.d.ts +104 -0
- package/dist/src/npc/behavior-tree/BehaviorTreeComponent.js +341 -0
- package/dist/src/npc/behavior-tree/behaviors/BehaviorAction.d.ts +52 -0
- package/dist/src/npc/behavior-tree/behaviors/BehaviorAction.js +70 -0
- package/dist/src/npc/behavior-tree/behaviors/ConditionEvaluator.d.ts +73 -0
- package/dist/src/npc/behavior-tree/behaviors/ConditionEvaluator.js +116 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.d.ts +33 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.js +138 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.d.ts +42 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.js +170 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.d.ts +27 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.js +86 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.d.ts +50 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.js +189 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/index.js +6 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.d.ts +37 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.js +172 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.d.ts +35 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.js +173 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/index.d.ts +2 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/index.js +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.d.ts +34 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.js +148 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.d.ts +30 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.js +129 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.d.ts +27 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.js +115 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.d.ts +28 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.js +120 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.d.ts +35 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.js +172 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/index.d.ts +5 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/index.js +7 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/index.js +10 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.d.ts +32 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.js +123 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.d.ts +43 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.js +140 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.d.ts +24 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.js +85 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/index.d.ts +3 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/index.js +5 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.d.ts +40 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.js +133 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.d.ts +29 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.js +167 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.d.ts +19 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.js +67 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.d.ts +25 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.js +94 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.d.ts +15 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.js +51 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.d.ts +19 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.js +66 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.d.ts +26 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.js +111 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.d.ts +24 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.js +81 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/index.d.ts +8 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/index.js +15 -0
- package/dist/src/npc/behavior-tree/behaviors/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/index.js +8 -0
- package/dist/src/npc/behavior-tree/blackboard/Blackboard.d.ts +50 -0
- package/dist/src/npc/behavior-tree/blackboard/Blackboard.js +121 -0
- package/dist/src/npc/behavior-tree/blackboard/BlackboardKey.d.ts +35 -0
- package/dist/src/npc/behavior-tree/blackboard/BlackboardKey.js +66 -0
- package/dist/src/npc/behavior-tree/blackboard/index.d.ts +2 -0
- package/dist/src/npc/behavior-tree/blackboard/index.js +3 -0
- package/dist/src/npc/behavior-tree/index.d.ts +9 -0
- package/dist/src/npc/behavior-tree/index.js +19 -0
- package/dist/src/npc/behavior-tree/loader/BehaviorTreeLoader.d.ts +91 -0
- package/dist/src/npc/behavior-tree/loader/BehaviorTreeLoader.js +240 -0
- package/dist/src/npc/behavior-tree/nodes/CompositeNode.d.ts +46 -0
- package/dist/src/npc/behavior-tree/nodes/CompositeNode.js +93 -0
- package/dist/src/npc/behavior-tree/nodes/LeafNode.d.ts +8 -0
- package/dist/src/npc/behavior-tree/nodes/LeafNode.js +11 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SelectorNode.d.ts +15 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SelectorNode.js +61 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SequenceNode.d.ts +15 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SequenceNode.js +61 -0
- package/dist/src/physics/BasePhysicsEngine.d.ts +389 -0
- package/dist/src/physics/BasePhysicsEngine.js +1227 -0
- package/dist/src/physics/IPhysicsVehicle.d.ts +150 -0
- package/dist/src/physics/IPhysicsVehicle.js +2 -0
- package/dist/src/physics/PhysicsEngine.d.ts +425 -0
- package/dist/src/physics/PhysicsEngine.js +69 -0
- package/dist/src/physics/PhysicsTypes.d.ts +91 -0
- package/dist/src/physics/PhysicsTypes.js +24 -0
- package/dist/src/physics/implementations/RapierDebugRender.d.ts +24 -0
- package/dist/src/physics/implementations/RapierDebugRender.js +66 -0
- package/dist/src/physics/implementations/RapierPhysics.d.ts +122 -0
- package/dist/src/physics/implementations/RapierPhysics.js +1191 -0
- package/dist/src/physics/implementations/RapierVehicle.d.ts +31 -0
- package/dist/src/physics/implementations/RapierVehicle.js +236 -0
- package/dist/src/physics/index.d.ts +16 -0
- package/dist/src/physics/index.js +17 -0
- package/dist/src/render/EdgeOutlineEffect.d.ts +40 -0
- package/dist/src/render/EdgeOutlineEffect.js +389 -0
- package/dist/src/render/PostProcessManager.d.ts +274 -0
- package/dist/src/render/PostProcessManager.js +932 -0
- package/dist/src/render/Renderer.d.ts +84 -0
- package/dist/src/render/Renderer.js +306 -0
- package/dist/src/render/Texture.d.ts +51 -0
- package/dist/src/render/Texture.js +144 -0
- package/dist/src/render/index.d.ts +20 -0
- package/dist/src/render/index.js +21 -0
- package/dist/src/render/lightmapping/LightmapAtlas.d.ts +52 -0
- package/dist/src/render/lightmapping/LightmapAtlas.js +201 -0
- package/dist/src/render/lightmapping/LightmapBaker.d.ts +99 -0
- package/dist/src/render/lightmapping/LightmapBaker.js +239 -0
- package/dist/src/render/lightmapping/LightmapManager.d.ts +148 -0
- package/dist/src/render/lightmapping/LightmapManager.js +630 -0
- package/dist/src/render/lightmapping/LightmapMaterial.d.ts +26 -0
- package/dist/src/render/lightmapping/LightmapMaterial.js +242 -0
- package/dist/src/render/lightmapping/LightmapSerialization.d.ts +379 -0
- package/dist/src/render/lightmapping/LightmapSerialization.js +244 -0
- package/dist/src/render/lightmapping/LightmapSerializer.d.ts +94 -0
- package/dist/src/render/lightmapping/LightmapSerializer.js +223 -0
- package/dist/src/render/lightmapping/MultiLightmapperMaterial.d.ts +41 -0
- package/dist/src/render/lightmapping/MultiLightmapperMaterial.js +424 -0
- package/dist/src/render/lightmapping/index.d.ts +9 -0
- package/dist/src/render/lightmapping/index.js +6 -0
- package/dist/src/render/postprocessing/EffectPassWrapper.d.ts +17 -0
- package/dist/src/render/postprocessing/EffectPassWrapper.js +47 -0
- package/dist/src/render/postprocessing/ObjectOutlineEffect.d.ts +49 -0
- package/dist/src/render/postprocessing/ObjectOutlineEffect.js +364 -0
- package/dist/src/render/postprocessing/index.d.ts +2 -0
- package/dist/src/render/postprocessing/index.js +3 -0
- package/dist/src/runtime/GameRuntime.d.ts +25 -0
- package/dist/src/runtime/GameRuntime.js +131 -0
- package/dist/src/runtime/InjectedDependencies.d.ts +13 -0
- package/dist/src/runtime/InjectedDependencies.js +63 -0
- package/dist/src/runtime/Utils.d.ts +16 -0
- package/dist/src/runtime/Utils.js +113 -0
- package/dist/src/runtime/index.d.ts +4 -0
- package/dist/src/runtime/index.js +5 -0
- package/dist/src/runtime/materials/MatcapShaderMaterial.d.ts +23 -0
- package/dist/src/runtime/materials/MatcapShaderMaterial.js +235 -0
- package/dist/src/runtime/materials/index.d.ts +1 -0
- package/dist/src/runtime/materials/index.js +2 -0
- package/dist/src/scripting/Plugin.d.ts +64 -0
- package/dist/src/scripting/Plugin.js +2 -0
- package/dist/src/scripting/PluginManager.d.ts +40 -0
- package/dist/src/scripting/PluginManager.js +111 -0
- package/dist/src/scripting/index.d.ts +1 -0
- package/dist/src/scripting/index.js +2 -0
- package/dist/src/storage/defaultStorageProvider.d.ts +15 -0
- package/dist/src/storage/defaultStorageProvider.js +73 -0
- package/dist/src/storage/index.d.ts +16 -0
- package/dist/src/storage/index.js +17 -0
- package/dist/src/storage/projectContext.d.ts +80 -0
- package/dist/src/storage/projectContext.js +164 -0
- package/dist/src/storage/storageProvider.d.ts +148 -0
- package/dist/src/storage/storageProvider.js +181 -0
- package/dist/src/systems/ClassRegistry.d.ts +98 -0
- package/dist/src/systems/ClassRegistry.js +478 -0
- package/dist/src/systems/ConsoleManager.d.ts +66 -0
- package/dist/src/systems/ConsoleManager.js +465 -0
- package/dist/src/systems/ConsoleVariableHandler.d.ts +17 -0
- package/dist/src/systems/ConsoleVariableHandler.js +120 -0
- package/dist/src/systems/ConsoleVariableManager.d.ts +128 -0
- package/dist/src/systems/ConsoleVariableManager.js +295 -0
- package/dist/src/systems/InputManager.d.ts +511 -0
- package/dist/src/systems/InputManager.js +1025 -0
- package/dist/src/systems/ObjectNamingSystem.d.ts +9 -0
- package/dist/src/systems/ObjectNamingSystem.js +34 -0
- package/dist/src/systems/Stats.d.ts +36 -0
- package/dist/src/systems/Stats.js +193 -0
- package/dist/src/systems/TimerSystem.d.ts +180 -0
- package/dist/src/systems/TimerSystem.js +292 -0
- package/dist/src/systems/TweenManager.d.ts +57 -0
- package/dist/src/systems/TweenManager.js +107 -0
- package/dist/src/systems/WorldSerialization.d.ts +216 -0
- package/dist/src/systems/WorldSerialization.js +1082 -0
- package/dist/src/systems/collision/CollisionConfig.d.ts +56 -0
- package/dist/src/systems/collision/CollisionConfig.js +249 -0
- package/dist/src/systems/collision/CollisionTypes.d.ts +138 -0
- package/dist/src/systems/collision/CollisionTypes.js +204 -0
- package/dist/src/systems/collision/index.d.ts +15 -0
- package/dist/src/systems/collision/index.js +16 -0
- package/dist/src/systems/index.d.ts +23 -0
- package/dist/src/systems/index.js +24 -0
- package/dist/src/templates/MyActor.d.ts +9 -0
- package/dist/src/templates/MyActor.js +25 -0
- package/dist/src/templates/MySceneComponent.d.ts +9 -0
- package/dist/src/templates/MySceneComponent.js +25 -0
- package/dist/src/ui/LoadingScreen.d.ts +15 -0
- package/dist/src/ui/LoadingScreen.js +103 -0
- package/dist/src/ui/UIElement.d.ts +74 -0
- package/dist/src/ui/UIElement.js +202 -0
- package/dist/src/ui/UILayout.d.ts +126 -0
- package/dist/src/ui/UILayout.js +244 -0
- package/dist/src/ui/UIManager.d.ts +44 -0
- package/dist/src/ui/UIManager.js +148 -0
- package/dist/src/ui/UIResource.d.ts +6 -0
- package/dist/src/ui/UIResource.js +24 -0
- package/dist/src/ui/components/AmmoCounter.d.ts +28 -0
- package/dist/src/ui/components/AmmoCounter.js +125 -0
- package/dist/src/ui/components/BaseUIComponent.d.ts +128 -0
- package/dist/src/ui/components/BaseUIComponent.js +342 -0
- package/dist/src/ui/components/Compass.d.ts +28 -0
- package/dist/src/ui/components/Compass.js +125 -0
- package/dist/src/ui/components/ControlsPanel.d.ts +37 -0
- package/dist/src/ui/components/ControlsPanel.js +47 -0
- package/dist/src/ui/components/Crosshair.d.ts +20 -0
- package/dist/src/ui/components/Crosshair.js +67 -0
- package/dist/src/ui/components/InventoryBar.d.ts +103 -0
- package/dist/src/ui/components/InventoryBar.js +177 -0
- package/dist/src/ui/components/InventoryGrid.d.ts +139 -0
- package/dist/src/ui/components/InventoryGrid.js +407 -0
- package/dist/src/ui/components/Minimap.d.ts +39 -0
- package/dist/src/ui/components/Minimap.js +156 -0
- package/dist/src/ui/components/NumberDisplay.d.ts +51 -0
- package/dist/src/ui/components/NumberDisplay.js +164 -0
- package/dist/src/ui/components/ProgressBar.d.ts +115 -0
- package/dist/src/ui/components/ProgressBar.js +347 -0
- package/dist/src/ui/components/ReloadIndicator.d.ts +29 -0
- package/dist/src/ui/components/ReloadIndicator.js +147 -0
- package/dist/src/ui/components/index.d.ts +11 -0
- package/dist/src/ui/components/index.js +13 -0
- package/dist/src/ui/index.d.ts +21 -0
- package/dist/src/ui/index.js +22 -0
- package/dist/src/ui/ui-loader.d.ts +49 -0
- package/dist/src/ui/ui-loader.js +83 -0
- package/dist/src/utils/Color.d.ts +48 -0
- package/dist/src/utils/Color.js +121 -0
- package/dist/src/utils/Delegate.d.ts +72 -0
- package/dist/src/utils/Delegate.js +102 -0
- package/dist/src/utils/DescriptionHelpers.d.ts +47 -0
- package/dist/src/utils/DescriptionHelpers.js +65 -0
- package/dist/src/utils/EditorClassMeta.d.ts +99 -0
- package/dist/src/utils/EditorClassMeta.js +2 -0
- package/dist/src/utils/GlobalAudioManager.d.ts +141 -0
- package/dist/src/utils/GlobalAudioManager.js +312 -0
- package/dist/src/utils/IAsyncLoadable.d.ts +94 -0
- package/dist/src/utils/IAsyncLoadable.js +52 -0
- package/dist/src/utils/MaterialHelpers.d.ts +67 -0
- package/dist/src/utils/MaterialHelpers.js +278 -0
- package/dist/src/utils/MathHelpers.d.ts +65 -0
- package/dist/src/utils/MathHelpers.js +60 -0
- package/dist/src/utils/NodeJs.d.ts +1 -0
- package/dist/src/utils/NodeJs.js +81 -0
- package/dist/src/utils/Perlin.d.ts +39 -0
- package/dist/src/utils/Perlin.js +380 -0
- package/dist/src/utils/ResourceManager.d.ts +183 -0
- package/dist/src/utils/ResourceManager.js +703 -0
- package/dist/src/utils/SceneGraphUtils.d.ts +26 -0
- package/dist/src/utils/SceneGraphUtils.js +139 -0
- package/dist/src/utils/Spawn.d.ts +27 -0
- package/dist/src/utils/Spawn.js +73 -0
- package/dist/src/utils/ThreeJsExtensions.d.ts +298 -0
- package/dist/src/utils/ThreeJsExtensions.js +817 -0
- package/dist/src/utils/TweenExtensions.d.ts +8 -0
- package/dist/src/utils/TweenExtensions.js +103 -0
- package/dist/src/utils/UserCodeEngine.d.ts +70 -0
- package/dist/src/utils/UserCodeEngine.js +235 -0
- package/dist/src/utils/Utils.d.ts +65 -0
- package/dist/src/utils/Utils.js +296 -0
- package/dist/src/utils/VRButtonUtils.d.ts +21 -0
- package/dist/src/utils/VRButtonUtils.js +88 -0
- package/dist/src/utils/browser-polyfills/module.d.ts +20 -0
- package/dist/src/utils/browser-polyfills/module.js +31 -0
- package/dist/src/utils/browser-polyfills/path.d.ts +69 -0
- package/dist/src/utils/browser-polyfills/path.js +188 -0
- package/dist/src/utils/index.d.ts +29 -0
- package/dist/src/utils/index.js +30 -0
- package/dist/src/utils/serialization/cdo.d.ts +6 -0
- package/dist/src/utils/serialization/cdo.js +74 -0
- package/dist/src/utils/serialization/clsAlias.d.ts +15 -0
- package/dist/src/utils/serialization/clsAlias.js +96 -0
- package/dist/src/utils/serialization/decorator.d.ts +132 -0
- package/dist/src/utils/serialization/decorator.js +66 -0
- package/dist/src/utils/serialization/index.d.ts +7 -0
- package/dist/src/utils/serialization/index.js +8 -0
- package/dist/src/utils/serialization/prefab.d.ts +9 -0
- package/dist/src/utils/serialization/prefab.js +55 -0
- package/dist/src/utils/serialization/prefabManager.d.ts +17 -0
- package/dist/src/utils/serialization/prefabManager.js +84 -0
- package/dist/src/utils/serialization/serializable.d.ts +23 -0
- package/dist/src/utils/serialization/serializable.js +2 -0
- package/dist/src/utils/serialization/serializer.d.ts +126 -0
- package/dist/src/utils/serialization/serializer.js +1032 -0
- package/dist/src/utils/serialization/specialization.d.ts +1 -0
- package/dist/src/utils/serialization/specialization.js +194 -0
- package/dist/src/utils/serialization/specializationUtils.d.ts +27 -0
- package/dist/src/utils/serialization/specializationUtils.js +137 -0
- package/dist/src/vfx/VFXComponent.d.ts +65 -0
- package/dist/src/vfx/VFXComponent.js +202 -0
- package/dist/src/vfx/index.d.ts +11 -0
- package/dist/src/vfx/index.js +11 -0
- package/dist/src/vfx/types.d.ts +146 -0
- package/dist/src/vfx/types.js +146 -0
- package/dist/src/world-commands/common.d.ts +23 -0
- package/dist/src/world-commands/common.js +2 -0
- package/dist/src/world-commands/generate-code.d.ts +3 -0
- package/dist/src/world-commands/generate-code.js +90 -0
- package/dist/src/world-commands/index.d.ts +19 -0
- package/dist/src/world-commands/index.js +20 -0
- package/dist/src/world-commands/place-gltf.d.ts +25 -0
- package/dist/src/world-commands/place-gltf.js +39 -0
- package/dist/src/world-commands/place-prefab.d.ts +25 -0
- package/dist/src/world-commands/place-prefab.js +40 -0
- package/dist/src/world-commands/place-primitive.d.ts +39 -0
- package/dist/src/world-commands/place-primitive.js +100 -0
- package/dist/src/world-commands/remove-actors.d.ts +23 -0
- package/dist/src/world-commands/remove-actors.js +9 -0
- package/dist/src/xr/VRActor.d.ts +46 -0
- package/dist/src/xr/VRActor.js +56 -0
- package/dist/src/xr/VRControllerHandler.d.ts +25 -0
- package/dist/src/xr/VRControllerHandler.js +74 -0
- package/dist/src/xr/VRControllerManager.d.ts +194 -0
- package/dist/src/xr/VRControllerManager.js +539 -0
- package/dist/src/xr/VRDeviceHandler.d.ts +47 -0
- package/dist/src/xr/VRDeviceHandler.js +61 -0
- package/dist/src/xr/VRHandHandler.d.ts +23 -0
- package/dist/src/xr/VRHandHandler.js +161 -0
- package/dist/src/xr/VRInputDevice.d.ts +100 -0
- package/dist/src/xr/VRInputDevice.js +367 -0
- package/dist/src/xr/VRPawn.d.ts +198 -0
- package/dist/src/xr/VRPawn.js +771 -0
- package/dist/src/xr/actor-components/CanvasUIComponent.d.ts +61 -0
- package/dist/src/xr/actor-components/CanvasUIComponent.js +418 -0
- package/dist/src/xr/actor-components/VRBaseComponent.d.ts +15 -0
- package/dist/src/xr/actor-components/VRBaseComponent.js +24 -0
- package/dist/src/xr/actor-components/VRGrabbableComponent.d.ts +31 -0
- package/dist/src/xr/actor-components/VRGrabbableComponent.js +81 -0
- package/dist/src/xr/actor-components/VRInteractableComponent.d.ts +19 -0
- package/dist/src/xr/actor-components/VRInteractableComponent.js +50 -0
- package/dist/src/xr/index.d.ts +17 -0
- package/dist/src/xr/index.js +18 -0
- package/dist/src/xr/pawn-components/VRGrabComponent.d.ts +36 -0
- package/dist/src/xr/pawn-components/VRGrabComponent.js +445 -0
- package/dist/src/xr/pawn-components/VRInteractComponent.d.ts +20 -0
- package/dist/src/xr/pawn-components/VRInteractComponent.js +81 -0
- package/dist/src/xr/pawn-components/VRSnapTurnComponent.d.ts +25 -0
- package/dist/src/xr/pawn-components/VRSnapTurnComponent.js +114 -0
- package/dist/src/xr/pawn-components/VRTeleportComponent.d.ts +42 -0
- package/dist/src/xr/pawn-components/VRTeleportComponent.js +318 -0
- package/dist/src/xr/ui/CanvasColorPicker.d.ts +33 -0
- package/dist/src/xr/ui/CanvasColorPicker.js +188 -0
- package/dist/src/xr/ui/CanvasKeyboard.d.ts +21 -0
- package/dist/src/xr/ui/CanvasKeyboard.js +281 -0
- package/dist/src/xr/ui/CanvasSlider.d.ts +21 -0
- package/dist/src/xr/ui/CanvasSlider.js +112 -0
- package/dist/src/xr/ui/CanvasUI.d.ts +129 -0
- package/dist/src/xr/ui/CanvasUI.js +876 -0
- package/dist/src/xr/ui/index.d.ts +8 -0
- package/dist/src/xr/ui/index.js +9 -0
- package/dist/test/absolute-transform.test.d.ts +1 -0
- package/dist/test/absolute-transform.test.js +796 -0
- package/dist/test/asset-path.test.d.ts +1 -0
- package/dist/test/asset-path.test.js +339 -0
- package/dist/test/component.test.d.ts +1 -0
- package/dist/test/component.test.js +24 -0
- package/dist/test/construction.test.d.ts +1 -0
- package/dist/test/construction.test.js +26 -0
- package/dist/test/default-options-validation.test.d.ts +1 -0
- package/dist/test/default-options-validation.test.js +186 -0
- package/dist/test/metadata.test.d.ts +1 -0
- package/dist/test/metadata.test.js +82 -0
- package/dist/test/nodeStorage.d.ts +19 -0
- package/dist/test/nodeStorage.js +85 -0
- package/dist/test/postprocess-manager.test.d.ts +1 -0
- package/dist/test/postprocess-manager.test.js +77 -0
- package/dist/test/prefab.test.d.ts +1 -0
- package/dist/test/prefab.test.js +903 -0
- package/dist/test/scene-component.test.d.ts +1 -0
- package/dist/test/scene-component.test.js +13 -0
- package/dist/test/scene-graph.test.d.ts +1 -0
- package/dist/test/scene-graph.test.js +163 -0
- package/dist/test/serialization-v1.test.d.ts +15 -0
- package/dist/test/serialization-v1.test.js +1057 -0
- package/dist/test/serialization.test.d.ts +1 -0
- package/dist/test/serialization.test.js +425 -0
- package/dist/test/spawn.test.d.ts +1 -0
- package/dist/test/spawn.test.js +137 -0
- package/dist/test/utils.d.ts +27 -0
- package/dist/test/utils.js +115 -0
- package/docs/agent-instructions.md +49 -0
- package/docs/deprecated/8-guide-user-interface-2.md +600 -0
- package/docs/deprecated/Agents.md +117 -0
- package/docs/deprecated/TELEGRAM_MINIAPP_SUPPORT_PLAN.md +283 -0
- package/docs/deprecated/summary-2.md +101 -0
- package/docs/engine-summary.md +104 -0
- package/docs/guides/0-world-and-gameloop.md +331 -0
- package/docs/guides/1-actors-and-components.md +955 -0
- package/docs/guides/10-camera-system.md +778 -0
- package/docs/guides/11-equipment-and-weapons.md +850 -0
- package/docs/guides/12-threejs-extensions.md +528 -0
- package/docs/guides/13-visual-effects-and-particles.md +530 -0
- package/docs/guides/14-sound-system.md +436 -0
- package/docs/guides/15-global-audio-manager.md +367 -0
- package/docs/guides/15-navigation-and-pathfinding.md +818 -0
- package/docs/guides/16-ragdoll-physics.md +479 -0
- package/docs/guides/17-asset-referencing.md +248 -0
- package/docs/guides/18-lightmapping-system.md +984 -0
- package/docs/guides/19-webxr-virtual-reality.md +367 -0
- package/docs/guides/2-player-inputs-and-controls.md +737 -0
- package/docs/guides/3-physics-and-collisions.md +248 -0
- package/docs/guides/4-visuals-and-rendering.md +946 -0
- package/docs/guides/5-animation.md +310 -0
- package/docs/guides/6-ai-and-behavior-trees.md +1316 -0
- package/docs/guides/7-building-levels.md +211 -0
- package/docs/guides/8-user-interface.md +291 -0
- package/docs/guides/9-multiplayer.md +181 -0
- package/docs/high-level-class-hierarchy.md +218 -0
- package/eslint-rules/constructor-type-consistency.js +251 -0
- package/eslint-rules/default-getter-return-type.js +42 -0
- package/eslint-rules/engine-class-name-consistency.js +62 -0
- package/eslint-rules/no-async-override-mismatch.js +100 -0
- package/eslint-rules/no-default-class-fields.js +66 -0
- package/eslint-rules/no-override-methods.js +158 -0
- package/games/animation-demo.ts +367 -0
- package/games/animation-retarget-demo.ts +553 -0
- package/games/behavior-tree-demo.ts +1774 -0
- package/games/character_animation.ts +194 -0
- package/games/collision-demo.ts +139 -0
- package/games/deprecated/advanced-grid-demo.ts +336 -0
- package/games/deprecated/airplane-demo.ts +156 -0
- package/games/deprecated/character-controller.ts +161 -0
- package/games/deprecated/chase-game.ts +310 -0
- package/games/deprecated/collision-config.ts +317 -0
- package/games/deprecated/door-demo.ts +641 -0
- package/games/deprecated/fps-demo.ts +128 -0
- package/games/deprecated/fps-shotgun-demo.ts +227 -0
- package/games/deprecated/index.ts +25 -0
- package/games/deprecated/lightmapping-demo.ts +1515 -0
- package/games/deprecated/lights-demo.ts +957 -0
- package/games/deprecated/matcap-demo.ts +823 -0
- package/games/deprecated/material-demo-2.ts +582 -0
- package/games/deprecated/material-demo.ts +204 -0
- package/games/deprecated/memory-leak-test.ts +23 -0
- package/games/deprecated/model-stress-test.ts +150 -0
- package/games/deprecated/multiplayer-demo.ts +392 -0
- package/games/deprecated/physics-demo.ts +199 -0
- package/games/deprecated/shadow-demo.ts +435 -0
- package/games/deprecated/shooting-demo.ts +352 -0
- package/games/deprecated/skybox-demo.ts +341 -0
- package/games/deprecated/sound-demo.ts +117 -0
- package/games/deprecated/timer-demo.ts +178 -0
- package/games/deprecated/voxel-demo.ts +50 -0
- package/games/deprecated/world-commands.ts +184 -0
- package/games/deprecated/world-loading.ts +90 -0
- package/games/examples/fps-advanced/const.ts +122 -0
- package/games/examples/fps-advanced/enemies.ts +174 -0
- package/games/examples/fps-advanced/game-mode.ts +347 -0
- package/games/examples/fps-advanced/game.ts +74 -0
- package/games/examples/fps-advanced/pickups.ts +225 -0
- package/games/examples/fps-advanced/player.ts +101 -0
- package/games/examples/fps-advanced/ui/endgame-ui.ts +277 -0
- package/games/examples/fps-advanced/ui/game-hud.ts +211 -0
- package/games/examples/fps-advanced/ui/menu-ui.ts +217 -0
- package/games/examples/fps-advanced/ui/weapon-hud.ts +254 -0
- package/games/examples/fps-advanced/weapons.ts +209 -0
- package/games/examples/index.ts +5 -0
- package/games/examples/plugin-demo/game.ts +175 -0
- package/games/examples/plugin-demo/plugins/dynamic-lighting.ts +146 -0
- package/games/examples/plugin-demo/plugins/instanced-forest.ts +186 -0
- package/games/examples/plugin-demo/plugins/particle-fountain.ts +63 -0
- package/games/examples/plugin-demo/plugins/physics-playground.ts +189 -0
- package/games/examples/plugin-demo/plugins/robot-follower.ts +306 -0
- package/games/examples/plugin-demo/plugins/scatter-models.ts +74 -0
- package/games/examples/plugin-demo/plugins/simple-cube.ts +44 -0
- package/games/examples/plugin-demo/plugins/tic-tac-toe.ts +522 -0
- package/games/examples/plugin-demo/plugins/wobbling-sphere.ts +66 -0
- package/games/examples/side-scroller-advanced/const.ts +88 -0
- package/games/examples/side-scroller-advanced/game-mode.ts +350 -0
- package/games/examples/side-scroller-advanced/game.ts +80 -0
- package/games/examples/side-scroller-advanced/level-generator.ts +384 -0
- package/games/examples/side-scroller-advanced/pickups.ts +132 -0
- package/games/examples/side-scroller-advanced/player.ts +105 -0
- package/games/examples/side-scroller-advanced/ui/endgame-ui.ts +278 -0
- package/games/examples/side-scroller-advanced/ui/game-hud.ts +238 -0
- package/games/examples/side-scroller-advanced/ui/menu-ui.ts +215 -0
- package/games/examples/vehicle/base-vehicle.ts +159 -0
- package/games/examples/vehicle/game.ts +154 -0
- package/games/examples/vehicle/mesh-vehicle.ts +191 -0
- package/games/examples/vehicle/player.ts +86 -0
- package/games/examples/vehicle/primitive-vehicle.ts +266 -0
- package/games/examples/vr-game/VRAttachableCube.ts +39 -0
- package/games/examples/vr-game/VRInteractableCylinder.ts +83 -0
- package/games/examples/vr-game/VRPressableButton.ts +113 -0
- package/games/examples/vr-game/VRProjectileActor.ts +69 -0
- package/games/examples/vr-game/VRRifleActor.ts +138 -0
- package/games/examples/vr-game/game.ts +69 -0
- package/games/examples/vr-game/index.ts +9 -0
- package/games/examples/vr-game/scene.ts +99 -0
- package/games/hand-tracking-demo.ts +71 -0
- package/games/index.ts +21 -0
- package/games/instanced-mesh-demo.ts +429 -0
- package/games/manifold-demo.ts +52 -0
- package/games/navigation-demo.ts +351 -0
- package/games/navmesh-primitives-demo.ts +1252 -0
- package/games/performance-test-demo.ts +237 -0
- package/games/postprocess-demo.ts +867 -0
- package/games/ragdoll-demo-simple.ts +163 -0
- package/games/ragdoll-demo.ts +272 -0
- package/games/swipe-tap-demo.ts +228 -0
- package/games/tween-demo.ts +125 -0
- package/games/ui-demo.ts +1058 -0
- package/games/vfx-demo.ts +922 -0
- package/games/vfx-wawa-demo.ts +540 -0
- package/games/vr-ui-demo-minimal.ts +156 -0
- package/games/vr-ui-demo.ts +972 -0
- package/package.json +104 -0
- package/scripts/build-browser-bundle.ts +75 -0
- package/scripts/check-asset-path.ts +166 -0
- package/scripts/dump-templates.ts +21 -0
- package/scripts/generate-dependencies.ts +145 -0
- package/scripts/generate-prefabs.ts +120 -0
- package/scripts/load-save-world.ts +44 -0
- package/scripts/loc.ts +112 -0
- package/scripts/optimize-glb-wrapper.ts +28 -0
- package/scripts/optimize-glb.ts +352 -0
- package/scripts/session-server.ts +861 -0
- package/scripts/test-world-loading.ts +23 -0
- package/src/actors/Actor.ts +1183 -0
- package/src/actors/GLTFMeshActor.ts +107 -0
- package/src/actors/GlobalParticleManager.ts +460 -0
- package/src/actors/Pawn.ts +370 -0
- package/src/actors/PlayerController.ts +646 -0
- package/src/actors/PlayerStart.ts +47 -0
- package/src/actors/Projectile.ts +179 -0
- package/src/actors/RagdollTestActor.ts +153 -0
- package/src/actors/ThirdPersonCharacterPawn.ts +139 -0
- package/src/actors/index.ts +21 -0
- package/src/animation/AnimationClipCache.ts +86 -0
- package/src/animation/AnimationRetargeting.ts +566 -0
- package/src/animation/SkeletonProfile.ts +137 -0
- package/src/animation/index.ts +14 -0
- package/src/animation/retargeting.ts +866 -0
- package/src/components/CharacterStatsComponent.ts +199 -0
- package/src/components/CollisionShapeComponent.ts +256 -0
- package/src/components/Component.ts +111 -0
- package/src/components/FollowComponent.ts +149 -0
- package/src/components/PrimitiveComponent.ts +368 -0
- package/src/components/ResetPositionComponent.ts +175 -0
- package/src/components/SceneComponent.ts +628 -0
- package/src/components/audio/SoundComponent.ts +385 -0
- package/src/components/audio/index.ts +11 -0
- package/src/components/csg/CSGCombiner.ts +268 -0
- package/src/components/csg/CSGShapes.ts +344 -0
- package/src/components/csg/index.ts +12 -0
- package/src/components/gameplay/BaseWeaponComponent.ts +597 -0
- package/src/components/gameplay/DoorComponent.ts +930 -0
- package/src/components/gameplay/Equipment.ts +30 -0
- package/src/components/gameplay/GenericEquipment.ts +96 -0
- package/src/components/gameplay/InstantHitWeaponComponent.ts +248 -0
- package/src/components/gameplay/PickupComponent.ts +473 -0
- package/src/components/gameplay/ProjectileWeaponComponent.ts +114 -0
- package/src/components/gameplay/ShotgunComponent.ts +220 -0
- package/src/components/gameplay/SwitchComponent.ts +466 -0
- package/src/components/gameplay/TriggerZoneComponent.ts +346 -0
- package/src/components/gameplay/index.ts +20 -0
- package/src/components/index.ts +19 -0
- package/src/components/lights/AmbientLightComponent.ts +72 -0
- package/src/components/lights/DirectionalLightComponent.ts +163 -0
- package/src/components/lights/HemisphereLightComponent.ts +132 -0
- package/src/components/lights/LightComponent.ts +351 -0
- package/src/components/lights/PointLightComponent.ts +115 -0
- package/src/components/lights/RectAreaLightComponent.ts +151 -0
- package/src/components/lights/SpotLightComponent.ts +193 -0
- package/src/components/lights/index.ts +17 -0
- package/src/components/movement/AerialMovementComponent.ts +348 -0
- package/src/components/movement/AirplaneMovementComponent.ts +236 -0
- package/src/components/movement/BasePawnMovementComponent.ts +297 -0
- package/src/components/movement/CharacterMovementComponent.ts +446 -0
- package/src/components/movement/DirectionalCharacterMovementComponent.ts +79 -0
- package/src/components/movement/NpcMovementComponent.ts +930 -0
- package/src/components/movement/PathMovementComponent.ts +190 -0
- package/src/components/movement/TopDownMovementComponent.ts +88 -0
- package/src/components/movement/TweenMovementComponent.ts +386 -0
- package/src/components/movement/VehicleMovementComponent.ts +469 -0
- package/src/components/movement/index.ts +19 -0
- package/src/components/physics/RagdollComponent.ts +730 -0
- package/src/components/visual/AnimationComponent.ts +208 -0
- package/src/components/visual/AnimationStateMachineComponent.ts +1079 -0
- package/src/components/visual/BaseInstancedMeshComponent.ts +904 -0
- package/src/components/visual/BillboardComponent.ts +127 -0
- package/src/components/visual/EditorOnlyMeshComponent.ts +54 -0
- package/src/components/visual/FogComponent.ts +131 -0
- package/src/components/visual/GLTFMeshComponent.ts +444 -0
- package/src/components/visual/InstancedGltfMeshComponent.ts +215 -0
- package/src/components/visual/InstancedMeshComponent.ts +118 -0
- package/src/components/visual/MeshComponent.ts +224 -0
- package/src/components/visual/ParticleEmitterComponent.ts +628 -0
- package/src/components/visual/SkyboxComponent.ts +381 -0
- package/src/components/visual/TerrainMeshComponent.ts +346 -0
- package/src/components/visual/UI3DComponent.ts +264 -0
- package/src/components/visual/index.ts +23 -0
- package/src/components/voxel/MagicaVoxelLoader.ts +184 -0
- package/src/components/voxel/VoxelMeshComponent.ts +274 -0
- package/src/components/voxel/index.ts +3 -0
- package/src/const.ts +68 -0
- package/src/csg/CSGUtils.ts +771 -0
- package/src/csg/ManifoldWrapper.ts +704 -0
- package/src/csg/index.ts +13 -0
- package/src/dependencies.ts +76 -0
- package/src/game/GameBuilder.ts +280 -0
- package/src/game/GameLoop.ts +614 -0
- package/src/game/GameMode.ts +127 -0
- package/src/game/Playable.ts +84 -0
- package/src/game/World.ts +1430 -0
- package/src/game/index.ts +18 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +39 -0
- package/src/materials.ts +181 -0
- package/src/multiplayer/MovementPrediction.ts +202 -0
- package/src/multiplayer/NetWorld.ts +920 -0
- package/src/multiplayer/README.md +349 -0
- package/src/multiplayer/implementations/MemorySession.ts +112 -0
- package/src/multiplayer/implementations/WebSocketSession.ts +468 -0
- package/src/multiplayer/implementations/index.ts +14 -0
- package/src/multiplayer/index.ts +16 -0
- package/src/multiplayer/interface.ts +174 -0
- package/src/navigation/NavigationServer.ts +170 -0
- package/src/navigation/RecastNavigationServer.ts +370 -0
- package/src/navigation/index.ts +17 -0
- package/src/npc/behavior-tree/BehaviorNode.ts +191 -0
- package/src/npc/behavior-tree/BehaviorTreeComponent.ts +351 -0
- package/src/npc/behavior-tree/behaviors/BehaviorAction.ts +97 -0
- package/src/npc/behavior-tree/behaviors/ConditionEvaluator.ts +128 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.ts +128 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.ts +159 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.ts +76 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.ts +160 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/index.ts +5 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.ts +151 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.ts +158 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/index.ts +3 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.ts +157 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.ts +131 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.ts +99 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.ts +114 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.ts +146 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/index.ts +6 -0
- package/src/npc/behavior-tree/behaviors/actions/index.ts +13 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.ts +117 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.ts +136 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.ts +70 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/index.ts +4 -0
- package/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.ts +144 -0
- package/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.ts +171 -0
- package/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.ts +63 -0
- package/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.ts +83 -0
- package/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.ts +49 -0
- package/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.ts +61 -0
- package/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.ts +106 -0
- package/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.ts +65 -0
- package/src/npc/behavior-tree/behaviors/conditions/index.ts +19 -0
- package/src/npc/behavior-tree/behaviors/index.ts +9 -0
- package/src/npc/behavior-tree/blackboard/Blackboard.ts +127 -0
- package/src/npc/behavior-tree/blackboard/BlackboardKey.ts +59 -0
- package/src/npc/behavior-tree/blackboard/index.ts +2 -0
- package/src/npc/behavior-tree/index.ts +27 -0
- package/src/npc/behavior-tree/loader/BehaviorTreeLoader.ts +296 -0
- package/src/npc/behavior-tree/nodes/CompositeNode.ts +100 -0
- package/src/npc/behavior-tree/nodes/LeafNode.ts +11 -0
- package/src/npc/behavior-tree/nodes/composite/SelectorNode.ts +56 -0
- package/src/npc/behavior-tree/nodes/composite/SequenceNode.ts +56 -0
- package/src/physics/BasePhysicsEngine.ts +1486 -0
- package/src/physics/IPhysicsVehicle.ts +162 -0
- package/src/physics/PhysicsEngine.ts +517 -0
- package/src/physics/PhysicsTypes.ts +116 -0
- package/src/physics/implementations/RapierDebugRender.ts +55 -0
- package/src/physics/implementations/RapierPhysics.ts +1419 -0
- package/src/physics/implementations/RapierVehicle.ts +267 -0
- package/src/physics/index.ts +16 -0
- package/src/render/EdgeOutlineEffect.ts +365 -0
- package/src/render/PostProcessManager.ts +1025 -0
- package/src/render/Renderer.ts +310 -0
- package/src/render/Texture.ts +140 -0
- package/src/render/index.ts +22 -0
- package/src/render/lightmapping/LightmapAtlas.ts +248 -0
- package/src/render/lightmapping/LightmapBaker.ts +333 -0
- package/src/render/lightmapping/LightmapManager.ts +752 -0
- package/src/render/lightmapping/LightmapMaterial.ts +283 -0
- package/src/render/lightmapping/LightmapSerialization.ts +336 -0
- package/src/render/lightmapping/LightmapSerializer.ts +309 -0
- package/src/render/lightmapping/MultiLightmapperMaterial.ts +484 -0
- package/src/render/lightmapping/index.ts +18 -0
- package/src/render/postprocessing/EffectPassWrapper.ts +47 -0
- package/src/render/postprocessing/ObjectOutlineEffect.ts +356 -0
- package/src/render/postprocessing/index.ts +2 -0
- package/src/runtime/GameRuntime.ts +153 -0
- package/src/runtime/InjectedDependencies.ts +70 -0
- package/src/runtime/Utils.ts +146 -0
- package/src/runtime/index.ts +4 -0
- package/src/runtime/materials/MatcapShaderMaterial.ts +242 -0
- package/src/runtime/materials/index.ts +1 -0
- package/src/scripting/Plugin.ts +67 -0
- package/src/scripting/PluginManager.ts +99 -0
- package/src/scripting/index.ts +1 -0
- package/src/storage/defaultStorageProvider.ts +95 -0
- package/src/storage/index.ts +16 -0
- package/src/storage/projectContext.ts +176 -0
- package/src/storage/storageProvider.ts +271 -0
- package/src/systems/ClassRegistry.ts +484 -0
- package/src/systems/ConsoleManager.ts +484 -0
- package/src/systems/ConsoleVariableHandler.ts +105 -0
- package/src/systems/ConsoleVariableManager.ts +288 -0
- package/src/systems/InputManager.ts +1255 -0
- package/src/systems/ObjectNamingSystem.ts +30 -0
- package/src/systems/Stats.ts +178 -0
- package/src/systems/TimerSystem.ts +353 -0
- package/src/systems/TweenManager.ts +107 -0
- package/src/systems/WorldSerialization.ts +1211 -0
- package/src/systems/collision/CollisionConfig.ts +281 -0
- package/src/systems/collision/CollisionTypes.ts +185 -0
- package/src/systems/collision/index.ts +15 -0
- package/src/systems/index.ts +23 -0
- package/src/templates/MyActor.ts +29 -0
- package/src/templates/MySceneComponent.ts +29 -0
- package/src/templates/README.md +1 -0
- package/src/types/rapier-es.d.ts +16 -0
- package/src/types/stats.js.d.ts +22 -0
- package/src/ui/LoadingScreen.ts +110 -0
- package/src/ui/UIElement.ts +224 -0
- package/src/ui/UILayout.ts +269 -0
- package/src/ui/UIManager.ts +161 -0
- package/src/ui/UIResource.ts +20 -0
- package/src/ui/components/AmmoCounter.ts +126 -0
- package/src/ui/components/BaseUIComponent.md +296 -0
- package/src/ui/components/BaseUIComponent.ts +390 -0
- package/src/ui/components/Compass.ts +144 -0
- package/src/ui/components/ControlsPanel.ts +62 -0
- package/src/ui/components/Crosshair.ts +76 -0
- package/src/ui/components/InventoryBar.ts +224 -0
- package/src/ui/components/InventoryGrid.ts +471 -0
- package/src/ui/components/Minimap.ts +181 -0
- package/src/ui/components/NumberDisplay.ts +198 -0
- package/src/ui/components/ProgressBar.ts +403 -0
- package/src/ui/components/ReloadIndicator.ts +159 -0
- package/src/ui/components/index.ts +12 -0
- package/src/ui/index.ts +21 -0
- package/src/ui/ui-loader.ts +87 -0
- package/src/utils/Color.ts +51 -0
- package/src/utils/Delegate.ts +112 -0
- package/src/utils/DescriptionHelpers.ts +93 -0
- package/src/utils/EditorClassMeta.ts +91 -0
- package/src/utils/GlobalAudioManager.ts +370 -0
- package/src/utils/IAsyncLoadable.ts +122 -0
- package/src/utils/MaterialHelpers.ts +321 -0
- package/src/utils/MathHelpers.ts +79 -0
- package/src/utils/NodeJs.ts +79 -0
- package/src/utils/Perlin.ts +346 -0
- package/src/utils/ResourceManager.ts +716 -0
- package/src/utils/SceneGraphUtils.ts +173 -0
- package/src/utils/Spawn.ts +93 -0
- package/src/utils/ThreeJsExtensions.ts +1200 -0
- package/src/utils/TweenExtensions.ts +124 -0
- package/src/utils/UserCodeEngine.ts +243 -0
- package/src/utils/Utils.ts +328 -0
- package/src/utils/VRButtonUtils.ts +125 -0
- package/src/utils/browser-polyfills/module.ts +36 -0
- package/src/utils/browser-polyfills/path.ts +232 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/serialization/cdo.ts +87 -0
- package/src/utils/serialization/clsAlias.ts +92 -0
- package/src/utils/serialization/decorator.ts +176 -0
- package/src/utils/serialization/index.ts +7 -0
- package/src/utils/serialization/prefab.ts +78 -0
- package/src/utils/serialization/prefabManager.ts +88 -0
- package/src/utils/serialization/serializable.ts +28 -0
- package/src/utils/serialization/serializer.ts +1111 -0
- package/src/utils/serialization/specialization.ts +224 -0
- package/src/utils/serialization/specializationUtils.ts +185 -0
- package/src/vfx/VFXComponent.ts +206 -0
- package/src/vfx/index.ts +17 -0
- package/src/vfx/types.ts +287 -0
- package/src/vfx/wawa-vfx-reference.md +399 -0
- package/src/world-commands/common.ts +25 -0
- package/src/world-commands/generate-code.ts +99 -0
- package/src/world-commands/index.ts +19 -0
- package/src/world-commands/place-gltf.ts +63 -0
- package/src/world-commands/place-prefab.ts +62 -0
- package/src/world-commands/place-primitive.ts +128 -0
- package/src/world-commands/remove-actors.ts +32 -0
- package/src/xr/VRActor.ts +71 -0
- package/src/xr/VRControllerHandler.ts +87 -0
- package/src/xr/VRControllerManager.ts +559 -0
- package/src/xr/VRDeviceHandler.ts +77 -0
- package/src/xr/VRHandHandler.ts +166 -0
- package/src/xr/VRInputDevice.ts +374 -0
- package/src/xr/VRPawn.ts +815 -0
- package/src/xr/actor-components/CanvasUIComponent.ts +425 -0
- package/src/xr/actor-components/VRBaseComponent.ts +26 -0
- package/src/xr/actor-components/VRGrabbableComponent.ts +73 -0
- package/src/xr/actor-components/VRInteractableComponent.ts +43 -0
- package/src/xr/index.ts +17 -0
- package/src/xr/pawn-components/VRGrabComponent.ts +435 -0
- package/src/xr/pawn-components/VRInteractComponent.ts +77 -0
- package/src/xr/pawn-components/VRSnapTurnComponent.ts +103 -0
- package/src/xr/pawn-components/VRTeleportComponent.ts +284 -0
- package/src/xr/ui/CanvasColorPicker.ts +172 -0
- package/src/xr/ui/CanvasKeyboard.ts +283 -0
- package/src/xr/ui/CanvasSlider.ts +83 -0
- package/src/xr/ui/CanvasUI.ts +879 -0
- package/src/xr/ui/index.ts +9 -0
|
@@ -0,0 +1,1774 @@
|
|
|
1
|
+
import * as ENGINE from 'genesys.js';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// All behavior tree classes are now available through ENGINE exports
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Behavior Tree Demo
|
|
9
|
+
*
|
|
10
|
+
* This demo showcases the genesys.js behavior tree system with three NPCs:
|
|
11
|
+
*
|
|
12
|
+
* 1. Patrol NPC (Orange Ring): Uses programmatically created patrol behavior
|
|
13
|
+
* - Patrols between waypoints when player is far
|
|
14
|
+
* - Approaches and performs melee attacks when player is detected
|
|
15
|
+
* - Uses close-range melee combat instead of ranged attacks
|
|
16
|
+
*
|
|
17
|
+
* 2. Combat NPC (Red/Yellow Ring): Uses programmatically created combat behavior
|
|
18
|
+
* - Aggressive combat behavior with shooting and positioning
|
|
19
|
+
* - Flees when health drops below 50% (ring turns yellow)
|
|
20
|
+
* - Demonstrates health-based behavior switching
|
|
21
|
+
*
|
|
22
|
+
* 3. Aerial NPC (Dark Red Drone): Uses programmatically created aerial behavior
|
|
23
|
+
* - Floats in the air and hunts the player from above
|
|
24
|
+
* - Shoots at player when in line of sight
|
|
25
|
+
* - Searches around last known position when player is hidden
|
|
26
|
+
* - Wanders randomly in the sky when no player information available
|
|
27
|
+
* - Uses custom AerialMovementComponent (no navigation server)
|
|
28
|
+
*
|
|
29
|
+
* 4. Aerial Patrol NPC (Blue Drone): Uses programmatically created waypoint patrol
|
|
30
|
+
* - Flies in a circular pattern between predefined 3D waypoints
|
|
31
|
+
* - Demonstrates aerial waypoint navigation and cycling
|
|
32
|
+
* - Peaceful patrol behavior (no combat functionality)
|
|
33
|
+
* - Shows how to create aerial patrol routes in 3D space
|
|
34
|
+
*
|
|
35
|
+
* Key Features Demonstrated:
|
|
36
|
+
* - Programmatic behavior tree creation (no JSON files required)
|
|
37
|
+
* - Clean blackboard-only actor referencing (no direct actor references)
|
|
38
|
+
* - Direct numeric values for behavior parameters (no template resolution)
|
|
39
|
+
* - Complex behavior tree logic with conditions and sequences
|
|
40
|
+
* - Health-based behavior switching
|
|
41
|
+
* - Navigation and pathfinding integration
|
|
42
|
+
* - Custom aerial movement without navigation server
|
|
43
|
+
* - Line-of-sight based behavior switching
|
|
44
|
+
* - Predictive search behavior
|
|
45
|
+
* - Random aerial wandering when no target information
|
|
46
|
+
* - Organized action categorization (aerial, ground, combat, utility)
|
|
47
|
+
* - Melee vs ranged combat behaviors
|
|
48
|
+
* - Scene loading from .genesys-scene files
|
|
49
|
+
* - Manifold-based mesh combination for navigation
|
|
50
|
+
*
|
|
51
|
+
* Controls:
|
|
52
|
+
* - WASD: Move player
|
|
53
|
+
* - Mouse: Look around and aim
|
|
54
|
+
* - Left Click: Shoot
|
|
55
|
+
* - T: Test player damage
|
|
56
|
+
* - Y: Damage combat NPC (to trigger fleeing)
|
|
57
|
+
* - U: Set combat NPC to low health (instant flee trigger)
|
|
58
|
+
* - I: Damage aerial NPC
|
|
59
|
+
* - P: Damage aerial patrol NPC
|
|
60
|
+
* - O: Toggle NPC debug panel (shows all NPCs' behavior states)
|
|
61
|
+
* - L: Toggle NPC path debug visualization (shows pathfinding routes)
|
|
62
|
+
*/
|
|
63
|
+
export class BehaviorTreeDemo extends ENGINE.BaseGameLoop {
|
|
64
|
+
private patrolNpc: ENGINE.ThirdPersonCharacterPawn | null = null;
|
|
65
|
+
private combatNpc: ENGINE.ThirdPersonCharacterPawn | null = null;
|
|
66
|
+
private aerialNpc: ENGINE.Pawn | null = null; // New aerial enemy
|
|
67
|
+
private aerialPatrolNpc: ENGINE.Pawn | null = null; // New aerial patrol enemy
|
|
68
|
+
private playerPawn: ENGINE.Pawn | null = null;
|
|
69
|
+
|
|
70
|
+
// UI Components
|
|
71
|
+
private playerHealthBar: ENGINE.ProgressBar | null = null;
|
|
72
|
+
private crosshair: ENGINE.Crosshair | null = null;
|
|
73
|
+
private npcDebugPanel: ENGINE.UIElement | null = null; // Renamed from aerialDebugPanel
|
|
74
|
+
|
|
75
|
+
// Enemy health bars (3D sprites above heads)
|
|
76
|
+
private enemyHealthBars: Map<ENGINE.Pawn, ENGINE.UIElement> = new Map();
|
|
77
|
+
|
|
78
|
+
// Debug visualization
|
|
79
|
+
private debugContainer: THREE.Group = new THREE.Group();
|
|
80
|
+
private waypointMarkers: THREE.Mesh[] = [];
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
constructor(container: HTMLElement) {
|
|
85
|
+
super(container);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public override getWorldConfiguration(): ENGINE.WorldOptions {
|
|
89
|
+
return {
|
|
90
|
+
...super.getWorldConfiguration(),
|
|
91
|
+
useManifold: true, // Enable Manifold for boolean operations
|
|
92
|
+
navigationOptions: {
|
|
93
|
+
engine: ENGINE.NavigationEngine.RecastNavigation,
|
|
94
|
+
debug: true, // Enable debug visualization for navmesh,
|
|
95
|
+
generateOnStartUp: true,
|
|
96
|
+
options: {
|
|
97
|
+
...ENGINE.RecastNavigationServer.DEFAULT_OPTIONS,
|
|
98
|
+
// Adjust parameters for better scene scale
|
|
99
|
+
borderSize: 1,
|
|
100
|
+
cs: 0.2, // Cell size - larger for bigger scenes
|
|
101
|
+
ch: 0.3, // Cell height
|
|
102
|
+
walkableRadius: 2, // Agent radius
|
|
103
|
+
walkableHeight: 2.0, // Agent height
|
|
104
|
+
walkableClimb: 1, // Step height agent can climb
|
|
105
|
+
walkableSlopeAngle: 45, // Max slope angle
|
|
106
|
+
maxEdgeLen: 20, // Max edge length
|
|
107
|
+
maxSimplificationError: 2.0,
|
|
108
|
+
minRegionArea: 15, // Min region area
|
|
109
|
+
mergeRegionArea: 40, // Merge region area
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
protected override async preStart(): Promise<void> {
|
|
116
|
+
// Add debug container to scene
|
|
117
|
+
this.world.scene.add(this.debugContainer);
|
|
118
|
+
|
|
119
|
+
// Create player
|
|
120
|
+
this.createPlayer();
|
|
121
|
+
|
|
122
|
+
// Load the scene file
|
|
123
|
+
this.loadScene();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
protected override postStart(): void {
|
|
127
|
+
const debugVisualization = this.world.getNavigationServer()?.createDebugVisualization();
|
|
128
|
+
if (debugVisualization) {
|
|
129
|
+
debugVisualization.traverse((child) => {
|
|
130
|
+
child.raycast = () => {};
|
|
131
|
+
});
|
|
132
|
+
this.world.scene.add(debugVisualization);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
(async () => {
|
|
136
|
+
// Create UI components (after player is created in preStart)
|
|
137
|
+
await this.createUI();
|
|
138
|
+
|
|
139
|
+
// Create patrol NPC that can chase the player
|
|
140
|
+
await this.createPatrolNPC();
|
|
141
|
+
|
|
142
|
+
// Create combat NPC that uses new attack behaviors
|
|
143
|
+
await this.createCombatNPC();
|
|
144
|
+
|
|
145
|
+
// Create aerial enemy that floats and hunts from the sky
|
|
146
|
+
await this.createAerialNPC();
|
|
147
|
+
|
|
148
|
+
// Create aerial patrol enemy that cycles between waypoints
|
|
149
|
+
await this.createAerialPatrolNPC();
|
|
150
|
+
})();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public override destroy(): void {
|
|
154
|
+
// Clean up UI components
|
|
155
|
+
this.playerHealthBar?.destroy();
|
|
156
|
+
this.crosshair?.destroy();
|
|
157
|
+
this.npcDebugPanel?.remove();
|
|
158
|
+
|
|
159
|
+
// Clean up enemy health bars
|
|
160
|
+
this.enemyHealthBars.forEach((healthBarElement) => {
|
|
161
|
+
healthBarElement.remove();
|
|
162
|
+
});
|
|
163
|
+
this.enemyHealthBars.clear();
|
|
164
|
+
|
|
165
|
+
// Clean up debug container
|
|
166
|
+
this.world.scene.remove(this.debugContainer);
|
|
167
|
+
|
|
168
|
+
super.destroy();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
private async loadScene(): Promise<void> {
|
|
172
|
+
fetch('@engine/assets/dev/fps-new.genesys-scene')
|
|
173
|
+
.then(response => response.json())
|
|
174
|
+
.then(async (data) => {
|
|
175
|
+
await this.loadWorldData(data);
|
|
176
|
+
})
|
|
177
|
+
.catch(error => {
|
|
178
|
+
console.error('Failed to load scene:', error);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
private async createUI(): Promise<void> {
|
|
186
|
+
// Create player health bar
|
|
187
|
+
this.playerHealthBar = new ENGINE.ProgressBar(this.world.uiManager, {
|
|
188
|
+
width: 300,
|
|
189
|
+
height: 25,
|
|
190
|
+
label: 'HEALTH',
|
|
191
|
+
theme: 'health',
|
|
192
|
+
animate: false,
|
|
193
|
+
textDisplay: 'value',
|
|
194
|
+
style: 'rounded',
|
|
195
|
+
visible: true,
|
|
196
|
+
currentValue: 100,
|
|
197
|
+
maxValue: 100,
|
|
198
|
+
minValue: 0
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
await this.playerHealthBar.initialize();
|
|
202
|
+
|
|
203
|
+
// Position the health bar in bottom-left corner using setPosition
|
|
204
|
+
this.playerHealthBar.setPosition({
|
|
205
|
+
position: 'absolute',
|
|
206
|
+
bottom: '20px',
|
|
207
|
+
left: '20px'
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
// Initialize player health bar with current values and set up event subscription
|
|
213
|
+
if (this.playerPawn) {
|
|
214
|
+
const playerStats = this.playerPawn.getComponent(ENGINE.CharacterStatsComponent);
|
|
215
|
+
if (playerStats) {
|
|
216
|
+
// Set initial values - try setting max first, then current
|
|
217
|
+
this.playerHealthBar.setMaxValue(playerStats.getMaxHealth());
|
|
218
|
+
this.playerHealthBar.setValue(playerStats.getCurrentHealth());
|
|
219
|
+
|
|
220
|
+
// Force the component to show (in case it's hidden)
|
|
221
|
+
this.playerHealthBar.show();
|
|
222
|
+
|
|
223
|
+
// Subscribe to health changes now that the UI is ready
|
|
224
|
+
playerStats.onHealthChanged.add((currentHealth: number, maxHealth: number) => {
|
|
225
|
+
if (this.playerHealthBar) {
|
|
226
|
+
this.playerHealthBar.setMaxValue(maxHealth);
|
|
227
|
+
this.playerHealthBar.setValue(currentHealth);
|
|
228
|
+
// Force show in case it got hidden
|
|
229
|
+
this.playerHealthBar.show();
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// Test controls for behavior tree demonstration
|
|
234
|
+
this.playerPawn.onKeyDown.add((event: KeyboardEvent) => {
|
|
235
|
+
if (event.code === 'KeyT') {
|
|
236
|
+
// Test player damage
|
|
237
|
+
playerStats.takeDamage(10);
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
// Test combat NPC damage with Y key (to trigger fleeing behavior)
|
|
241
|
+
if (event.code === 'KeyY' && this.combatNpc) {
|
|
242
|
+
const combatStats = this.combatNpc.getComponent(ENGINE.CharacterStatsComponent);
|
|
243
|
+
if (combatStats) {
|
|
244
|
+
combatStats.takeDamage(30);
|
|
245
|
+
}
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
// Test combat NPC set to low health with U key (instant flee trigger)
|
|
249
|
+
if (event.code === 'KeyU' && this.combatNpc) {
|
|
250
|
+
const combatStats = this.combatNpc.getComponent(ENGINE.CharacterStatsComponent);
|
|
251
|
+
if (combatStats) {
|
|
252
|
+
const targetHealth = 40; // Set to 40 out of 120 = 33% health (below 50% threshold)
|
|
253
|
+
const currentHealth = combatStats.getCurrentHealth();
|
|
254
|
+
const damageToDeal = Math.max(0, currentHealth - targetHealth);
|
|
255
|
+
if (damageToDeal > 0) {
|
|
256
|
+
combatStats.takeDamage(damageToDeal);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
// Test aerial NPC damage with I key
|
|
262
|
+
if (event.code === 'KeyI' && this.aerialNpc) {
|
|
263
|
+
const aerialStats = this.aerialNpc.getComponent(ENGINE.CharacterStatsComponent);
|
|
264
|
+
if (aerialStats) {
|
|
265
|
+
aerialStats.takeDamage(20);
|
|
266
|
+
}
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
// Test aerial patrol NPC damage with P key
|
|
270
|
+
if (event.code === 'KeyP' && this.aerialPatrolNpc) {
|
|
271
|
+
const aerialPatrolStats = this.aerialPatrolNpc.getComponent(ENGINE.CharacterStatsComponent);
|
|
272
|
+
if (aerialPatrolStats) {
|
|
273
|
+
aerialPatrolStats.takeDamage(15);
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
// Toggle aerial debug panel with O key
|
|
278
|
+
if (event.code === 'KeyO' && this.npcDebugPanel) {
|
|
279
|
+
// Simple toggle by checking if it's currently visible
|
|
280
|
+
const element = this.npcDebugPanel.element;
|
|
281
|
+
if (element && element.style.display === 'none') {
|
|
282
|
+
this.npcDebugPanel.show();
|
|
283
|
+
} else {
|
|
284
|
+
this.npcDebugPanel.hide();
|
|
285
|
+
}
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
return false;
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Create crosshair
|
|
294
|
+
this.crosshair = new ENGINE.Crosshair(this.world.uiManager, {
|
|
295
|
+
size: 6,
|
|
296
|
+
color: 'rgba(255, 255, 255, 0.8)',
|
|
297
|
+
style: 'cross'
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
await this.crosshair.initialize();
|
|
301
|
+
|
|
302
|
+
// Position the crosshair in the center using setPosition
|
|
303
|
+
this.crosshair.setPosition({
|
|
304
|
+
position: 'absolute',
|
|
305
|
+
top: '50%',
|
|
306
|
+
left: '50%',
|
|
307
|
+
transform: 'translate(-50%, -50%)'
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// Create aerial NPC debug panel
|
|
311
|
+
await this.createNPCDebugPanel();
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
private async createNPCDebugPanel(): Promise<void> {
|
|
315
|
+
const ui = this.world.uiManager;
|
|
316
|
+
|
|
317
|
+
// Create debug panel container
|
|
318
|
+
this.npcDebugPanel = ui.createElement('npc-debug-panel', {
|
|
319
|
+
style: {
|
|
320
|
+
position: 'absolute',
|
|
321
|
+
top: '20px',
|
|
322
|
+
right: '20px',
|
|
323
|
+
width: '400px',
|
|
324
|
+
maxHeight: '80vh',
|
|
325
|
+
backgroundColor: 'rgba(0, 0, 0, 0.9)',
|
|
326
|
+
border: '1px solid rgba(255, 255, 255, 0.3)',
|
|
327
|
+
borderRadius: '8px',
|
|
328
|
+
padding: '15px',
|
|
329
|
+
fontFamily: 'monospace',
|
|
330
|
+
fontSize: '11px',
|
|
331
|
+
color: '#ffffff',
|
|
332
|
+
zIndex: '1000',
|
|
333
|
+
boxSizing: 'border-box',
|
|
334
|
+
overflowY: 'auto'
|
|
335
|
+
},
|
|
336
|
+
innerHTML: `
|
|
337
|
+
<div style="font-weight: bold; margin-bottom: 15px; color: #ff6b6b; text-align: center; font-size: 14px;">🤖 NPC Behavior Debug</div>
|
|
338
|
+
|
|
339
|
+
<!-- Patrol NPC Section -->
|
|
340
|
+
<div style="margin-bottom: 15px; border: 1px solid rgba(255, 165, 0, 0.5); border-radius: 6px; padding: 10px;">
|
|
341
|
+
<div style="font-weight: bold; color: #FFA500; margin-bottom: 8px;">🟠 Patrol NPC (Melee)</div>
|
|
342
|
+
<div id="patrol-sequence" style="color: #4ecdc4;">Sequence: --</div>
|
|
343
|
+
<div id="patrol-action" style="color: #95e6cb;">Action: --</div>
|
|
344
|
+
<div id="patrol-status" style="color: #ffffff;">Status: --</div>
|
|
345
|
+
<div id="patrol-health" style="color: #ff9f43; margin-top: 5px;">Health: --</div>
|
|
346
|
+
<div id="patrol-path" style="color: #87ceeb; margin-top: 5px;">Path: --</div>
|
|
347
|
+
<div id="patrol-following" style="color: #dda0dd; margin-top: 5px;">Following: --</div>
|
|
348
|
+
</div>
|
|
349
|
+
|
|
350
|
+
<!-- Combat NPC Section -->
|
|
351
|
+
<div style="margin-bottom: 15px; border: 1px solid rgba(255, 0, 0, 0.5); border-radius: 6px; padding: 10px;">
|
|
352
|
+
<div style="font-weight: bold; color: #FF0000; margin-bottom: 8px;">🔴 Combat NPC (Ranged)</div>
|
|
353
|
+
<div id="combat-sequence" style="color: #4ecdc4;">Sequence: --</div>
|
|
354
|
+
<div id="combat-action" style="color: #95e6cb;">Action: --</div>
|
|
355
|
+
<div id="combat-status" style="color: #ffffff;">Status: --</div>
|
|
356
|
+
<div id="combat-health" style="color: #ff9f43; margin-top: 5px;">Health: --</div>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
<!-- Aerial NPC Section -->
|
|
360
|
+
<div style="margin-bottom: 15px; border: 1px solid rgba(139, 0, 0, 0.5); border-radius: 6px; padding: 10px;">
|
|
361
|
+
<div style="font-weight: bold; color: #8B0000; margin-bottom: 8px;">🚁 Aerial NPC (Hunter Drone)</div>
|
|
362
|
+
<div id="aerial-sequence" style="color: #4ecdc4;">Sequence: --</div>
|
|
363
|
+
<div id="aerial-action" style="color: #95e6cb;">Action: --</div>
|
|
364
|
+
<div id="aerial-status" style="color: #ffffff;">Status: --</div>
|
|
365
|
+
<div id="aerial-health" style="color: #ff9f43; margin-top: 5px;">Health: --</div>
|
|
366
|
+
<div id="aerial-special" style="color: #ffd700; margin-top: 5px;">Line of Sight: --</div>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<!-- Aerial Patrol NPC Section -->
|
|
370
|
+
<div style="margin-bottom: 15px; border: 1px solid rgba(65, 105, 225, 0.5); border-radius: 6px; padding: 10px;">
|
|
371
|
+
<div style="font-weight: bold; color: #4169E1; margin-bottom: 8px;">🛩️ Aerial Patrol (Waypoint Drone)</div>
|
|
372
|
+
<div id="aerial-patrol-sequence" style="color: #4ecdc4;">Sequence: --</div>
|
|
373
|
+
<div id="aerial-patrol-action" style="color: #95e6cb;">Action: --</div>
|
|
374
|
+
<div id="aerial-patrol-status" style="color: #ffffff;">Status: --</div>
|
|
375
|
+
<div id="aerial-patrol-health" style="color: #ff9f43; margin-top: 5px;">Health: --</div>
|
|
376
|
+
<div id="aerial-patrol-waypoint" style="color: #87ceeb; margin-top: 5px;">Current Waypoint: --</div>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<div style="margin-top: 15px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.2); text-align: center; color: #888;">
|
|
380
|
+
Press 'O' to toggle this panel
|
|
381
|
+
</div>
|
|
382
|
+
`
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
private createPlayer(): void {
|
|
387
|
+
// Create a first-person player character like in chase-game
|
|
388
|
+
const { pawn } = ENGINE.GameBuilder.createDefaultPawnWithPhysics(
|
|
389
|
+
this.world,
|
|
390
|
+
ENGINE.CharacterMovementType.FirstPerson
|
|
391
|
+
);
|
|
392
|
+
this.playerPawn = pawn;
|
|
393
|
+
|
|
394
|
+
// Position player at PlayerStart location from the scene (will be updated after scene loads)
|
|
395
|
+
pawn.rootComponent.setWorldPosition(new THREE.Vector3(-4, 6, -13));
|
|
396
|
+
|
|
397
|
+
// Set reasonable movement speed
|
|
398
|
+
if (pawn.movementComponent) {
|
|
399
|
+
(pawn.movementComponent.options as ENGINE.CharacterMovementOptions).maxSpeed = 15;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Add character stats for combat interactions
|
|
403
|
+
const playerStats = new ENGINE.CharacterStatsComponent({
|
|
404
|
+
maxHealth: 100,
|
|
405
|
+
healthRegen: 0, // Disable health regeneration
|
|
406
|
+
attackRange: 50.0,
|
|
407
|
+
attackDamage: 30,
|
|
408
|
+
attackCooldown: 0.3
|
|
409
|
+
});
|
|
410
|
+
pawn.rootComponent.add(playerStats);
|
|
411
|
+
|
|
412
|
+
// Add projectile weapon for the player (damage disabled for demo)
|
|
413
|
+
const playerWeapon = new ENGINE.ProjectileWeaponComponent({
|
|
414
|
+
position: new THREE.Vector3(0, 0, -1), // Slightly in front of player
|
|
415
|
+
fireInterval: playerStats.getAttackCooldown(),
|
|
416
|
+
isSingleFire: false,
|
|
417
|
+
projectileOptions: {
|
|
418
|
+
velocity: 80,
|
|
419
|
+
range: playerStats.getAttackRange(),
|
|
420
|
+
damageDealt: 10,
|
|
421
|
+
useOverlapCheck: true,
|
|
422
|
+
destroyOnHit: true,
|
|
423
|
+
geometry: new THREE.SphereGeometry(0.3),
|
|
424
|
+
material: new THREE.MeshStandardMaterial({ color: ENGINE.Color.BLUE })
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
pawn.rootComponent.add(playerWeapon);
|
|
428
|
+
|
|
429
|
+
// Note: Health bar subscription will be set up after UI is created
|
|
430
|
+
|
|
431
|
+
// Player will be stored in NPC blackboards when they're created
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
private createEnemyHealthBar(npc: ENGINE.Pawn): ENGINE.UIElement {
|
|
435
|
+
const ui = this.world.uiManager;
|
|
436
|
+
|
|
437
|
+
// Create a health bar element using CSS-based fill like in ui-demo
|
|
438
|
+
const healthBarElement = ui.createElement(`health-container-${npc.uuid}`, {
|
|
439
|
+
style: {
|
|
440
|
+
position: 'absolute',
|
|
441
|
+
width: '60px',
|
|
442
|
+
height: '8px',
|
|
443
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
444
|
+
borderRadius: '4px',
|
|
445
|
+
border: '1px solid rgba(255, 255, 255, 0.3)',
|
|
446
|
+
pointerEvents: 'none',
|
|
447
|
+
display: 'none',
|
|
448
|
+
left: '-1000px',
|
|
449
|
+
top: '-1000px',
|
|
450
|
+
zIndex: '1500',
|
|
451
|
+
boxSizing: 'border-box',
|
|
452
|
+
// Use background gradient to create the fill effect
|
|
453
|
+
backgroundImage: 'linear-gradient(to right, #4CAF50 100%, transparent 100%)',
|
|
454
|
+
backgroundClip: 'padding-box',
|
|
455
|
+
transition: 'background-image 0.3s ease'
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
// Subscribe to NPC health changes
|
|
460
|
+
const npcStats = npc.getComponent(ENGINE.CharacterStatsComponent);
|
|
461
|
+
if (npcStats) {
|
|
462
|
+
npcStats.onHealthChanged.add((currentHealth: number, maxHealth: number) => {
|
|
463
|
+
this.updateEnemyHealthBar(npc, currentHealth, maxHealth);
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// Set initial health
|
|
467
|
+
this.updateEnemyHealthBar(npc, npcStats.getCurrentHealth(), npcStats.getMaxHealth());
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
return healthBarElement;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
private updateEnemyHealthBar(npc: ENGINE.Pawn, currentHealth: number, maxHealth: number): void {
|
|
474
|
+
const healthBarElement = this.enemyHealthBars.get(npc);
|
|
475
|
+
if (!healthBarElement) return;
|
|
476
|
+
|
|
477
|
+
const percentage = Math.max(0, currentHealth / maxHealth);
|
|
478
|
+
|
|
479
|
+
// Determine color based on health
|
|
480
|
+
let color = '#4CAF50'; // Green
|
|
481
|
+
if (currentHealth <= maxHealth * 0.3) {
|
|
482
|
+
color = '#F44336'; // Red
|
|
483
|
+
} else if (currentHealth <= maxHealth * 0.6) {
|
|
484
|
+
color = '#FF9800'; // Orange
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// Update the background gradient to show the health percentage
|
|
488
|
+
const fillPercentage = Math.round(percentage * 100);
|
|
489
|
+
healthBarElement.setStyle('backgroundImage',
|
|
490
|
+
`linear-gradient(to right, ${color} ${fillPercentage}%, transparent ${fillPercentage}%)`
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
protected override tick(tickTime: ENGINE.TickTime): void {
|
|
495
|
+
super.tick(tickTime);
|
|
496
|
+
|
|
497
|
+
// Update enemy health bar positions
|
|
498
|
+
this.updateEnemyHealthBarPositions();
|
|
499
|
+
|
|
500
|
+
// Update aerial NPC debug panel
|
|
501
|
+
this.updateNPCDebugPanel();
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
private updateEnemyHealthBarPositions(): void {
|
|
505
|
+
const camera = this.world.getActiveCamera();
|
|
506
|
+
if (!camera) return;
|
|
507
|
+
|
|
508
|
+
this.enemyHealthBars.forEach((healthBarElement, npc) => {
|
|
509
|
+
// Get NPC position
|
|
510
|
+
const npcPosition = new THREE.Vector3();
|
|
511
|
+
npc.rootComponent.getWorldPosition(npcPosition);
|
|
512
|
+
|
|
513
|
+
// Position health bar above the NPC
|
|
514
|
+
npcPosition.y += 5;
|
|
515
|
+
|
|
516
|
+
// Project 3D position to screen coordinates
|
|
517
|
+
const screenPosition = npcPosition.clone().project(camera);
|
|
518
|
+
|
|
519
|
+
// Convert to screen pixels using renderer size
|
|
520
|
+
const containerSize = this.renderer.getWindowSize();
|
|
521
|
+
const x = (screenPosition.x * 0.5 + 0.5) * containerSize.width;
|
|
522
|
+
const y = (screenPosition.y * -0.5 + 0.5) * containerSize.height;
|
|
523
|
+
|
|
524
|
+
// Health bar dimensions
|
|
525
|
+
const healthBarWidth = 60;
|
|
526
|
+
const healthBarHeight = 8;
|
|
527
|
+
const healthBarX = x - healthBarWidth / 2;
|
|
528
|
+
const healthBarY = y - 10;
|
|
529
|
+
|
|
530
|
+
// Hide health bar if NPC is behind camera or outside container bounds
|
|
531
|
+
const margin = 10;
|
|
532
|
+
if (screenPosition.z > 1 || screenPosition.z < 0 ||
|
|
533
|
+
healthBarX < margin || healthBarX + healthBarWidth > containerSize.width - margin ||
|
|
534
|
+
healthBarY < margin || healthBarY + healthBarHeight > containerSize.height - margin) {
|
|
535
|
+
healthBarElement.hide();
|
|
536
|
+
} else {
|
|
537
|
+
// Update health bar position (clamp to safe bounds)
|
|
538
|
+
const clampedX = Math.max(margin, Math.min(healthBarX, containerSize.width - healthBarWidth - margin));
|
|
539
|
+
const clampedY = Math.max(margin, Math.min(healthBarY, containerSize.height - healthBarHeight - margin));
|
|
540
|
+
|
|
541
|
+
healthBarElement.setStyle('left', `${clampedX}px`);
|
|
542
|
+
healthBarElement.setStyle('top', `${clampedY}px`);
|
|
543
|
+
healthBarElement.setStyle('display', 'block');
|
|
544
|
+
healthBarElement.show();
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
private updateNPCDebugPanel(): void {
|
|
550
|
+
if (!this.npcDebugPanel || !this.playerPawn) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// Update Patrol NPC debug info
|
|
555
|
+
this.updateNPCDebugInfo('patrol', this.patrolNpc);
|
|
556
|
+
|
|
557
|
+
// Update Combat NPC debug info
|
|
558
|
+
this.updateNPCDebugInfo('combat', this.combatNpc);
|
|
559
|
+
|
|
560
|
+
// Update Aerial NPC debug info
|
|
561
|
+
this.updateNPCDebugInfo('aerial', this.aerialNpc);
|
|
562
|
+
|
|
563
|
+
// Update Aerial Patrol NPC debug info
|
|
564
|
+
this.updateAerialPatrolDebugInfo();
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
private updateNPCDebugInfo(prefix: string, npc: ENGINE.Pawn | null): void {
|
|
568
|
+
if (!npc || !this.npcDebugPanel) {
|
|
569
|
+
// NPC not available, show "Not Available"
|
|
570
|
+
const sequenceElement = this.npcDebugPanel?.querySelector(`#${prefix}-sequence`);
|
|
571
|
+
const actionElement = this.npcDebugPanel?.querySelector(`#${prefix}-action`);
|
|
572
|
+
const statusElement = this.npcDebugPanel?.querySelector(`#${prefix}-status`);
|
|
573
|
+
const healthElement = this.npcDebugPanel?.querySelector(`#${prefix}-health`);
|
|
574
|
+
|
|
575
|
+
if (sequenceElement) sequenceElement.textContent = 'Sequence: Not Available';
|
|
576
|
+
if (actionElement) actionElement.textContent = 'Action: Not Available';
|
|
577
|
+
if (statusElement) statusElement.textContent = 'Status: Not Available';
|
|
578
|
+
if (healthElement) healthElement.textContent = 'Health: Not Available';
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// Get behavior tree component
|
|
583
|
+
const behaviorTree = npc.getComponent(ENGINE.BehaviorTreeComponent);
|
|
584
|
+
const stats = npc.getComponent(ENGINE.CharacterStatsComponent);
|
|
585
|
+
|
|
586
|
+
// Get DOM elements
|
|
587
|
+
const sequenceElement = this.npcDebugPanel.querySelector(`#${prefix}-sequence`);
|
|
588
|
+
const actionElement = this.npcDebugPanel.querySelector(`#${prefix}-action`);
|
|
589
|
+
const statusElement = this.npcDebugPanel.querySelector(`#${prefix}-status`);
|
|
590
|
+
const healthElement = this.npcDebugPanel.querySelector(`#${prefix}-health`);
|
|
591
|
+
|
|
592
|
+
if (behaviorTree && behaviorTree.isRunningBehaviorTree()) {
|
|
593
|
+
// Get current sequence and action
|
|
594
|
+
const currentSequence = behaviorTree.getCurrentSequence();
|
|
595
|
+
const currentAction = behaviorTree.getCurrentAction();
|
|
596
|
+
const treeStatus = behaviorTree.getCurrentStatus();
|
|
597
|
+
|
|
598
|
+
// Update sequence info
|
|
599
|
+
if (sequenceElement) {
|
|
600
|
+
const sequenceName = currentSequence ? currentSequence.name : 'None';
|
|
601
|
+
sequenceElement.textContent = `Sequence: ${sequenceName}`;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Update action info
|
|
605
|
+
if (actionElement) {
|
|
606
|
+
const actionName = currentAction ? currentAction.name : 'None';
|
|
607
|
+
const actionStatus = currentAction ? currentAction.getStatus() : 'N/A';
|
|
608
|
+
actionElement.textContent = `Action: ${actionName} (${actionStatus})`;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// Update overall status
|
|
612
|
+
if (statusElement) {
|
|
613
|
+
statusElement.textContent = `Status: ${treeStatus}`;
|
|
614
|
+
}
|
|
615
|
+
} else {
|
|
616
|
+
// Behavior tree not running
|
|
617
|
+
if (sequenceElement) sequenceElement.textContent = 'Sequence: Inactive';
|
|
618
|
+
if (actionElement) actionElement.textContent = 'Action: Inactive';
|
|
619
|
+
if (statusElement) statusElement.textContent = 'Status: Stopped';
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// Update health info
|
|
623
|
+
if (healthElement && stats) {
|
|
624
|
+
const currentHealth = stats.getCurrentHealth();
|
|
625
|
+
const maxHealth = stats.getMaxHealth();
|
|
626
|
+
const healthPercent = Math.round((currentHealth / maxHealth) * 100);
|
|
627
|
+
healthElement.textContent = `Health: ${currentHealth}/${maxHealth} (${healthPercent}%)`;
|
|
628
|
+
|
|
629
|
+
// Color health based on percentage
|
|
630
|
+
if (healthPercent <= 30) {
|
|
631
|
+
healthElement.style.color = '#F44336'; // Red
|
|
632
|
+
} else if (healthPercent <= 60) {
|
|
633
|
+
healthElement.style.color = '#FF9800'; // Orange
|
|
634
|
+
} else {
|
|
635
|
+
healthElement.style.color = '#4CAF50'; // Green
|
|
636
|
+
}
|
|
637
|
+
} else if (healthElement) {
|
|
638
|
+
healthElement.textContent = 'Health: No Stats Component';
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// Special handling for patrol NPC (path and following info)
|
|
642
|
+
if (prefix === 'patrol') {
|
|
643
|
+
const pathElement = this.npcDebugPanel.querySelector('#patrol-path');
|
|
644
|
+
const followingElement = this.npcDebugPanel.querySelector('#patrol-following');
|
|
645
|
+
|
|
646
|
+
if (pathElement || followingElement) {
|
|
647
|
+
const movementComponent = npc.getComponent(ENGINE.NpcMovementComponent);
|
|
648
|
+
|
|
649
|
+
if (movementComponent) {
|
|
650
|
+
// Update path information
|
|
651
|
+
if (pathElement) {
|
|
652
|
+
const currentPath = movementComponent.getCurrentPath();
|
|
653
|
+
const currentPathIndex = movementComponent.getCurrentPathIndex();
|
|
654
|
+
const pathLength = movementComponent.getPathLength();
|
|
655
|
+
|
|
656
|
+
if (pathLength > 0) {
|
|
657
|
+
const hasReached = movementComponent.hasReachedCurrentTarget();
|
|
658
|
+
pathElement.textContent = `Path: ${currentPathIndex + 1}/${pathLength} ${hasReached ? '✅' : '🔄'}`;
|
|
659
|
+
pathElement.style.color = hasReached ? '#4CAF50' : '#87ceeb';
|
|
660
|
+
} else {
|
|
661
|
+
pathElement.textContent = 'Path: No active path';
|
|
662
|
+
pathElement.style.color = '#888888';
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// Update following information
|
|
667
|
+
if (followingElement) {
|
|
668
|
+
const followedActor = movementComponent.getFollowedActor();
|
|
669
|
+
const currentTarget = movementComponent.getCurrentTarget();
|
|
670
|
+
|
|
671
|
+
if (followedActor) {
|
|
672
|
+
const npcPos = new THREE.Vector3();
|
|
673
|
+
const targetPos = new THREE.Vector3();
|
|
674
|
+
npc.rootComponent.getWorldPosition(npcPos);
|
|
675
|
+
followedActor.rootComponent.getWorldPosition(targetPos);
|
|
676
|
+
const distance = npcPos.distanceTo(targetPos).toFixed(1);
|
|
677
|
+
|
|
678
|
+
followingElement.textContent = `Following: Player (${distance}m)`;
|
|
679
|
+
followingElement.style.color = '#dda0dd';
|
|
680
|
+
} else if (currentTarget) {
|
|
681
|
+
const npcPos = new THREE.Vector3();
|
|
682
|
+
npc.rootComponent.getWorldPosition(npcPos);
|
|
683
|
+
const distance = npcPos.distanceTo(currentTarget).toFixed(1);
|
|
684
|
+
|
|
685
|
+
followingElement.textContent = `Following: Waypoint (${distance}m)`;
|
|
686
|
+
followingElement.style.color = '#87ceeb';
|
|
687
|
+
} else {
|
|
688
|
+
followingElement.textContent = 'Following: None';
|
|
689
|
+
followingElement.style.color = '#888888';
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
} else {
|
|
693
|
+
// No movement component
|
|
694
|
+
if (pathElement) {
|
|
695
|
+
pathElement.textContent = 'Path: No Movement Component';
|
|
696
|
+
pathElement.style.color = '#888888';
|
|
697
|
+
}
|
|
698
|
+
if (followingElement) {
|
|
699
|
+
followingElement.textContent = 'Following: No Movement Component';
|
|
700
|
+
followingElement.style.color = '#888888';
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// Special handling for aerial NPC (line of sight and wander info)
|
|
707
|
+
if (prefix === 'aerial' && this.playerPawn) {
|
|
708
|
+
const specialElement = this.npcDebugPanel.querySelector('#aerial-special');
|
|
709
|
+
if (specialElement) {
|
|
710
|
+
const npcPos = new THREE.Vector3();
|
|
711
|
+
const playerPos = new THREE.Vector3();
|
|
712
|
+
npc.rootComponent.getWorldPosition(npcPos);
|
|
713
|
+
this.playerPawn.rootComponent.getWorldPosition(playerPos);
|
|
714
|
+
|
|
715
|
+
const canSee = this.checkLineOfSight(npcPos, playerPos);
|
|
716
|
+
const distance = npcPos.distanceTo(playerPos).toFixed(1);
|
|
717
|
+
|
|
718
|
+
// Get wander info if available
|
|
719
|
+
let wanderInfo = '';
|
|
720
|
+
if (behaviorTree) {
|
|
721
|
+
const currentAction = behaviorTree.getCurrentAction();
|
|
722
|
+
if (currentAction && currentAction.name === 'AerialWander') {
|
|
723
|
+
const wanderAction = currentAction as any; // Type assertion for debugging
|
|
724
|
+
if (wanderAction.getCurrentWanderTarget && wanderAction.isCurrentlyWaiting) {
|
|
725
|
+
const wanderTarget = wanderAction.getCurrentWanderTarget();
|
|
726
|
+
const isWaiting = wanderAction.isCurrentlyWaiting();
|
|
727
|
+
if (wanderTarget) {
|
|
728
|
+
const wanderDistance = npcPos.distanceTo(wanderTarget).toFixed(1);
|
|
729
|
+
wanderInfo = ` | Wander: ${isWaiting ? 'Waiting' : `Moving to (${wanderTarget.x.toFixed(1)}, ${wanderTarget.y.toFixed(1)}, ${wanderTarget.z.toFixed(1)}) ${wanderDistance}m`}`;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
specialElement.textContent = `Line of Sight: ${canSee ? '✅ YES' : '❌ NO'} (${distance}m)${wanderInfo}`;
|
|
736
|
+
specialElement.style.color = canSee ? '#4CAF50' : '#F44336';
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
private checkLineOfSight(fromPos: THREE.Vector3, toPos: THREE.Vector3): boolean {
|
|
742
|
+
// Simple line of sight check (similar to what CanSeeTargetCondition does)
|
|
743
|
+
const raycaster = new THREE.Raycaster();
|
|
744
|
+
const direction = toPos.clone().sub(fromPos).normalize();
|
|
745
|
+
const distance = fromPos.distanceTo(toPos);
|
|
746
|
+
|
|
747
|
+
raycaster.set(fromPos, direction);
|
|
748
|
+
raycaster.far = distance - 0.1; // Stop just before the target
|
|
749
|
+
|
|
750
|
+
// Get all meshes in the scene (excluding sprites and UI elements)
|
|
751
|
+
const meshes: THREE.Mesh[] = [];
|
|
752
|
+
this.world.scene.traverse((child) => {
|
|
753
|
+
if (child instanceof THREE.Mesh && !(child instanceof THREE.Sprite)) {
|
|
754
|
+
// Exclude the aerial NPC itself and player
|
|
755
|
+
const isAerialNPC = this.aerialNpc?.rootComponent.getObjectByProperty('uuid', child.uuid);
|
|
756
|
+
const isPlayer = this.playerPawn?.rootComponent.getObjectByProperty('uuid', child.uuid);
|
|
757
|
+
if (!isAerialNPC && !isPlayer) {
|
|
758
|
+
meshes.push(child);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
const intersections = raycaster.intersectObjects(meshes, false);
|
|
764
|
+
return intersections.length === 0; // Clear line of sight if no intersections
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
private updateAerialPatrolDebugInfo(): void {
|
|
768
|
+
if (!this.npcDebugPanel || !this.aerialPatrolNpc) {
|
|
769
|
+
// NPC not available, show "Not Available"
|
|
770
|
+
const sequenceElement = this.npcDebugPanel?.querySelector('#aerial-patrol-sequence');
|
|
771
|
+
const actionElement = this.npcDebugPanel?.querySelector('#aerial-patrol-action');
|
|
772
|
+
const statusElement = this.npcDebugPanel?.querySelector('#aerial-patrol-status');
|
|
773
|
+
const healthElement = this.npcDebugPanel?.querySelector('#aerial-patrol-health');
|
|
774
|
+
const waypointElement = this.npcDebugPanel?.querySelector('#aerial-patrol-waypoint');
|
|
775
|
+
|
|
776
|
+
if (sequenceElement) sequenceElement.textContent = 'Sequence: Not Available';
|
|
777
|
+
if (actionElement) actionElement.textContent = 'Action: Not Available';
|
|
778
|
+
if (statusElement) statusElement.textContent = 'Status: Not Available';
|
|
779
|
+
if (healthElement) healthElement.textContent = 'Health: Not Available';
|
|
780
|
+
if (waypointElement) waypointElement.textContent = 'Current Waypoint: Not Available';
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// Get behavior tree component
|
|
785
|
+
const behaviorTree = this.aerialPatrolNpc.getComponent(ENGINE.BehaviorTreeComponent);
|
|
786
|
+
const stats = this.aerialPatrolNpc.getComponent(ENGINE.CharacterStatsComponent);
|
|
787
|
+
|
|
788
|
+
// Get DOM elements
|
|
789
|
+
const sequenceElement = this.npcDebugPanel.querySelector('#aerial-patrol-sequence');
|
|
790
|
+
const actionElement = this.npcDebugPanel.querySelector('#aerial-patrol-action');
|
|
791
|
+
const statusElement = this.npcDebugPanel.querySelector('#aerial-patrol-status');
|
|
792
|
+
const healthElement = this.npcDebugPanel.querySelector('#aerial-patrol-health');
|
|
793
|
+
const waypointElement = this.npcDebugPanel.querySelector('#aerial-patrol-waypoint');
|
|
794
|
+
|
|
795
|
+
if (behaviorTree && behaviorTree.isRunningBehaviorTree()) {
|
|
796
|
+
// Get current sequence and action
|
|
797
|
+
const currentSequence = behaviorTree.getCurrentSequence();
|
|
798
|
+
const currentAction = behaviorTree.getCurrentAction();
|
|
799
|
+
const treeStatus = behaviorTree.getCurrentStatus();
|
|
800
|
+
|
|
801
|
+
// Update sequence info
|
|
802
|
+
if (sequenceElement) {
|
|
803
|
+
const sequenceName = currentSequence ? currentSequence.name : 'None';
|
|
804
|
+
sequenceElement.textContent = `Sequence: ${sequenceName}`;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// Update action info
|
|
808
|
+
if (actionElement) {
|
|
809
|
+
const actionName = currentAction ? currentAction.name : 'None';
|
|
810
|
+
const actionStatus = currentAction ? currentAction.getStatus() : 'N/A';
|
|
811
|
+
actionElement.textContent = `Action: ${actionName} (${actionStatus})`;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// Update overall status
|
|
815
|
+
if (statusElement) {
|
|
816
|
+
statusElement.textContent = `Status: ${treeStatus}`;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// Update waypoint info
|
|
820
|
+
if (waypointElement) {
|
|
821
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
822
|
+
const currentIndex = blackboard.getValue<number>('CurrentAerialWaypointIndex') ?? 0;
|
|
823
|
+
const waypoints = blackboard.getValue<THREE.Vector3[]>('AerialPatrolWaypoints');
|
|
824
|
+
|
|
825
|
+
if (waypoints && waypoints.length > 0) {
|
|
826
|
+
const totalWaypoints = waypoints.length;
|
|
827
|
+
waypointElement.textContent = `Current Waypoint: ${currentIndex + 1}/${totalWaypoints}`;
|
|
828
|
+
} else {
|
|
829
|
+
waypointElement.textContent = 'Current Waypoint: No waypoints';
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
} else {
|
|
833
|
+
// Behavior tree not running
|
|
834
|
+
if (sequenceElement) sequenceElement.textContent = 'Sequence: Inactive';
|
|
835
|
+
if (actionElement) actionElement.textContent = 'Action: Inactive';
|
|
836
|
+
if (statusElement) statusElement.textContent = 'Status: Stopped';
|
|
837
|
+
if (waypointElement) waypointElement.textContent = 'Current Waypoint: Inactive';
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// Update health info
|
|
841
|
+
if (healthElement && stats) {
|
|
842
|
+
const currentHealth = stats.getCurrentHealth();
|
|
843
|
+
const maxHealth = stats.getMaxHealth();
|
|
844
|
+
const healthPercent = Math.round((currentHealth / maxHealth) * 100);
|
|
845
|
+
healthElement.textContent = `Health: ${currentHealth}/${maxHealth} (${healthPercent}%)`;
|
|
846
|
+
|
|
847
|
+
// Color health based on percentage
|
|
848
|
+
if (healthPercent <= 30) {
|
|
849
|
+
healthElement.style.color = '#F44336'; // Red
|
|
850
|
+
} else if (healthPercent <= 60) {
|
|
851
|
+
healthElement.style.color = '#FF9800'; // Orange
|
|
852
|
+
} else {
|
|
853
|
+
healthElement.style.color = '#4CAF50'; // Green
|
|
854
|
+
}
|
|
855
|
+
} else if (healthElement) {
|
|
856
|
+
healthElement.textContent = 'Health: No Stats Component';
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
private async createPatrolNPC(): Promise<void> {
|
|
861
|
+
// Create patrol NPC using ThirdPersonCharacterPawn positioned near the first SKM actor
|
|
862
|
+
this.patrolNpc = new ENGINE.ThirdPersonCharacterPawn({
|
|
863
|
+
modelUrl: '@engine/assets/character/mannequinG.glb',
|
|
864
|
+
configUrl: '@engine/assets/character/config/mannequin-anim.json',
|
|
865
|
+
meshPosition: new THREE.Vector3(0, -ENGINE.CHARACTER_HEIGHT / 2, 0),
|
|
866
|
+
meshRotation: new THREE.Euler(0, Math.PI, 0),
|
|
867
|
+
meshScale: new THREE.Vector3(1, 1, 1),
|
|
868
|
+
position: new THREE.Vector3(-8, 4, 2), // Position near the Aviator SKM actor at (-8.9, 4.3, -0.1)
|
|
869
|
+
movementComponent: new ENGINE.NpcMovementComponent({
|
|
870
|
+
...ENGINE.NpcMovementComponent.DEFAULT_OPTIONS,
|
|
871
|
+
useNavigationServer: true,
|
|
872
|
+
movementSpeed: 8, // Slower movement speed for patrolling
|
|
873
|
+
pathFollowingAccuracy: 1.5,
|
|
874
|
+
actorFollowingDistance: 3.0,
|
|
875
|
+
stopDistance: 1.5,
|
|
876
|
+
debugVisualization: {
|
|
877
|
+
enabled: true,
|
|
878
|
+
pathColor: 0xffa500, // Orange for patrol NPC
|
|
879
|
+
targetColor: 0xff6600,
|
|
880
|
+
lineWidth: 8,
|
|
881
|
+
showWaypoints: true,
|
|
882
|
+
waypointSize: 0.5
|
|
883
|
+
},
|
|
884
|
+
}),
|
|
885
|
+
camera: null, // NPCs don't need cameras
|
|
886
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
887
|
+
geometry: ENGINE.GameBuilder.createDefaultPawnCapsuleGeometry(),
|
|
888
|
+
material: new THREE.MeshStandardMaterial({ color: 0x00ff00, visible: false, transparent: true, opacity: 0.5 }), // Invisible collision capsule
|
|
889
|
+
physicsOptions: {
|
|
890
|
+
enabled: true,
|
|
891
|
+
motionType: ENGINE.PhysicsMotionType.KinematicVelocityBased,
|
|
892
|
+
collisionProfile: ENGINE.DefaultCollisionProfile.Character,
|
|
893
|
+
}
|
|
894
|
+
})
|
|
895
|
+
});
|
|
896
|
+
|
|
897
|
+
// Create behavior tree component with programmatically created tree
|
|
898
|
+
const behaviorTreeComponent = new ENGINE.BehaviorTreeComponent({
|
|
899
|
+
rootNode: this.createPatrolBehaviorTree(),
|
|
900
|
+
updateInterval: 0.15,
|
|
901
|
+
autoStart: true
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
this.patrolNpc.rootComponent.add(behaviorTreeComponent);
|
|
905
|
+
this.world.addActors(this.patrolNpc);
|
|
906
|
+
|
|
907
|
+
// Add character stats for melee combat
|
|
908
|
+
const npcStats = new ENGINE.CharacterStatsComponent({
|
|
909
|
+
maxHealth: 80,
|
|
910
|
+
attackRange: 4.0, // Shorter range for melee
|
|
911
|
+
attackDamage: 0, // Higher damage for melee
|
|
912
|
+
attackCooldown: 1.2 // Slower melee attacks
|
|
913
|
+
});
|
|
914
|
+
this.patrolNpc.rootComponent.add(npcStats);
|
|
915
|
+
|
|
916
|
+
// Remove projectile weapon - this NPC uses melee attacks only
|
|
917
|
+
|
|
918
|
+
// Create health bar for this NPC
|
|
919
|
+
const healthBar = this.createEnemyHealthBar(this.patrolNpc);
|
|
920
|
+
this.enemyHealthBars.set(this.patrolNpc, healthBar);
|
|
921
|
+
|
|
922
|
+
// Set up blackboard values for patrol NPC
|
|
923
|
+
const behaviorTree = this.patrolNpc.getComponent(ENGINE.BehaviorTreeComponent);
|
|
924
|
+
if (behaviorTree && this.playerPawn) {
|
|
925
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
926
|
+
|
|
927
|
+
// Set player reference (required by all targeting actions/conditions)
|
|
928
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
929
|
+
|
|
930
|
+
// Set patrol waypoints near all three SKM actors
|
|
931
|
+
// SKM positions: Adventurer(1.1, 0.3, -4.6), Aviator(-8.9, 4.3, -0.1), Shaman(11.5, 4.3, -9.4)
|
|
932
|
+
blackboard.setValue('patrolWaypoints', [
|
|
933
|
+
new THREE.Vector3(-8, 4, 2), // Near Aviator SKM actor
|
|
934
|
+
new THREE.Vector3(-6, 4, -2), // Between Aviator and center
|
|
935
|
+
new THREE.Vector3(2, 1, -3), // Near Adventurer SKM actor
|
|
936
|
+
new THREE.Vector3(0, 1, -6), // South of Adventurer SKM actor
|
|
937
|
+
new THREE.Vector3(8, 4, -8), // Near Shaman SKM actor
|
|
938
|
+
new THREE.Vector3(12, 4, -7), // East of Shaman SKM actor
|
|
939
|
+
new THREE.Vector3(6, 2, -2), // Central area
|
|
940
|
+
new THREE.Vector3(-4, 3, 1), // Back toward Aviator area
|
|
941
|
+
]);
|
|
942
|
+
blackboard.setValue('currentWaypointIndex', 0);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// Create debug visualization for patrol NPC
|
|
946
|
+
this.createNPCDebugVisualization(this.patrolNpc, 'Patrol', 0xff6600); // Orange color for patrol behavior
|
|
947
|
+
this.createWaypointVisualization();
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
private async createCombatNPC(): Promise<void> {
|
|
951
|
+
// Create combat NPC positioned near the Shaman SKM actor area
|
|
952
|
+
this.combatNpc = new ENGINE.ThirdPersonCharacterPawn({
|
|
953
|
+
modelUrl: '@engine/assets/character/mannequinG.glb',
|
|
954
|
+
configUrl: '@engine/assets/character/config/mannequin-anim.json',
|
|
955
|
+
meshPosition: new THREE.Vector3(0, -ENGINE.CHARACTER_HEIGHT / 2, 0),
|
|
956
|
+
meshRotation: new THREE.Euler(0, Math.PI, 0),
|
|
957
|
+
meshScale: new THREE.Vector3(1, 1, 1),
|
|
958
|
+
position: new THREE.Vector3(9, 4, -11), // Position near the Shaman SKM actor at (11.5, 4.3, -9.4)
|
|
959
|
+
movementComponent: new ENGINE.NpcMovementComponent({
|
|
960
|
+
...ENGINE.NpcMovementComponent.DEFAULT_OPTIONS,
|
|
961
|
+
useNavigationServer: true,
|
|
962
|
+
movementSpeed: 12,
|
|
963
|
+
pathFollowingAccuracy: 1.5,
|
|
964
|
+
actorFollowingDistance: 2.0,
|
|
965
|
+
stopDistance: 2.0, // Default stop distance for movement component
|
|
966
|
+
debugVisualization: {
|
|
967
|
+
enabled: true,
|
|
968
|
+
pathColor: 0xff0000, // Red for combat NPC
|
|
969
|
+
targetColor: 0xff4444,
|
|
970
|
+
lineWidth: 8,
|
|
971
|
+
showWaypoints: true,
|
|
972
|
+
waypointSize: 0.8
|
|
973
|
+
}
|
|
974
|
+
}),
|
|
975
|
+
camera: null,
|
|
976
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
977
|
+
geometry: ENGINE.GameBuilder.createDefaultPawnCapsuleGeometry(),
|
|
978
|
+
material: new THREE.MeshStandardMaterial({ color: 0xff0000, visible: false, transparent: true, opacity: 0.5 }), // Red collision capsule
|
|
979
|
+
physicsOptions: {
|
|
980
|
+
enabled: true,
|
|
981
|
+
motionType: ENGINE.PhysicsMotionType.KinematicVelocityBased,
|
|
982
|
+
collisionProfile: ENGINE.DefaultCollisionProfile.Character,
|
|
983
|
+
}
|
|
984
|
+
})
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
// Add character stats for combat
|
|
988
|
+
const combatStats = new ENGINE.CharacterStatsComponent({
|
|
989
|
+
maxHealth: 120,
|
|
990
|
+
attackRange: 40.0,
|
|
991
|
+
attackDamage: 25,
|
|
992
|
+
attackCooldown: 0.4 // Much faster firing rate
|
|
993
|
+
});
|
|
994
|
+
this.combatNpc.rootComponent.add(combatStats);
|
|
995
|
+
|
|
996
|
+
// Create health bar for this NPC
|
|
997
|
+
const healthBar = this.createEnemyHealthBar(this.combatNpc);
|
|
998
|
+
this.enemyHealthBars.set(this.combatNpc, healthBar);
|
|
999
|
+
|
|
1000
|
+
// Add projectile weapon for shooting (damage disabled for demo)
|
|
1001
|
+
const weapon = new ENGINE.ProjectileWeaponComponent({
|
|
1002
|
+
position: new THREE.Vector3(0, 0, -1), // Slightly in front of NPC
|
|
1003
|
+
fireInterval: combatStats.getAttackCooldown(),
|
|
1004
|
+
isSingleFire: false,
|
|
1005
|
+
projectileOptions: {
|
|
1006
|
+
velocity: 80, // Faster projectiles
|
|
1007
|
+
range: combatStats.getAttackRange(),
|
|
1008
|
+
damageDealt: 0, // Disabled damage for demo
|
|
1009
|
+
useOverlapCheck: true, // Use overlap for reliable damage detection
|
|
1010
|
+
destroyOnHit: true,
|
|
1011
|
+
geometry: new THREE.SphereGeometry(0.5), // Larger projectiles for better hit detection
|
|
1012
|
+
material: new THREE.MeshStandardMaterial({ color: ENGINE.Color.RED })
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
this.combatNpc.rootComponent.add(weapon);
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
// Create behavior tree component with programmatically created combat tree
|
|
1020
|
+
const behaviorTreeComponent = new ENGINE.BehaviorTreeComponent({
|
|
1021
|
+
rootNode: this.createCombatBehaviorTree(),
|
|
1022
|
+
updateInterval: 0.1,
|
|
1023
|
+
autoStart: true
|
|
1024
|
+
});
|
|
1025
|
+
|
|
1026
|
+
this.combatNpc.rootComponent.add(behaviorTreeComponent);
|
|
1027
|
+
this.world.addActors(this.combatNpc);
|
|
1028
|
+
|
|
1029
|
+
// Set up blackboard values for combat NPC
|
|
1030
|
+
const blackboard = behaviorTreeComponent.getBlackboard();
|
|
1031
|
+
if (this.playerPawn) {
|
|
1032
|
+
// Set player reference (required by all targeting actions/conditions)
|
|
1033
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
// Create debug visualization for combat NPC
|
|
1037
|
+
this.createNPCDebugVisualization(this.combatNpc, 'Combat', 0xff0000); // Red color to indicate combat behavior
|
|
1038
|
+
|
|
1039
|
+
// Add health change listener to update debug visualization when fleeing
|
|
1040
|
+
const combatBehaviorTree = this.combatNpc.getComponent(ENGINE.BehaviorTreeComponent);
|
|
1041
|
+
if (combatBehaviorTree && combatStats) {
|
|
1042
|
+
combatStats.onHealthChanged.add((currentHealth: number, maxHealth: number) => {
|
|
1043
|
+
const healthPercentage = (currentHealth / maxHealth) * 100;
|
|
1044
|
+
// Change debug ring color to yellow when at low health (fleeing)
|
|
1045
|
+
if (this.combatNpc) {
|
|
1046
|
+
if (healthPercentage <= 50) { // Match the JSON threshold
|
|
1047
|
+
this.updateNPCDebugColor(this.combatNpc, 0xffff00); // Yellow for fleeing
|
|
1048
|
+
} else {
|
|
1049
|
+
this.updateNPCDebugColor(this.combatNpc, 0xff0000); // Red for combat
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
private async createAerialNPC(): Promise<void> {
|
|
1057
|
+
// Create aerial enemy using basic Pawn with custom aerial movement
|
|
1058
|
+
this.aerialNpc = new ENGINE.Pawn({
|
|
1059
|
+
position: new THREE.Vector3(0, 25, 0), // Start high in the air
|
|
1060
|
+
movementComponent: new ENGINE.AerialMovementComponent({
|
|
1061
|
+
maxSpeed: 20,
|
|
1062
|
+
accelerationLambda: 3,
|
|
1063
|
+
decelerationLambda: 2,
|
|
1064
|
+
hoverHeight: 20,
|
|
1065
|
+
hoverVariation: 5,
|
|
1066
|
+
rotationSpeed: 2.0,
|
|
1067
|
+
maxTiltAngle: 15
|
|
1068
|
+
}),
|
|
1069
|
+
camera: null, // NPCs don't need cameras
|
|
1070
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
1071
|
+
geometry: ENGINE.GameBuilder.createDefaultPawnCapsuleGeometry(),
|
|
1072
|
+
material: new THREE.MeshStandardMaterial({ color: 0x00ff00, visible: false, transparent: true, opacity: 0.5 }), // Invisible collision capsule
|
|
1073
|
+
physicsOptions: {
|
|
1074
|
+
enabled: true,
|
|
1075
|
+
motionType: ENGINE.PhysicsMotionType.KinematicVelocityBased,
|
|
1076
|
+
collisionProfile: ENGINE.DefaultCollisionProfile.Character,
|
|
1077
|
+
}
|
|
1078
|
+
})
|
|
1079
|
+
});
|
|
1080
|
+
|
|
1081
|
+
// Create visual representation - a floating drone-like enemy
|
|
1082
|
+
const bodyGeometry = new THREE.SphereGeometry(1.2, 12, 8);
|
|
1083
|
+
const bodyMaterial = new THREE.MeshStandardMaterial({
|
|
1084
|
+
color: 0x8B0000, // Dark red
|
|
1085
|
+
metalness: 0.7,
|
|
1086
|
+
roughness: 0.3
|
|
1087
|
+
});
|
|
1088
|
+
const body = new ENGINE.MeshComponent({
|
|
1089
|
+
geometry: bodyGeometry,
|
|
1090
|
+
material: bodyMaterial,
|
|
1091
|
+
position: new THREE.Vector3(0, 0, 0)
|
|
1092
|
+
});
|
|
1093
|
+
body.castShadow = true;
|
|
1094
|
+
|
|
1095
|
+
// Add glowing "eye" effect
|
|
1096
|
+
const eyeGeometry = new THREE.SphereGeometry(0.3, 8, 6);
|
|
1097
|
+
const eyeMaterial = new THREE.MeshStandardMaterial({
|
|
1098
|
+
color: 0xFF0000,
|
|
1099
|
+
emissive: 0xFF0000,
|
|
1100
|
+
emissiveIntensity: 0.5
|
|
1101
|
+
});
|
|
1102
|
+
const eye = new ENGINE.MeshComponent({
|
|
1103
|
+
geometry: eyeGeometry,
|
|
1104
|
+
material: eyeMaterial,
|
|
1105
|
+
position: new THREE.Vector3(0, 0, -1)
|
|
1106
|
+
});
|
|
1107
|
+
|
|
1108
|
+
// Add floating propellers/rotors
|
|
1109
|
+
const rotorGeometry = new THREE.CylinderGeometry(0.1, 0.1, 2, 8);
|
|
1110
|
+
const rotorMaterial = new THREE.MeshStandardMaterial({ color: 0x444444 });
|
|
1111
|
+
|
|
1112
|
+
const rotor1 = new ENGINE.MeshComponent({
|
|
1113
|
+
geometry: rotorGeometry,
|
|
1114
|
+
material: rotorMaterial,
|
|
1115
|
+
position: new THREE.Vector3(-1.5, 0.5, 0),
|
|
1116
|
+
rotation: new THREE.Euler(0, 0, Math.PI/2)
|
|
1117
|
+
});
|
|
1118
|
+
|
|
1119
|
+
const rotor2 = new ENGINE.MeshComponent({
|
|
1120
|
+
geometry: rotorGeometry,
|
|
1121
|
+
material: rotorMaterial,
|
|
1122
|
+
position: new THREE.Vector3(1.5, 0.5, 0),
|
|
1123
|
+
rotation: new THREE.Euler(0, 0, Math.PI/2)
|
|
1124
|
+
});
|
|
1125
|
+
|
|
1126
|
+
// Add components to the aerial NPC
|
|
1127
|
+
this.aerialNpc.rootComponent.add(body);
|
|
1128
|
+
body.add(eye);
|
|
1129
|
+
body.add(rotor1);
|
|
1130
|
+
body.add(rotor2);
|
|
1131
|
+
|
|
1132
|
+
// Add character stats for combat
|
|
1133
|
+
const aerialStats = new ENGINE.CharacterStatsComponent({
|
|
1134
|
+
maxHealth: 60,
|
|
1135
|
+
attackRange: 45.0,
|
|
1136
|
+
attackDamage: 20,
|
|
1137
|
+
attackCooldown: 0.8
|
|
1138
|
+
});
|
|
1139
|
+
this.aerialNpc.rootComponent.add(aerialStats);
|
|
1140
|
+
|
|
1141
|
+
// Add projectile weapon for aerial attacks (damage disabled for demo)
|
|
1142
|
+
const aerialWeapon = new ENGINE.ProjectileWeaponComponent({
|
|
1143
|
+
position: new THREE.Vector3(0, -0.5, -2.5), // Further in front to avoid self-collision
|
|
1144
|
+
fireInterval: aerialStats.getAttackCooldown(),
|
|
1145
|
+
isSingleFire: false,
|
|
1146
|
+
projectileOptions: {
|
|
1147
|
+
velocity: 80, // Faster projectiles
|
|
1148
|
+
range: aerialStats.getAttackRange(),
|
|
1149
|
+
damageDealt: 0, // Disabled damage for demo
|
|
1150
|
+
useOverlapCheck: true, // Use overlap for reliable damage detection
|
|
1151
|
+
destroyOnHit: true,
|
|
1152
|
+
geometry: new THREE.SphereGeometry(0.5), // Larger projectiles for better hit detection
|
|
1153
|
+
material: new THREE.MeshStandardMaterial({ color: ENGINE.Color.RED })
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
this.aerialNpc.rootComponent.add(aerialWeapon);
|
|
1157
|
+
|
|
1158
|
+
// Create behavior tree component with programmatically created aerial tree
|
|
1159
|
+
const behaviorTreeComponent = new ENGINE.BehaviorTreeComponent({
|
|
1160
|
+
rootNode: this.createAerialBehaviorTree(),
|
|
1161
|
+
updateInterval: 0.1,
|
|
1162
|
+
autoStart: true
|
|
1163
|
+
});
|
|
1164
|
+
|
|
1165
|
+
this.aerialNpc.rootComponent.add(behaviorTreeComponent);
|
|
1166
|
+
this.world.addActors(this.aerialNpc);
|
|
1167
|
+
|
|
1168
|
+
// Create health bar for this NPC
|
|
1169
|
+
const healthBar = this.createEnemyHealthBar(this.aerialNpc);
|
|
1170
|
+
this.enemyHealthBars.set(this.aerialNpc, healthBar);
|
|
1171
|
+
|
|
1172
|
+
// Set up blackboard values for aerial NPC
|
|
1173
|
+
const blackboard = behaviorTreeComponent.getBlackboard();
|
|
1174
|
+
if (this.playerPawn) {
|
|
1175
|
+
// Set player reference (required by all targeting actions/conditions)
|
|
1176
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// Create debug visualization for aerial NPC
|
|
1180
|
+
this.createNPCDebugVisualization(this.aerialNpc, 'Aerial', 0x8B0000); // Dark red color to indicate aerial threat
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
private async createAerialPatrolNPC(): Promise<void> {
|
|
1184
|
+
// Create aerial patrol enemy using basic Pawn with aerial movement
|
|
1185
|
+
this.aerialPatrolNpc = new ENGINE.Pawn({
|
|
1186
|
+
position: new THREE.Vector3(15, 20, 0), // Start high in the air on the side
|
|
1187
|
+
movementComponent: new ENGINE.AerialMovementComponent({
|
|
1188
|
+
maxSpeed: 12,
|
|
1189
|
+
accelerationLambda: 2,
|
|
1190
|
+
decelerationLambda: 1.5,
|
|
1191
|
+
hoverHeight: 25,
|
|
1192
|
+
hoverVariation: 3,
|
|
1193
|
+
rotationSpeed: 1.5,
|
|
1194
|
+
maxTiltAngle: 10
|
|
1195
|
+
}),
|
|
1196
|
+
camera: null, // NPCs don't need cameras
|
|
1197
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
1198
|
+
geometry: ENGINE.GameBuilder.createDefaultPawnCapsuleGeometry(),
|
|
1199
|
+
material: new THREE.MeshStandardMaterial({ color: 0x00ff00, visible: false, transparent: true, opacity: 0.5 }), // Invisible collision capsule
|
|
1200
|
+
physicsOptions: {
|
|
1201
|
+
enabled: true,
|
|
1202
|
+
motionType: ENGINE.PhysicsMotionType.KinematicVelocityBased,
|
|
1203
|
+
collisionProfile: ENGINE.DefaultCollisionProfile.Character,
|
|
1204
|
+
}
|
|
1205
|
+
})
|
|
1206
|
+
});
|
|
1207
|
+
|
|
1208
|
+
// Create visual representation - a different style of drone
|
|
1209
|
+
const bodyGeometry = new THREE.BoxGeometry(2, 1, 3); // More rectangular body
|
|
1210
|
+
const bodyMaterial = new THREE.MeshStandardMaterial({
|
|
1211
|
+
color: 0x4169E1, // Royal blue
|
|
1212
|
+
metalness: 0.6,
|
|
1213
|
+
roughness: 0.4
|
|
1214
|
+
});
|
|
1215
|
+
const body = new ENGINE.MeshComponent({
|
|
1216
|
+
geometry: bodyGeometry,
|
|
1217
|
+
material: bodyMaterial,
|
|
1218
|
+
position: new THREE.Vector3(0, 0, 0)
|
|
1219
|
+
});
|
|
1220
|
+
body.castShadow = true;
|
|
1221
|
+
|
|
1222
|
+
// Add glowing navigation lights
|
|
1223
|
+
const leftLightGeometry = new THREE.SphereGeometry(0.2, 8, 6);
|
|
1224
|
+
const leftLightMaterial = new THREE.MeshStandardMaterial({
|
|
1225
|
+
color: 0x00FF00,
|
|
1226
|
+
emissive: 0x00FF00,
|
|
1227
|
+
emissiveIntensity: 0.8
|
|
1228
|
+
});
|
|
1229
|
+
const leftLight = new ENGINE.MeshComponent({
|
|
1230
|
+
geometry: leftLightGeometry,
|
|
1231
|
+
material: leftLightMaterial,
|
|
1232
|
+
position: new THREE.Vector3(-1.2, 0, -0.5)
|
|
1233
|
+
});
|
|
1234
|
+
|
|
1235
|
+
const rightLightGeometry = new THREE.SphereGeometry(0.2, 8, 6);
|
|
1236
|
+
const rightLightMaterial = new THREE.MeshStandardMaterial({
|
|
1237
|
+
color: 0xFF0000,
|
|
1238
|
+
emissive: 0xFF0000,
|
|
1239
|
+
emissiveIntensity: 0.8
|
|
1240
|
+
});
|
|
1241
|
+
const rightLight = new ENGINE.MeshComponent({
|
|
1242
|
+
geometry: rightLightGeometry,
|
|
1243
|
+
material: rightLightMaterial,
|
|
1244
|
+
position: new THREE.Vector3(1.2, 0, -0.5)
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1247
|
+
// Add simple propellers
|
|
1248
|
+
const propGeometry = new THREE.CylinderGeometry(0.05, 0.05, 1.5, 6);
|
|
1249
|
+
const propMaterial = new THREE.MeshStandardMaterial({ color: 0x333333 });
|
|
1250
|
+
|
|
1251
|
+
const prop1 = new ENGINE.MeshComponent({
|
|
1252
|
+
geometry: propGeometry,
|
|
1253
|
+
material: propMaterial,
|
|
1254
|
+
position: new THREE.Vector3(-1, 0.8, 0.5),
|
|
1255
|
+
rotation: new THREE.Euler(0, 0, Math.PI/2)
|
|
1256
|
+
});
|
|
1257
|
+
|
|
1258
|
+
const prop2 = new ENGINE.MeshComponent({
|
|
1259
|
+
geometry: propGeometry,
|
|
1260
|
+
material: propMaterial,
|
|
1261
|
+
position: new THREE.Vector3(1, 0.8, 0.5),
|
|
1262
|
+
rotation: new THREE.Euler(0, 0, Math.PI/2)
|
|
1263
|
+
});
|
|
1264
|
+
|
|
1265
|
+
// Add components to the aerial patrol NPC
|
|
1266
|
+
this.aerialPatrolNpc.rootComponent.add(body);
|
|
1267
|
+
body.add(leftLight);
|
|
1268
|
+
body.add(rightLight);
|
|
1269
|
+
body.add(prop1);
|
|
1270
|
+
body.add(prop2);
|
|
1271
|
+
|
|
1272
|
+
// Add character stats (optional - this one doesn't need combat)
|
|
1273
|
+
const aerialPatrolStats = new ENGINE.CharacterStatsComponent({
|
|
1274
|
+
maxHealth: 40,
|
|
1275
|
+
attackRange: 0, // No weapons for patrol drone
|
|
1276
|
+
attackDamage: 0,
|
|
1277
|
+
attackCooldown: 0
|
|
1278
|
+
});
|
|
1279
|
+
this.aerialPatrolNpc.rootComponent.add(aerialPatrolStats);
|
|
1280
|
+
|
|
1281
|
+
// Create behavior tree component with programmatically created aerial patrol tree
|
|
1282
|
+
const behaviorTreeComponent = new ENGINE.BehaviorTreeComponent({
|
|
1283
|
+
rootNode: this.createAerialPatrolBehaviorTree(),
|
|
1284
|
+
updateInterval: 0.2,
|
|
1285
|
+
autoStart: true
|
|
1286
|
+
});
|
|
1287
|
+
|
|
1288
|
+
this.aerialPatrolNpc.rootComponent.add(behaviorTreeComponent);
|
|
1289
|
+
this.world.addActors(this.aerialPatrolNpc);
|
|
1290
|
+
|
|
1291
|
+
// Create health bar for this NPC
|
|
1292
|
+
const healthBar = this.createEnemyHealthBar(this.aerialPatrolNpc);
|
|
1293
|
+
this.enemyHealthBars.set(this.aerialPatrolNpc, healthBar);
|
|
1294
|
+
|
|
1295
|
+
// Set up blackboard values for aerial patrol NPC
|
|
1296
|
+
const blackboard = behaviorTreeComponent.getBlackboard();
|
|
1297
|
+
// Note: We don't set PlayerActor for this patrol drone as it should ignore the player
|
|
1298
|
+
|
|
1299
|
+
// Set aerial patrol waypoints - create a circular patrol pattern in the sky (adjusted for scene)
|
|
1300
|
+
const aerialWaypoints = [
|
|
1301
|
+
new THREE.Vector3(15, 20, 0), // Start position
|
|
1302
|
+
new THREE.Vector3(15, 20, 15), // Forward
|
|
1303
|
+
new THREE.Vector3(0, 20, 15), // Left
|
|
1304
|
+
new THREE.Vector3(-15, 20, 15), // Back-left
|
|
1305
|
+
new THREE.Vector3(-15, 20, 0), // Back
|
|
1306
|
+
new THREE.Vector3(-15, 20, -15), // Back-right
|
|
1307
|
+
new THREE.Vector3(0, 20, -15), // Right
|
|
1308
|
+
new THREE.Vector3(15, 20, -15) // Forward-right
|
|
1309
|
+
];
|
|
1310
|
+
|
|
1311
|
+
blackboard.setValue('AerialPatrolWaypoints', aerialWaypoints);
|
|
1312
|
+
blackboard.setValue('CurrentAerialWaypointIndex', 0);
|
|
1313
|
+
|
|
1314
|
+
// Create debug visualization for aerial patrol NPC
|
|
1315
|
+
this.createNPCDebugVisualization(this.aerialPatrolNpc, 'Patrol', 0x4169E1); // Royal blue color to indicate patrol behavior
|
|
1316
|
+
this.createAerialWaypointVisualization(aerialWaypoints);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
// Debug visualization methods
|
|
1320
|
+
private createNPCDebugVisualization(npc: ENGINE.Pawn, name: string, color: number): void {
|
|
1321
|
+
// Create a colored ring above the NPC to indicate its role
|
|
1322
|
+
const geometry = new THREE.RingGeometry(0.8, 1.2, 16);
|
|
1323
|
+
const material = new THREE.MeshBasicMaterial({
|
|
1324
|
+
color,
|
|
1325
|
+
transparent: true,
|
|
1326
|
+
opacity: 0.8,
|
|
1327
|
+
side: THREE.DoubleSide
|
|
1328
|
+
});
|
|
1329
|
+
const ring = new THREE.Mesh(geometry, material);
|
|
1330
|
+
ring.position.set(0, 4, 0);
|
|
1331
|
+
ring.rotation.x = -Math.PI / 2; // Make it horizontal
|
|
1332
|
+
|
|
1333
|
+
// Store reference to the ring for color updates
|
|
1334
|
+
ring.userData = { isDebugRing: true };
|
|
1335
|
+
|
|
1336
|
+
// Add to NPC's root component
|
|
1337
|
+
const rootComponent = npc.rootComponent;
|
|
1338
|
+
if (rootComponent) {
|
|
1339
|
+
rootComponent.add(ring);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
private updateNPCDebugColor(npc: ENGINE.Pawn, color: number): void {
|
|
1344
|
+
const rootComponent = npc.rootComponent;
|
|
1345
|
+
if (!rootComponent) return;
|
|
1346
|
+
|
|
1347
|
+
// Find the debug ring and update its color
|
|
1348
|
+
rootComponent.traverse((child) => {
|
|
1349
|
+
if (child instanceof THREE.Mesh && child.userData?.isDebugRing) {
|
|
1350
|
+
const material = child.material as THREE.MeshBasicMaterial;
|
|
1351
|
+
material.color.setHex(color);
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
private createWaypointVisualization(): void {
|
|
1357
|
+
// Create waypoint markers for patrol path (matching updated waypoints)
|
|
1358
|
+
const patrolWaypoints = [
|
|
1359
|
+
new THREE.Vector3(-8, 4, 2), // Near Aviator SKM actor
|
|
1360
|
+
new THREE.Vector3(-6, 4, -2), // Between Aviator and center
|
|
1361
|
+
new THREE.Vector3(2, 1, -3), // Near Adventurer SKM actor
|
|
1362
|
+
new THREE.Vector3(0, 1, -6), // South of Adventurer SKM actor
|
|
1363
|
+
new THREE.Vector3(8, 4, -8), // Near Shaman SKM actor
|
|
1364
|
+
new THREE.Vector3(12, 4, -7), // East of Shaman SKM actor
|
|
1365
|
+
new THREE.Vector3(6, 2, -2), // Central area
|
|
1366
|
+
new THREE.Vector3(-4, 3, 1), // Back toward Aviator area
|
|
1367
|
+
];
|
|
1368
|
+
|
|
1369
|
+
patrolWaypoints.forEach((waypoint, index) => {
|
|
1370
|
+
const geometry = new THREE.CylinderGeometry(0.5, 0.5, 2, 8);
|
|
1371
|
+
const material = new THREE.MeshBasicMaterial({
|
|
1372
|
+
color: 0x00ffff,
|
|
1373
|
+
transparent: true,
|
|
1374
|
+
opacity: 0.6
|
|
1375
|
+
});
|
|
1376
|
+
const marker = new THREE.Mesh(geometry, material);
|
|
1377
|
+
marker.position.copy(waypoint);
|
|
1378
|
+
marker.position.y += 1; // Raise above ground
|
|
1379
|
+
|
|
1380
|
+
this.waypointMarkers.push(marker);
|
|
1381
|
+
this.debugContainer.add(marker);
|
|
1382
|
+
|
|
1383
|
+
// Add waypoint number text
|
|
1384
|
+
const canvas = document.createElement('canvas');
|
|
1385
|
+
const context = canvas.getContext('2d')!;
|
|
1386
|
+
canvas.width = 64;
|
|
1387
|
+
canvas.height = 64;
|
|
1388
|
+
context.fillStyle = 'white';
|
|
1389
|
+
context.font = '32px Arial';
|
|
1390
|
+
context.textAlign = 'center';
|
|
1391
|
+
context.fillText((index + 1).toString(), 32, 40);
|
|
1392
|
+
|
|
1393
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
1394
|
+
const spriteMaterial = new THREE.SpriteMaterial({ map: texture });
|
|
1395
|
+
const sprite = new THREE.Sprite(spriteMaterial);
|
|
1396
|
+
sprite.position.copy(waypoint);
|
|
1397
|
+
sprite.position.y += 2.5;
|
|
1398
|
+
sprite.scale.set(1, 1, 1);
|
|
1399
|
+
|
|
1400
|
+
this.debugContainer.add(sprite);
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
// Behavior Tree Creation Methods
|
|
1405
|
+
private createPatrolBehaviorTree(): ENGINE.BehaviorNode {
|
|
1406
|
+
// Create the root selector node
|
|
1407
|
+
const rootSelector = new ENGINE.SelectorNode({
|
|
1408
|
+
name: 'Patrol Behavior'
|
|
1409
|
+
});
|
|
1410
|
+
|
|
1411
|
+
// 1. Melee Attack Player sequence - when very close
|
|
1412
|
+
const meleeSequence = new ENGINE.SequenceNode({
|
|
1413
|
+
name: 'Melee Attack Player',
|
|
1414
|
+
conditions: [
|
|
1415
|
+
new ENGINE.IsPlayerNearCondition({ range: 5.0 }), // Close range for melee
|
|
1416
|
+
new ENGINE.TargetInConeCondition({
|
|
1417
|
+
targetActorKey: 'PlayerActor',
|
|
1418
|
+
coneAngle: 90.0, // Wider cone for melee
|
|
1419
|
+
maxDistance: 5.0
|
|
1420
|
+
})
|
|
1421
|
+
]
|
|
1422
|
+
});
|
|
1423
|
+
meleeSequence.addChildren([
|
|
1424
|
+
new ENGINE.LookAtTargetAction({ targetActorKey: 'PlayerActor', speed: 5.0 }),
|
|
1425
|
+
new ENGINE.MeleeAttackAction({
|
|
1426
|
+
targetActorKey: 'PlayerActor',
|
|
1427
|
+
attackRange: 4.0,
|
|
1428
|
+
damage: 25,
|
|
1429
|
+
attackCooldown: 1.2,
|
|
1430
|
+
attackDuration: 0.8
|
|
1431
|
+
})
|
|
1432
|
+
]);
|
|
1433
|
+
|
|
1434
|
+
// 2. Chase Player sequence - get close for melee
|
|
1435
|
+
const chaseSequence = new ENGINE.SequenceNode({
|
|
1436
|
+
name: 'Chase Player',
|
|
1437
|
+
conditions: [
|
|
1438
|
+
new ENGINE.IsPlayerNearCondition({ range: 20.0 }) // Larger detection range
|
|
1439
|
+
]
|
|
1440
|
+
});
|
|
1441
|
+
chaseSequence.addChildren([
|
|
1442
|
+
new ENGINE.FollowActorAction({
|
|
1443
|
+
targetActorKey: 'PlayerActor',
|
|
1444
|
+
stopDistance: 2.0, // Get very close for melee
|
|
1445
|
+
followDistance: 3.0,
|
|
1446
|
+
continueAfterReached: false // Allow sequence to complete
|
|
1447
|
+
})
|
|
1448
|
+
]);
|
|
1449
|
+
|
|
1450
|
+
// 4. Normal Patrol sequence
|
|
1451
|
+
const patrolSequence = new ENGINE.SequenceNode({
|
|
1452
|
+
name: 'Normal Patrol'
|
|
1453
|
+
});
|
|
1454
|
+
patrolSequence.addChildren([
|
|
1455
|
+
new ENGINE.SetNextWaypointAction({ waypointsKey: 'patrolWaypoints' }),
|
|
1456
|
+
new ENGINE.MoveToPositionAction({
|
|
1457
|
+
targetPositionKey: 'CurrentWaypoint',
|
|
1458
|
+
acceptanceRadius: 2.0,
|
|
1459
|
+
conditions: [
|
|
1460
|
+
new ENGINE.IsPlayerNearCondition({ range: 30.0, invert: true }) // Don't patrol when player is near
|
|
1461
|
+
]
|
|
1462
|
+
}),
|
|
1463
|
+
new ENGINE.WaitAction({ duration: 1.0, randomDuration: true })
|
|
1464
|
+
]);
|
|
1465
|
+
|
|
1466
|
+
// Add all sequences to root selector
|
|
1467
|
+
rootSelector.addChildren([
|
|
1468
|
+
meleeSequence,
|
|
1469
|
+
chaseSequence,
|
|
1470
|
+
patrolSequence
|
|
1471
|
+
]);
|
|
1472
|
+
|
|
1473
|
+
return rootSelector;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
private createCombatBehaviorTree(): ENGINE.BehaviorNode {
|
|
1477
|
+
// Create the root selector node
|
|
1478
|
+
const rootSelector = new ENGINE.SelectorNode({
|
|
1479
|
+
name: 'Combat Behavior'
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
// 1. Low Health Flee sequence - only flee when health is critically low
|
|
1483
|
+
const fleeSequence = new ENGINE.SequenceNode({
|
|
1484
|
+
name: 'Low Health Flee',
|
|
1485
|
+
conditions: [
|
|
1486
|
+
new ENGINE.HpAbovePercentCondition({
|
|
1487
|
+
percentage: 25.0, // Very low health threshold
|
|
1488
|
+
checkOwner: true,
|
|
1489
|
+
invert: true
|
|
1490
|
+
}),
|
|
1491
|
+
new ENGINE.IsPlayerNearCondition({ range: 50.0 }) // Only flee if player is nearby
|
|
1492
|
+
]
|
|
1493
|
+
});
|
|
1494
|
+
fleeSequence.addChild(new ENGINE.FleeFromTargetAction({
|
|
1495
|
+
targetActorKey: 'PlayerActor',
|
|
1496
|
+
fleeDistance: 30.0,
|
|
1497
|
+
maxFleeDistance: 50.0,
|
|
1498
|
+
fleeSpeedMultiplier: 1.5
|
|
1499
|
+
}));
|
|
1500
|
+
|
|
1501
|
+
// 2. Ranged Attack sequence - attack when player is in sight and in range
|
|
1502
|
+
const attackSequence = new ENGINE.SequenceNode({
|
|
1503
|
+
name: 'Ranged Attack',
|
|
1504
|
+
conditions: [
|
|
1505
|
+
new ENGINE.HpAbovePercentCondition({
|
|
1506
|
+
percentage: 25.0, // Only attack if not critically injured
|
|
1507
|
+
checkOwner: true
|
|
1508
|
+
}),
|
|
1509
|
+
new ENGINE.IsPlayerNearCondition({ range: 30.0 }), // Close enough to attack
|
|
1510
|
+
new ENGINE.CanSeeTargetCondition({
|
|
1511
|
+
targetActorKey: 'PlayerActor',
|
|
1512
|
+
maxDistance: 30.0,
|
|
1513
|
+
eyeHeightOffset: 1.7,
|
|
1514
|
+
targetHeightOffset: 1.7
|
|
1515
|
+
})
|
|
1516
|
+
]
|
|
1517
|
+
});
|
|
1518
|
+
|
|
1519
|
+
attackSequence.addChildren([
|
|
1520
|
+
new ENGINE.LookAtTargetAction({
|
|
1521
|
+
targetActorKey: 'PlayerActor',
|
|
1522
|
+
speed: 3.0,
|
|
1523
|
+
angleThreshold: Math.PI / 12, // Tighter aim for better accuracy
|
|
1524
|
+
rotationSpeed: 3.0
|
|
1525
|
+
}),
|
|
1526
|
+
new ENGINE.ShootAction({
|
|
1527
|
+
targetActorKey: 'PlayerActor',
|
|
1528
|
+
shootRange: 30.0,
|
|
1529
|
+
aimDuration: 0.3
|
|
1530
|
+
}),
|
|
1531
|
+
new ENGINE.WaitAction({
|
|
1532
|
+
duration: 0.2 // Brief cooldown after shooting
|
|
1533
|
+
})
|
|
1534
|
+
]);
|
|
1535
|
+
|
|
1536
|
+
// 3. Approach Player sequence - move to get into shooting range
|
|
1537
|
+
const approachSequence = new ENGINE.SequenceNode({
|
|
1538
|
+
name: 'Approach Player',
|
|
1539
|
+
conditions: [
|
|
1540
|
+
new ENGINE.HpAbovePercentCondition({
|
|
1541
|
+
percentage: 25.0, // Only approach if not critically injured
|
|
1542
|
+
checkOwner: true
|
|
1543
|
+
}),
|
|
1544
|
+
new ENGINE.IsPlayerNearCondition({ range: 60.0 }) // Detect player from farther away
|
|
1545
|
+
]
|
|
1546
|
+
});
|
|
1547
|
+
approachSequence.addChildren([
|
|
1548
|
+
new ENGINE.CalculateTacticalPositionAction({
|
|
1549
|
+
targetActorKey: 'PlayerActor',
|
|
1550
|
+
outputPositionKey: 'CombatPosition',
|
|
1551
|
+
distance: 25.0, // Shooting range
|
|
1552
|
+
useNavigation: true
|
|
1553
|
+
}),
|
|
1554
|
+
new ENGINE.MoveToPositionAction({
|
|
1555
|
+
targetPositionKey: 'CombatPosition',
|
|
1556
|
+
acceptanceRadius: 3.0,
|
|
1557
|
+
useNavigation: true
|
|
1558
|
+
})
|
|
1559
|
+
]);
|
|
1560
|
+
|
|
1561
|
+
// 4. Idle/Patrol behavior when player is not detected
|
|
1562
|
+
const idleSequence = new ENGINE.SequenceNode({
|
|
1563
|
+
name: 'Idle Behavior'
|
|
1564
|
+
});
|
|
1565
|
+
idleSequence.addChild(new ENGINE.WaitAction({
|
|
1566
|
+
duration: 2.0,
|
|
1567
|
+
randomDuration: true
|
|
1568
|
+
}));
|
|
1569
|
+
|
|
1570
|
+
// Add all sequences to root selector (order matters - higher priority first)
|
|
1571
|
+
rootSelector.addChildren([
|
|
1572
|
+
fleeSequence, // Highest priority - flee when critically low health
|
|
1573
|
+
attackSequence, // Attack when can see player and in range
|
|
1574
|
+
approachSequence, // Move to get into shooting range
|
|
1575
|
+
idleSequence // Default behavior
|
|
1576
|
+
]);
|
|
1577
|
+
|
|
1578
|
+
return rootSelector;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
private createAerialBehaviorTree(): ENGINE.BehaviorNode {
|
|
1582
|
+
// Create the root selector node
|
|
1583
|
+
const rootSelector = new ENGINE.SelectorNode({
|
|
1584
|
+
name: 'Aerial Hunter Behavior'
|
|
1585
|
+
});
|
|
1586
|
+
|
|
1587
|
+
// 1. Attack Player sequence
|
|
1588
|
+
const attackSequence = new ENGINE.SequenceNode({
|
|
1589
|
+
name: 'Attack Player',
|
|
1590
|
+
conditions: [
|
|
1591
|
+
new ENGINE.IsPlayerNearCondition({ range: 80.0 }),
|
|
1592
|
+
new ENGINE.CanSeeTargetCondition({
|
|
1593
|
+
targetActorKey: 'PlayerActor',
|
|
1594
|
+
maxDistance: 80.0,
|
|
1595
|
+
eyeHeightOffset: 0.0,
|
|
1596
|
+
targetHeightOffset: 1.7
|
|
1597
|
+
})
|
|
1598
|
+
]
|
|
1599
|
+
});
|
|
1600
|
+
attackSequence.addChildren([
|
|
1601
|
+
new ENGINE.AerialTrackTargetAction({
|
|
1602
|
+
targetActorKey: 'PlayerActor',
|
|
1603
|
+
lastKnownPositionKey: 'LastKnownPlayerPosition',
|
|
1604
|
+
updateInterval: 0.3
|
|
1605
|
+
}),
|
|
1606
|
+
new ENGINE.AerialMoveToTargetAction({
|
|
1607
|
+
targetActorKey: 'PlayerActor',
|
|
1608
|
+
acceptanceRadius: 25.0,
|
|
1609
|
+
hoverAboveTarget: true,
|
|
1610
|
+
hoverHeightOffset: 15.0
|
|
1611
|
+
}),
|
|
1612
|
+
new ENGINE.ShootAction({
|
|
1613
|
+
targetActorKey: 'PlayerActor',
|
|
1614
|
+
shootRange: 70.0,
|
|
1615
|
+
aimDuration: 0.6
|
|
1616
|
+
})
|
|
1617
|
+
]);
|
|
1618
|
+
|
|
1619
|
+
// 2. Search for Player sequence
|
|
1620
|
+
const searchSequence = new ENGINE.SequenceNode({
|
|
1621
|
+
name: 'Search for Player',
|
|
1622
|
+
conditions: [
|
|
1623
|
+
new ENGINE.IsPlayerNearCondition({ range: 80.0 }),
|
|
1624
|
+
new ENGINE.CanSeeTargetCondition({
|
|
1625
|
+
targetActorKey: 'PlayerActor',
|
|
1626
|
+
maxDistance: 80.0,
|
|
1627
|
+
eyeHeightOffset: 0.0,
|
|
1628
|
+
targetHeightOffset: 1.7,
|
|
1629
|
+
invert: true
|
|
1630
|
+
}),
|
|
1631
|
+
new ENGINE.HasLastKnownPositionCondition({
|
|
1632
|
+
lastKnownPositionKey: 'LastKnownPlayerPosition',
|
|
1633
|
+
maxAge: 15.0
|
|
1634
|
+
})
|
|
1635
|
+
]
|
|
1636
|
+
});
|
|
1637
|
+
searchSequence.addChild(new ENGINE.AerialSearchAction({
|
|
1638
|
+
playerActorKey: 'PlayerActor',
|
|
1639
|
+
lastKnownPositionKey: 'LastKnownPlayerPosition',
|
|
1640
|
+
searchRadius: 20.0,
|
|
1641
|
+
searchHeight: 20.0,
|
|
1642
|
+
searchDuration: 8.0
|
|
1643
|
+
}));
|
|
1644
|
+
|
|
1645
|
+
// 3. Random Patrol sequence
|
|
1646
|
+
const wanderSequence = new ENGINE.SequenceNode({
|
|
1647
|
+
name: 'Random Patrol'
|
|
1648
|
+
});
|
|
1649
|
+
wanderSequence.addChild(new ENGINE.AerialWanderAction({
|
|
1650
|
+
wanderRadius: 35.0, // Larger wander area
|
|
1651
|
+
wanderHeight: 20.0,
|
|
1652
|
+
heightVariation: 8.0, // More height variation
|
|
1653
|
+
waitTime: 1.0, // Shorter wait time for more active movement
|
|
1654
|
+
speedMultiplier: 0.8 // Faster movement
|
|
1655
|
+
}));
|
|
1656
|
+
|
|
1657
|
+
// Add all sequences to root selector
|
|
1658
|
+
rootSelector.addChildren([
|
|
1659
|
+
attackSequence,
|
|
1660
|
+
searchSequence,
|
|
1661
|
+
wanderSequence
|
|
1662
|
+
]);
|
|
1663
|
+
|
|
1664
|
+
return rootSelector;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
private createAerialPatrolBehaviorTree(): ENGINE.BehaviorNode {
|
|
1668
|
+
// Create a simple patrol behavior that cycles between waypoints
|
|
1669
|
+
const patrolSequence = new ENGINE.SequenceNode({
|
|
1670
|
+
name: 'Aerial Patrol'
|
|
1671
|
+
});
|
|
1672
|
+
|
|
1673
|
+
patrolSequence.addChildren([
|
|
1674
|
+
new ENGINE.SetNextWaypointAction({
|
|
1675
|
+
waypointsKey: 'AerialPatrolWaypoints',
|
|
1676
|
+
indexKey: 'CurrentAerialWaypointIndex',
|
|
1677
|
+
currentWaypointKey: 'CurrentAerialWaypoint',
|
|
1678
|
+
loop: true
|
|
1679
|
+
}),
|
|
1680
|
+
new ENGINE.AerialMoveToTargetAction({
|
|
1681
|
+
targetActorKey: undefined, // Don't follow any actor
|
|
1682
|
+
targetPositionKey: 'CurrentAerialWaypoint',
|
|
1683
|
+
acceptanceRadius: 3.0,
|
|
1684
|
+
hoverAboveTarget: false // Move directly to waypoint positions
|
|
1685
|
+
}),
|
|
1686
|
+
new ENGINE.WaitAction({
|
|
1687
|
+
duration: 2.0,
|
|
1688
|
+
randomDuration: true
|
|
1689
|
+
}) // Wait at each waypoint
|
|
1690
|
+
]);
|
|
1691
|
+
|
|
1692
|
+
return patrolSequence;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
private toggleNPCPathDebugVisualization(): void {
|
|
1696
|
+
// Toggle debug visualization for all NPCs with movement components
|
|
1697
|
+
const npcs = [this.patrolNpc, this.combatNpc];
|
|
1698
|
+
|
|
1699
|
+
npcs.forEach(npc => {
|
|
1700
|
+
if (npc) {
|
|
1701
|
+
const movementComponent = npc.getComponent(ENGINE.NpcMovementComponent);
|
|
1702
|
+
if (movementComponent) {
|
|
1703
|
+
// Get current state and toggle it
|
|
1704
|
+
const currentState = movementComponent.isDebugVisualizationEnabled();
|
|
1705
|
+
movementComponent.setDebugVisualizationEnabled(!currentState);
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
});
|
|
1709
|
+
|
|
1710
|
+
console.log('Toggled NPC path debug visualization');
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
private createAerialWaypointVisualization(waypoints: THREE.Vector3[]): void {
|
|
1714
|
+
// Create waypoint markers for aerial patrol path
|
|
1715
|
+
waypoints.forEach((waypoint, index) => {
|
|
1716
|
+
// Create a floating ring marker for aerial waypoints
|
|
1717
|
+
const geometry = new THREE.RingGeometry(1.0, 1.5, 16);
|
|
1718
|
+
const material = new THREE.MeshBasicMaterial({
|
|
1719
|
+
color: 0x4169E1, // Royal blue to match the patrol drone
|
|
1720
|
+
transparent: true,
|
|
1721
|
+
opacity: 0.7,
|
|
1722
|
+
side: THREE.DoubleSide
|
|
1723
|
+
});
|
|
1724
|
+
const marker = new THREE.Mesh(geometry, material);
|
|
1725
|
+
marker.position.copy(waypoint);
|
|
1726
|
+
marker.rotation.x = -Math.PI / 2; // Make it horizontal
|
|
1727
|
+
|
|
1728
|
+
this.debugContainer.add(marker);
|
|
1729
|
+
|
|
1730
|
+
// Add waypoint number text
|
|
1731
|
+
const canvas = document.createElement('canvas');
|
|
1732
|
+
const context = canvas.getContext('2d')!;
|
|
1733
|
+
canvas.width = 64;
|
|
1734
|
+
canvas.height = 64;
|
|
1735
|
+
context.fillStyle = 'white';
|
|
1736
|
+
context.font = '24px Arial';
|
|
1737
|
+
context.textAlign = 'center';
|
|
1738
|
+
context.fillText(`A${index + 1}`, 32, 40); // "A" for Aerial
|
|
1739
|
+
|
|
1740
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
1741
|
+
const spriteMaterial = new THREE.SpriteMaterial({ map: texture });
|
|
1742
|
+
const sprite = new THREE.Sprite(spriteMaterial);
|
|
1743
|
+
sprite.position.copy(waypoint);
|
|
1744
|
+
sprite.position.y += 2;
|
|
1745
|
+
sprite.scale.set(2, 2, 2);
|
|
1746
|
+
|
|
1747
|
+
this.debugContainer.add(sprite);
|
|
1748
|
+
|
|
1749
|
+
// Add a connecting line to the next waypoint (for visualization)
|
|
1750
|
+
if (index < waypoints.length - 1) {
|
|
1751
|
+
const nextWaypoint = waypoints[index + 1];
|
|
1752
|
+
const lineGeometry = new THREE.BufferGeometry().setFromPoints([waypoint, nextWaypoint]);
|
|
1753
|
+
const lineMaterial = new THREE.LineBasicMaterial({
|
|
1754
|
+
color: 0x4169E1,
|
|
1755
|
+
transparent: true,
|
|
1756
|
+
opacity: 0.3
|
|
1757
|
+
});
|
|
1758
|
+
const line = new THREE.Line(lineGeometry, lineMaterial);
|
|
1759
|
+
this.debugContainer.add(line);
|
|
1760
|
+
} else {
|
|
1761
|
+
// Connect last waypoint back to first for loop visualization
|
|
1762
|
+
const firstWaypoint = waypoints[0];
|
|
1763
|
+
const lineGeometry = new THREE.BufferGeometry().setFromPoints([waypoint, firstWaypoint]);
|
|
1764
|
+
const lineMaterial = new THREE.LineBasicMaterial({
|
|
1765
|
+
color: 0x4169E1,
|
|
1766
|
+
transparent: true,
|
|
1767
|
+
opacity: 0.3
|
|
1768
|
+
});
|
|
1769
|
+
const line = new THREE.Line(lineGeometry, lineMaterial);
|
|
1770
|
+
this.debugContainer.add(line);
|
|
1771
|
+
}
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
}
|