@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,1200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThreeJsExtensions augments THREE.Object3D with convenience methods tailored for Genesys.
|
|
3
|
+
*
|
|
4
|
+
* Detailed explanation:
|
|
5
|
+
* - Adds transform setters and getters that operate in both local and world space without manual matrix math.
|
|
6
|
+
* - Provides tree traversal helpers to fetch objects by type and generates debug data for SceneGraph utilities.
|
|
7
|
+
* - Marks objects as hidden or transient using userData flags so the engine can skip them when needed.
|
|
8
|
+
*
|
|
9
|
+
* Recommended usage (for humans and AI assistants):
|
|
10
|
+
* - Import this file once near engine startup so the prototype methods are patched before any scenes are built.
|
|
11
|
+
* - Use `setWorldTransform` or `getWorldTransform` when synchronizing with physics or other global systems.
|
|
12
|
+
* - Avoid heavy per-frame allocations; reuse vectors or quaternions where possible when calling these methods.
|
|
13
|
+
*/
|
|
14
|
+
import * as THREE from 'three';
|
|
15
|
+
|
|
16
|
+
import { SceneComponent } from '../components/SceneComponent.js';
|
|
17
|
+
import { ClassRegistry } from '../systems/ClassRegistry.js';
|
|
18
|
+
import { WorldSerializer } from '../systems/WorldSerialization.js';
|
|
19
|
+
import { ensure } from '../utils/Utils.js';
|
|
20
|
+
|
|
21
|
+
import type { SceneGraphDebugNode } from './SceneGraphUtils.js';
|
|
22
|
+
import type { ComponentDescriptionOptions } from '../components/Component.js';
|
|
23
|
+
import type { World } from '../game/World.js';
|
|
24
|
+
import type { ComponentPhysicsOptions } from '../physics/PhysicsTypes.js';
|
|
25
|
+
import type { Actor } from 'src/actors/Actor.js';
|
|
26
|
+
|
|
27
|
+
const tempPosition = new THREE.Vector3();
|
|
28
|
+
const tempRotation = new THREE.Euler();
|
|
29
|
+
const tempScale = new THREE.Vector3();
|
|
30
|
+
const tempQuaternion = new THREE.Quaternion();
|
|
31
|
+
|
|
32
|
+
declare module 'three' {
|
|
33
|
+
interface Object3D {
|
|
34
|
+
/**
|
|
35
|
+
* When true, position is interpreted as world position rather than local.
|
|
36
|
+
* Useful for objects that need to maintain a fixed world position regardless of parent transforms.
|
|
37
|
+
*/
|
|
38
|
+
useAbsolutePosition: boolean;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* When true, rotation is interpreted as world rotation rather than local.
|
|
42
|
+
* Useful for objects that need to maintain a fixed world rotation regardless of parent transforms.
|
|
43
|
+
*/
|
|
44
|
+
useAbsoluteRotation: boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* When true, scale is interpreted as world scale rather than local.
|
|
48
|
+
* Useful for objects that need to maintain a fixed world scale regardless of parent transforms.
|
|
49
|
+
*/
|
|
50
|
+
useAbsoluteScale: boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Gets the Actor that owns this object by traversing up the parent hierarchy.
|
|
54
|
+
* Returns null if this object is not part of an Actor's scene graph.
|
|
55
|
+
*/
|
|
56
|
+
getActor(): Actor | null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Gets the full hierarchical path name of this object (e.g., "Actor.RootComponent.Mesh").
|
|
60
|
+
* Uses the object's name property or falls back to its class name.
|
|
61
|
+
*/
|
|
62
|
+
getPathName(): string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Generates a debug node structure for visualization in scene graph debugging tools.
|
|
66
|
+
* Includes transform data, visibility, and recursively processes all children.
|
|
67
|
+
*/
|
|
68
|
+
generateDebugNode(): SceneGraphDebugNode | null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Finds the first object of the specified type in this object and its descendants.
|
|
72
|
+
* Uses depth-first search to traverse the scene graph.
|
|
73
|
+
* @param type The constructor/class to search for
|
|
74
|
+
* @returns The first matching object or null if not found
|
|
75
|
+
*/
|
|
76
|
+
getComponent<T extends THREE.Object3D>(type: abstract new (...args: any[]) => T): T | null;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Finds all objects of the specified type in this object and its descendants.
|
|
80
|
+
* Recursively searches the entire subtree.
|
|
81
|
+
* @param type The constructor/class to search for
|
|
82
|
+
* @returns Array of all matching objects (may be empty)
|
|
83
|
+
*/
|
|
84
|
+
getComponents<T extends THREE.Object3D>(type: abstract new (...args: any[]) => T): T[];
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Checks if this object is hidden (not visible).
|
|
88
|
+
* @returns true if the object is hidden
|
|
89
|
+
*/
|
|
90
|
+
isHidden(): boolean;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Sets the visibility state of this object.
|
|
94
|
+
* @param hidden Whether to hide (true) or show (false) the object
|
|
95
|
+
* @param propagateToChildren Whether to apply the visibility change to all children
|
|
96
|
+
*/
|
|
97
|
+
setHidden(hidden: boolean, propagateToChildren: boolean): this;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Checks if this object is marked as transient (temporary/non-persistent).
|
|
101
|
+
* Transient objects are typically excluded from serialization.
|
|
102
|
+
* @returns true if the object is transient
|
|
103
|
+
*/
|
|
104
|
+
isTransient(): boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Marks this object as transient or persistent.
|
|
108
|
+
* Transient objects are excluded from world serialization.
|
|
109
|
+
* @param transient Whether the object should be transient
|
|
110
|
+
*/
|
|
111
|
+
setTransient(transient: boolean): this;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Sets the local position relative to the parent.
|
|
115
|
+
* @param pos The new local position
|
|
116
|
+
*/
|
|
117
|
+
setLocalPosition(pos: THREE.Vector3): this;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Sets the local rotation relative to the parent using Euler angles.
|
|
121
|
+
* @param rot The new local rotation
|
|
122
|
+
*/
|
|
123
|
+
setLocalRotation(rot: THREE.Euler): this;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Sets the local rotation relative to the parent using a quaternion.
|
|
127
|
+
* @param quaternion The new local rotation quaternion
|
|
128
|
+
*/
|
|
129
|
+
setLocalQuaternion(quaternion: THREE.Quaternion): this;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Sets the local scale relative to the parent.
|
|
133
|
+
* @param scale The new local scale
|
|
134
|
+
*/
|
|
135
|
+
setLocalScale(scale: THREE.Vector3): this;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Sets multiple local transform properties at once.
|
|
139
|
+
* @param transform Object containing optional position, rotation, and/or scale
|
|
140
|
+
*/
|
|
141
|
+
setLocalTransform(transform: { position?: THREE.Vector3, rotation?: THREE.Euler, scale?: THREE.Vector3 }): this;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Adds a delta to the current local position.
|
|
145
|
+
* @param delta The position offset to add
|
|
146
|
+
*/
|
|
147
|
+
addLocalPosition(delta: THREE.Vector3): this;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Adds a delta rotation to the current local rotation.
|
|
151
|
+
* @param delta The rotation offset to add (in Euler angles)
|
|
152
|
+
*/
|
|
153
|
+
addLocalRotation(delta: THREE.Euler): this;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Sets the world position, automatically converting to local space if parented.
|
|
157
|
+
* @param pos The new world position
|
|
158
|
+
*/
|
|
159
|
+
setWorldPosition(pos: THREE.Vector3): this;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Sets the world rotation using Euler angles, automatically converting to local space if parented.
|
|
163
|
+
* @param rot The new world rotation
|
|
164
|
+
*/
|
|
165
|
+
setWorldRotation(rot: THREE.Euler): this;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Sets the world rotation using a quaternion, automatically converting to local space if parented.
|
|
169
|
+
* @param quaternion The new world rotation quaternion
|
|
170
|
+
*/
|
|
171
|
+
setWorldQuaternion(quaternion: THREE.Quaternion): this;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Sets the world scale, automatically converting to local space if parented.
|
|
175
|
+
* @param scale The new world scale
|
|
176
|
+
*/
|
|
177
|
+
setWorldScale(scale: THREE.Vector3): this;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Sets multiple world transform properties at once.
|
|
181
|
+
* @param transform Object containing optional position, rotation, and/or scale in world space
|
|
182
|
+
*/
|
|
183
|
+
setWorldTransform(transform: { position?: THREE.Vector3, rotation?: THREE.Euler, scale?: THREE.Vector3 }): this;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Adds a delta to the current world position.
|
|
187
|
+
* @param delta The world position offset to add
|
|
188
|
+
*/
|
|
189
|
+
addWorldPosition(delta: THREE.Vector3): this;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Adds a delta rotation to the current world rotation.
|
|
193
|
+
* @param delta The world rotation offset to add (in Euler angles)
|
|
194
|
+
*/
|
|
195
|
+
addWorldRotation(delta: THREE.Euler): this;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Gets the complete world transform as an object with position, rotation, and scale.
|
|
199
|
+
* @returns Object containing world position, rotation (Euler), and scale
|
|
200
|
+
*/
|
|
201
|
+
getWorldTransform(): { position: THREE.Vector3, rotation: THREE.Euler, scale: THREE.Vector3 };
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Gets the world position of this object.
|
|
205
|
+
* @param target Optional target vector to store the result (creates new if not provided)
|
|
206
|
+
* @returns The world position
|
|
207
|
+
*/
|
|
208
|
+
getWorldPosition(target?: THREE.Vector3): THREE.Vector3;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Gets the world rotation as Euler angles.
|
|
212
|
+
* @param target Optional target Euler to store the result (creates new if not provided)
|
|
213
|
+
* @returns The world rotation
|
|
214
|
+
*/
|
|
215
|
+
getWorldRotation(target?: THREE.Euler): THREE.Euler;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Gets the world scale of this object.
|
|
219
|
+
* @param target Optional target vector to store the result (creates new if not provided)
|
|
220
|
+
* @returns The world scale
|
|
221
|
+
*/
|
|
222
|
+
getWorldScale(target?: THREE.Vector3): THREE.Vector3;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Gets the world rotation as a quaternion.
|
|
226
|
+
* @param target Optional target quaternion to store the result (creates new if not provided)
|
|
227
|
+
* @returns The world rotation quaternion
|
|
228
|
+
*/
|
|
229
|
+
getWorldQuaternion(target?: THREE.Quaternion): THREE.Quaternion;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Generates a string representation of the object hierarchy for debugging.
|
|
233
|
+
* @param depth Starting indentation depth
|
|
234
|
+
* @param printTransform Whether to include transform data (position, rotation, scale)
|
|
235
|
+
* @returns Formatted string showing the hierarchy
|
|
236
|
+
*/
|
|
237
|
+
printHierarchy(depth: number, printTransform: boolean): string;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Exports this object to a serializable format for saving/loading.
|
|
241
|
+
* @param includeDefaults Whether to include properties that match default values
|
|
242
|
+
* @returns Serialized object representation
|
|
243
|
+
*/
|
|
244
|
+
asExportedObject(includeDefaults: boolean): any;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Generates a description of this object's properties for UI/debugging.
|
|
248
|
+
* @param options Options for controlling the description format
|
|
249
|
+
* @returns Object containing descriptive properties
|
|
250
|
+
*/
|
|
251
|
+
describe(options?: ComponentDescriptionOptions): Record<string, any>;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Temporarily overrides the material on this object (useful for effects like highlighting).
|
|
255
|
+
* @param material The override material (null to restore original)
|
|
256
|
+
* @param recursive Whether to apply to all descendants
|
|
257
|
+
*/
|
|
258
|
+
setOverrideMaterial(material: THREE.Material | null, recursive: boolean): this;
|
|
259
|
+
|
|
260
|
+
// Lifecycle methods that propagate through the scene graph
|
|
261
|
+
/**
|
|
262
|
+
* Called when this object enters play mode (added to an active world).
|
|
263
|
+
* Recursively calls beginPlay on all children.
|
|
264
|
+
*/
|
|
265
|
+
beginPlay(): void;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Called when this object exits play mode (removed from world or world stops).
|
|
269
|
+
* Recursively calls endPlay on all children.
|
|
270
|
+
*/
|
|
271
|
+
endPlay(): void;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Update tick called before physics simulation.
|
|
275
|
+
* Recursively calls tickPrePhysics on all children.
|
|
276
|
+
* @param deltaTime Time elapsed since last frame in seconds
|
|
277
|
+
*/
|
|
278
|
+
tickPrePhysics(deltaTime: number): void;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Update tick called after physics simulation.
|
|
282
|
+
* Recursively calls tickPostPhysics on all children.
|
|
283
|
+
* @param deltaTime Time elapsed since last frame in seconds
|
|
284
|
+
*/
|
|
285
|
+
tickPostPhysics(deltaTime: number): void;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Replaces physics options for this object and optionally its children.
|
|
289
|
+
* @param newOptions The new physics configuration
|
|
290
|
+
* @param propagateToChildren Whether to apply to all descendants
|
|
291
|
+
*/
|
|
292
|
+
replacePhysicsOptions(newOptions: ComponentPhysicsOptions, propagateToChildren: boolean): this
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Overrides the physics options for this object and optionally its children.
|
|
296
|
+
* @param newOptions The new physics configuration
|
|
297
|
+
* @param propagateToChildren Whether to apply to all descendants
|
|
298
|
+
*/
|
|
299
|
+
overridePhysicsOptions(newOptions: ComponentPhysicsOptions, propagateToChildren: boolean): this
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
interface Scene {
|
|
303
|
+
/**
|
|
304
|
+
* Gets the World instance that owns this scene.
|
|
305
|
+
* @returns The owning World or null if not attached to a world
|
|
306
|
+
*/
|
|
307
|
+
getWorld(): World | null;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Associates this scene with a World instance.
|
|
311
|
+
* @param world The World to associate with (or null to clear)
|
|
312
|
+
*/
|
|
313
|
+
setWorld(world: World | null): this;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
interface Material {
|
|
317
|
+
/**
|
|
318
|
+
* Exports this material to a serializable format.
|
|
319
|
+
* @param includeDefaults Whether to include properties that match default values
|
|
320
|
+
* @returns Serialized material representation
|
|
321
|
+
*/
|
|
322
|
+
asExportedObject(includeDefaults: boolean): any;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
interface Vector3 {
|
|
326
|
+
/**
|
|
327
|
+
* Checks if this vector is approximately equal to another within a tolerance.
|
|
328
|
+
* @param other The vector to compare against
|
|
329
|
+
* @param epsilon Maximum allowed difference per component (default: 0.00001)
|
|
330
|
+
* @returns true if vectors are approximately equal
|
|
331
|
+
*/
|
|
332
|
+
almostEquals(other: THREE.Vector3Like, epsilon?: number): boolean;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
interface Euler {
|
|
336
|
+
/**
|
|
337
|
+
* Checks if this Euler rotation is approximately equal to another within a tolerance.
|
|
338
|
+
* @param other The Euler to compare against
|
|
339
|
+
* @param epsilon Maximum allowed difference per component in radians (default: 0.00001)
|
|
340
|
+
* @returns true if rotations are approximately equal
|
|
341
|
+
*/
|
|
342
|
+
almostEquals(other: THREE.Euler, epsilon?: number): boolean;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Gets the World instance associated with this scene.
|
|
348
|
+
* The World reference is stored in userData for easy access.
|
|
349
|
+
*/
|
|
350
|
+
THREE.Scene.prototype.getWorld = function (): World | null {
|
|
351
|
+
return this.userData.world as World | null;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Associates a World instance with this scene.
|
|
356
|
+
* Used by the engine to track which World owns each scene.
|
|
357
|
+
*/
|
|
358
|
+
THREE.Scene.prototype.setWorld = function (world: World | null): THREE.Scene {
|
|
359
|
+
this.userData.world = world;
|
|
360
|
+
return this;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
// Define getter/setter properties for absolute transform flags
|
|
364
|
+
Object.defineProperty(THREE.Object3D.prototype, 'useAbsolutePosition', {
|
|
365
|
+
get: function() {
|
|
366
|
+
return this.userData.useAbsolutePosition === true;
|
|
367
|
+
},
|
|
368
|
+
set: function(value: boolean) {
|
|
369
|
+
this.userData.useAbsolutePosition = value;
|
|
370
|
+
},
|
|
371
|
+
enumerable: true,
|
|
372
|
+
configurable: true
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
Object.defineProperty(THREE.Object3D.prototype, 'useAbsoluteRotation', {
|
|
376
|
+
get: function() {
|
|
377
|
+
return this.userData.useAbsoluteRotation === true;
|
|
378
|
+
},
|
|
379
|
+
set: function(value: boolean) {
|
|
380
|
+
this.userData.useAbsoluteRotation = value;
|
|
381
|
+
},
|
|
382
|
+
enumerable: true,
|
|
383
|
+
configurable: true
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
Object.defineProperty(THREE.Object3D.prototype, 'useAbsoluteScale', {
|
|
387
|
+
get: function() {
|
|
388
|
+
return this.userData.useAbsoluteScale === true;
|
|
389
|
+
},
|
|
390
|
+
set: function(value: boolean) {
|
|
391
|
+
this.userData.useAbsoluteScale = value;
|
|
392
|
+
},
|
|
393
|
+
enumerable: true,
|
|
394
|
+
configurable: true
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
function printMaterial(indent: string, material: THREE.Material): string {
|
|
398
|
+
let result = `${indent}- ${material.type}: '${material.name ?? 'unnamed'}'\n`;
|
|
399
|
+
|
|
400
|
+
for (const [key, value] of Object.entries(material)) {
|
|
401
|
+
if (value instanceof THREE.Texture) {
|
|
402
|
+
result += `${indent} - ${key} (${ClassRegistry.getClassOrConstructorName(value)}): '${value.name ?? 'unnamed'}'\n`;
|
|
403
|
+
result += `${indent} - Dimensions: ${value.width}x${value.height}x${value.depth}\n`;
|
|
404
|
+
// result += `${indent} - Format: ${value.format}\n`;
|
|
405
|
+
// result += `${indent} - Type: ${value.type}\n`;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return result;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Traverses up the parent hierarchy to find the Actor that owns this object.
|
|
414
|
+
* Components and other scene objects use this to access their owning Actor.
|
|
415
|
+
*/
|
|
416
|
+
THREE.Object3D.prototype.getActor = function (): Actor | null {
|
|
417
|
+
return this.parent?.getActor() ?? null;
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Serializes this object using the WorldSerializer for saving/loading.
|
|
422
|
+
* Handles conversion to JSON-compatible format with proper class registration.
|
|
423
|
+
*/
|
|
424
|
+
THREE.Object3D.prototype.asExportedObject = function (includeDefaults: boolean): any {
|
|
425
|
+
return WorldSerializer.exportObject(this, includeDefaults);
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Generates a human-readable string representation of the object hierarchy.
|
|
430
|
+
* Useful for debugging scene structure and understanding parent-child relationships.
|
|
431
|
+
* Includes geometry and material information for meshes.
|
|
432
|
+
*/
|
|
433
|
+
THREE.Object3D.prototype.printHierarchy = function (depth: number = 0, printTransform: boolean = false): string {
|
|
434
|
+
const indent = ' '.repeat(depth);
|
|
435
|
+
let result = `${indent}${this.type}: '${this.name ?? 'unnamed'}'\n`;
|
|
436
|
+
if (printTransform) {
|
|
437
|
+
result += `${indent} - Position: (${this.position.x.toFixed(2)}, ${this.position.y.toFixed(2)}, ${this.position.z.toFixed(2)})\n`;
|
|
438
|
+
result += `${indent} - Rotation: (${this.rotation.x.toFixed(2)}, ${this.rotation.y.toFixed(2)}, ${this.rotation.z.toFixed(2)})\n`;
|
|
439
|
+
result += `${indent} - Scale: (${this.scale.x.toFixed(2)}, ${this.scale.y.toFixed(2)}, ${this.scale.z.toFixed(2)})\n`;
|
|
440
|
+
}
|
|
441
|
+
if (this instanceof THREE.Mesh) {
|
|
442
|
+
result += `${indent} - ${this.geometry.type}: '${this.geometry.name ?? 'unnamed'}'\n`;
|
|
443
|
+
result += `${indent} - Vertices: ${this.geometry.attributes.position?.count ?? 0}\n`;
|
|
444
|
+
if (this.material) {
|
|
445
|
+
const materialIndent = indent + ' ';
|
|
446
|
+
if (Array.isArray(this.material)) {
|
|
447
|
+
this.material.forEach(m => result += printMaterial(materialIndent, m));
|
|
448
|
+
} else {
|
|
449
|
+
result += printMaterial(materialIndent, this.material);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
this.children.forEach(child => result += child.printHierarchy(depth + 1, printTransform));
|
|
454
|
+
return result;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Builds a dot-separated path string representing this object's location in the hierarchy.
|
|
459
|
+
* Example: "PlayerActor.RootComponent.MeshComponent"
|
|
460
|
+
* Used for debugging and logging to identify specific objects.
|
|
461
|
+
*/
|
|
462
|
+
THREE.Object3D.prototype.getPathName = function () {
|
|
463
|
+
const myName = this.name || ClassRegistry.getClassOrConstructorName(this);
|
|
464
|
+
if (this.parent) {
|
|
465
|
+
return `${this.parent.getPathName()}.${myName}`;
|
|
466
|
+
} else {
|
|
467
|
+
return myName;
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Creates a debug data structure for scene graph visualization tools.
|
|
473
|
+
* Recursively processes all children to build a complete tree representation.
|
|
474
|
+
* Includes transform data, visibility state, and UUIDs for debugging.
|
|
475
|
+
*/
|
|
476
|
+
THREE.Object3D.prototype.generateDebugNode = function (): SceneGraphDebugNode | null {
|
|
477
|
+
|
|
478
|
+
const myName = this.name || ClassRegistry.getClassOrConstructorName(this);
|
|
479
|
+
const children: (SceneGraphDebugNode | null)[] = [];
|
|
480
|
+
this.children.forEach((child: THREE.Object3D) => {
|
|
481
|
+
children.push(child.generateDebugNode());
|
|
482
|
+
});
|
|
483
|
+
return {
|
|
484
|
+
title: myName,
|
|
485
|
+
children,
|
|
486
|
+
data: {
|
|
487
|
+
uuid: this.uuid,
|
|
488
|
+
position: this.position.toArray(),
|
|
489
|
+
rotation: this.rotation.toArray(),
|
|
490
|
+
scale: this.scale.toArray(),
|
|
491
|
+
visible: this.visible,
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Searches for the first object of the specified type in this subtree.
|
|
498
|
+
* Uses depth-first search, checking this object first then its children.
|
|
499
|
+
* Commonly used to find specific component types within an actor.
|
|
500
|
+
*/
|
|
501
|
+
THREE.Object3D.prototype.getComponent = function <T extends THREE.Object3D>(type: abstract new (...args: any[]) => T = SceneComponent as any): T | null {
|
|
502
|
+
if (this instanceof type) {
|
|
503
|
+
return this as T;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
for (const child of this.children) {
|
|
507
|
+
const result = child.getComponent(type);
|
|
508
|
+
if (result) {
|
|
509
|
+
return result;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return null;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Collects all objects of the specified type in this subtree.
|
|
517
|
+
* Recursively searches the entire hierarchy including this object.
|
|
518
|
+
* Returns an array that may be empty if no matches are found.
|
|
519
|
+
*/
|
|
520
|
+
THREE.Object3D.prototype.getComponents = function <T extends THREE.Object3D>(type: abstract new (...args: any[]) => T = SceneComponent as any): T[] {
|
|
521
|
+
const results: T[] = [];
|
|
522
|
+
if (this instanceof type) {
|
|
523
|
+
results.push(this as T);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
for (const child of this.children) {
|
|
527
|
+
results.push(...child.getComponents(type));
|
|
528
|
+
}
|
|
529
|
+
return results;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Convenience method to check if this object is hidden.
|
|
534
|
+
* Simply returns the inverse of the visible property.
|
|
535
|
+
*/
|
|
536
|
+
THREE.Object3D.prototype.isHidden = function (): boolean {
|
|
537
|
+
return !this.visible;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Sets the visibility of this object and optionally all its descendants.
|
|
542
|
+
* Useful for hiding entire branches of the scene graph at once.
|
|
543
|
+
*/
|
|
544
|
+
THREE.Object3D.prototype.setHidden = function (hidden: boolean, propagateToChildren: boolean = false): THREE.Object3D {
|
|
545
|
+
this.visible = !hidden;
|
|
546
|
+
if (propagateToChildren) {
|
|
547
|
+
this.children.forEach(child => {
|
|
548
|
+
child.setHidden(hidden, propagateToChildren);
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
return this;
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Adds a position offset in local space.
|
|
556
|
+
* Directly modifies the position property without matrix calculations.
|
|
557
|
+
*/
|
|
558
|
+
THREE.Object3D.prototype.addLocalPosition = function (delta: THREE.Vector3): THREE.Object3D {
|
|
559
|
+
this.position.x += delta.x;
|
|
560
|
+
this.position.y += delta.y;
|
|
561
|
+
this.position.z += delta.z;
|
|
562
|
+
return this;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Adds a rotation offset in local space.
|
|
567
|
+
* Converts Euler angles to quaternion and multiplies with current rotation.
|
|
568
|
+
*/
|
|
569
|
+
THREE.Object3D.prototype.addLocalRotation = function (delta: THREE.Euler): THREE.Object3D {
|
|
570
|
+
this.quaternion.multiply(new THREE.Quaternion().setFromEuler(delta));
|
|
571
|
+
return this;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Sets the local position relative to the parent.
|
|
576
|
+
* If useAbsolutePosition is true, interprets as world position.
|
|
577
|
+
*/
|
|
578
|
+
THREE.Object3D.prototype.setLocalPosition = function (pos: THREE.Vector3): THREE.Object3D {
|
|
579
|
+
this.position.copy(pos);
|
|
580
|
+
return this;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Sets the local rotation using Euler angles.
|
|
585
|
+
* If useAbsoluteRotation is true, interprets as world rotation.
|
|
586
|
+
*/
|
|
587
|
+
THREE.Object3D.prototype.setLocalRotation = function (rot: THREE.Euler): THREE.Object3D {
|
|
588
|
+
this.quaternion.setFromEuler(rot);
|
|
589
|
+
return this;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Sets the local rotation using a quaternion.
|
|
594
|
+
* If useAbsoluteRotation is true, interprets as world rotation.
|
|
595
|
+
*/
|
|
596
|
+
THREE.Object3D.prototype.setLocalQuaternion = function (quaternion: THREE.Quaternion): THREE.Object3D {
|
|
597
|
+
this.quaternion.copy(quaternion);
|
|
598
|
+
return this;
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Sets the local scale relative to the parent.
|
|
603
|
+
* If useAbsoluteScale is true, interprets as world scale.
|
|
604
|
+
*/
|
|
605
|
+
THREE.Object3D.prototype.setLocalScale = function (scale: THREE.Vector3): THREE.Object3D {
|
|
606
|
+
this.scale.copy(scale);
|
|
607
|
+
return this;
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Sets multiple transform properties at once in local space.
|
|
612
|
+
* Only modifies the properties that are provided in the transform object.
|
|
613
|
+
*/
|
|
614
|
+
THREE.Object3D.prototype.setLocalTransform = function (transform: { position?: THREE.Vector3, rotation?: THREE.Euler, scale?: THREE.Vector3 }): THREE.Object3D {
|
|
615
|
+
if (transform.position) {
|
|
616
|
+
this.setLocalPosition(transform.position);
|
|
617
|
+
}
|
|
618
|
+
if (transform.rotation) {
|
|
619
|
+
this.setLocalRotation(transform.rotation);
|
|
620
|
+
}
|
|
621
|
+
if (transform.scale) {
|
|
622
|
+
this.setLocalScale(transform.scale);
|
|
623
|
+
}
|
|
624
|
+
return this;
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Sets the position in world space, automatically converting to local space if parented.
|
|
630
|
+
* Handles the matrix math to transform from world to local coordinates.
|
|
631
|
+
*/
|
|
632
|
+
THREE.Object3D.prototype.setWorldPosition = function (pos: THREE.Vector3): THREE.Object3D {
|
|
633
|
+
if (this.useAbsolutePosition) {
|
|
634
|
+
// When using absolute position, store world position directly
|
|
635
|
+
this.position.copy(pos);
|
|
636
|
+
} else if (this.parent) {
|
|
637
|
+
// Convert the world position to local position
|
|
638
|
+
const localPos = pos.clone();
|
|
639
|
+
// Get the parent's world matrix inverse to convert to local space
|
|
640
|
+
const parentWorldMatrixInverse = new THREE.Matrix4();
|
|
641
|
+
parentWorldMatrixInverse.copy(this.parent.matrixWorld).invert();
|
|
642
|
+
// Apply the inverse matrix to get local position
|
|
643
|
+
localPos.applyMatrix4(parentWorldMatrixInverse);
|
|
644
|
+
// Set the local position
|
|
645
|
+
this.position.copy(localPos);
|
|
646
|
+
} else {
|
|
647
|
+
this.setLocalPosition(pos);
|
|
648
|
+
}
|
|
649
|
+
return this;
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Sets the rotation in world space using Euler angles.
|
|
654
|
+
* Internally converts to quaternion and delegates to setWorldQuaternion.
|
|
655
|
+
*/
|
|
656
|
+
THREE.Object3D.prototype.setWorldRotation = function (rot: THREE.Euler): THREE.Object3D {
|
|
657
|
+
this.setWorldQuaternion(new THREE.Quaternion().setFromEuler(rot));
|
|
658
|
+
return this;
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Sets the rotation in world space using a quaternion.
|
|
663
|
+
* Calculates the required local rotation to achieve the desired world rotation.
|
|
664
|
+
*/
|
|
665
|
+
THREE.Object3D.prototype.setWorldQuaternion = function (quaternion: THREE.Quaternion): THREE.Object3D {
|
|
666
|
+
if (this.useAbsoluteRotation) {
|
|
667
|
+
// When using absolute rotation, store world rotation directly
|
|
668
|
+
this.quaternion.copy(quaternion);
|
|
669
|
+
} else if (this.parent) {
|
|
670
|
+
// Get the parent's world quaternion
|
|
671
|
+
const parentWorldQuat = new THREE.Quaternion();
|
|
672
|
+
this.parent.getWorldQuaternion(parentWorldQuat);
|
|
673
|
+
// Invert parent's world quaternion
|
|
674
|
+
parentWorldQuat.invert();
|
|
675
|
+
// Calculate local quaternion by multiplying world quaternion by inverted parent quaternion
|
|
676
|
+
const localQuaternion = quaternion.clone().premultiply(parentWorldQuat);
|
|
677
|
+
// Set the local quaternion
|
|
678
|
+
this.quaternion.copy(localQuaternion);
|
|
679
|
+
} else {
|
|
680
|
+
this.setLocalQuaternion(quaternion);
|
|
681
|
+
}
|
|
682
|
+
return this;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Sets the scale in world space, compensating for parent scaling.
|
|
687
|
+
* Calculates the local scale needed to achieve the desired world scale.
|
|
688
|
+
*/
|
|
689
|
+
THREE.Object3D.prototype.setWorldScale = function (scale: THREE.Vector3): THREE.Object3D {
|
|
690
|
+
if (this.useAbsoluteScale) {
|
|
691
|
+
// When using absolute scale, store world scale directly
|
|
692
|
+
this.scale.copy(scale);
|
|
693
|
+
} else if (this.parent) {
|
|
694
|
+
const parentWorldScale = new THREE.Vector3();
|
|
695
|
+
this.parent.getWorldScale(parentWorldScale);
|
|
696
|
+
this.scale.set(scale.x / parentWorldScale.x, scale.y / parentWorldScale.y, scale.z / parentWorldScale.z);
|
|
697
|
+
} else {
|
|
698
|
+
this.setLocalScale(scale);
|
|
699
|
+
}
|
|
700
|
+
return this;
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Sets multiple transform properties at once in world space.
|
|
705
|
+
* Delegates to individual world setters for each provided property.
|
|
706
|
+
*/
|
|
707
|
+
THREE.Object3D.prototype.setWorldTransform = function (transform: { position?: THREE.Vector3, rotation?: THREE.Euler, scale?: THREE.Vector3 }): THREE.Object3D {
|
|
708
|
+
if (transform.position) {
|
|
709
|
+
this.setWorldPosition(transform.position);
|
|
710
|
+
}
|
|
711
|
+
if (transform.rotation) {
|
|
712
|
+
this.setWorldRotation(transform.rotation);
|
|
713
|
+
}
|
|
714
|
+
if (transform.scale) {
|
|
715
|
+
this.setWorldScale(transform.scale);
|
|
716
|
+
}
|
|
717
|
+
return this;
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Adds a position offset in world space.
|
|
722
|
+
* Transforms the world delta to local space before applying.
|
|
723
|
+
*/
|
|
724
|
+
THREE.Object3D.prototype.addWorldPosition = function (delta: THREE.Vector3): THREE.Object3D {
|
|
725
|
+
if (this.useAbsolutePosition) {
|
|
726
|
+
// When using absolute position, position is already in world space
|
|
727
|
+
this.position.add(delta);
|
|
728
|
+
} else if (this.parent) {
|
|
729
|
+
this.updateMatrixWorld(true);
|
|
730
|
+
// Convert the delta from world space to local space
|
|
731
|
+
// We need to transform the direction only, not apply the full matrix
|
|
732
|
+
const worldDelta = delta.clone();
|
|
733
|
+
|
|
734
|
+
// Get parent's world rotation and scale to transform the delta
|
|
735
|
+
const parentWorldQuat = new THREE.Quaternion();
|
|
736
|
+
const parentWorldScale = new THREE.Vector3();
|
|
737
|
+
const parentWorldPos = new THREE.Vector3();
|
|
738
|
+
this.parent.matrixWorld.decompose(parentWorldPos, parentWorldQuat, parentWorldScale);
|
|
739
|
+
|
|
740
|
+
// Apply inverse scale
|
|
741
|
+
worldDelta.divide(parentWorldScale);
|
|
742
|
+
|
|
743
|
+
// Apply inverse rotation
|
|
744
|
+
parentWorldQuat.invert();
|
|
745
|
+
worldDelta.applyQuaternion(parentWorldQuat);
|
|
746
|
+
|
|
747
|
+
// Apply the local translation
|
|
748
|
+
this.position.add(worldDelta);
|
|
749
|
+
} else {
|
|
750
|
+
this.addLocalPosition(delta);
|
|
751
|
+
}
|
|
752
|
+
return this;
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Adds a rotation offset in world space.
|
|
757
|
+
* Applies the rotation in world coordinates then converts back to local.
|
|
758
|
+
*/
|
|
759
|
+
THREE.Object3D.prototype.addWorldRotation = function (delta: THREE.Euler): THREE.Object3D {
|
|
760
|
+
if (this.useAbsoluteRotation) {
|
|
761
|
+
// When using absolute rotation, quaternion is already in world space
|
|
762
|
+
const deltaQuat = new THREE.Quaternion().setFromEuler(delta);
|
|
763
|
+
this.quaternion.premultiply(deltaQuat);
|
|
764
|
+
} else if (this.parent) {
|
|
765
|
+
this.updateMatrixWorld(true);
|
|
766
|
+
const currentWorldQuat = new THREE.Quaternion();
|
|
767
|
+
this.getWorldQuaternion(currentWorldQuat);
|
|
768
|
+
currentWorldQuat.premultiply(new THREE.Quaternion().setFromEuler(delta));
|
|
769
|
+
const parentWorldQuat = new THREE.Quaternion();
|
|
770
|
+
this.parent.getWorldQuaternion(parentWorldQuat);
|
|
771
|
+
parentWorldQuat.invert();
|
|
772
|
+
this.quaternion.copy(currentWorldQuat.premultiply(parentWorldQuat));
|
|
773
|
+
} else {
|
|
774
|
+
this.addLocalRotation(delta);
|
|
775
|
+
}
|
|
776
|
+
return this;
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Gets all world transform components as a single object.
|
|
781
|
+
* Convenient for getting position, rotation, and scale in one call.
|
|
782
|
+
*/
|
|
783
|
+
THREE.Object3D.prototype.getWorldTransform = function (): { position: THREE.Vector3, rotation: THREE.Euler, scale: THREE.Vector3 } {
|
|
784
|
+
return {
|
|
785
|
+
position: this.getWorldPosition(),
|
|
786
|
+
rotation: this.getWorldRotation(),
|
|
787
|
+
scale: this.getWorldScale(),
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Gets the world position, extracting it from the world matrix.
|
|
793
|
+
* Updates world matrix if needed to ensure accuracy.
|
|
794
|
+
*/
|
|
795
|
+
THREE.Object3D.prototype.getWorldPosition = function (target?: THREE.Vector3): THREE.Vector3 {
|
|
796
|
+
target ??= new THREE.Vector3();
|
|
797
|
+
// For absolute position, just return the position directly
|
|
798
|
+
if (this.useAbsolutePosition) {
|
|
799
|
+
return target.copy(this.position);
|
|
800
|
+
}
|
|
801
|
+
this.updateWorldMatrix(true, false);
|
|
802
|
+
return target.setFromMatrixPosition(this.matrixWorld);
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Gets the world rotation as Euler angles.
|
|
807
|
+
* Internally gets world quaternion and converts to Euler.
|
|
808
|
+
*/
|
|
809
|
+
THREE.Object3D.prototype.getWorldRotation = function (target?: THREE.Euler): THREE.Euler {
|
|
810
|
+
target ??= new THREE.Euler();
|
|
811
|
+
// For absolute rotation, convert quaternion to Euler directly
|
|
812
|
+
if (this.useAbsoluteRotation) {
|
|
813
|
+
return target.setFromQuaternion(this.quaternion);
|
|
814
|
+
}
|
|
815
|
+
return target.setFromQuaternion(this.getWorldQuaternion());
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Gets the world scale by decomposing the world matrix.
|
|
820
|
+
* Extracts scale component from the transformation matrix.
|
|
821
|
+
*/
|
|
822
|
+
THREE.Object3D.prototype.getWorldScale = function (target?: THREE.Vector3): THREE.Vector3 {
|
|
823
|
+
target ??= new THREE.Vector3();
|
|
824
|
+
// For absolute scale, just return the scale directly
|
|
825
|
+
if (this.useAbsoluteScale) {
|
|
826
|
+
return target.copy(this.scale);
|
|
827
|
+
}
|
|
828
|
+
this.updateWorldMatrix(true, false);
|
|
829
|
+
this.matrixWorld.decompose(tempPosition, tempQuaternion, target);
|
|
830
|
+
return target;
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Gets the world rotation as a quaternion by decomposing the world matrix.
|
|
835
|
+
* More precise than Euler angles for rotation calculations.
|
|
836
|
+
*/
|
|
837
|
+
THREE.Object3D.prototype.getWorldQuaternion = function (target?: THREE.Quaternion): THREE.Quaternion {
|
|
838
|
+
target ??= new THREE.Quaternion();
|
|
839
|
+
// For absolute rotation, just return the quaternion directly
|
|
840
|
+
if (this.useAbsoluteRotation) {
|
|
841
|
+
return target.copy(this.quaternion);
|
|
842
|
+
}
|
|
843
|
+
this.updateWorldMatrix(true, false);
|
|
844
|
+
this.matrixWorld.decompose(tempPosition, target, tempScale);
|
|
845
|
+
return target;
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Checks if this object is marked as transient (temporary/non-persistent).
|
|
850
|
+
* Transient objects are excluded from world serialization.
|
|
851
|
+
*/
|
|
852
|
+
THREE.Object3D.prototype.isTransient = function (): boolean {
|
|
853
|
+
// Object3D is serialized as scene graph so if the parent is transient then the children won't be serialized
|
|
854
|
+
// effectively making them transient as well
|
|
855
|
+
return this.userData.isTransient ?? this.parent?.isTransient() ?? false;
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Marks this object as transient or persistent.
|
|
860
|
+
* Transient flag is stored in userData to persist across operations.
|
|
861
|
+
*/
|
|
862
|
+
THREE.Object3D.prototype.setTransient = function (transient: boolean): THREE.Object3D {
|
|
863
|
+
this.userData.isTransient = transient;
|
|
864
|
+
return this;
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Returns a description of this object for UI/debugging purposes.
|
|
869
|
+
* Base implementation returns empty object; components override for custom descriptions.
|
|
870
|
+
*/
|
|
871
|
+
THREE.Object3D.prototype.describe = function (options?: ComponentDescriptionOptions): Record<string, any> {
|
|
872
|
+
return {};
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Temporarily overrides materials for visual effects (e.g., highlighting).
|
|
877
|
+
* Base implementation just propagates to children; Mesh overrides to actually swap materials.
|
|
878
|
+
*/
|
|
879
|
+
THREE.Object3D.prototype.setOverrideMaterial = function (material: THREE.Material | null, recursive: boolean): THREE.Object3D {
|
|
880
|
+
if (recursive) {
|
|
881
|
+
this.children.forEach(child => child.setOverrideMaterial(material, true));
|
|
882
|
+
}
|
|
883
|
+
return this;
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* Called when entering play mode, propagates to all children.
|
|
888
|
+
* Components override this to initialize gameplay logic.
|
|
889
|
+
*/
|
|
890
|
+
THREE.Object3D.prototype.beginPlay = function (): void {
|
|
891
|
+
this.children.forEach(child => child.beginPlay());
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Called when exiting play mode, propagates to all children.
|
|
896
|
+
* Components override this to clean up gameplay resources.
|
|
897
|
+
*/
|
|
898
|
+
THREE.Object3D.prototype.endPlay = function (): void {
|
|
899
|
+
this.children.forEach(child => child.endPlay());
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Update called before physics simulation each frame.
|
|
904
|
+
* Components override this for pre-physics updates like input handling.
|
|
905
|
+
*/
|
|
906
|
+
THREE.Object3D.prototype.tickPrePhysics = function (deltaTime: number): void {
|
|
907
|
+
this.children.forEach(child => child.tickPrePhysics(deltaTime));
|
|
908
|
+
};
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Update called after physics simulation each frame.
|
|
912
|
+
* Components override this for post-physics updates like visual synchronization.
|
|
913
|
+
*/
|
|
914
|
+
THREE.Object3D.prototype.tickPostPhysics = function (deltaTime: number): void {
|
|
915
|
+
this.children.forEach(child => child.tickPostPhysics(deltaTime));
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Updates physics configuration for this object and optionally its children.
|
|
920
|
+
* Components with physics override this to actually update their physics bodies.
|
|
921
|
+
*/
|
|
922
|
+
THREE.Object3D.prototype.replacePhysicsOptions = function (newOptions: ComponentPhysicsOptions, propagateToChildren: boolean = false): THREE.Object3D {
|
|
923
|
+
if (propagateToChildren) {
|
|
924
|
+
this.children.forEach(child => child.replacePhysicsOptions(newOptions, true));
|
|
925
|
+
}
|
|
926
|
+
return this;
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Overrides the physics options for this object and optionally its children.
|
|
931
|
+
* @param newOptions The new physics configuration
|
|
932
|
+
* @param propagateToChildren Whether to apply to all descendants
|
|
933
|
+
*/
|
|
934
|
+
THREE.Object3D.prototype.overridePhysicsOptions = function (newOptions: ComponentPhysicsOptions, propagateToChildren: boolean = false): THREE.Object3D {
|
|
935
|
+
if (propagateToChildren) {
|
|
936
|
+
this.children.forEach(child => child.overridePhysicsOptions(newOptions, true));
|
|
937
|
+
}
|
|
938
|
+
return this;
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
// Override add method to handle lifecycle events
|
|
942
|
+
/**
|
|
943
|
+
* Extended add method that automatically calls beginPlay on added objects
|
|
944
|
+
* if they're being added to an active (playing) actor.
|
|
945
|
+
*/
|
|
946
|
+
const originalAdd = THREE.Object3D.prototype.add;
|
|
947
|
+
|
|
948
|
+
THREE.Object3D.prototype.add = function (...objects: THREE.Object3D[]): THREE.Object3D {
|
|
949
|
+
const actor = this.getActor();
|
|
950
|
+
if (actor) {
|
|
951
|
+
if (!ensure(!actor.isPlayEnded())) {
|
|
952
|
+
return this;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
originalAdd.call(this, ...objects);
|
|
957
|
+
|
|
958
|
+
if (actor?.isPlaying()) {
|
|
959
|
+
objects.forEach(obj => obj.beginPlay());
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
return this;
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
// Override remove method to handle lifecycle events
|
|
966
|
+
/**
|
|
967
|
+
* Extended remove method that automatically calls endPlay on removed objects
|
|
968
|
+
* if they're being removed from an active (playing) actor.
|
|
969
|
+
*/
|
|
970
|
+
const originalRemove = THREE.Object3D.prototype.remove;
|
|
971
|
+
|
|
972
|
+
THREE.Object3D.prototype.remove = function (...objects: THREE.Object3D[]): THREE.Object3D {
|
|
973
|
+
const actor = this.getActor();
|
|
974
|
+
if (actor) {
|
|
975
|
+
if (!ensure(!actor.isPlayEnded())) {
|
|
976
|
+
return this;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
originalRemove.call(this, ...objects);
|
|
981
|
+
|
|
982
|
+
if (actor?.isPlaying()) {
|
|
983
|
+
objects.forEach(obj => obj.endPlay());
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
return this;
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Mesh-specific override material implementation.
|
|
991
|
+
* Saves the original material and swaps it with the override, or restores the original.
|
|
992
|
+
*/
|
|
993
|
+
THREE.Mesh.prototype.setOverrideMaterial = function (material: THREE.Material | null, recursive: boolean): THREE.Mesh {
|
|
994
|
+
if (material) {
|
|
995
|
+
this.userData.__savedMaterial__ = this.material;
|
|
996
|
+
this.material = material;
|
|
997
|
+
} else {
|
|
998
|
+
const savedMaterial = this.userData.__savedMaterial__;
|
|
999
|
+
if (savedMaterial) {
|
|
1000
|
+
this.material = savedMaterial;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
THREE.Object3D.prototype.setOverrideMaterial.call(this, material, recursive);
|
|
1004
|
+
return this;
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Serializes this material for saving/loading.
|
|
1009
|
+
* Uses the WorldSerializer to handle material-specific properties.
|
|
1010
|
+
*/
|
|
1011
|
+
THREE.Material.prototype.asExportedObject = function (includeDefaults: boolean): any {
|
|
1012
|
+
return WorldSerializer.exportObject(this, includeDefaults);
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Checks if two vectors are approximately equal within a tolerance.
|
|
1017
|
+
* Useful for comparing positions/scales where floating point precision matters.
|
|
1018
|
+
*/
|
|
1019
|
+
THREE.Vector3.prototype.almostEquals = function (other: THREE.Vector3Like, epsilon: number = 0.00001): boolean {
|
|
1020
|
+
epsilon ??= 0.00001;
|
|
1021
|
+
return Math.abs(this.x - other.x) < epsilon &&
|
|
1022
|
+
Math.abs(this.y - other.y) < epsilon &&
|
|
1023
|
+
Math.abs(this.z - other.z) < epsilon;
|
|
1024
|
+
};
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Checks if two Euler rotations are approximately equal within a tolerance.
|
|
1028
|
+
* Useful for comparing rotations where floating point precision matters.
|
|
1029
|
+
* Note: Compares raw angles, doesn't account for equivalent rotations.
|
|
1030
|
+
*/
|
|
1031
|
+
THREE.Euler.prototype.almostEquals = function (other: THREE.Euler, epsilon: number = 0.00001): boolean {
|
|
1032
|
+
epsilon ??= 0.00001;
|
|
1033
|
+
return Math.abs(this.x - other.x) < epsilon &&
|
|
1034
|
+
Math.abs(this.y - other.y) < epsilon &&
|
|
1035
|
+
Math.abs(this.z - other.z) < epsilon;
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
// Store the original updateMatrixWorld method
|
|
1039
|
+
const originalUpdateMatrixWorld = THREE.Object3D.prototype.updateMatrixWorld;
|
|
1040
|
+
const originalUpdateWorldMatrix = THREE.Object3D.prototype.updateWorldMatrix;
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Override updateWorldMatrix to handle absolute transform properties.
|
|
1044
|
+
* This method is called by getWorldPosition/Rotation/Scale and needs to respect absolute transforms.
|
|
1045
|
+
|
|
1046
|
+
======================== Default Implementation ========================
|
|
1047
|
+
|
|
1048
|
+
updateWorldMatrix( updateParents, updateChildren ) {
|
|
1049
|
+
const parent = this.parent;
|
|
1050
|
+
if ( updateParents === true && parent !== null ) {
|
|
1051
|
+
parent.updateWorldMatrix( true, false );
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if ( this.matrixAutoUpdate ) this.updateMatrix();
|
|
1055
|
+
|
|
1056
|
+
if ( this.matrixWorldAutoUpdate === true ) {
|
|
1057
|
+
if ( this.parent === null ) {
|
|
1058
|
+
this.matrixWorld.copy( this.matrix );
|
|
1059
|
+
} else {
|
|
1060
|
+
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
// make sure descendants are updated
|
|
1065
|
+
|
|
1066
|
+
if ( updateChildren === true ) {
|
|
1067
|
+
const children = this.children;
|
|
1068
|
+
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
1069
|
+
const child = children[ i ];
|
|
1070
|
+
child.updateWorldMatrix( false, true );
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
*/
|
|
1075
|
+
THREE.Object3D.prototype.updateWorldMatrix = function(updateParents?: boolean, updateChildren?: boolean): void {
|
|
1076
|
+
const parent = this.parent;
|
|
1077
|
+
if (updateParents && parent) {
|
|
1078
|
+
parent.updateWorldMatrix(true, false);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
if (this.matrixAutoUpdate) {
|
|
1082
|
+
this.updateMatrix();
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
if (this.matrixWorldAutoUpdate) {
|
|
1086
|
+
calculateMatrixWorld(this);
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
if (updateChildren) {
|
|
1090
|
+
for (const child of this.children) {
|
|
1091
|
+
child.updateWorldMatrix(false, true);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Override updateMatrixWorld to handle absolute transform properties.
|
|
1098
|
+
* When useAbsolutePosition/Rotation/Scale are true, the object maintains
|
|
1099
|
+
* its world transform regardless of parent transformations.
|
|
1100
|
+
|
|
1101
|
+
======================== Default Implementation ========================
|
|
1102
|
+
|
|
1103
|
+
updateMatrixWorld( force ) {
|
|
1104
|
+
if ( this.matrixAutoUpdate ) this.updateMatrix();
|
|
1105
|
+
if ( this.matrixWorldNeedsUpdate || force ) {
|
|
1106
|
+
if ( this.matrixWorldAutoUpdate === true ) {
|
|
1107
|
+
if ( this.parent === null ) {
|
|
1108
|
+
this.matrixWorld.copy( this.matrix );
|
|
1109
|
+
} else {
|
|
1110
|
+
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
this.matrixWorldNeedsUpdate = false;
|
|
1115
|
+
force = true;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// make sure descendants are updated if required
|
|
1119
|
+
|
|
1120
|
+
const children = this.children;
|
|
1121
|
+
|
|
1122
|
+
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
1123
|
+
const child = children[ i ];
|
|
1124
|
+
child.updateMatrixWorld( force );
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
*/
|
|
1128
|
+
|
|
1129
|
+
THREE.Object3D.prototype.updateMatrixWorld = function(force?: boolean): void {
|
|
1130
|
+
if (this.matrixAutoUpdate) {
|
|
1131
|
+
this.updateMatrix();
|
|
1132
|
+
}
|
|
1133
|
+
if (this.matrixWorldNeedsUpdate || force) {
|
|
1134
|
+
if (this.matrixWorldAutoUpdate) {
|
|
1135
|
+
calculateMatrixWorld(this);
|
|
1136
|
+
}
|
|
1137
|
+
this.matrixWorldNeedsUpdate = false;
|
|
1138
|
+
force = true;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
for (const child of this.children) {
|
|
1142
|
+
child.updateMatrixWorld(force);
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
function calculateMatrixWorld(object: THREE.Object3D): void {
|
|
1147
|
+
if (!object.parent) {
|
|
1148
|
+
object.matrixWorld.copy(object.matrix);
|
|
1149
|
+
} else {
|
|
1150
|
+
if (object.useAbsolutePosition || object.useAbsoluteRotation || object.useAbsoluteScale) {
|
|
1151
|
+
// Get parent's world transform for non-absolute components
|
|
1152
|
+
const parentPos = new THREE.Vector3();
|
|
1153
|
+
const parentQuat = new THREE.Quaternion();
|
|
1154
|
+
const parentScale = new THREE.Vector3();
|
|
1155
|
+
object.parent.matrixWorld.decompose(parentPos, parentQuat, parentScale);
|
|
1156
|
+
|
|
1157
|
+
// Determine final world position
|
|
1158
|
+
let finalWorldPos: THREE.Vector3;
|
|
1159
|
+
if (object.useAbsolutePosition) {
|
|
1160
|
+
// Use position as world position directly
|
|
1161
|
+
finalWorldPos = object.position.clone();
|
|
1162
|
+
} else {
|
|
1163
|
+
// Transform local position by parent's rotation and scale, then add parent's position
|
|
1164
|
+
finalWorldPos = object.position.clone();
|
|
1165
|
+
// Apply parent's rotation
|
|
1166
|
+
finalWorldPos.applyQuaternion(parentQuat);
|
|
1167
|
+
// Apply parent's scale
|
|
1168
|
+
finalWorldPos.multiply(parentScale);
|
|
1169
|
+
// Add parent's position
|
|
1170
|
+
finalWorldPos.add(parentPos);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// Determine final world rotation
|
|
1174
|
+
let finalWorldQuat: THREE.Quaternion;
|
|
1175
|
+
if (object.useAbsoluteRotation) {
|
|
1176
|
+
// Use quaternion as world rotation directly
|
|
1177
|
+
finalWorldQuat = object.quaternion.clone();
|
|
1178
|
+
} else {
|
|
1179
|
+
// Combine with parent rotation
|
|
1180
|
+
finalWorldQuat = parentQuat.clone();
|
|
1181
|
+
finalWorldQuat.multiply(object.quaternion);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
// Determine final world scale
|
|
1185
|
+
let finalWorldScale: THREE.Vector3;
|
|
1186
|
+
if (object.useAbsoluteScale) {
|
|
1187
|
+
// Use scale as world scale directly
|
|
1188
|
+
finalWorldScale = object.scale.clone();
|
|
1189
|
+
} else {
|
|
1190
|
+
// Multiply with parent scale
|
|
1191
|
+
finalWorldScale = object.scale.clone();
|
|
1192
|
+
finalWorldScale.multiply(parentScale);
|
|
1193
|
+
}
|
|
1194
|
+
// Compose world matrix from the computed components
|
|
1195
|
+
object.matrixWorld.compose(finalWorldPos, finalWorldQuat, finalWorldScale);
|
|
1196
|
+
} else {
|
|
1197
|
+
object.matrixWorld.multiplyMatrices(object.parent.matrixWorld, object.matrix);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|