@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,1430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* World represents the entire runtime scene and all systems that operate within it.
|
|
3
|
+
*
|
|
4
|
+
* Detailed explanation:
|
|
5
|
+
* - Owns the Three.js scene graph, manages arrays of actors and coordinates their lifecycles.
|
|
6
|
+
* - Creates and controls global services including input, timers, physics, navigation and networking.
|
|
7
|
+
* - The tick method advances simulation, handles network replication and processes queued actor removals.
|
|
8
|
+
* - Supports serialization via WorldSerializer and produces debug nodes for editor tooling.
|
|
9
|
+
* - Manages camera references for rendering and exposes helpers to spawn basic shapes and geometry.
|
|
10
|
+
*
|
|
11
|
+
* Recommended usage (for humans and AI assistants):
|
|
12
|
+
* - Instantiate a World in your game loop with physics and navigation options suited to the project.
|
|
13
|
+
* - Add or remove actors using the provided methods instead of manipulating the scene directly.
|
|
14
|
+
* - Query actors with getActors or getFirstActor when implementing gameplay logic.
|
|
15
|
+
* - Avoid spawning player controllers before beginPlay since they rely on world initialization.
|
|
16
|
+
*/
|
|
17
|
+
import * as THREE from 'three';
|
|
18
|
+
|
|
19
|
+
import { Actor } from '../actors/Actor.js';
|
|
20
|
+
import { GlobalParticleManager } from '../actors/GlobalParticleManager.js';
|
|
21
|
+
import { PlayerController } from '../actors/PlayerController.js';
|
|
22
|
+
import { GLTFMeshComponent, LightComponent } from '../components/index.js';
|
|
23
|
+
import { MeshComponent } from '../components/visual/MeshComponent.js';
|
|
24
|
+
import { ENABLE_LIGHTMAPS } from '../const.js';
|
|
25
|
+
import { ManifoldWrapper } from '../csg/ManifoldWrapper.js';
|
|
26
|
+
import { NetWorld } from '../multiplayer/index.js';
|
|
27
|
+
import { createNavigationServer } from '../navigation/NavigationServer.js';
|
|
28
|
+
import { createPhysicsEngine } from '../physics/PhysicsEngine.js';
|
|
29
|
+
import { PhysicsMotionType } from '../physics/PhysicsTypes.js';
|
|
30
|
+
import { LightmapManager } from '../render/lightmapping/LightmapManager.js';
|
|
31
|
+
import { type PostProcessConfiguration, PostProcessManager } from '../render/PostProcessManager.js';
|
|
32
|
+
import { PluginManager } from '../scripting/PluginManager.js';
|
|
33
|
+
import { ClassRegistry, EngineClass } from '../systems/ClassRegistry.js';
|
|
34
|
+
import { ConsoleCommand, ConsoleManager } from '../systems/ConsoleManager.js';
|
|
35
|
+
import { ConsoleVariableHandler } from '../systems/ConsoleVariableHandler.js';
|
|
36
|
+
import { InputManager } from '../systems/InputManager.js';
|
|
37
|
+
import { ObjectNamingSystem } from '../systems/ObjectNamingSystem.js';
|
|
38
|
+
import { StatsDisplay } from '../systems/Stats.js';
|
|
39
|
+
import { TimerSystem } from '../systems/TimerSystem.js';
|
|
40
|
+
import { TweenManager } from '../systems/TweenManager.js';
|
|
41
|
+
import { WorldSerializer } from '../systems/WorldSerialization.js';
|
|
42
|
+
import { UIManager } from '../ui/UIManager.js';
|
|
43
|
+
import { GlobalAudioManager } from '../utils/GlobalAudioManager.js';
|
|
44
|
+
import { resourceManager } from '../utils/ResourceManager.js';
|
|
45
|
+
import { SceneGraphUtils } from '../utils/SceneGraphUtils.js';
|
|
46
|
+
import { property } from '../utils/serialization/decorator.js';
|
|
47
|
+
import { ISerializableObjectTag } from '../utils/serialization/serializable.js';
|
|
48
|
+
import { isNode } from '../utils/Utils.js';
|
|
49
|
+
import { ensure, shortUUID } from '../utils/Utils.js';
|
|
50
|
+
|
|
51
|
+
import { GameMode } from './GameMode.js';
|
|
52
|
+
import { Playable, PlayState } from './Playable.js';
|
|
53
|
+
|
|
54
|
+
import type { BaseGameLoop } from './GameLoop.js';
|
|
55
|
+
import type { Pawn } from '../actors/Pawn.js';
|
|
56
|
+
import type { SkyboxComponent } from '../components/index.js';
|
|
57
|
+
import type { SceneComponent } from '../components/SceneComponent.js';
|
|
58
|
+
import type { INavigationServer, NavigationOptions } from '../navigation/NavigationServer.js';
|
|
59
|
+
import type { IPhysicsEngine, PhysicsOptions } from '../physics/PhysicsEngine.js';
|
|
60
|
+
import type { AssetPath } from '../storage/storageProvider.js';
|
|
61
|
+
import type { ISerializable, SceneResources, SerializedWorld, WorldSerializationContext } from '../systems/WorldSerialization';
|
|
62
|
+
import type { Delegate } from '../utils/Delegate.js';
|
|
63
|
+
import type { ISceneGraphDebugNodeGenerator, SceneGraphDebugNode } from '../utils/SceneGraphUtils';
|
|
64
|
+
import type { Dumper, Loader } from '../utils/serialization/serializer.js';
|
|
65
|
+
|
|
66
|
+
export interface WorldOptions {
|
|
67
|
+
rendererDomElement: HTMLElement;
|
|
68
|
+
gameContainer: HTMLElement;
|
|
69
|
+
backgroundColor?: THREE.ColorRepresentation;
|
|
70
|
+
physicsOptions: PhysicsOptions
|
|
71
|
+
navigationOptions: NavigationOptions
|
|
72
|
+
useManifold?: boolean;
|
|
73
|
+
gameMode?: GameMode;
|
|
74
|
+
enableGamepad?: boolean;
|
|
75
|
+
gameId?: string;
|
|
76
|
+
gameLoop?: WeakRef<BaseGameLoop>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface WorldDescriptionOptions {
|
|
80
|
+
// actor IDs, if specified, actors not in this list will be omitted and only contain basic uuid and name info
|
|
81
|
+
specifiedActors?: string[];
|
|
82
|
+
|
|
83
|
+
// whether to include the actor's components in the description
|
|
84
|
+
includeComponentsDetails?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface RenderWindowSize {
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type GenericWorldDelegate = Delegate<[World], void>;
|
|
93
|
+
|
|
94
|
+
@EngineClass('World')
|
|
95
|
+
export class World extends Playable implements ISceneGraphDebugNodeGenerator, ISerializable {
|
|
96
|
+
readonly [ISerializableObjectTag] = true;
|
|
97
|
+
|
|
98
|
+
public readonly postProcessManager: PostProcessManager = new PostProcessManager();
|
|
99
|
+
|
|
100
|
+
public readonly uuid: string = shortUUID();
|
|
101
|
+
public readonly name: string;
|
|
102
|
+
public readonly scene: THREE.Scene;
|
|
103
|
+
public readonly inputManager: InputManager;
|
|
104
|
+
public readonly consoleManager: ConsoleManager;
|
|
105
|
+
public readonly timerSystem: TimerSystem;
|
|
106
|
+
public readonly tweenManager: TweenManager;
|
|
107
|
+
public readonly uiManager: UIManager;
|
|
108
|
+
public readonly gameMode: GameMode;
|
|
109
|
+
public readonly pluginManager: PluginManager;
|
|
110
|
+
private lastCameraWarningTime: number = 0;
|
|
111
|
+
public readonly netWorld: NetWorld;
|
|
112
|
+
public readonly audioListener: THREE.AudioListener | null;
|
|
113
|
+
public readonly globalAudioManager: GlobalAudioManager;
|
|
114
|
+
public readonly globalParticleManager: GlobalParticleManager;
|
|
115
|
+
public editorData: Record<string, any> = {};
|
|
116
|
+
public isEditorWorld: boolean = false;
|
|
117
|
+
public sceneResources: SceneResources | null = null;
|
|
118
|
+
public postProcessConfiguration: PostProcessConfiguration | null = null;
|
|
119
|
+
|
|
120
|
+
private actors: Actor[] = [];
|
|
121
|
+
private playerControllers: PlayerController[] = [];
|
|
122
|
+
private physicsEngine: IPhysicsEngine | null = null;
|
|
123
|
+
private navigationServer: INavigationServer | null = null;
|
|
124
|
+
private manifold: ManifoldWrapper | null = null;
|
|
125
|
+
private lightmapManager: LightmapManager | null = null;
|
|
126
|
+
private navigationMeshVisualization: THREE.Group | null = null;
|
|
127
|
+
|
|
128
|
+
// if valid for physics engine to be null if the user doesn't want it, so use a separate flag to track
|
|
129
|
+
private navigationServerCreated: boolean = false;
|
|
130
|
+
private physicsEngineCreated: boolean = false;
|
|
131
|
+
private manifoldCreated: boolean = false;
|
|
132
|
+
private lightmapManagerCreated: boolean = false;
|
|
133
|
+
private isTicking: boolean = false;
|
|
134
|
+
private actorsToRemove: Actor[] = [];
|
|
135
|
+
private hiddenInGameActors: Set<Actor> = new Set();
|
|
136
|
+
private hiddenInGameSceneComponents: Set<SceneComponent> = new Set();
|
|
137
|
+
private isPaused: boolean = false;
|
|
138
|
+
private slomo: number = 1;
|
|
139
|
+
private gameTime: number = 0;
|
|
140
|
+
private overrideCamera: THREE.Camera | null = null;
|
|
141
|
+
// the camera actor that is used for rendering the world
|
|
142
|
+
private skyboxComponent: SkyboxComponent | null = null;
|
|
143
|
+
private renderWindowSize: RenderWindowSize | null = null;
|
|
144
|
+
private nextTickFunctions: (() => void)[] = [];
|
|
145
|
+
private statsDisplay: StatsDisplay;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The camera used for rendering the world
|
|
149
|
+
*/
|
|
150
|
+
public camera: THREE.Camera | null = null;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A fallback camera used when no active camera is available
|
|
154
|
+
*/
|
|
155
|
+
private fallbackCamera: THREE.PerspectiveCamera;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Creates a new World instance
|
|
159
|
+
* @param options - Configuration options for the world including:
|
|
160
|
+
* - rendererDomElement: HTML element to attach the renderer to
|
|
161
|
+
* - backgroundColor: Optional background color for the scene
|
|
162
|
+
* - physicsOptions: Configuration for the physics engine
|
|
163
|
+
*/
|
|
164
|
+
constructor(readonly options: WorldOptions) {
|
|
165
|
+
super();
|
|
166
|
+
this.netWorld = new NetWorld(this, options.gameId ?? 'default');
|
|
167
|
+
this.name = ObjectNamingSystem.generateName(this);
|
|
168
|
+
this.scene = new THREE.Scene();
|
|
169
|
+
this.scene.setWorld(this);
|
|
170
|
+
this.scene.background = new THREE.Color(options.backgroundColor);
|
|
171
|
+
this.actors = [];
|
|
172
|
+
this.inputManager = new InputManager({
|
|
173
|
+
rendererDomElement: options.rendererDomElement,
|
|
174
|
+
gameContainer: options.gameContainer,
|
|
175
|
+
world: new WeakRef(this),
|
|
176
|
+
enableGamepad: options.enableGamepad
|
|
177
|
+
});
|
|
178
|
+
this.timerSystem = new TimerSystem({
|
|
179
|
+
world: this
|
|
180
|
+
});
|
|
181
|
+
this.tweenManager = new TweenManager(this);
|
|
182
|
+
this.consoleManager = new ConsoleManager();
|
|
183
|
+
this.inputManager.addInputHandler(this.consoleManager);
|
|
184
|
+
|
|
185
|
+
// Register console variable handler for CVar system
|
|
186
|
+
this.consoleManager.addCommandHandler(new ConsoleVariableHandler());
|
|
187
|
+
|
|
188
|
+
// Register stats console handler
|
|
189
|
+
this.statsDisplay = new StatsDisplay(options.gameContainer);
|
|
190
|
+
|
|
191
|
+
this.uiManager = new UIManager({
|
|
192
|
+
container: options.gameContainer
|
|
193
|
+
});
|
|
194
|
+
this.inputManager.addInputHandler(this.uiManager);
|
|
195
|
+
|
|
196
|
+
this.gameMode = options.gameMode ?? new GameMode({});
|
|
197
|
+
this.gameMode.setWorld(this);
|
|
198
|
+
|
|
199
|
+
this.audioListener = !isNode() ? new THREE.AudioListener() : null;
|
|
200
|
+
|
|
201
|
+
this.globalAudioManager = GlobalAudioManager.getInstance();
|
|
202
|
+
this.globalAudioManager.setWorld(this);
|
|
203
|
+
|
|
204
|
+
// the global particle manager is never saved
|
|
205
|
+
this.globalParticleManager = new GlobalParticleManager();
|
|
206
|
+
this.globalParticleManager.setTransient(true);
|
|
207
|
+
this.addActors(this.globalParticleManager);
|
|
208
|
+
|
|
209
|
+
this.fallbackCamera = new THREE.PerspectiveCamera(75, 1, 0.1, 1000);
|
|
210
|
+
// Position the fallback camera at a reasonable default location
|
|
211
|
+
this.fallbackCamera.position.set(0, 5, 10);
|
|
212
|
+
this.fallbackCamera.lookAt(0, 0, 0);
|
|
213
|
+
|
|
214
|
+
this.pluginManager = new PluginManager(new WeakRef(this));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public export(context: WorldSerializationContext, includeDefaults: boolean): SerializedWorld {
|
|
218
|
+
return {
|
|
219
|
+
class: ClassRegistry.getClassNameChecked(this),
|
|
220
|
+
uuid: this.uuid,
|
|
221
|
+
ctor: context.exportObject(this.options, includeDefaults),
|
|
222
|
+
actors: this.actors.map(actor => context.exportObject(actor, includeDefaults)).filter(actor => !!actor),
|
|
223
|
+
resources: this.sceneResources ?? undefined,
|
|
224
|
+
properties: {
|
|
225
|
+
editorData: this.editorData,
|
|
226
|
+
postProcessConfiguration: this.postProcessConfiguration
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
public serialize(dumper: Dumper): void {
|
|
232
|
+
dumper.dumpValue('$uuid', this.uuid);
|
|
233
|
+
dumper.dumpValue('actors', this.actors.filter(actor => !!actor));
|
|
234
|
+
dumper.dumpValue('resources', this.sceneResources);
|
|
235
|
+
dumper.dumpValue('editorData', this.editorData);
|
|
236
|
+
dumper.dumpValue('postProcessConfiguration', this.postProcessConfiguration);
|
|
237
|
+
|
|
238
|
+
dumper.dumpProperties(this);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
public deserialize(loader: Loader): void {
|
|
242
|
+
(this as any).uuid = loader.loadValue('$uuid') ?? this.uuid;
|
|
243
|
+
|
|
244
|
+
this.sceneResources = loader.loadValue('resources', this.sceneResources);
|
|
245
|
+
this.editorData = loader.loadValue('editorData', this.editorData);
|
|
246
|
+
this.postProcessConfiguration = loader.loadValue('postProcessConfiguration', this.postProcessConfiguration);
|
|
247
|
+
|
|
248
|
+
// I could do,
|
|
249
|
+
// ```
|
|
250
|
+
// const actors = [...this.actors];
|
|
251
|
+
// loader.loadValue('actors', actors);
|
|
252
|
+
// ```
|
|
253
|
+
// expecting the loader to populate into some existing actor, but let's assume that world is clean when loaded for now
|
|
254
|
+
const actors: Actor[] = loader.loadValue('actors');
|
|
255
|
+
const newlyLoadedActors = actors.filter(actor => actor && !this.actors.includes(actor));
|
|
256
|
+
this.addActors(...newlyLoadedActors);
|
|
257
|
+
|
|
258
|
+
loader.loadProperties(this);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The container element that holds the game UI and game content
|
|
264
|
+
*/
|
|
265
|
+
public get gameContainer(): HTMLElement {
|
|
266
|
+
return this.options.gameContainer;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Gets the game loop
|
|
271
|
+
* @returns The game loop
|
|
272
|
+
*/
|
|
273
|
+
public get gameLoop(): BaseGameLoop | null {
|
|
274
|
+
return this.options.gameLoop?.deref() ?? null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Gets the render window size
|
|
279
|
+
* @returns The render window size
|
|
280
|
+
*/
|
|
281
|
+
public getRenderWindowSize(): RenderWindowSize | null {
|
|
282
|
+
return this.renderWindowSize;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Sets the lightmap resource references for this scene.
|
|
287
|
+
* Used by external tools to configure lightmap file paths.
|
|
288
|
+
*/
|
|
289
|
+
public setLightmapResources(metadataPath: string, texturePath: string): void {
|
|
290
|
+
this.sceneResources ??= {};
|
|
291
|
+
this.sceneResources.lightmap = {
|
|
292
|
+
metadataPath,
|
|
293
|
+
texturePath
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Sets the NavMesh resource reference for this scene.
|
|
299
|
+
* Used by external tools to configure NavMesh file path.
|
|
300
|
+
*/
|
|
301
|
+
public setNavMeshResource(path: string): void {
|
|
302
|
+
this.sceneResources ??= {};
|
|
303
|
+
this.sceneResources.navMesh = {
|
|
304
|
+
path
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Clears lightmap resource references for this scene.
|
|
310
|
+
*/
|
|
311
|
+
public clearLightmapResources(): void {
|
|
312
|
+
if (this.sceneResources) {
|
|
313
|
+
this.sceneResources.lightmap = undefined;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Clears NavMesh resource reference for this scene.
|
|
319
|
+
*/
|
|
320
|
+
public clearNavMeshResource(): void {
|
|
321
|
+
if (this.sceneResources) {
|
|
322
|
+
this.sceneResources.navMesh = undefined;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Gets the current scene resource configuration.
|
|
328
|
+
*/
|
|
329
|
+
public getSceneResources(): SceneResources | null {
|
|
330
|
+
return this.sceneResources;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Gets the current post-processing configuration.
|
|
335
|
+
*/
|
|
336
|
+
public getPostProcessConfiguration(): PostProcessConfiguration | null {
|
|
337
|
+
return this.postProcessConfiguration;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Sets the post-processing configuration (merges with defaults).
|
|
342
|
+
* @param config - The post-processing configuration to set
|
|
343
|
+
*/
|
|
344
|
+
public setPostProcessConfiguration(config: PostProcessConfiguration | null): void {
|
|
345
|
+
this.postProcessConfiguration = config;
|
|
346
|
+
if (config) {
|
|
347
|
+
this.postProcessManager.setConfiguration(config);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Updates the post-processing configuration (merges with current).
|
|
353
|
+
* @param config - The post-processing configuration to update
|
|
354
|
+
*/
|
|
355
|
+
public updatePostProcessConfiguration(config: PostProcessConfiguration): void {
|
|
356
|
+
if (this.postProcessConfiguration) {
|
|
357
|
+
// Merge with existing configuration
|
|
358
|
+
const mergedEffects = [...this.postProcessConfiguration.effects];
|
|
359
|
+
for (const newEffect of config.effects) {
|
|
360
|
+
const existingIndex = mergedEffects.findIndex(e => e.type === newEffect.type);
|
|
361
|
+
if (existingIndex >= 0) {
|
|
362
|
+
mergedEffects[existingIndex] = { ...mergedEffects[existingIndex], ...newEffect };
|
|
363
|
+
} else {
|
|
364
|
+
mergedEffects.push(newEffect);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
this.postProcessConfiguration = { effects: mergedEffects };
|
|
368
|
+
} else {
|
|
369
|
+
this.postProcessConfiguration = config;
|
|
370
|
+
}
|
|
371
|
+
this.postProcessManager.updateConfiguration(config);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Adds an actor to the world
|
|
376
|
+
* @param actor The actor to add
|
|
377
|
+
* @returns This world instance for method chaining
|
|
378
|
+
*/
|
|
379
|
+
public addActor(actor: Actor): this {
|
|
380
|
+
return this.addActors(actor);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Adds one or more actors to the world
|
|
385
|
+
* @param actors The actors to add
|
|
386
|
+
* @returns This world instance for method chaining
|
|
387
|
+
*/
|
|
388
|
+
public addActors(...actors: Actor[]): this {
|
|
389
|
+
if (!ensure(!this.isPlayEnded())) {
|
|
390
|
+
return this;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
actors.forEach(actor => {
|
|
394
|
+
if (!ensure(!this.actors.includes(actor))) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
this.actors.push(actor);
|
|
398
|
+
actor.setWorld(this);
|
|
399
|
+
this.scene.add(actor.rootComponent);
|
|
400
|
+
if (this.isPlaying()) {
|
|
401
|
+
actor.beginPlay();
|
|
402
|
+
}
|
|
403
|
+
if (actor instanceof PlayerController) {
|
|
404
|
+
if (this.playerControllers.length) {
|
|
405
|
+
throw new Error('Only one player controller is allowed in the world');
|
|
406
|
+
}
|
|
407
|
+
this.playerControllers.push(actor);
|
|
408
|
+
}
|
|
409
|
+
if (this.isEditorWorld) {
|
|
410
|
+
actor.onEditorAddToWorld();
|
|
411
|
+
this.onEditorActorAddToWorld?.(actor);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
return this;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Gets the current physics engine instance
|
|
420
|
+
* @returns The physics engine instance if available, otherwise null
|
|
421
|
+
*/
|
|
422
|
+
public getPhysicsEngine(): IPhysicsEngine | null {
|
|
423
|
+
return this.physicsEngine;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
public getNavigationServer(): INavigationServer | null {
|
|
427
|
+
return this.navigationServer;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Creates a navigation mesh from the current scene.
|
|
432
|
+
* This method waits for both the scene to be fully loaded and all GLTF meshes to be loaded
|
|
433
|
+
* before generating the navigation mesh from actors with GLTFMeshComponents that are set to static motion type.
|
|
434
|
+
*/
|
|
435
|
+
public async createNavigationMeshFromScene(): Promise<void> {
|
|
436
|
+
if (!this.navigationServerCreated) {
|
|
437
|
+
throw new Error('[Navigation Server] Navigation server not created');
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
const navigationServer = this.getNavigationServer();
|
|
441
|
+
if (!navigationServer) {
|
|
442
|
+
console.error('[Navigation Server] createNavigationMeshFromScene: Navigation server not available');
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
const meshes: THREE.Mesh[] = [];
|
|
447
|
+
|
|
448
|
+
// gather all the relevant gltf mesh components
|
|
449
|
+
let gltfMeshComponents: GLTFMeshComponent[] = [];
|
|
450
|
+
for (const actor of this.actors) {
|
|
451
|
+
gltfMeshComponents.push(...actor.getComponents(GLTFMeshComponent));
|
|
452
|
+
}
|
|
453
|
+
gltfMeshComponents = gltfMeshComponents.filter(component => component.getPhysicsOptions()?.motionType === PhysicsMotionType.Static && !component.options.excludeFromNavigation);
|
|
454
|
+
|
|
455
|
+
if (gltfMeshComponents.length > 0) {
|
|
456
|
+
// wait for all the models to be loaded
|
|
457
|
+
await Promise.all(Object.values(resourceManager.getCachedModels()));
|
|
458
|
+
// Extract meshes from GLTFMeshComponents
|
|
459
|
+
for (const component of gltfMeshComponents) {
|
|
460
|
+
meshes.push(...component.getAllMeshes());
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// gather all the relevant mesh components
|
|
465
|
+
let meshComponents: MeshComponent[] = [];
|
|
466
|
+
for (const actor of this.actors) {
|
|
467
|
+
meshComponents.push(...actor.getComponents(MeshComponent));
|
|
468
|
+
}
|
|
469
|
+
meshComponents = meshComponents.filter(component => component.getPhysicsOptions()?.motionType === PhysicsMotionType.Static && !component.options.excludeFromNavigation);
|
|
470
|
+
for (const component of meshComponents) {
|
|
471
|
+
meshes.push(component.getMesh());
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (meshes.length === 0) {
|
|
475
|
+
console.warn('[Navigation Server] No meshes found for navigation mesh generation');
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
const success = await navigationServer.createNavigationMeshFromMeshes(meshes);
|
|
480
|
+
if (success) {
|
|
481
|
+
console.log('[Navigation Server] Navigation mesh created successfully');
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
console.error('[Navigation Server] Failed to create navigation mesh');
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Export the current navigation mesh to a binary file
|
|
490
|
+
* @param scenePath The path to the scene file (used to determine navmesh file path)
|
|
491
|
+
* @returns Promise resolving to export result with data and filename
|
|
492
|
+
*/
|
|
493
|
+
public async exportNavigationMesh(scenePath: AssetPath): Promise<{ success: boolean; data?: ArrayBuffer; filename?: string }> {
|
|
494
|
+
const navigationServer = this.getNavigationServer();
|
|
495
|
+
if (!navigationServer) {
|
|
496
|
+
console.error('[World] exportNavigationMesh: Navigation server not available');
|
|
497
|
+
return { success: false };
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return await navigationServer.exportNavigationMesh(scenePath);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Import a navigation mesh from a binary file
|
|
505
|
+
* @param scenePath The path to the scene file (used to determine navmesh file path)
|
|
506
|
+
* @returns Promise resolving to success/failure
|
|
507
|
+
*/
|
|
508
|
+
public async importNavigationMesh(scenePath: AssetPath): Promise<boolean> {
|
|
509
|
+
const navigationServer = this.getNavigationServer();
|
|
510
|
+
if (!navigationServer) {
|
|
511
|
+
console.error('[World] importNavigationMesh: Navigation server not available');
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return await navigationServer.importNavigationMesh(scenePath);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Import a navigation mesh from binary data directly
|
|
520
|
+
* @param navMeshData The NavMesh binary data as ArrayBuffer
|
|
521
|
+
* @returns Promise resolving to success/failure
|
|
522
|
+
*/
|
|
523
|
+
public async importNavigationMeshFromData(navMeshData: ArrayBuffer): Promise<boolean> {
|
|
524
|
+
const navigationServer = this.getNavigationServer();
|
|
525
|
+
if (!navigationServer) {
|
|
526
|
+
console.error('[World] importNavigationMeshFromData: Navigation server not available');
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return await navigationServer.importNavigationMeshFromData(navMeshData);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Clear the current navigation mesh
|
|
535
|
+
*/
|
|
536
|
+
public clearNavigationMesh(): void {
|
|
537
|
+
const navigationServer = this.getNavigationServer();
|
|
538
|
+
if (!navigationServer) {
|
|
539
|
+
console.error('[World] clearNavigationMesh: Navigation server not available');
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
navigationServer.clearNavigationMesh();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public getManifold(): ManifoldWrapper | null {
|
|
547
|
+
return this.manifold;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Removes an actor from the world
|
|
552
|
+
* @param actor The actor to remove
|
|
553
|
+
* @returns This world instance for method chaining
|
|
554
|
+
*/
|
|
555
|
+
public removeActor(actor: Actor): this {
|
|
556
|
+
return this.removeActors(actor);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Removes one or more actors from the world
|
|
561
|
+
* @param actors - The actors to remove
|
|
562
|
+
* @returns This world instance for method chaining
|
|
563
|
+
*/
|
|
564
|
+
public removeActors(...actors: Actor[]): this {
|
|
565
|
+
if (!ensure(!this.isPlayEnded())) {
|
|
566
|
+
return this;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if (this.isTicking) {
|
|
570
|
+
this.actorsToRemove.push(...actors);
|
|
571
|
+
return this;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
actors.forEach(actor => {
|
|
575
|
+
const index = this.actors.indexOf(actor);
|
|
576
|
+
if (ensure(index !== -1, `${actor.getPathName()} not found in world`)) {
|
|
577
|
+
if (this.isPlaying()) {
|
|
578
|
+
actor.endPlay();
|
|
579
|
+
}
|
|
580
|
+
if (this.isEditorWorld) {
|
|
581
|
+
actor.onEditorRemoveFromWorld();
|
|
582
|
+
this.onEditorActorRemoveFromWorld?.(actor);
|
|
583
|
+
}
|
|
584
|
+
actor.setWorld(null);
|
|
585
|
+
this.actors.splice(index, 1);
|
|
586
|
+
this.scene.remove(actor.rootComponent);
|
|
587
|
+
if (actor instanceof PlayerController) {
|
|
588
|
+
const index = this.playerControllers.indexOf(actor);
|
|
589
|
+
if (index !== -1) {
|
|
590
|
+
this.playerControllers.splice(index, 1);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
return this;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Schedules a function to be executed at the beginning of the next tick
|
|
601
|
+
* @param fn - The function to execute next tick
|
|
602
|
+
*/
|
|
603
|
+
public runInNextTick(fn: () => void): void {
|
|
604
|
+
this.nextTickFunctions.push(fn);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Updates the world state for the current frame
|
|
609
|
+
* @param deltaTime - Time elapsed since last frame in seconds
|
|
610
|
+
*/
|
|
611
|
+
public tick(deltaTime: number): void {
|
|
612
|
+
deltaTime *= this.slomo;
|
|
613
|
+
if (this.playState !== PlayState.Playing) {
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
if (this.isPaused) {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if (deltaTime <= 0) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
this.gameTime += deltaTime;
|
|
626
|
+
this.isTicking = true;
|
|
627
|
+
|
|
628
|
+
// Execute functions scheduled for this tick
|
|
629
|
+
if (this.nextTickFunctions.length > 0) {
|
|
630
|
+
const functionsToExecute = [...this.nextTickFunctions];
|
|
631
|
+
this.nextTickFunctions = [];
|
|
632
|
+
for (const fn of functionsToExecute) {
|
|
633
|
+
try {
|
|
634
|
+
fn();
|
|
635
|
+
} catch (error) {
|
|
636
|
+
console.error('Error executing next tick function:', error);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// Process timer events before physics
|
|
642
|
+
this.timerSystem.tick(deltaTime);
|
|
643
|
+
|
|
644
|
+
// Update all managed tweens
|
|
645
|
+
this.tweenManager.update(deltaTime);
|
|
646
|
+
|
|
647
|
+
this.gameMode.tick(deltaTime);
|
|
648
|
+
|
|
649
|
+
for (const actor of this.actors) {
|
|
650
|
+
actor.tickPrePhysics(deltaTime);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (this.physicsEngine) {
|
|
654
|
+
this.physicsEngine.tick(deltaTime);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
for (const actor of this.actors) {
|
|
658
|
+
actor.tickPostPhysics(deltaTime);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
this.netWorld.tick(deltaTime);
|
|
662
|
+
|
|
663
|
+
this.statsDisplay.tick();
|
|
664
|
+
|
|
665
|
+
// Ensure the audio listener is attached to the correct camera
|
|
666
|
+
const camera = this.getActiveCamera();
|
|
667
|
+
if (camera && this.audioListener && this.audioListener.parent != camera) {
|
|
668
|
+
|
|
669
|
+
camera.add(this.audioListener);
|
|
670
|
+
camera.getActor()?.onPreEndPlay.add((cameraActor) => {
|
|
671
|
+
this.audioListener?.removeFromParent();
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
this.isTicking = false;
|
|
676
|
+
this.removeActors(...this.actorsToRemove);
|
|
677
|
+
this.actorsToRemove = [];
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Creates the physics engine
|
|
682
|
+
* @returns A promise that resolves when the physics engine is created
|
|
683
|
+
*/
|
|
684
|
+
public async createPhysicsEngine(): Promise<void> {
|
|
685
|
+
if (this.physicsEngineCreated) {
|
|
686
|
+
throw new Error('Physics engine already created');
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
this.physicsEngine = await createPhysicsEngine(this.options.physicsOptions, this);
|
|
690
|
+
console.log('Physics engine created:', ClassRegistry.getClassOrConstructorName(this.physicsEngine));
|
|
691
|
+
this.physicsEngineCreated = true;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
public async createManifold(): Promise<void> {
|
|
695
|
+
if (this.manifoldCreated) {
|
|
696
|
+
throw new Error('Manifold already created');
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
if (!this.options.useManifold) {
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
this.manifold = new ManifoldWrapper();
|
|
704
|
+
await this.manifold?.initManifold();
|
|
705
|
+
this.manifoldCreated = true;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
public async createNavigationServer(): Promise<void> {
|
|
709
|
+
if (this.navigationServerCreated) {
|
|
710
|
+
throw new Error('Navigation server already created');
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
this.navigationServer = await createNavigationServer(this.options.navigationOptions);
|
|
714
|
+
console.log('Navigation server created:', this.navigationServer);
|
|
715
|
+
this.navigationServerCreated = true;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Creates the lightmap manager
|
|
720
|
+
* @returns A promise that resolves when the lightmap manager is created
|
|
721
|
+
*/
|
|
722
|
+
public async createLightmapManager(renderer?: any): Promise<void> {
|
|
723
|
+
if (this.lightmapManagerCreated || !ENABLE_LIGHTMAPS) {
|
|
724
|
+
return; // Already created, just return
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
try {
|
|
728
|
+
if (!renderer) {
|
|
729
|
+
console.warn('No renderer provided for lightmap manager creation');
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
this.lightmapManager = new LightmapManager(this, renderer, {
|
|
734
|
+
autoApply: true,
|
|
735
|
+
progressiveBaking: true,
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
await this.lightmapManager.initialize();
|
|
739
|
+
console.log('Lightmap manager created and initialized');
|
|
740
|
+
this.lightmapManagerCreated = true;
|
|
741
|
+
} catch (error) {
|
|
742
|
+
console.warn('Failed to create lightmap manager:', error);
|
|
743
|
+
// Don't set lightmapManagerCreated to true if initialization failed
|
|
744
|
+
this.lightmapManager = null;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Gets the lightmap manager
|
|
750
|
+
* @returns The lightmap manager if created, otherwise null
|
|
751
|
+
*/
|
|
752
|
+
public getLightmapManager(): LightmapManager | null {
|
|
753
|
+
return this.lightmapManager;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Generates a debug node for the world
|
|
758
|
+
* @returns A debug node for the world
|
|
759
|
+
*/
|
|
760
|
+
public generateDebugNode(): SceneGraphDebugNode | null {
|
|
761
|
+
const children: (SceneGraphDebugNode | null)[] = [];
|
|
762
|
+
children.push(this.gameMode.generateDebugNode());
|
|
763
|
+
for (const actor of this.actors) {
|
|
764
|
+
children.push(actor.generateDebugNode());
|
|
765
|
+
}
|
|
766
|
+
return {
|
|
767
|
+
title: this.name,
|
|
768
|
+
children,
|
|
769
|
+
data: {
|
|
770
|
+
uuid: this.uuid,
|
|
771
|
+
...this.options
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* Gets the first actor of a specified type
|
|
778
|
+
* @param type - The type of actor to search for
|
|
779
|
+
* @returns The first actor of the specified type or null if no such actor exists
|
|
780
|
+
*/
|
|
781
|
+
public getFirstActor<T extends Actor>(type: new (...args: any[]) => T): T | null {
|
|
782
|
+
return this.actors.find(actor => actor instanceof type) as T | null;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* Gets the first component of a specified type
|
|
787
|
+
* @param type - The type of component to search for
|
|
788
|
+
* @returns The first component of the specified type or null if no such component exists
|
|
789
|
+
*/
|
|
790
|
+
public getComponent<T extends SceneComponent>(type: new (...args: any[]) => T): T | null {
|
|
791
|
+
for (const actor of this.actors) {
|
|
792
|
+
const component = actor.getComponent(type);
|
|
793
|
+
if (component) {
|
|
794
|
+
return component;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
return null;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Gets all actors of a specified type
|
|
802
|
+
* @param type - The type of actor to search for
|
|
803
|
+
* @returns An array of all actors of the specified type
|
|
804
|
+
*/
|
|
805
|
+
public getActors<T extends Actor>(type: abstract new (...args: any[]) => T = Actor as any): T[] {
|
|
806
|
+
return this.actors.filter(actor => actor instanceof type) as T[];
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* Gets an actor by its UUID
|
|
811
|
+
* @param uuid - The UUID of the actor to search for
|
|
812
|
+
* @returns The actor with the specified UUID or null if no such actor exists
|
|
813
|
+
*/
|
|
814
|
+
public getActorByUuid<T extends Actor>(uuid: string): T | null {
|
|
815
|
+
return this.actors.find(actor => actor.uuid === uuid) as T | null;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Gets all actors that match a predicate
|
|
820
|
+
* @param predicate - The predicate to match
|
|
821
|
+
* @returns An array of all actors that match the predicate
|
|
822
|
+
*/
|
|
823
|
+
public getActorsByPredicate(predicate: (actor: Actor) => boolean): Actor[] {
|
|
824
|
+
return this.actors.filter(predicate);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Gets the first actor with the specified tag
|
|
829
|
+
* @param tag - The tag to search for
|
|
830
|
+
* @returns The first actor with the specified tag or null if no such actor exists
|
|
831
|
+
*/
|
|
832
|
+
public getFirstActorByTag(tag: string): Actor | null {
|
|
833
|
+
return this.actors.find(actor => actor.hasActorTag(tag)) ?? null;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Gets all actors with the specified tag
|
|
838
|
+
* @param tag - The tag to search for
|
|
839
|
+
* @returns An array of all actors with the specified tag
|
|
840
|
+
*/
|
|
841
|
+
public getActorsByTag(tag: string): Actor[] {
|
|
842
|
+
return this.actors.filter(actor => actor.hasActorTag(tag));
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Gets the first actor that has any of the specified tags
|
|
847
|
+
* @param tags - The tags to search for
|
|
848
|
+
* @returns The first actor with any of the specified tags or null if no such actor exists
|
|
849
|
+
*/
|
|
850
|
+
public getFirstActorByAnyTag(tags: string[]): Actor | null {
|
|
851
|
+
return this.actors.find(actor => actor.hasAnyActorTag(tags)) ?? null;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Gets all actors that have any of the specified tags
|
|
856
|
+
* @param tags - The tags to search for
|
|
857
|
+
* @returns An array of all actors with any of the specified tags
|
|
858
|
+
*/
|
|
859
|
+
public getActorsByAnyTag(tags: string[]): Actor[] {
|
|
860
|
+
return this.actors.filter(actor => actor.hasAnyActorTag(tags));
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Gets the first actor that has all of the specified tags
|
|
865
|
+
* @param tags - The tags to search for
|
|
866
|
+
* @returns The first actor with all of the specified tags or null if no such actor exists
|
|
867
|
+
*/
|
|
868
|
+
public getFirstActorByAllTags(tags: string[]): Actor | null {
|
|
869
|
+
return this.actors.find(actor => actor.hasAllActorTags(tags)) ?? null;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Gets all actors that have all of the specified tags
|
|
874
|
+
* @param tags - The tags to search for
|
|
875
|
+
* @returns An array of all actors with all of the specified tags
|
|
876
|
+
*/
|
|
877
|
+
public getActorsByAllTags(tags: string[]): Actor[] {
|
|
878
|
+
return this.actors.filter(actor => actor.hasAllActorTags(tags));
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Gets the first player pawn in the world
|
|
883
|
+
* @returns The first player pawn in the world or null if no player pawn exists
|
|
884
|
+
*/
|
|
885
|
+
public getFirstPlayerPawn(): Pawn | null {
|
|
886
|
+
return this.getFirstActor(PlayerController)?.getPawn() ?? null;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Clears the world
|
|
891
|
+
*/
|
|
892
|
+
public clearWorld(): void {
|
|
893
|
+
this.removeActors(...this.actors);
|
|
894
|
+
this.actors = [];
|
|
895
|
+
this.scene.remove(...this.scene.children);
|
|
896
|
+
|
|
897
|
+
if (this.isEditorWorld) {
|
|
898
|
+
this.onEditorActorAddToWorld = undefined;
|
|
899
|
+
this.onEditorActorRemoveFromWorld = undefined;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Gets the path name of the world
|
|
905
|
+
* @returns The path name of the world
|
|
906
|
+
*/
|
|
907
|
+
public getPathName(): string {
|
|
908
|
+
return this.name;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Adds a box to the world
|
|
913
|
+
* @param options - The options for the box
|
|
914
|
+
* @returns The actor that was created
|
|
915
|
+
*/
|
|
916
|
+
public addBox(options: {
|
|
917
|
+
position?: THREE.Vector3,
|
|
918
|
+
rotation?: THREE.Euler,
|
|
919
|
+
scale?: THREE.Vector3,
|
|
920
|
+
width?: number,
|
|
921
|
+
height?: number,
|
|
922
|
+
depth?: number,
|
|
923
|
+
color?: THREE.ColorRepresentation,
|
|
924
|
+
motionType?: PhysicsMotionType
|
|
925
|
+
}): Actor {
|
|
926
|
+
return this.addBasicGeometry({
|
|
927
|
+
...options,
|
|
928
|
+
geometry: new THREE.BoxGeometry(options.width, options.height, options.depth),
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Adds a sphere to the world
|
|
934
|
+
* @param options - The options for the sphere
|
|
935
|
+
* @returns The actor that was created
|
|
936
|
+
*/
|
|
937
|
+
public addSphere(options: {
|
|
938
|
+
position?: THREE.Vector3,
|
|
939
|
+
rotation?: THREE.Euler,
|
|
940
|
+
scale?: THREE.Vector3,
|
|
941
|
+
radius?: number,
|
|
942
|
+
color?: THREE.ColorRepresentation,
|
|
943
|
+
motionType?: PhysicsMotionType
|
|
944
|
+
}): Actor {
|
|
945
|
+
return this.addBasicGeometry({
|
|
946
|
+
...options,
|
|
947
|
+
geometry: new THREE.SphereGeometry(options.radius),
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Adds a capsule to the world
|
|
953
|
+
* @param options - The options for the capsule
|
|
954
|
+
* @returns The actor that was created
|
|
955
|
+
*/
|
|
956
|
+
public addCapsule(options: {
|
|
957
|
+
position?: THREE.Vector3,
|
|
958
|
+
rotation?: THREE.Euler,
|
|
959
|
+
scale?: THREE.Vector3,
|
|
960
|
+
radius?: number,
|
|
961
|
+
height?: number,
|
|
962
|
+
color?: THREE.ColorRepresentation,
|
|
963
|
+
motionType?: PhysicsMotionType
|
|
964
|
+
}): Actor {
|
|
965
|
+
return this.addBasicGeometry({
|
|
966
|
+
...options,
|
|
967
|
+
geometry: new THREE.CapsuleGeometry(options.radius, options.height),
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* Adds a cylinder to the world
|
|
973
|
+
* @param options - The options for the cylinder
|
|
974
|
+
* @returns The actor that was created
|
|
975
|
+
*/
|
|
976
|
+
public addCylinder(options: {
|
|
977
|
+
position?: THREE.Vector3,
|
|
978
|
+
rotation?: THREE.Euler,
|
|
979
|
+
scale?: THREE.Vector3,
|
|
980
|
+
radius?: number,
|
|
981
|
+
height?: number,
|
|
982
|
+
color?: THREE.ColorRepresentation,
|
|
983
|
+
motionType?: PhysicsMotionType
|
|
984
|
+
}): Actor {
|
|
985
|
+
return this.addBasicGeometry({
|
|
986
|
+
...options,
|
|
987
|
+
geometry: new THREE.CylinderGeometry(options.radius, options.radius, options.height),
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Adds a cone to the world
|
|
993
|
+
* @param options - The options for the cone
|
|
994
|
+
* @returns The actor that was created
|
|
995
|
+
*/
|
|
996
|
+
public addCone(options: {
|
|
997
|
+
position?: THREE.Vector3,
|
|
998
|
+
rotation?: THREE.Euler,
|
|
999
|
+
scale?: THREE.Vector3,
|
|
1000
|
+
radius?: number,
|
|
1001
|
+
height?: number,
|
|
1002
|
+
color?: THREE.ColorRepresentation,
|
|
1003
|
+
motionType?: PhysicsMotionType
|
|
1004
|
+
}): Actor {
|
|
1005
|
+
return this.addBasicGeometry({
|
|
1006
|
+
...options,
|
|
1007
|
+
geometry: new THREE.ConeGeometry(options.radius, options.height),
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Adds a basic geometry to the world
|
|
1013
|
+
* @param options - The options for the geometry
|
|
1014
|
+
* @returns The actor that was created
|
|
1015
|
+
*/
|
|
1016
|
+
public addBasicGeometry(options: {
|
|
1017
|
+
position?: THREE.Vector3,
|
|
1018
|
+
rotation?: THREE.Euler,
|
|
1019
|
+
scale?: THREE.Vector3,
|
|
1020
|
+
geometry: THREE.BufferGeometry,
|
|
1021
|
+
color?: THREE.ColorRepresentation,
|
|
1022
|
+
motionType?: PhysicsMotionType
|
|
1023
|
+
}): Actor {
|
|
1024
|
+
const actor = new Actor({
|
|
1025
|
+
rootComponent: new MeshComponent({
|
|
1026
|
+
position: options.position,
|
|
1027
|
+
rotation: options.rotation,
|
|
1028
|
+
scale: options.scale,
|
|
1029
|
+
geometry: options.geometry,
|
|
1030
|
+
material: new THREE.MeshStandardMaterial({ color: options.color }),
|
|
1031
|
+
physicsOptions: {
|
|
1032
|
+
enabled: !!options.motionType,
|
|
1033
|
+
motionType: options.motionType
|
|
1034
|
+
}
|
|
1035
|
+
})
|
|
1036
|
+
});
|
|
1037
|
+
this.addActors(actor);
|
|
1038
|
+
return actor;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Adds an axes helper to the world
|
|
1043
|
+
* @param options - The options for the axes helper
|
|
1044
|
+
* @returns The actor that was created
|
|
1045
|
+
*/
|
|
1046
|
+
public addAxesHelper(options: {
|
|
1047
|
+
position?: THREE.Vector3,
|
|
1048
|
+
rotation?: THREE.Euler,
|
|
1049
|
+
size?: number,
|
|
1050
|
+
}): Actor {
|
|
1051
|
+
const actor = new Actor({
|
|
1052
|
+
position: options.position,
|
|
1053
|
+
rotation: options.rotation,
|
|
1054
|
+
});
|
|
1055
|
+
actor.rootComponent.add(new THREE.AxesHelper(options.size));
|
|
1056
|
+
this.addActors(actor);
|
|
1057
|
+
return actor;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Returns an exported object representation of the world
|
|
1062
|
+
* @param includeDefaults Whether to include default values
|
|
1063
|
+
* @returns An exported object representation of the world
|
|
1064
|
+
*/
|
|
1065
|
+
public asExportedObject(includeDefaults: boolean = false): any {
|
|
1066
|
+
return WorldSerializer.exportObject(this, includeDefaults);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Gets the game time
|
|
1071
|
+
* @returns The game time
|
|
1072
|
+
*/
|
|
1073
|
+
public getGameTime(): number {
|
|
1074
|
+
return this.gameTime;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Gets the active camera to render the scene
|
|
1079
|
+
* @returns The active camera
|
|
1080
|
+
*/
|
|
1081
|
+
public getActiveCamera(): THREE.Camera | null {
|
|
1082
|
+
if (this.overrideCamera) {
|
|
1083
|
+
return this.overrideCamera;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
return this.playerControllers[0]?.getCamera() ?? null;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Renders the scene
|
|
1091
|
+
* @param renderer - The renderer to use
|
|
1092
|
+
*/
|
|
1093
|
+
public renderScene(renderer: THREE.WebGLRenderer, windowSize: RenderWindowSize) {
|
|
1094
|
+
const camera = this.getActiveCamera();
|
|
1095
|
+
if (!camera) {
|
|
1096
|
+
this.logCameraWarning();
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
this.renderWindowSize = windowSize;
|
|
1100
|
+
const cameraToUse = camera ?? this.fallbackCamera;
|
|
1101
|
+
|
|
1102
|
+
if (cameraToUse instanceof THREE.PerspectiveCamera) {
|
|
1103
|
+
cameraToUse.aspect = windowSize.width / windowSize.height;
|
|
1104
|
+
cameraToUse.updateProjectionMatrix();
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
this.postProcessManager.renderScene(renderer, this.scene, cameraToUse, windowSize);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Logs a warning when no camera is found, throttled to every 10 seconds
|
|
1112
|
+
*/
|
|
1113
|
+
private logCameraWarning(): void {
|
|
1114
|
+
const currentTime = Date.now();
|
|
1115
|
+
// Only log warning every 10 seconds (10000ms)
|
|
1116
|
+
if (currentTime - this.lastCameraWarningTime >= 10000) {
|
|
1117
|
+
console.warn('No camera found. Please add a three.js camera to your pawn or set one using "world.setOverrideCamera(camera)".');
|
|
1118
|
+
this.lastCameraWarningTime = currentTime;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Gets the override camera
|
|
1124
|
+
* @returns The override camera
|
|
1125
|
+
*/
|
|
1126
|
+
public getOverrideCamera(): THREE.Camera | null {
|
|
1127
|
+
return this.overrideCamera;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* Sets the override camera
|
|
1132
|
+
* @param camera - The camera to set
|
|
1133
|
+
*/
|
|
1134
|
+
public setOverrideCamera(camera: THREE.Camera | null): void {
|
|
1135
|
+
this.overrideCamera = camera;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* Gets the skybox component
|
|
1140
|
+
* @returns The skybox component
|
|
1141
|
+
*/
|
|
1142
|
+
public getSkyboxComponent(): SkyboxComponent | null {
|
|
1143
|
+
return this.skyboxComponent;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
/**
|
|
1147
|
+
* Sets the skybox component
|
|
1148
|
+
* @param component - The skybox component to set
|
|
1149
|
+
*/
|
|
1150
|
+
public setSkyboxComponent(component: SkyboxComponent | null): void {
|
|
1151
|
+
if (this.skyboxComponent && component && this.skyboxComponent !== component) {
|
|
1152
|
+
ensure(false, 'Skybox component already set, cannot set another');
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
this.skyboxComponent = component;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
public destroy(): void {
|
|
1159
|
+
if (this.isPlaying()) {
|
|
1160
|
+
this.endPlay();
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
this.scene.setWorld(null);
|
|
1164
|
+
|
|
1165
|
+
// Reset camera warning timer
|
|
1166
|
+
this.lastCameraWarningTime = 0;
|
|
1167
|
+
|
|
1168
|
+
// Clean up UI manager
|
|
1169
|
+
this.uiManager.destroy();
|
|
1170
|
+
|
|
1171
|
+
// Clean up input manager
|
|
1172
|
+
this.inputManager.destroy();
|
|
1173
|
+
|
|
1174
|
+
if (this.physicsEngine) {
|
|
1175
|
+
this.physicsEngine.destroy();
|
|
1176
|
+
this.physicsEngine = null;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
this.consoleManager.removeCommandHandler(this);
|
|
1180
|
+
|
|
1181
|
+
this.consoleManager.destroy();
|
|
1182
|
+
|
|
1183
|
+
this.postProcessManager.destroy();
|
|
1184
|
+
|
|
1185
|
+
this.navigationServer?.destroy();
|
|
1186
|
+
|
|
1187
|
+
// Clean up navigation mesh visualization
|
|
1188
|
+
if (this.navigationMeshVisualization) {
|
|
1189
|
+
this.scene.remove(this.navigationMeshVisualization);
|
|
1190
|
+
this.navigationMeshVisualization = null;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
this.hiddenInGameActors.clear();
|
|
1194
|
+
this.actors = [];
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
//====================================================================================================
|
|
1198
|
+
|
|
1199
|
+
protected override doBeginPlay(): void {
|
|
1200
|
+
if (!this.physicsEngineCreated) {
|
|
1201
|
+
throw new Error('Physics engine not created');
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
this.consoleManager.addCommandHandler(this);
|
|
1205
|
+
|
|
1206
|
+
// other actors can be spawned in the beginPlay call below and add themselves to this.actors
|
|
1207
|
+
// so we must iterate over a copy
|
|
1208
|
+
// and we're iterating on the actors before calling beginPlay on the subsystems below
|
|
1209
|
+
// to avoid the issue where the subsystems can spawn actors which would get beginPlay called twice
|
|
1210
|
+
for (const actor of [...this.actors]) {
|
|
1211
|
+
actor.beginPlay();
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
this.inputManager.beginPlay();
|
|
1215
|
+
|
|
1216
|
+
// Begin play for the timer system
|
|
1217
|
+
this.timerSystem.beginPlay();
|
|
1218
|
+
|
|
1219
|
+
this.gameMode.beginPlay();
|
|
1220
|
+
|
|
1221
|
+
this.netWorld.beginPlay();
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
protected override doEndPlay(): void {
|
|
1225
|
+
for (const actor of this.actors) {
|
|
1226
|
+
actor.endPlay();
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
this.netWorld.endPlay();
|
|
1230
|
+
|
|
1231
|
+
this.inputManager.endPlay();
|
|
1232
|
+
|
|
1233
|
+
this.gameMode.endPlay();
|
|
1234
|
+
|
|
1235
|
+
// End play for the timer system
|
|
1236
|
+
this.timerSystem.endPlay();
|
|
1237
|
+
|
|
1238
|
+
// End play for the global audio manager
|
|
1239
|
+
this.globalAudioManager.endPlay();
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
public describe(options?: WorldDescriptionOptions): Record<string, any> {
|
|
1243
|
+
const description: Record<string, any> = {};
|
|
1244
|
+
if (this.editorData && Object.keys(this.editorData).length > 0) {
|
|
1245
|
+
description.info = this.editorData;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
const specifiedActors = options?.specifiedActors;
|
|
1249
|
+
return {
|
|
1250
|
+
...description,
|
|
1251
|
+
actorsNumber: this.actors.length,
|
|
1252
|
+
actors: this.actors.map(actor => actor.describe({
|
|
1253
|
+
includeComponentsDetails: options?.includeComponentsDetails,
|
|
1254
|
+
omitDescription: specifiedActors ? !specifiedActors.includes(actor.uuid) : false
|
|
1255
|
+
})),
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
@ConsoleCommand('clearworld', 'Clear all actors from the world')
|
|
1260
|
+
private clearWorldCommand(): string {
|
|
1261
|
+
this.clearWorld();
|
|
1262
|
+
return 'World cleared';
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
@ConsoleCommand('dumpsg', 'Dump scene graph to HTML file (usage: dumpsg [html])')
|
|
1266
|
+
private dumpSG(format = 'html'): string {
|
|
1267
|
+
format = format.toLowerCase();
|
|
1268
|
+
if (format === 'html') {
|
|
1269
|
+
const html = SceneGraphUtils.dumpHtml(this);
|
|
1270
|
+
const blob = new Blob([html], { type: 'text/html' });
|
|
1271
|
+
const url = URL.createObjectURL(blob);
|
|
1272
|
+
window.open(url, '_blank');
|
|
1273
|
+
return 'Scene graph dumped to html';
|
|
1274
|
+
}
|
|
1275
|
+
return 'Invalid format';
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
@ConsoleCommand('exportworld', 'Export world data to JSON file (usage: exportworld [includeDefaults])')
|
|
1279
|
+
private exportWorld(includeDefaults?: string): boolean {
|
|
1280
|
+
const worldData = WorldSerializer.exportObject(this, !!includeDefaults);
|
|
1281
|
+
const worldDataString = JSON.stringify(worldData, null, 2);
|
|
1282
|
+
const blob = new Blob([worldDataString], { type: 'application/json' });
|
|
1283
|
+
const url = URL.createObjectURL(blob);
|
|
1284
|
+
window.open(url, '_blank');
|
|
1285
|
+
return true;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
@ConsoleCommand('pause', 'Toggle world pause state')
|
|
1289
|
+
private pause(): string {
|
|
1290
|
+
this.isPaused = !this.isPaused;
|
|
1291
|
+
return `World paused: ${this.isPaused}`;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
@ConsoleCommand('slomo', 'Set world slow motion multiplier (usage: slomo <value>)')
|
|
1295
|
+
private setSlomoCommand(value: string): string {
|
|
1296
|
+
const num = parseFloat(value);
|
|
1297
|
+
if (isNaN(num)) {
|
|
1298
|
+
return 'Invalid number';
|
|
1299
|
+
}
|
|
1300
|
+
this.slomo = num;
|
|
1301
|
+
return `World slomo set to: ${this.slomo}`;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
@ConsoleCommand('clearcache', 'Clear all cached resources')
|
|
1305
|
+
private clearCachedResources(): boolean {
|
|
1306
|
+
resourceManager.clearCachedResources();
|
|
1307
|
+
return true;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
@ConsoleCommand('logcache', 'Log all cached resources to console')
|
|
1311
|
+
private logCachedResources(): boolean {
|
|
1312
|
+
resourceManager.logCachedResources();
|
|
1313
|
+
return true;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
@ConsoleCommand('show', 'Show/hide debug visualizations (usage: show <lighthelper | lightcamerahelper | navmesh | collision>)')
|
|
1317
|
+
private show(helperType: string): string | boolean {
|
|
1318
|
+
const type = helperType.toLowerCase();
|
|
1319
|
+
|
|
1320
|
+
if (type === 'stats') {
|
|
1321
|
+
this.statsDisplay.toggle();
|
|
1322
|
+
return 'Stats console toggled';
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
if (type === 'navmesh') {
|
|
1326
|
+
const navigationServer = this.getNavigationServer();
|
|
1327
|
+
if (!navigationServer) {
|
|
1328
|
+
return 'Navigation server not available';
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
if (this.navigationMeshVisualization) {
|
|
1332
|
+
// Remove existing visualization
|
|
1333
|
+
this.scene.remove(this.navigationMeshVisualization);
|
|
1334
|
+
this.navigationMeshVisualization = null;
|
|
1335
|
+
return 'Navigation mesh visualization hidden';
|
|
1336
|
+
} else {
|
|
1337
|
+
// Create and add visualization
|
|
1338
|
+
const visualization = navigationServer.createDebugVisualization();
|
|
1339
|
+
if (!visualization) {
|
|
1340
|
+
console.error('[Navigation Server] show navmesh: Failed to create debug visualization');
|
|
1341
|
+
return 'Failed to create debug visualization';
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
// Disable raycasting for debug mesh to prevent interference with any gameplay
|
|
1345
|
+
visualization.traverse((child) => {
|
|
1346
|
+
child.raycast = () => { };
|
|
1347
|
+
});
|
|
1348
|
+
|
|
1349
|
+
this.scene.add(visualization);
|
|
1350
|
+
this.navigationMeshVisualization = visualization;
|
|
1351
|
+
return 'Navigation mesh visualization shown';
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
if (type === 'collision') {
|
|
1356
|
+
const physicsEngine = this.getPhysicsEngine();
|
|
1357
|
+
if (!physicsEngine) {
|
|
1358
|
+
return 'Physics engine not available';
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
physicsEngine.setDebugRendererEnabled(!physicsEngine.isDebugRendererEnabled());
|
|
1362
|
+
return 'Collision debug visualization ' + (physicsEngine.isDebugRendererEnabled() ? 'enabled' : 'disabled');
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
const lightComponents: LightComponent<any, any>[] = [];
|
|
1366
|
+
|
|
1367
|
+
for (const actor of this.actors) {
|
|
1368
|
+
lightComponents.push(...actor.getComponents(LightComponent));
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
if (type === 'lighthelper') {
|
|
1372
|
+
for (const lightComponent of lightComponents) {
|
|
1373
|
+
lightComponent.showHelper(!lightComponent.isHelperVisible());
|
|
1374
|
+
}
|
|
1375
|
+
return `Toggled light helpers for ${lightComponents.length} lights`;
|
|
1376
|
+
} else if (type === 'lightcamerahelper') {
|
|
1377
|
+
for (const lightComponent of lightComponents) {
|
|
1378
|
+
lightComponent.showCameraHelper(!lightComponent.isCameraHelperVisible());
|
|
1379
|
+
}
|
|
1380
|
+
return `Toggled light camera helpers for ${lightComponents.length} lights`;
|
|
1381
|
+
} else {
|
|
1382
|
+
return 'Invalid helper type. Use: lighthelper, lightcamerahelper, navmesh, or collision';
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
public setActorHiddenInGame(actor: Actor, hidden: boolean): void {
|
|
1387
|
+
if (!this.isEditorWorld) {
|
|
1388
|
+
if (hidden) {
|
|
1389
|
+
this.hiddenInGameActors.add(actor);
|
|
1390
|
+
actor.rootComponent.traverse(obj => obj.layers.disableAll());
|
|
1391
|
+
this.postProcessManager.hiddenObjects.add(actor.rootComponent);
|
|
1392
|
+
} else {
|
|
1393
|
+
this.postProcessManager.hiddenObjects.delete(actor.rootComponent);
|
|
1394
|
+
actor.rootComponent.traverse(obj => obj.layers.enable(0));
|
|
1395
|
+
this.hiddenInGameActors.delete(actor);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
public setSceneComponentHiddenInGame(sceneComponent: SceneComponent, hidden: boolean): void {
|
|
1401
|
+
if (!this.isEditorWorld) {
|
|
1402
|
+
if (hidden) {
|
|
1403
|
+
this.hiddenInGameSceneComponents.add(sceneComponent);
|
|
1404
|
+
sceneComponent.traverse(obj => obj.layers.disableAll());
|
|
1405
|
+
this.postProcessManager.hiddenObjects.add(sceneComponent);
|
|
1406
|
+
} else {
|
|
1407
|
+
this.postProcessManager.hiddenObjects.delete(sceneComponent);
|
|
1408
|
+
sceneComponent.traverse(obj => obj.layers.enable(0));
|
|
1409
|
+
this.hiddenInGameSceneComponents.delete(sceneComponent);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
//====================================================================================================
|
|
1415
|
+
// Editor Functions
|
|
1416
|
+
//====================================================================================================
|
|
1417
|
+
|
|
1418
|
+
private onEditorActorAddToWorld?: (actor: Actor) => void;
|
|
1419
|
+
private onEditorActorRemoveFromWorld?: (actor: Actor) => void;
|
|
1420
|
+
|
|
1421
|
+
public setIsEditorWorld(isEditorWorld: boolean, onActorAddToWorld?: (actor: Actor) => void, onActorRemoveFromWorld?: (actor: Actor) => void): void {
|
|
1422
|
+
this.isEditorWorld = isEditorWorld;
|
|
1423
|
+
if (onActorAddToWorld) {
|
|
1424
|
+
this.onEditorActorAddToWorld = onActorAddToWorld;
|
|
1425
|
+
}
|
|
1426
|
+
if (onActorRemoveFromWorld) {
|
|
1427
|
+
this.onEditorActorRemoveFromWorld = onActorRemoveFromWorld;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
}
|