@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,1515 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightmapping System Demo
|
|
3
|
+
*
|
|
4
|
+
* This is the main demo showcasing the complete lightmapping system including:
|
|
5
|
+
* - Loading existing Genesys scene files with automatic lightmap loading
|
|
6
|
+
* - Interactive lightmap baking with automatic light detection
|
|
7
|
+
* - Export/import lightmap data to/from files
|
|
8
|
+
* - Various visualization modes for debugging and testing
|
|
9
|
+
* - Integration with the core engine's automatic lightmap system
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import * as ENGINE from 'genesys.js';
|
|
13
|
+
import * as THREE from 'three';
|
|
14
|
+
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
|
|
15
|
+
import { Pane } from 'tweakpane';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export class LightmappingDemo extends ENGINE.BaseGameLoop {
|
|
19
|
+
private lightmapManager!: ENGINE.LightmapManager;
|
|
20
|
+
private pane!: Pane;
|
|
21
|
+
|
|
22
|
+
// Store reference to directional light actor and transform controls
|
|
23
|
+
private directionalLightActor: ENGINE.Actor | null = null;
|
|
24
|
+
|
|
25
|
+
// Track current scene path for filename generation
|
|
26
|
+
private currentScenePath: ENGINE.AssetPath | null = null;
|
|
27
|
+
private transformControls: TransformControls | null = null;
|
|
28
|
+
|
|
29
|
+
// Tweakpane controls and parameters
|
|
30
|
+
private lightmapParams = {
|
|
31
|
+
// Basic settings
|
|
32
|
+
resolution: 512,
|
|
33
|
+
casts: 32,
|
|
34
|
+
progressiveSamples: 128,
|
|
35
|
+
lightSize: 0.5,
|
|
36
|
+
|
|
37
|
+
// Lighting toggles
|
|
38
|
+
directLightEnabled: true,
|
|
39
|
+
indirectLightEnabled: false,
|
|
40
|
+
ambientLightEnabled: false,
|
|
41
|
+
|
|
42
|
+
// Advanced settings
|
|
43
|
+
ambientDistance: 10.0,
|
|
44
|
+
filterMode: 'Linear' as 'Linear' | 'Nearest',
|
|
45
|
+
|
|
46
|
+
// Atlas options (matching LightmapAtlasOptions interface)
|
|
47
|
+
padding: 2,
|
|
48
|
+
dilate: true,
|
|
49
|
+
|
|
50
|
+
// Manager options
|
|
51
|
+
progressiveBaking: true,
|
|
52
|
+
autoApply: true,
|
|
53
|
+
|
|
54
|
+
// Export options (only includeSceneHash is actually used)
|
|
55
|
+
includeSceneHash: true,
|
|
56
|
+
|
|
57
|
+
// Render mode for visualization
|
|
58
|
+
renderMode: 'standard' as 'standard' | 'positions' | 'normals' | 'uv' | 'lightmap' | 'beauty'
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Store original material maps for restoration
|
|
62
|
+
private originalMaterialMaps = new Map<THREE.Material, THREE.Texture | null>();
|
|
63
|
+
|
|
64
|
+
// File input for scene loading
|
|
65
|
+
private fileInput: HTMLInputElement | null = null;
|
|
66
|
+
|
|
67
|
+
protected override async preStart(): Promise<void> {
|
|
68
|
+
// Load default scene
|
|
69
|
+
await this.loadDefaultScene();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
protected override postStart(): void {
|
|
73
|
+
// Get the lightmap manager from the world (it's created automatically by the engine)
|
|
74
|
+
this.lightmapManager = this.world.getLightmapManager()!;
|
|
75
|
+
this.createTweakPane();
|
|
76
|
+
this.createFileInput();
|
|
77
|
+
|
|
78
|
+
// Set up transform controls after the world is fully initialized
|
|
79
|
+
this.setupTransformControls();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private async loadDefaultScene(): Promise<void> {
|
|
83
|
+
this.clearExistingScene();
|
|
84
|
+
await this.createDefaultScene();
|
|
85
|
+
this.updateStatus('✓ Default scene created');
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Clears all existing actors and debug objects from the scene
|
|
91
|
+
*/
|
|
92
|
+
private clearExistingScene(): void {
|
|
93
|
+
// Clean up transform controls and light helpers FIRST
|
|
94
|
+
this.cleanupTransformControlsAndHelpers();
|
|
95
|
+
|
|
96
|
+
// Clear debug textures
|
|
97
|
+
this.clearDebugTextures();
|
|
98
|
+
|
|
99
|
+
// Clear original material maps
|
|
100
|
+
this.originalMaterialMaps.clear();
|
|
101
|
+
|
|
102
|
+
// Remove all existing actors
|
|
103
|
+
const existingActors = this.world.getActors();
|
|
104
|
+
this.world.removeActors(...existingActors);
|
|
105
|
+
|
|
106
|
+
// Clear current scene path
|
|
107
|
+
this.currentScenePath = null;
|
|
108
|
+
|
|
109
|
+
// Reset directional light actor reference since scene is cleared
|
|
110
|
+
this.directionalLightActor = null;
|
|
111
|
+
|
|
112
|
+
// Reset light helper visibility state for new scene
|
|
113
|
+
// This property is no longer needed as we use userData on the light component
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Cleans up transform controls and light helpers before scene changes
|
|
118
|
+
*/
|
|
119
|
+
private cleanupTransformControlsAndHelpers(): void {
|
|
120
|
+
// Disable and dispose of transform controls first
|
|
121
|
+
if (this.transformControls) {
|
|
122
|
+
console.log('Cleaning up transform controls...');
|
|
123
|
+
|
|
124
|
+
// Disable the controls to prevent any ongoing interactions
|
|
125
|
+
this.transformControls.enabled = false;
|
|
126
|
+
|
|
127
|
+
// Detach from any object
|
|
128
|
+
this.transformControls.detach();
|
|
129
|
+
|
|
130
|
+
// Remove event listeners by disposing
|
|
131
|
+
this.transformControls.dispose();
|
|
132
|
+
|
|
133
|
+
// Remove the helper from the scene
|
|
134
|
+
const helper = this.transformControls.getHelper();
|
|
135
|
+
if (helper && helper.parent) {
|
|
136
|
+
helper.parent.remove(helper);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Clear the reference
|
|
140
|
+
this.transformControls = null;
|
|
141
|
+
console.log('Transform controls cleaned up');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Hide all light helpers in the current scene before clearing
|
|
145
|
+
const lightActors = this.world.getActorsByPredicate(actor =>
|
|
146
|
+
actor.getComponents(ENGINE.DirectionalLightComponent).length > 0 ||
|
|
147
|
+
actor.getComponents(ENGINE.PointLightComponent).length > 0 ||
|
|
148
|
+
actor.getComponents(ENGINE.SpotLightComponent).length > 0
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
for (const actor of lightActors) {
|
|
152
|
+
// Handle DirectionalLightComponent
|
|
153
|
+
const directionalLights = actor.getComponents(ENGINE.DirectionalLightComponent);
|
|
154
|
+
for (const light of directionalLights) {
|
|
155
|
+
if (light.userData.helperVisible === true) {
|
|
156
|
+
try {
|
|
157
|
+
console.log('Hiding directional light helper before scene clear');
|
|
158
|
+
light.showHelper(false);
|
|
159
|
+
delete light.userData.helperVisible;
|
|
160
|
+
} catch (error) {
|
|
161
|
+
console.warn('Error hiding directional light helper:', error);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Handle PointLightComponent
|
|
167
|
+
const pointLights = actor.getComponents(ENGINE.PointLightComponent);
|
|
168
|
+
for (const light of pointLights) {
|
|
169
|
+
if (light.userData.helperVisible === true) {
|
|
170
|
+
try {
|
|
171
|
+
console.log('Hiding point light helper before scene clear');
|
|
172
|
+
light.showHelper(false);
|
|
173
|
+
delete light.userData.helperVisible;
|
|
174
|
+
} catch (error) {
|
|
175
|
+
console.warn('Error hiding point light helper:', error);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Handle SpotLightComponent
|
|
181
|
+
const spotLights = actor.getComponents(ENGINE.SpotLightComponent);
|
|
182
|
+
for (const light of spotLights) {
|
|
183
|
+
if (light.userData.helperVisible === true) {
|
|
184
|
+
try {
|
|
185
|
+
console.log('Hiding spot light helper before scene clear');
|
|
186
|
+
light.showHelper(false);
|
|
187
|
+
delete light.userData.helperVisible;
|
|
188
|
+
} catch (error) {
|
|
189
|
+
console.warn('Error hiding spot light helper:', error);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Clear the directional light actor reference
|
|
196
|
+
this.directionalLightActor = null;
|
|
197
|
+
console.log('Light helpers cleaned up and references cleared');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Creates a simple fallback scene if no scene file is available
|
|
202
|
+
*/
|
|
203
|
+
private async createDefaultScene(): Promise<void> {
|
|
204
|
+
const { pawn } = ENGINE.GameBuilder.createDefaultPawn(this.world, new THREE.Vector3(0, 8, 5));
|
|
205
|
+
pawn.getCamera()?.lookAt(0, 0, 0);
|
|
206
|
+
|
|
207
|
+
// Create ground plane (STATIC - will be included in lightmapping)
|
|
208
|
+
const ground = new ENGINE.Actor({
|
|
209
|
+
position: new THREE.Vector3(0, 0, 0),
|
|
210
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
211
|
+
geometry: new THREE.PlaneGeometry(20, 20),
|
|
212
|
+
material: new THREE.MeshStandardMaterial({
|
|
213
|
+
color: 0xffffff,
|
|
214
|
+
roughness: 0.8,
|
|
215
|
+
metalness: 0.1
|
|
216
|
+
}),
|
|
217
|
+
physicsOptions: {
|
|
218
|
+
enabled: true,
|
|
219
|
+
motionType: ENGINE.PhysicsMotionType.Static, // STATIC: Included in lightmaps
|
|
220
|
+
collisionProfile: 'WorldStatic'
|
|
221
|
+
}
|
|
222
|
+
})
|
|
223
|
+
});
|
|
224
|
+
ground.rootComponent.rotation.x = -Math.PI / 2;
|
|
225
|
+
// Enable shadows for ground
|
|
226
|
+
const groundMeshComp = ground.rootComponent as ENGINE.MeshComponent;
|
|
227
|
+
groundMeshComp.receiveShadow = true;
|
|
228
|
+
ground.addActorTag('ground');
|
|
229
|
+
this.world.addActors(ground);
|
|
230
|
+
|
|
231
|
+
// Create static cubes to cast shadows (STATIC - will be included in lightmapping)
|
|
232
|
+
const staticCubePositions = [
|
|
233
|
+
{ x: -2, z: -1 },
|
|
234
|
+
{ x: 2, z: 3 },
|
|
235
|
+
{ x: -1, z: 4 },
|
|
236
|
+
{x: 0, z: 0},
|
|
237
|
+
{x: 4, z: -2}
|
|
238
|
+
];
|
|
239
|
+
const staticCubeGeometries = [
|
|
240
|
+
{ width: 1, height: 2, depth: 1 },
|
|
241
|
+
{ width: 1, height: 2, depth: 2 },
|
|
242
|
+
{ width: 2, height: 2, depth: 1 },
|
|
243
|
+
{ width: 2, height: 2, depth: 2 },
|
|
244
|
+
{ width: 1, height: 1, depth: 1 },
|
|
245
|
+
];
|
|
246
|
+
|
|
247
|
+
const staticCubeColor = 0x0000ff; // blue
|
|
248
|
+
|
|
249
|
+
for (let i = 0; i < staticCubePositions.length; i++) {
|
|
250
|
+
const staticCube = new ENGINE.Actor({
|
|
251
|
+
position: new THREE.Vector3(
|
|
252
|
+
staticCubePositions[i].x,
|
|
253
|
+
1,
|
|
254
|
+
staticCubePositions[i].z
|
|
255
|
+
),
|
|
256
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
257
|
+
geometry: new THREE.BoxGeometry(
|
|
258
|
+
staticCubeGeometries[i].width,
|
|
259
|
+
staticCubeGeometries[i].height,
|
|
260
|
+
staticCubeGeometries[i].depth
|
|
261
|
+
),
|
|
262
|
+
material: new THREE.MeshStandardMaterial({
|
|
263
|
+
color: new THREE.Color(staticCubeColor),
|
|
264
|
+
roughness: 0.6,
|
|
265
|
+
metalness: 0.2
|
|
266
|
+
}),
|
|
267
|
+
physicsOptions: {
|
|
268
|
+
enabled: true,
|
|
269
|
+
motionType: ENGINE.PhysicsMotionType.Static, // STATIC: Included in lightmaps
|
|
270
|
+
collisionProfile: 'WorldStatic'
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
});
|
|
274
|
+
staticCube.addActorTag('staticCube_' + i);
|
|
275
|
+
// Enable shadows
|
|
276
|
+
const staticMeshComp = staticCube.rootComponent as ENGINE.MeshComponent;
|
|
277
|
+
staticMeshComp.castShadow = true;
|
|
278
|
+
staticMeshComp.receiveShadow = true;
|
|
279
|
+
this.world.addActors(staticCube);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Create dynamic cubes (DYNAMIC - will be EXCLUDED from lightmapping)
|
|
283
|
+
const dynamicCubePositions = [
|
|
284
|
+
{ x: 3, z: -3 },
|
|
285
|
+
{ x: -2, z: 1 }
|
|
286
|
+
];
|
|
287
|
+
const dynamicCubeColors = [
|
|
288
|
+
0xf9ca24, // Yellow
|
|
289
|
+
0x6c5ce7 // Purple
|
|
290
|
+
];
|
|
291
|
+
|
|
292
|
+
for (let i = 0; i < 2; i++) {
|
|
293
|
+
const dynamicCube = new ENGINE.Actor({
|
|
294
|
+
position: new THREE.Vector3(
|
|
295
|
+
dynamicCubePositions[i].x,
|
|
296
|
+
1,
|
|
297
|
+
dynamicCubePositions[i].z
|
|
298
|
+
),
|
|
299
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
300
|
+
geometry: new THREE.BoxGeometry(1, 2, 1),
|
|
301
|
+
material: new THREE.MeshStandardMaterial({
|
|
302
|
+
color: new THREE.Color(dynamicCubeColors[i]),
|
|
303
|
+
roughness: 0.6,
|
|
304
|
+
metalness: 0.2,
|
|
305
|
+
emissive: new THREE.Color(dynamicCubeColors[i]).multiplyScalar(0.1) // Slight glow to indicate they're dynamic
|
|
306
|
+
}),
|
|
307
|
+
physicsOptions: {
|
|
308
|
+
enabled: true,
|
|
309
|
+
motionType: ENGINE.PhysicsMotionType.Dynamic, // DYNAMIC: Excluded from lightmaps
|
|
310
|
+
collisionProfile: 'WorldDynamic'
|
|
311
|
+
}
|
|
312
|
+
})
|
|
313
|
+
});
|
|
314
|
+
// Enable shadows
|
|
315
|
+
const dynamicMeshComp = dynamicCube.rootComponent as ENGINE.MeshComponent;
|
|
316
|
+
dynamicMeshComp.castShadow = true;
|
|
317
|
+
dynamicMeshComp.receiveShadow = true;
|
|
318
|
+
dynamicCube.addActorTag('dynamicCube_' + i);
|
|
319
|
+
this.world.addActors(dynamicCube);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Create a kinematic moving platform (KINEMATIC - will be EXCLUDED from lightmapping)
|
|
323
|
+
const movingPlatform = new ENGINE.Actor({
|
|
324
|
+
position: new THREE.Vector3(0, 0.5, -8),
|
|
325
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
326
|
+
geometry: new THREE.BoxGeometry(3, 0.5, 2),
|
|
327
|
+
material: new THREE.MeshStandardMaterial({
|
|
328
|
+
color: 0x00ff88,
|
|
329
|
+
roughness: 0.4,
|
|
330
|
+
metalness: 0.8,
|
|
331
|
+
emissive: new THREE.Color(0x00ff88).multiplyScalar(0.05) // Slight glow to indicate it's kinematic
|
|
332
|
+
}),
|
|
333
|
+
physicsOptions: {
|
|
334
|
+
enabled: true,
|
|
335
|
+
motionType: ENGINE.PhysicsMotionType.KinematicPositionBased, // KINEMATIC: Excluded from lightmaps
|
|
336
|
+
collisionProfile: 'WorldStatic'
|
|
337
|
+
}
|
|
338
|
+
})
|
|
339
|
+
});
|
|
340
|
+
// Enable shadows
|
|
341
|
+
const platformMeshComp = movingPlatform.rootComponent as ENGINE.MeshComponent;
|
|
342
|
+
platformMeshComp.castShadow = true;
|
|
343
|
+
platformMeshComp.receiveShadow = true;
|
|
344
|
+
movingPlatform.addActorTag('movingPlatform');
|
|
345
|
+
this.world.addActors(movingPlatform);
|
|
346
|
+
|
|
347
|
+
// Add a directional light (sun) - white, high intensity, from above at angle
|
|
348
|
+
this.directionalLightActor = new ENGINE.Actor({
|
|
349
|
+
position: new THREE.Vector3(8, 12, 3),
|
|
350
|
+
rootComponent: new ENGINE.DirectionalLightComponent({
|
|
351
|
+
color: 0xffffff,
|
|
352
|
+
intensity: 50.0,
|
|
353
|
+
castShadow: true
|
|
354
|
+
})
|
|
355
|
+
});
|
|
356
|
+
const directionalLight = this.directionalLightActor.rootComponent as ENGINE.DirectionalLightComponent;
|
|
357
|
+
directionalLight.lookAt(0, 0, 0);
|
|
358
|
+
this.directionalLightActor.addActorTag('directionalLight');
|
|
359
|
+
this.world.addActors(this.directionalLightActor);
|
|
360
|
+
|
|
361
|
+
// Add ambient light for overall illumination
|
|
362
|
+
const ambientLightActor = new ENGINE.Actor({
|
|
363
|
+
rootComponent: new ENGINE.AmbientLightComponent({
|
|
364
|
+
color: 0xffffff,
|
|
365
|
+
intensity: 5
|
|
366
|
+
})
|
|
367
|
+
});
|
|
368
|
+
ambientLightActor.addActorTag('ambientLight');
|
|
369
|
+
this.world.addActors(ambientLightActor);
|
|
370
|
+
|
|
371
|
+
// Add a yellow point light to shine on the last static cube
|
|
372
|
+
const pointLightActor = new ENGINE.Actor({
|
|
373
|
+
position: new THREE.Vector3(4, 3, -2), // Above the last static cube at (4, -2)
|
|
374
|
+
rootComponent: new ENGINE.PointLightComponent({
|
|
375
|
+
color: 0xffff55, // Slightly yellow
|
|
376
|
+
intensity: 100,
|
|
377
|
+
distance: 15,
|
|
378
|
+
decay: 2,
|
|
379
|
+
castShadow: true
|
|
380
|
+
})
|
|
381
|
+
});
|
|
382
|
+
pointLightActor.addActorTag('pointLight');
|
|
383
|
+
this.world.addActors(pointLightActor);
|
|
384
|
+
|
|
385
|
+
console.log('📍 Default scene created with static/dynamic mesh examples:');
|
|
386
|
+
console.log(' 🔹 Static meshes (included in lightmaps): blue cubes');
|
|
387
|
+
console.log(' 🔸 Dynamic meshes (excluded from lightmaps): yellow and purple cubes');
|
|
388
|
+
console.log(' 🔷 Kinematic meshes (excluded from lightmaps): Moving platform (green)');
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Sets up transform controls for the directional light
|
|
393
|
+
*/
|
|
394
|
+
private setupTransformControls(): void {
|
|
395
|
+
// Use the reattach method which handles finding the light and setting up controls
|
|
396
|
+
this.reattachTransformControls();
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Handles interaction state changes for transform controls
|
|
401
|
+
*/
|
|
402
|
+
private handleTransformControlsInteraction(isDragging: boolean): void {
|
|
403
|
+
// Get the player controller to disable input when dragging
|
|
404
|
+
const playerController = this.world.getFirstActor(ENGINE.PlayerController);
|
|
405
|
+
if (playerController) {
|
|
406
|
+
// When dragging, we want to prevent player camera movement
|
|
407
|
+
// This is handled automatically by the transform controls blocking pointer events
|
|
408
|
+
// The engine's input system will respect this
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Updates the directional light's direction to point towards the origin
|
|
414
|
+
*/
|
|
415
|
+
private updateDirectionalLightDirection(): void {
|
|
416
|
+
if (!this.directionalLightActor) return;
|
|
417
|
+
|
|
418
|
+
try {
|
|
419
|
+
const directionalLightComponents = this.directionalLightActor.getComponents(ENGINE.DirectionalLightComponent);
|
|
420
|
+
if (directionalLightComponents.length > 0) {
|
|
421
|
+
const directionalLight = directionalLightComponents[0];
|
|
422
|
+
|
|
423
|
+
// Get the current world position of the light
|
|
424
|
+
const lightPosition = this.directionalLightActor.getWorldPosition();
|
|
425
|
+
|
|
426
|
+
// Make the light look at the origin (0, 0, 0)
|
|
427
|
+
directionalLight.lookAt(0, 0, 0);
|
|
428
|
+
|
|
429
|
+
// Update the light's target for shadow mapping using the public API
|
|
430
|
+
directionalLight.setTarget(new THREE.Vector3(0, 0, 0));
|
|
431
|
+
|
|
432
|
+
// Log the new position for debugging
|
|
433
|
+
console.log(`🔆 Directional light moved to: (${lightPosition.x.toFixed(2)}, ${lightPosition.y.toFixed(2)}, ${lightPosition.z.toFixed(2)}) - Bake lightmaps to see changes!`);
|
|
434
|
+
}
|
|
435
|
+
} catch (error) {
|
|
436
|
+
console.warn('Failed to update directional light direction:', error);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Creates a hidden file input for scene loading
|
|
442
|
+
*/
|
|
443
|
+
private createFileInput(): void {
|
|
444
|
+
this.fileInput = document.createElement('input');
|
|
445
|
+
this.fileInput.type = 'file';
|
|
446
|
+
this.fileInput.accept = '.genesys-scene,.json';
|
|
447
|
+
this.fileInput.style.display = 'none';
|
|
448
|
+
document.body.appendChild(this.fileInput);
|
|
449
|
+
|
|
450
|
+
this.fileInput.addEventListener('change', async (event) => {
|
|
451
|
+
const file = (event.target as HTMLInputElement).files?.[0];
|
|
452
|
+
if (file) {
|
|
453
|
+
await this.loadSceneFromFile(file);
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Loads a scene from a selected file
|
|
460
|
+
*/
|
|
461
|
+
private async loadSceneFromFile(file: File): Promise<void> {
|
|
462
|
+
try {
|
|
463
|
+
this.updateStatus('Loading scene file...');
|
|
464
|
+
|
|
465
|
+
const text = await file.text();
|
|
466
|
+
const sceneData = JSON.parse(text);
|
|
467
|
+
|
|
468
|
+
// Clear existing scene completely
|
|
469
|
+
this.clearExistingScene();
|
|
470
|
+
|
|
471
|
+
// Load the new scene data using proper method
|
|
472
|
+
await this.loadWorldData(sceneData);
|
|
473
|
+
|
|
474
|
+
// Update current scene path
|
|
475
|
+
this.currentScenePath = ENGINE.AssetPath.fromString(`/scenes/${file.name}`);
|
|
476
|
+
|
|
477
|
+
// Create camera controller if none exists
|
|
478
|
+
if (!this.world.getFirstActor(ENGINE.PlayerController)) {
|
|
479
|
+
ENGINE.GameBuilder.createDefaultPawn(this.world, new THREE.Vector3(0, 1, 0));
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// Reattach transform controls to the new scene's directional light
|
|
483
|
+
this.reattachTransformControls();
|
|
484
|
+
|
|
485
|
+
// For user-uploaded files, attempt to auto-load lightmaps
|
|
486
|
+
await this.tryLoadLightmapsForUserFile(file.name);
|
|
487
|
+
|
|
488
|
+
} catch (error) {
|
|
489
|
+
this.updateStatus(`✗ Failed to load scene: ${error}`);
|
|
490
|
+
console.error('Failed to load scene file:', error);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Attempts to load lightmaps for a user-uploaded file
|
|
496
|
+
*/
|
|
497
|
+
private async tryLoadLightmapsForUserFile(sceneName: string): Promise<void> {
|
|
498
|
+
// Extract base name without extension
|
|
499
|
+
const baseName = sceneName.replace(/\.[^.]+$/, '');
|
|
500
|
+
|
|
501
|
+
// For user files, we can't automatically find the lightmap files
|
|
502
|
+
// since they're not in a known file system location
|
|
503
|
+
// Just report that the scene was loaded without lightmaps
|
|
504
|
+
this.updateStatus(`✓ Loaded scene: ${sceneName} (use Import Lightmaps button to load lightmaps manually)`);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Checks and reports lightmap loading status after scene loading
|
|
509
|
+
*/
|
|
510
|
+
private checkLightmapStatus(sceneName: string): void {
|
|
511
|
+
const lightmapManager = this.world.getLightmapManager();
|
|
512
|
+
if (lightmapManager && lightmapManager.hasLightmapData()) {
|
|
513
|
+
this.updateStatus(`✓ Loaded scene: ${sceneName} (lightmaps automatically applied)`);
|
|
514
|
+
} else {
|
|
515
|
+
this.updateStatus(`✓ Loaded scene: ${sceneName} (no lightmaps found)`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Reattaches transform controls to the directional light in the current scene
|
|
521
|
+
*/
|
|
522
|
+
private reattachTransformControls(): void {
|
|
523
|
+
// Clean up existing transform controls first using the dedicated cleanup method
|
|
524
|
+
this.cleanupTransformControlsAndHelpers();
|
|
525
|
+
|
|
526
|
+
// Find the directional light in the current scene
|
|
527
|
+
const foundActor = this.world.getActorsByPredicate(actor =>
|
|
528
|
+
actor.getComponents(ENGINE.DirectionalLightComponent).length > 0
|
|
529
|
+
)[0];
|
|
530
|
+
|
|
531
|
+
if (!foundActor) {
|
|
532
|
+
console.log('No directional light found in scene to attach transform controls.');
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Update our reference to the new directional light
|
|
537
|
+
this.directionalLightActor = foundActor;
|
|
538
|
+
|
|
539
|
+
// Get the camera from the world for the transform controls
|
|
540
|
+
const camera = this.world.getActiveCamera();
|
|
541
|
+
if (!camera) {
|
|
542
|
+
console.log('No camera found for transform controls');
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Create transform controls
|
|
547
|
+
this.transformControls = new TransformControls(camera, this.renderer.renderer.domElement);
|
|
548
|
+
|
|
549
|
+
// Attach to the directional light's root component
|
|
550
|
+
this.transformControls.attach(this.directionalLightActor.rootComponent);
|
|
551
|
+
|
|
552
|
+
// Add to the scene (cast to Object3D)
|
|
553
|
+
this.world.scene.add(this.transformControls.getHelper());
|
|
554
|
+
|
|
555
|
+
// Set initial mode to translate
|
|
556
|
+
this.transformControls.setMode('translate');
|
|
557
|
+
|
|
558
|
+
// Make the controls visible and slightly larger
|
|
559
|
+
this.transformControls.setSize(1.5);
|
|
560
|
+
|
|
561
|
+
// Show the directional light helper for better visualization with error handling
|
|
562
|
+
try {
|
|
563
|
+
const directionalLightComponents = this.directionalLightActor.getComponents(ENGINE.DirectionalLightComponent);
|
|
564
|
+
if (directionalLightComponents.length > 0) {
|
|
565
|
+
const directionalLight = directionalLightComponents[0];
|
|
566
|
+
|
|
567
|
+
directionalLight.showHelper(true);
|
|
568
|
+
// Mark helper as visible in userData for toggle button
|
|
569
|
+
directionalLight.userData.helperVisible = true;
|
|
570
|
+
console.log('Directional light helper shown');
|
|
571
|
+
} else {
|
|
572
|
+
console.warn('No DirectionalLightComponent found in the actor');
|
|
573
|
+
}
|
|
574
|
+
} catch (error) {
|
|
575
|
+
console.error('Error showing directional light helper:', error);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Add event listeners
|
|
579
|
+
this.transformControls.addEventListener('dragging-changed', (event) => {
|
|
580
|
+
// Disable camera controls when dragging the transform control
|
|
581
|
+
const isDragging = event.value as boolean;
|
|
582
|
+
this.handleTransformControlsInteraction(isDragging);
|
|
583
|
+
|
|
584
|
+
// Update light direction when dragging ends
|
|
585
|
+
if (!isDragging) {
|
|
586
|
+
this.updateDirectionalLightDirection();
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
this.transformControls.addEventListener('change', () => {
|
|
591
|
+
// Update the light's direction in real-time during dragging
|
|
592
|
+
this.updateDirectionalLightDirection();
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
this.transformControls.addEventListener('objectChange', () => {
|
|
596
|
+
// Additional update when the object transformation changes
|
|
597
|
+
this.updateDirectionalLightDirection();
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
console.log('Transform controls reattached to new directional light successfully');
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
private createTweakPane(): void {
|
|
604
|
+
this.pane = new Pane({title: 'Lightmapping Demo'});
|
|
605
|
+
|
|
606
|
+
// Scene controls
|
|
607
|
+
const sceneFolder = this.pane.addFolder({title: 'Scene', expanded: true});
|
|
608
|
+
|
|
609
|
+
const loadSceneButton = sceneFolder.addButton({title: 'Load Default Scene File'});
|
|
610
|
+
loadSceneButton.on('click', async () => {
|
|
611
|
+
// Load the default fps-new.genesys-scene file directly
|
|
612
|
+
try {
|
|
613
|
+
const defaultScenePath = ENGINE.AssetPath.fromString('@engine/assets/dev/fps-new.genesys-scene');
|
|
614
|
+
this.clearExistingScene();
|
|
615
|
+
this.currentScenePath = defaultScenePath;
|
|
616
|
+
await this.loadWorldDataFromPath(defaultScenePath);
|
|
617
|
+
|
|
618
|
+
if (!this.world.getFirstActor(ENGINE.PlayerController)) {
|
|
619
|
+
ENGINE.GameBuilder.createDefaultPawn(this.world, new THREE.Vector3(0, 2, 0));
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
this.reattachTransformControls();
|
|
623
|
+
this.checkLightmapStatus('fps-new.genesys-scene');
|
|
624
|
+
} catch (error) {
|
|
625
|
+
console.error('Failed to load scene file:', error);
|
|
626
|
+
this.updateStatus('❌ Failed to load scene file');
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
const loadCustomSceneButton = sceneFolder.addButton({title: 'Load Custom Scene File'});
|
|
631
|
+
loadCustomSceneButton.on('click', () => {
|
|
632
|
+
this.fileInput?.click();
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
const reloadButton = sceneFolder.addButton({title: 'Reload Default Scene'});
|
|
636
|
+
reloadButton.on('click', () => {
|
|
637
|
+
this.loadDefaultScene();
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
// Basic lightmap settings
|
|
641
|
+
const basicFolder = this.pane.addFolder({title: 'Basic Settings', expanded: true});
|
|
642
|
+
basicFolder.addBinding(this.lightmapParams, 'resolution', {
|
|
643
|
+
min: 128,
|
|
644
|
+
max: 2048,
|
|
645
|
+
step: 128,
|
|
646
|
+
label: 'Resolution'
|
|
647
|
+
});
|
|
648
|
+
basicFolder.addBinding(this.lightmapParams, 'casts', {
|
|
649
|
+
min: 1,
|
|
650
|
+
max: 128,
|
|
651
|
+
step: 1,
|
|
652
|
+
label: 'Ray Casts'
|
|
653
|
+
});
|
|
654
|
+
basicFolder.addBinding(this.lightmapParams, 'progressiveSamples', {
|
|
655
|
+
min: 1,
|
|
656
|
+
max: 1000,
|
|
657
|
+
label: 'Samples'
|
|
658
|
+
});
|
|
659
|
+
basicFolder.addBinding(this.lightmapParams, 'lightSize', {
|
|
660
|
+
min: 0.1,
|
|
661
|
+
max: 2.0,
|
|
662
|
+
step: 0.1,
|
|
663
|
+
label: 'Light Size'
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
// Render mode control
|
|
667
|
+
const renderModeControl = basicFolder.addBinding(this.lightmapParams, 'renderMode', {
|
|
668
|
+
options: {
|
|
669
|
+
'Standard': 'standard',
|
|
670
|
+
'Positions': 'positions',
|
|
671
|
+
'Normals': 'normals',
|
|
672
|
+
'UV Debug': 'uv',
|
|
673
|
+
'Lightmap Only': 'lightmap',
|
|
674
|
+
'Beauty (Lightmap + Textures)': 'beauty'
|
|
675
|
+
},
|
|
676
|
+
label: 'Render Mode'
|
|
677
|
+
});
|
|
678
|
+
renderModeControl.on('change', () => {
|
|
679
|
+
this.onRenderModeChange();
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
// Lighting options
|
|
683
|
+
const lightingFolder = this.pane.addFolder({title: 'Lighting Options', expanded: true});
|
|
684
|
+
lightingFolder.addBinding(this.lightmapParams, 'directLightEnabled', {
|
|
685
|
+
label: 'Direct Light'
|
|
686
|
+
});
|
|
687
|
+
lightingFolder.addBinding(this.lightmapParams, 'indirectLightEnabled', {
|
|
688
|
+
label: 'Indirect Light'
|
|
689
|
+
});
|
|
690
|
+
lightingFolder.addBinding(this.lightmapParams, 'ambientLightEnabled', {
|
|
691
|
+
label: 'Ambient/AO'
|
|
692
|
+
});
|
|
693
|
+
lightingFolder.addBinding(this.lightmapParams, 'ambientDistance', {
|
|
694
|
+
min: 1.0,
|
|
695
|
+
max: 50.0,
|
|
696
|
+
step: 0.5,
|
|
697
|
+
label: 'AO Distance'
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
// Advanced settings
|
|
701
|
+
const advancedFolder = this.pane.addFolder({title: 'Advanced Settings', expanded: false});
|
|
702
|
+
advancedFolder.addBinding(this.lightmapParams, 'filterMode', {
|
|
703
|
+
options: {
|
|
704
|
+
Linear: 'Linear',
|
|
705
|
+
Nearest: 'Nearest'
|
|
706
|
+
},
|
|
707
|
+
label: 'Filter Mode'
|
|
708
|
+
});
|
|
709
|
+
advancedFolder.addBinding(this.lightmapParams, 'padding', {
|
|
710
|
+
min: 0,
|
|
711
|
+
max: 10,
|
|
712
|
+
step: 1,
|
|
713
|
+
label: 'Atlas Padding'
|
|
714
|
+
});
|
|
715
|
+
advancedFolder.addBinding(this.lightmapParams, 'dilate', {
|
|
716
|
+
label: 'Atlas Dilation'
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
// Manager options
|
|
720
|
+
const managerFolder = this.pane.addFolder({title: 'Baking Options', expanded: false});
|
|
721
|
+
managerFolder.addBinding(this.lightmapParams, 'progressiveBaking', {
|
|
722
|
+
label: 'Progressive Baking'
|
|
723
|
+
});
|
|
724
|
+
managerFolder.addBinding(this.lightmapParams, 'autoApply', {
|
|
725
|
+
label: 'Auto Apply'
|
|
726
|
+
});
|
|
727
|
+
|
|
728
|
+
// Action buttons
|
|
729
|
+
const actionsFolder = this.pane.addFolder({title: 'Actions', expanded: true});
|
|
730
|
+
const bakeButton = actionsFolder.addButton({title: 'Bake Lightmaps'});
|
|
731
|
+
bakeButton.on('click', () => {
|
|
732
|
+
this.bakeLightmaps();
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
const removeButton = actionsFolder.addButton({title: 'Remove Lightmaps'});
|
|
736
|
+
removeButton.on('click', () => {
|
|
737
|
+
this.removeLightmaps();
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
// Export/Import controls
|
|
741
|
+
const exportImportFolder = this.pane.addFolder({title: 'Export/Import', expanded: true});
|
|
742
|
+
|
|
743
|
+
exportImportFolder.addBinding(this.lightmapParams, 'includeSceneHash', {
|
|
744
|
+
label: 'Include Scene Hash'
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
const exportButton = exportImportFolder.addButton({title: 'Export Lightmaps (Files)'});
|
|
748
|
+
exportButton.on('click', () => {
|
|
749
|
+
this.exportLightmaps();
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
const exportDataButton = exportImportFolder.addButton({title: 'Export Data (Custom)'});
|
|
753
|
+
exportDataButton.on('click', () => {
|
|
754
|
+
this.exportLightmapData();
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
const importButton = exportImportFolder.addButton({title: 'Import Lightmaps'});
|
|
758
|
+
importButton.on('click', () => {
|
|
759
|
+
this.openImportDialog();
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// Transform controls
|
|
763
|
+
const transformFolder = this.pane.addFolder({title: 'Transform Controls', expanded: true});
|
|
764
|
+
|
|
765
|
+
const translateButton = transformFolder.addButton({title: 'Translate Mode'});
|
|
766
|
+
translateButton.on('click', () => {
|
|
767
|
+
if (this.transformControls && this.transformControls.enabled) {
|
|
768
|
+
this.transformControls.setMode('translate');
|
|
769
|
+
} else {
|
|
770
|
+
console.log('Transform controls not available. Try refreshing controls first.');
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
const rotateButton = transformFolder.addButton({title: 'Rotate Mode'});
|
|
775
|
+
rotateButton.on('click', () => {
|
|
776
|
+
if (this.transformControls && this.transformControls.enabled) {
|
|
777
|
+
this.transformControls.setMode('rotate');
|
|
778
|
+
} else {
|
|
779
|
+
console.log('Transform controls not available. Try refreshing controls first.');
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
const scaleButton = transformFolder.addButton({title: 'Scale Mode'});
|
|
784
|
+
scaleButton.on('click', () => {
|
|
785
|
+
if (this.transformControls && this.transformControls.enabled) {
|
|
786
|
+
this.transformControls.setMode('scale');
|
|
787
|
+
} else {
|
|
788
|
+
console.log('Transform controls not available. Try refreshing controls first.');
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
const toggleControlsButton = transformFolder.addButton({title: 'Toggle Controls'});
|
|
793
|
+
toggleControlsButton.on('click', () => {
|
|
794
|
+
if (this.transformControls) {
|
|
795
|
+
this.transformControls.enabled = !this.transformControls.enabled;
|
|
796
|
+
console.log(`Transform controls ${this.transformControls.enabled ? 'enabled' : 'disabled'}`);
|
|
797
|
+
} else {
|
|
798
|
+
console.log('Transform controls not available. Try refreshing controls first.');
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
const refreshControlsButton = transformFolder.addButton({title: 'Refresh Controls'});
|
|
803
|
+
refreshControlsButton.on('click', () => {
|
|
804
|
+
this.reattachTransformControls();
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
const toggleLightHelperButton = transformFolder.addButton({title: 'Toggle Light Helper'});
|
|
808
|
+
toggleLightHelperButton.on('click', () => {
|
|
809
|
+
// Find the current directional light in the scene dynamically
|
|
810
|
+
const foundActor = this.world.getActorsByPredicate(actor =>
|
|
811
|
+
actor.getComponents(ENGINE.DirectionalLightComponent).length > 0
|
|
812
|
+
)[0];
|
|
813
|
+
|
|
814
|
+
if (foundActor) {
|
|
815
|
+
try {
|
|
816
|
+
const directionalLightComponents = foundActor.getComponents(ENGINE.DirectionalLightComponent);
|
|
817
|
+
if (directionalLightComponents.length > 0) {
|
|
818
|
+
const directionalLight = directionalLightComponents[0];
|
|
819
|
+
|
|
820
|
+
// Use userData to track toggle state per light component
|
|
821
|
+
const isHelperVisible = directionalLight.userData.helperVisible === true;
|
|
822
|
+
|
|
823
|
+
if (isHelperVisible) {
|
|
824
|
+
directionalLight.showHelper(false);
|
|
825
|
+
directionalLight.userData.helperVisible = false;
|
|
826
|
+
console.log('Light helper hidden');
|
|
827
|
+
} else {
|
|
828
|
+
directionalLight.showHelper(true);
|
|
829
|
+
directionalLight.userData.helperVisible = true;
|
|
830
|
+
console.log('Light helper shown');
|
|
831
|
+
}
|
|
832
|
+
} else {
|
|
833
|
+
console.warn('No DirectionalLightComponent found in the actor');
|
|
834
|
+
}
|
|
835
|
+
} catch (error) {
|
|
836
|
+
console.error('Error toggling light helper:', error);
|
|
837
|
+
}
|
|
838
|
+
} else {
|
|
839
|
+
console.log('No directional light found to toggle helper');
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
|
|
843
|
+
// Status display
|
|
844
|
+
this.pane.addBlade({ view: 'separator' });
|
|
845
|
+
const statusElement = document.createElement('div');
|
|
846
|
+
statusElement.style.padding = '8px';
|
|
847
|
+
statusElement.style.fontSize = '12px';
|
|
848
|
+
statusElement.style.color = '#888';
|
|
849
|
+
statusElement.style.backgroundColor = '#1a1a1a';
|
|
850
|
+
statusElement.style.borderRadius = '4px';
|
|
851
|
+
statusElement.innerHTML = 'Status: Ready<br/>💡 Move the directional light using transform controls, then bake to see the lighting changes!<br/>📍 The light position is captured at the moment baking starts.<br/>🔸 Static meshes (blue/red/teal cubes) will be included in lightmaps<br/>🔹 Dynamic meshes (yellow/purple cubes) will be excluded from lightmaps<br/>🔷 Kinematic meshes (green platform) will be excluded from lightmaps<br/>📦 Use "Export Data (Custom)" to see custom handling examples!';
|
|
852
|
+
exportImportFolder.element.appendChild(statusElement);
|
|
853
|
+
|
|
854
|
+
// Store reference for updates
|
|
855
|
+
(this as any).statusElement = statusElement;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Bakes lightmaps for the scene using the current settings
|
|
860
|
+
*/
|
|
861
|
+
private async bakeLightmaps(): Promise<void> {
|
|
862
|
+
try {
|
|
863
|
+
this.updateStatus('Baking lightmaps...');
|
|
864
|
+
|
|
865
|
+
await this.lightmapManager.bakeLightmaps(
|
|
866
|
+
{
|
|
867
|
+
resolution: this.lightmapParams.resolution,
|
|
868
|
+
casts: this.lightmapParams.casts,
|
|
869
|
+
progressiveSamples: this.lightmapParams.progressiveSamples,
|
|
870
|
+
|
|
871
|
+
directLightEnabled: this.lightmapParams.directLightEnabled,
|
|
872
|
+
indirectLightEnabled: this.lightmapParams.indirectLightEnabled,
|
|
873
|
+
ambientLightEnabled: this.lightmapParams.ambientLightEnabled,
|
|
874
|
+
ambientDistance: this.lightmapParams.ambientDistance,
|
|
875
|
+
filterMode: this.lightmapParams.filterMode === 'Linear' ? THREE.LinearFilter : THREE.NearestFilter,
|
|
876
|
+
atlasOptions: {
|
|
877
|
+
resolution: this.lightmapParams.resolution,
|
|
878
|
+
padding: this.lightmapParams.padding,
|
|
879
|
+
dilate: this.lightmapParams.dilate
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
(stage, progress, message) => {
|
|
883
|
+
this.updateStatus(`${stage}: ${progress.toFixed(1)}% - ${message ?? ''}`);
|
|
884
|
+
}
|
|
885
|
+
);
|
|
886
|
+
|
|
887
|
+
this.updateStatus('✓ Lightmaps baked successfully! Ready to export.');
|
|
888
|
+
} catch (error) {
|
|
889
|
+
this.updateStatus(`✗ Lightmap baking failed: ${error}`);
|
|
890
|
+
console.error('Lightmap baking failed:', error);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
private removeLightmaps(): void {
|
|
895
|
+
this.lightmapManager.removeLightmaps();
|
|
896
|
+
// Light management is now handled automatically by LightmapManager.removeLightmaps()
|
|
897
|
+
this.updateStatus('Lightmaps removed. Dynamic lighting restored.');
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Exports the current lightmaps to files
|
|
902
|
+
*/
|
|
903
|
+
private async exportLightmaps(): Promise<void> {
|
|
904
|
+
try {
|
|
905
|
+
if (!this.lightmapManager.hasLightmapData()) {
|
|
906
|
+
this.updateStatus('No lightmap data to export. Bake lightmaps first.');
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
this.updateStatus('Exporting lightmaps...');
|
|
911
|
+
|
|
912
|
+
// Get base filename from current scene path or use default
|
|
913
|
+
const baseFileName = this.currentScenePath ?
|
|
914
|
+
this.currentScenePath.initialPath.replace(/\.[^/.]+$/, '').replace(/^\/+/, '') :
|
|
915
|
+
'lightmap-demo';
|
|
916
|
+
|
|
917
|
+
// Get the lightmap data using the pure manager API
|
|
918
|
+
const result = await this.lightmapManager.exportLightmapData(baseFileName, {
|
|
919
|
+
includeSceneHash: this.lightmapParams.includeSceneHash,
|
|
920
|
+
});
|
|
921
|
+
|
|
922
|
+
// Handle file downloads in the demo
|
|
923
|
+
this.downloadBlob(result.textureBlob, result.textureFileName);
|
|
924
|
+
|
|
925
|
+
const metadataBlob = new Blob([result.metadataJson], { type: 'application/json' });
|
|
926
|
+
this.downloadBlob(metadataBlob, result.metadataFileName);
|
|
927
|
+
|
|
928
|
+
this.updateStatus(`✓ Lightmaps exported: ${result.metadataFileName} and ${result.textureFileName}`);
|
|
929
|
+
} catch (error) {
|
|
930
|
+
this.updateStatus(`✗ Export failed: ${error}`);
|
|
931
|
+
console.error('Failed to export lightmaps:', error);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Exports lightmap data for custom handling (demonstrates the new exportLightmapData API)
|
|
937
|
+
*/
|
|
938
|
+
private async exportLightmapData(): Promise<void> {
|
|
939
|
+
try {
|
|
940
|
+
if (!this.lightmapManager.hasLightmapData()) {
|
|
941
|
+
this.updateStatus('No lightmap data to export. Bake lightmaps first.');
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
this.updateStatus('Exporting lightmap data for custom handling...');
|
|
946
|
+
|
|
947
|
+
// Get base filename from current scene path or use default
|
|
948
|
+
const baseFileName = this.currentScenePath ?
|
|
949
|
+
this.currentScenePath.initialPath.replace(/\.[^/.]+$/, '').replace(/^\/+/, '') :
|
|
950
|
+
'lightmap-demo';
|
|
951
|
+
|
|
952
|
+
// Use the new exportLightmapData method to get data instead of directly creating files
|
|
953
|
+
const result = await this.lightmapManager.exportLightmapData(baseFileName, {
|
|
954
|
+
includeSceneHash: this.lightmapParams.includeSceneHash,
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
// Demonstrate different ways to handle the data:
|
|
958
|
+
console.log('📦 Lightmap data exported for custom handling:');
|
|
959
|
+
console.log(` Metadata size: ${(result.metadataJson.length / 1024).toFixed(2)} KB`);
|
|
960
|
+
console.log(` Texture size: ${(result.textureBlob.size / 1024 / 1024).toFixed(2)} MB`);
|
|
961
|
+
console.log(` Suggested filenames: ${result.metadataFileName}, ${result.textureFileName}`);
|
|
962
|
+
|
|
963
|
+
// Example 1: Save to browser's IndexedDB for offline use
|
|
964
|
+
await this.saveToIndexedDB(result);
|
|
965
|
+
|
|
966
|
+
// Example 2: Create downloadable files manually (same result as exportLightmap)
|
|
967
|
+
this.downloadLightmapData(result);
|
|
968
|
+
|
|
969
|
+
// Example 3: Send to a server (simulated)
|
|
970
|
+
await this.simulateServerUpload(result);
|
|
971
|
+
|
|
972
|
+
this.updateStatus('✓ Lightmap data exported with custom handling examples (check console for details)');
|
|
973
|
+
} catch (error) {
|
|
974
|
+
this.updateStatus(`✗ Export data failed: ${error}`);
|
|
975
|
+
console.error('Failed to export lightmap data:', error);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Example: Save lightmap data to IndexedDB for offline use
|
|
981
|
+
*/
|
|
982
|
+
private async saveToIndexedDB(lightmapData: any): Promise<void> {
|
|
983
|
+
return new Promise((resolve, reject) => {
|
|
984
|
+
const request = indexedDB.open('LightmapStorage', 1);
|
|
985
|
+
|
|
986
|
+
request.onerror = () => reject(request.error);
|
|
987
|
+
|
|
988
|
+
request.onsuccess = () => {
|
|
989
|
+
const db = request.result;
|
|
990
|
+
const transaction = db.transaction(['lightmaps'], 'readwrite');
|
|
991
|
+
const store = transaction.objectStore('lightmaps');
|
|
992
|
+
|
|
993
|
+
const lightmapRecord = {
|
|
994
|
+
id: Date.now(),
|
|
995
|
+
metadata: lightmapData.metadataJson,
|
|
996
|
+
texture: lightmapData.textureBlob,
|
|
997
|
+
metadataFileName: lightmapData.metadataFileName,
|
|
998
|
+
textureFileName: lightmapData.textureFileName,
|
|
999
|
+
timestamp: new Date().toISOString()
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
store.add(lightmapRecord);
|
|
1003
|
+
transaction.oncomplete = () => {
|
|
1004
|
+
console.log('💾 Lightmap data saved to IndexedDB for offline use');
|
|
1005
|
+
resolve();
|
|
1006
|
+
};
|
|
1007
|
+
transaction.onerror = () => reject(transaction.error);
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
request.onupgradeneeded = () => {
|
|
1011
|
+
const db = request.result;
|
|
1012
|
+
if (!db.objectStoreNames.contains('lightmaps')) {
|
|
1013
|
+
db.createObjectStore('lightmaps', { keyPath: 'id' });
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Example: Manually create downloadable files from the data
|
|
1021
|
+
*/
|
|
1022
|
+
private downloadLightmapData(lightmapData: any): void {
|
|
1023
|
+
// Create metadata blob and download
|
|
1024
|
+
const metadataBlob = new Blob([lightmapData.metadataJson], { type: 'application/json' });
|
|
1025
|
+
this.downloadBlob(metadataBlob, lightmapData.metadataFileName);
|
|
1026
|
+
|
|
1027
|
+
// Download texture blob
|
|
1028
|
+
this.downloadBlob(lightmapData.textureBlob, lightmapData.textureFileName);
|
|
1029
|
+
|
|
1030
|
+
console.log('📁 Lightmap files downloaded manually from data');
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Helper method to download a blob as a file
|
|
1035
|
+
*/
|
|
1036
|
+
private downloadBlob(blob: Blob, filename: string): void {
|
|
1037
|
+
const url = URL.createObjectURL(blob);
|
|
1038
|
+
const a = document.createElement('a');
|
|
1039
|
+
a.href = url;
|
|
1040
|
+
a.download = filename;
|
|
1041
|
+
a.style.display = 'none';
|
|
1042
|
+
document.body.appendChild(a);
|
|
1043
|
+
a.click();
|
|
1044
|
+
document.body.removeChild(a);
|
|
1045
|
+
URL.revokeObjectURL(url);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Example: Simulate sending lightmap data to a server
|
|
1050
|
+
*/
|
|
1051
|
+
private async simulateServerUpload(lightmapData: any): Promise<void> {
|
|
1052
|
+
return new Promise((resolve) => {
|
|
1053
|
+
setTimeout(() => {
|
|
1054
|
+
console.log('🌐 Simulated server upload:');
|
|
1055
|
+
console.log(` Would POST metadata (${(lightmapData.metadataJson.length / 1024).toFixed(2)} KB) to /api/lightmaps/metadata`);
|
|
1056
|
+
console.log(` Would POST texture (${(lightmapData.textureBlob.size / 1024 / 1024).toFixed(2)} MB) to /api/lightmaps/texture`);
|
|
1057
|
+
console.log(' Server could store these in cloud storage, database, etc.');
|
|
1058
|
+
resolve();
|
|
1059
|
+
}, 500); // Simulate network delay
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Opens a file dialog to select lightmap files to import
|
|
1065
|
+
*/
|
|
1066
|
+
private openImportDialog(): void {
|
|
1067
|
+
// Create file input element for lightmap files
|
|
1068
|
+
const fileInput = document.createElement('input');
|
|
1069
|
+
fileInput.type = 'file';
|
|
1070
|
+
fileInput.accept = '.lightmap.json';
|
|
1071
|
+
fileInput.multiple = false;
|
|
1072
|
+
fileInput.style.display = 'none';
|
|
1073
|
+
|
|
1074
|
+
// Handle file selection
|
|
1075
|
+
fileInput.addEventListener('change', (event) => {
|
|
1076
|
+
const target = event.target as HTMLInputElement;
|
|
1077
|
+
const file = target.files?.[0];
|
|
1078
|
+
|
|
1079
|
+
if (file) {
|
|
1080
|
+
this.importLightmapsFromFile(file);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// Clean up
|
|
1084
|
+
document.body.removeChild(fileInput);
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
// Add to DOM and trigger click
|
|
1088
|
+
document.body.appendChild(fileInput);
|
|
1089
|
+
fileInput.click();
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* Imports lightmaps from a selected file
|
|
1094
|
+
*/
|
|
1095
|
+
private async importLightmapsFromFile(file: File): Promise<void> {
|
|
1096
|
+
try {
|
|
1097
|
+
this.updateStatus('📂 Loading lightmap file...');
|
|
1098
|
+
|
|
1099
|
+
// Read the lightmap JSON file
|
|
1100
|
+
const lightmapText = await file.text();
|
|
1101
|
+
const lightmapData = JSON.parse(lightmapText);
|
|
1102
|
+
|
|
1103
|
+
// Extract the binary filename from the lightmap data
|
|
1104
|
+
const binaryFileName = lightmapData.lightmap?.textureFile;
|
|
1105
|
+
if (!binaryFileName) {
|
|
1106
|
+
throw new Error('Lightmap file does not contain texture file reference');
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
// Prompt user to select the binary file
|
|
1110
|
+
this.updateStatus('📂 Please select the corresponding binary texture file...');
|
|
1111
|
+
|
|
1112
|
+
const binaryFile = await this.selectBinaryFile(binaryFileName);
|
|
1113
|
+
if (!binaryFile) {
|
|
1114
|
+
this.updateStatus('❌ Binary file selection cancelled');
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// Read binary file as ArrayBuffer
|
|
1119
|
+
const textureData = await binaryFile.arrayBuffer();
|
|
1120
|
+
|
|
1121
|
+
// Import using the new API
|
|
1122
|
+
await this.lightmapManager.importLightmap(lightmapData, textureData);
|
|
1123
|
+
|
|
1124
|
+
this.updateStatus('✓ Lightmaps imported successfully! (full precision preserved)');
|
|
1125
|
+
|
|
1126
|
+
} catch (error) {
|
|
1127
|
+
this.updateStatus(`✗ Import failed: ${error}`);
|
|
1128
|
+
console.error('Failed to import lightmaps:', error);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Prompts user to select the binary texture file
|
|
1134
|
+
*/
|
|
1135
|
+
private async selectBinaryFile(expectedFileName: string): Promise<File | null> {
|
|
1136
|
+
return new Promise((resolve) => {
|
|
1137
|
+
const fileInput = document.createElement('input');
|
|
1138
|
+
fileInput.type = 'file';
|
|
1139
|
+
fileInput.accept = '.lightmap';
|
|
1140
|
+
fileInput.style.display = 'none';
|
|
1141
|
+
|
|
1142
|
+
// Add instruction text
|
|
1143
|
+
const instruction = document.createElement('div');
|
|
1144
|
+
instruction.textContent = `Please select: ${expectedFileName}`;
|
|
1145
|
+
instruction.style.cssText = 'position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 20px; border: 2px solid #ccc; border-radius: 8px; z-index: 10000; font-family: Arial; box-shadow: 0 4px 8px rgba(0,0,0,0.2);';
|
|
1146
|
+
|
|
1147
|
+
fileInput.addEventListener('change', (event) => {
|
|
1148
|
+
const target = event.target as HTMLInputElement;
|
|
1149
|
+
const file = target.files?.[0] ?? null;
|
|
1150
|
+
|
|
1151
|
+
// Clean up - remove event listener first
|
|
1152
|
+
document.removeEventListener('click', handleCancel);
|
|
1153
|
+
|
|
1154
|
+
// Remove elements if they still exist
|
|
1155
|
+
if (document.body.contains(fileInput)) {
|
|
1156
|
+
document.body.removeChild(fileInput);
|
|
1157
|
+
}
|
|
1158
|
+
if (document.body.contains(instruction)) {
|
|
1159
|
+
document.body.removeChild(instruction);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
resolve(file);
|
|
1163
|
+
});
|
|
1164
|
+
|
|
1165
|
+
// Cancel if user clicks outside
|
|
1166
|
+
const handleCancel = (event: Event) => {
|
|
1167
|
+
if (event.target === instruction) return;
|
|
1168
|
+
document.removeEventListener('click', handleCancel);
|
|
1169
|
+
|
|
1170
|
+
// Remove elements if they still exist
|
|
1171
|
+
if (document.body.contains(fileInput)) {
|
|
1172
|
+
document.body.removeChild(fileInput);
|
|
1173
|
+
}
|
|
1174
|
+
if (document.body.contains(instruction)) {
|
|
1175
|
+
document.body.removeChild(instruction);
|
|
1176
|
+
}
|
|
1177
|
+
resolve(null);
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
setTimeout(() => {
|
|
1181
|
+
document.addEventListener('click', handleCancel);
|
|
1182
|
+
}, 100);
|
|
1183
|
+
|
|
1184
|
+
// Add to DOM and trigger click
|
|
1185
|
+
document.body.appendChild(instruction);
|
|
1186
|
+
document.body.appendChild(fileInput);
|
|
1187
|
+
fileInput.click();
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* Updates the status display in the UI
|
|
1193
|
+
*/
|
|
1194
|
+
private updateStatus(message: string): void {
|
|
1195
|
+
const statusElement = (this as any).statusElement;
|
|
1196
|
+
if (statusElement) {
|
|
1197
|
+
statusElement.innerHTML = `Status: ${message}`;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
private debugTextureActors: ENGINE.Actor<any>[] = [];
|
|
1203
|
+
|
|
1204
|
+
private createDebugTextures(): void {
|
|
1205
|
+
// Clear existing debug textures
|
|
1206
|
+
this.clearDebugTextures();
|
|
1207
|
+
|
|
1208
|
+
if (!this.lightmapManager || !this.lightmapManager.hasLightmapData()) {
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
// Get the baked lightmap texture
|
|
1213
|
+
const lightmapTexture = this.lightmapManager.getLastBakedTexture();
|
|
1214
|
+
if (lightmapTexture) {
|
|
1215
|
+
this.createDebugTexture(lightmapTexture, new THREE.Vector3(-30, 10, 0), 'Final Lightmap');
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
// Try to get atlas textures from the baker if possible
|
|
1219
|
+
const baker = this.lightmapManager.getBaker();
|
|
1220
|
+
if (baker) {
|
|
1221
|
+
const atlasResult = baker.getAtlasResult();
|
|
1222
|
+
|
|
1223
|
+
if (atlasResult?.positionTexture) {
|
|
1224
|
+
this.createDebugTexture(atlasResult.positionTexture, new THREE.Vector3(-30, 30, 0), 'Position Atlas');
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
if (atlasResult?.normalTexture) {
|
|
1228
|
+
this.createDebugTexture(atlasResult.normalTexture, new THREE.Vector3(-30, 50, 0), 'Normal Atlas');
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
private createDebugTexture(texture: THREE.Texture, position: THREE.Vector3, label: string): void {
|
|
1234
|
+
// Check if this is an HDR texture (FloatType) and needs special handling
|
|
1235
|
+
const isHDR = texture.type === THREE.FloatType;
|
|
1236
|
+
|
|
1237
|
+
let material: THREE.Material;
|
|
1238
|
+
|
|
1239
|
+
if (isHDR) {
|
|
1240
|
+
// Use a custom shader material for HDR textures with tone mapping
|
|
1241
|
+
material = new THREE.ShaderMaterial({
|
|
1242
|
+
uniforms: {
|
|
1243
|
+
tDiffuse: { value: texture },
|
|
1244
|
+
exposure: { value: 1.0 }
|
|
1245
|
+
},
|
|
1246
|
+
vertexShader: `
|
|
1247
|
+
varying vec2 vUv;
|
|
1248
|
+
void main() {
|
|
1249
|
+
vUv = uv;
|
|
1250
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1251
|
+
}
|
|
1252
|
+
`,
|
|
1253
|
+
fragmentShader: `
|
|
1254
|
+
uniform sampler2D tDiffuse;
|
|
1255
|
+
uniform float exposure;
|
|
1256
|
+
varying vec2 vUv;
|
|
1257
|
+
|
|
1258
|
+
// Simple tone mapping function
|
|
1259
|
+
vec3 toneMap(vec3 color, float exposure) {
|
|
1260
|
+
color *= exposure;
|
|
1261
|
+
return color / (color + 1.0); // Reinhard tone mapping
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
void main() {
|
|
1265
|
+
vec4 texel = texture2D(tDiffuse, vUv);
|
|
1266
|
+
vec3 color = toneMap(texel.rgb, exposure);
|
|
1267
|
+
gl_FragColor = vec4(color, texel.a);
|
|
1268
|
+
}
|
|
1269
|
+
`,
|
|
1270
|
+
side: THREE.DoubleSide
|
|
1271
|
+
});
|
|
1272
|
+
} else {
|
|
1273
|
+
material = new THREE.MeshBasicMaterial({
|
|
1274
|
+
map: texture,
|
|
1275
|
+
side: THREE.DoubleSide
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
const debugTexture = new THREE.Mesh(
|
|
1280
|
+
new THREE.PlaneGeometry(20, 20),
|
|
1281
|
+
material
|
|
1282
|
+
);
|
|
1283
|
+
|
|
1284
|
+
const debugActor = new ENGINE.Actor({
|
|
1285
|
+
rootComponent: new ENGINE.MeshComponent({
|
|
1286
|
+
mesh: debugTexture
|
|
1287
|
+
})
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
debugActor.setWorldPosition(position);
|
|
1291
|
+
|
|
1292
|
+
this.world.addActors(debugActor);
|
|
1293
|
+
this.debugTextureActors.push(debugActor);
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
private clearDebugTextures(): void {
|
|
1297
|
+
this.world.removeActors(...this.debugTextureActors);
|
|
1298
|
+
this.debugTextureActors = [];
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* Stores original material maps before applying debug textures
|
|
1303
|
+
*/
|
|
1304
|
+
private storeOriginalMaterials(): void {
|
|
1305
|
+
const actors = this.world.getActors();
|
|
1306
|
+
for (const actor of actors) {
|
|
1307
|
+
const meshes = this.getMeshesFromActor(actor);
|
|
1308
|
+
for (const mesh of meshes) {
|
|
1309
|
+
if (mesh.material) {
|
|
1310
|
+
const material = Array.isArray(mesh.material) ? mesh.material[0] : mesh.material;
|
|
1311
|
+
if (material instanceof THREE.MeshStandardMaterial || material instanceof THREE.MeshLambertMaterial) {
|
|
1312
|
+
if (!this.originalMaterialMaps.has(material)) {
|
|
1313
|
+
this.originalMaterialMaps.set(material, material.map);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Creates a UV debug texture for visualization
|
|
1323
|
+
*/
|
|
1324
|
+
private createUVDebugTexture(): THREE.Texture {
|
|
1325
|
+
const size = 512;
|
|
1326
|
+
const canvas = document.createElement('canvas');
|
|
1327
|
+
canvas.width = size;
|
|
1328
|
+
canvas.height = size;
|
|
1329
|
+
const ctx = canvas.getContext('2d')!;
|
|
1330
|
+
|
|
1331
|
+
// Create a UV grid pattern
|
|
1332
|
+
ctx.fillStyle = '#000000';
|
|
1333
|
+
ctx.fillRect(0, 0, size, size);
|
|
1334
|
+
|
|
1335
|
+
// Draw grid lines
|
|
1336
|
+
ctx.strokeStyle = '#ffffff';
|
|
1337
|
+
ctx.lineWidth = 2;
|
|
1338
|
+
const gridSize = size / 8;
|
|
1339
|
+
|
|
1340
|
+
for (let i = 0; i <= 8; i++) {
|
|
1341
|
+
const pos = i * gridSize;
|
|
1342
|
+
// Vertical lines
|
|
1343
|
+
ctx.beginPath();
|
|
1344
|
+
ctx.moveTo(pos, 0);
|
|
1345
|
+
ctx.lineTo(pos, size);
|
|
1346
|
+
ctx.stroke();
|
|
1347
|
+
|
|
1348
|
+
// Horizontal lines
|
|
1349
|
+
ctx.beginPath();
|
|
1350
|
+
ctx.moveTo(0, pos);
|
|
1351
|
+
ctx.lineTo(size, pos);
|
|
1352
|
+
ctx.stroke();
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// Add corner colors for UV orientation
|
|
1356
|
+
ctx.fillStyle = '#ff0000'; // Red = (1,1)
|
|
1357
|
+
ctx.fillRect(size - gridSize/2, 0, gridSize/2, gridSize/2);
|
|
1358
|
+
|
|
1359
|
+
ctx.fillStyle = '#00ff00'; // Green = (0,1)
|
|
1360
|
+
ctx.fillRect(0, 0, gridSize/2, gridSize/2);
|
|
1361
|
+
|
|
1362
|
+
ctx.fillStyle = '#0000ff'; // Blue = (0,0)
|
|
1363
|
+
ctx.fillRect(0, size - gridSize/2, gridSize/2, gridSize/2);
|
|
1364
|
+
|
|
1365
|
+
ctx.fillStyle = '#ffff00'; // Yellow = (1,0)
|
|
1366
|
+
ctx.fillRect(size - gridSize/2, size - gridSize/2, gridSize/2, gridSize/2);
|
|
1367
|
+
|
|
1368
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
1369
|
+
texture.flipY = false;
|
|
1370
|
+
texture.wrapS = THREE.RepeatWrapping;
|
|
1371
|
+
texture.wrapT = THREE.RepeatWrapping;
|
|
1372
|
+
return texture;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* Handles render mode changes to switch between different visualizations
|
|
1377
|
+
*/
|
|
1378
|
+
private onRenderModeChange(): void {
|
|
1379
|
+
// Store original materials if not already done
|
|
1380
|
+
this.storeOriginalMaterials();
|
|
1381
|
+
|
|
1382
|
+
const actors = this.world.getActors();
|
|
1383
|
+
|
|
1384
|
+
for (const actor of actors) {
|
|
1385
|
+
const meshes = this.getMeshesFromActor(actor);
|
|
1386
|
+
for (const mesh of meshes) {
|
|
1387
|
+
if (mesh.material) {
|
|
1388
|
+
const material = Array.isArray(mesh.material) ? mesh.material[0] : mesh.material;
|
|
1389
|
+
if (material instanceof THREE.MeshStandardMaterial || material instanceof THREE.MeshLambertMaterial) {
|
|
1390
|
+
|
|
1391
|
+
// Reset material state
|
|
1392
|
+
material.map = null;
|
|
1393
|
+
material.lightMap = null;
|
|
1394
|
+
|
|
1395
|
+
switch (this.lightmapParams.renderMode) {
|
|
1396
|
+
case 'standard':
|
|
1397
|
+
// Restore original textures and remove lightmap
|
|
1398
|
+
const originalMap = this.originalMaterialMaps.get(material);
|
|
1399
|
+
material.map = originalMap ?? null;
|
|
1400
|
+
material.lightMap = null;
|
|
1401
|
+
break;
|
|
1402
|
+
|
|
1403
|
+
case 'positions':
|
|
1404
|
+
// Show position atlas texture
|
|
1405
|
+
if (this.lightmapManager && this.lightmapManager.getBaker()?.getAtlasResult()?.positionTexture) {
|
|
1406
|
+
material.lightMap = this.lightmapManager.getBaker()!.getAtlasResult()!.positionTexture;
|
|
1407
|
+
if (material.lightMap) {
|
|
1408
|
+
material.lightMap.channel = 2;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
break;
|
|
1412
|
+
|
|
1413
|
+
case 'normals':
|
|
1414
|
+
// Show normal atlas texture
|
|
1415
|
+
if (this.lightmapManager && this.lightmapManager.getBaker()?.getAtlasResult()?.normalTexture) {
|
|
1416
|
+
material.lightMap = this.lightmapManager.getBaker()!.getAtlasResult()!.normalTexture;
|
|
1417
|
+
if (material.lightMap) {
|
|
1418
|
+
material.lightMap.channel = 2;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
break;
|
|
1422
|
+
|
|
1423
|
+
case 'uv':
|
|
1424
|
+
// Show UV debug texture
|
|
1425
|
+
material.lightMap = this.createUVDebugTexture();
|
|
1426
|
+
material.lightMap.channel = 2;
|
|
1427
|
+
break;
|
|
1428
|
+
|
|
1429
|
+
case 'lightmap':
|
|
1430
|
+
// Show lightmap only
|
|
1431
|
+
if (this.lightmapManager && this.lightmapManager.getLastBakedTexture()) {
|
|
1432
|
+
material.lightMap = this.lightmapManager.getLastBakedTexture();
|
|
1433
|
+
if (material.lightMap) {
|
|
1434
|
+
material.lightMap.channel = 2;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
break;
|
|
1438
|
+
|
|
1439
|
+
case 'beauty':
|
|
1440
|
+
// Show lightmap + original textures
|
|
1441
|
+
const originalMapBeauty = this.originalMaterialMaps.get(material);
|
|
1442
|
+
material.map = originalMapBeauty ?? null;
|
|
1443
|
+
if (this.lightmapManager && this.lightmapManager.getLastBakedTexture()) {
|
|
1444
|
+
material.lightMap = this.lightmapManager.getLastBakedTexture();
|
|
1445
|
+
if (material.lightMap) {
|
|
1446
|
+
material.lightMap.channel = 2;
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
break;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
// Update material properties
|
|
1453
|
+
if (material.lightMap) {
|
|
1454
|
+
material.lightMap.needsUpdate = true;
|
|
1455
|
+
material.lightMap.channel = 2;
|
|
1456
|
+
}
|
|
1457
|
+
material.lightMapIntensity = 1.0;
|
|
1458
|
+
material.needsUpdate = true;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
// Manage runtime lighting based on render mode
|
|
1465
|
+
if (this.lightmapParams.renderMode === 'standard') {
|
|
1466
|
+
// Restore dynamic lighting
|
|
1467
|
+
this.lightmapManager?.manageRuntimeLighting(false);
|
|
1468
|
+
} else {
|
|
1469
|
+
// Hide runtime lights for debug modes
|
|
1470
|
+
this.lightmapManager?.manageRuntimeLighting(true);
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
this.updateStatus(`Render mode: ${this.lightmapParams.renderMode}`);
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
/**
|
|
1477
|
+
* Helper method to get meshes from an actor (reused logic)
|
|
1478
|
+
*/
|
|
1479
|
+
private getMeshesFromActor(actor: ENGINE.Actor<any>): THREE.Mesh[] {
|
|
1480
|
+
const meshes: THREE.Mesh[] = [];
|
|
1481
|
+
|
|
1482
|
+
if (actor instanceof ENGINE.GLTFMeshActor) {
|
|
1483
|
+
const gltfMesh = actor.rootComponent as ENGINE.GLTFMeshComponent;
|
|
1484
|
+
if (gltfMesh) {
|
|
1485
|
+
meshes.push(...gltfMesh.getAllMeshes());
|
|
1486
|
+
}
|
|
1487
|
+
} else {
|
|
1488
|
+
const rootComponent = actor.rootComponent;
|
|
1489
|
+
if (rootComponent instanceof ENGINE.MeshComponent) {
|
|
1490
|
+
const mesh = rootComponent.getMesh();
|
|
1491
|
+
if (mesh) {
|
|
1492
|
+
meshes.push(mesh);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
return meshes;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
public override destroy(): void {
|
|
1501
|
+
// Clean up file input
|
|
1502
|
+
if (this.fileInput) {
|
|
1503
|
+
this.fileInput.remove();
|
|
1504
|
+
this.fileInput = null;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// Clean up transform controls and light helpers
|
|
1508
|
+
this.cleanupTransformControlsAndHelpers();
|
|
1509
|
+
|
|
1510
|
+
this.pane.dispose();
|
|
1511
|
+
|
|
1512
|
+
this.lightmapManager?.dispose();
|
|
1513
|
+
super.destroy();
|
|
1514
|
+
}
|
|
1515
|
+
}
|