@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,866 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnimationRetargeting algorithm for Three.js - adapted from https://github.com/upf-gti/retargeting-threejs
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as THREE from 'three';
|
|
6
|
+
|
|
7
|
+
export interface PositionAxisFlips {
|
|
8
|
+
x?: boolean;
|
|
9
|
+
y?: boolean;
|
|
10
|
+
z?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RetargetingOptions {
|
|
14
|
+
srcPoseMode?: number;
|
|
15
|
+
trgPoseMode?: number;
|
|
16
|
+
srcEmbedWorldTransforms?: boolean;
|
|
17
|
+
trgEmbedWorldTransforms?: boolean;
|
|
18
|
+
boneNameMap?: Record<string, string>;
|
|
19
|
+
positionAxisFlips?: PositionAxisFlips;
|
|
20
|
+
hipsPositionAxisFlips?: PositionAxisFlips;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Transform {
|
|
24
|
+
p: THREE.Vector3;
|
|
25
|
+
q: THREE.Quaternion;
|
|
26
|
+
s: THREE.Vector3;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface EmbeddedTransforms {
|
|
30
|
+
forward: Transform;
|
|
31
|
+
inverse: Transform;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface ExtendedSkeleton extends THREE.Skeleton {
|
|
35
|
+
parentIndices: Int16Array;
|
|
36
|
+
transformsWorld: Transform[];
|
|
37
|
+
transformsWorldInverses: Transform[];
|
|
38
|
+
transformsWorldEmbedded?: EmbeddedTransforms;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface BoneMapResult {
|
|
42
|
+
idxMap: Int16Array;
|
|
43
|
+
nameMap: Record<string, string>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface PrecomputedQuats {
|
|
47
|
+
left: (THREE.Quaternion | null)[];
|
|
48
|
+
right: (THREE.Quaternion | null)[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// asymetric and/or negative scaling of objects is not properly supported
|
|
52
|
+
class AnimationRetargeting {
|
|
53
|
+
|
|
54
|
+
static BindPoseModes = { DEFAULT : 0, CURRENT: 1 };
|
|
55
|
+
static boneMap: Record<string, string> = {
|
|
56
|
+
'LEye': 'lefteye',
|
|
57
|
+
'REye': 'righteye',
|
|
58
|
+
'Head': 'head',
|
|
59
|
+
'Neck': 'neck',
|
|
60
|
+
'ShouldersUnion': 'spine2', // chest
|
|
61
|
+
'Stomach': 'spine1',
|
|
62
|
+
'BelowStomach': 'spine',
|
|
63
|
+
'Hips': 'hips',
|
|
64
|
+
'RShoulder': 'rightshoulder',
|
|
65
|
+
'RArm': 'rightarm',
|
|
66
|
+
'RElbow': 'rightforearm',
|
|
67
|
+
'RHandThumb': 'righthandthumb1',
|
|
68
|
+
'RHandThumb2': 'righthandthumb2',
|
|
69
|
+
'RHandThumb3': 'righthandthumb3',
|
|
70
|
+
'RHandThumb4': 'righthandthumb4',
|
|
71
|
+
'RHandIndex': 'righthandindex1',
|
|
72
|
+
'RHandIndex2': 'righthandindex2',
|
|
73
|
+
'RHandIndex3': 'righthandindex3',
|
|
74
|
+
'RHandIndex4': 'righthandindex4',
|
|
75
|
+
'RHandMiddle': 'righthandmiddle1',
|
|
76
|
+
'RHandMiddle2': 'righthandmiddle2',
|
|
77
|
+
'RHandMiddle3': 'righthandmiddle3',
|
|
78
|
+
'RHandMiddle4': 'righthandmiddle4',
|
|
79
|
+
'RHandRing': 'righthandring1',
|
|
80
|
+
'RHandRing2': 'righthandring2',
|
|
81
|
+
'RHandRing3': 'righthandring3',
|
|
82
|
+
'RHandRing4': 'righthandring4',
|
|
83
|
+
'RHandPinky': 'righthandpinky1',
|
|
84
|
+
'RHandPinky2': 'righthandpinky2',
|
|
85
|
+
'RHandPinky3': 'righthandpinky3',
|
|
86
|
+
'RHandPinky4': 'righthandpinky4',
|
|
87
|
+
'RWrist': 'righthand',
|
|
88
|
+
'LShoulder': 'leftshoulder',
|
|
89
|
+
'LArm': 'leftarm',
|
|
90
|
+
'LElbow': 'leftforearm',
|
|
91
|
+
'LHandThumb': 'lefthandthumb1',
|
|
92
|
+
'LHandThumb2': 'lefthandthumb2',
|
|
93
|
+
'LHandThumb3': 'lefthandthumb3',
|
|
94
|
+
'LHandThumb4': 'lefthandthumb4',
|
|
95
|
+
'LHandIndex': 'lefthandindex1',
|
|
96
|
+
'LHandIndex2': 'lefthandindex2',
|
|
97
|
+
'LHandIndex3': 'lefthandindex3',
|
|
98
|
+
'LHandIndex4': 'lefthandindex4',
|
|
99
|
+
'LHandMiddle': 'lefthandmiddle1',
|
|
100
|
+
'LHandMiddle2': 'lefthandmiddle2',
|
|
101
|
+
'LHandMiddle3': 'lefthandmiddle3',
|
|
102
|
+
'LHandMiddle4': 'lefthandmiddle4',
|
|
103
|
+
'LHandRing': 'lefthandring1',
|
|
104
|
+
'LHandRing2': 'lefthandring2',
|
|
105
|
+
'LHandRing3': 'lefthandring3',
|
|
106
|
+
'LHandRing4': 'lefthandring4',
|
|
107
|
+
'LHandPinky': 'lefthandpinky1',
|
|
108
|
+
'LHandPinky2': 'lefthandpinky2',
|
|
109
|
+
'LHandPinky3': 'lefthandpinky3',
|
|
110
|
+
'LHandPinky4': 'lefthandpinky4',
|
|
111
|
+
'LWrist': 'lefthand',
|
|
112
|
+
'LUpLeg': 'leftupleg',
|
|
113
|
+
'LLeg': 'leftleg',
|
|
114
|
+
'LFoot': 'leftfoot',
|
|
115
|
+
'LToeBase': 'lefttoebase',
|
|
116
|
+
'RUpLeg': 'rightupleg',
|
|
117
|
+
'RLeg': 'rightleg',
|
|
118
|
+
'RFoot': 'rightfoot',
|
|
119
|
+
'RToeBase': 'righttoebase',
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
srcSkeleton: THREE.Skeleton;
|
|
123
|
+
trgSkeleton: THREE.Skeleton;
|
|
124
|
+
boneMap: BoneMapResult;
|
|
125
|
+
srcBindPose: ExtendedSkeleton;
|
|
126
|
+
trgBindPose: ExtendedSkeleton;
|
|
127
|
+
precomputedQuats: PrecomputedQuats;
|
|
128
|
+
proportionRatio: number;
|
|
129
|
+
positionAxisFlips: PositionAxisFlips;
|
|
130
|
+
hipsPositionAxisFlips: PositionAxisFlips;
|
|
131
|
+
srcBoneMap?: BoneMapResult;
|
|
132
|
+
trgBoneMap?: BoneMapResult;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Retargets animations and/or current poses from one skeleton to another.
|
|
136
|
+
* Both skeletons must have the same bind pose (same orientation for each mapped bone) in order to properly work.
|
|
137
|
+
* Use optional parameters to adjust the bind pose.
|
|
138
|
+
* @param srcSkeleton Skeleton of source avatar. Its bind pose must be the same as trgSkeleton. The original skeleton is cloned and can be safely modified
|
|
139
|
+
* @param trgSkeleton Same as srcSkeleton but for the target avatar
|
|
140
|
+
* @param options.srcPoseMode BindPoseModes enum values. Pose of the srcSkeleton that will be used as the bind pose for the retargeting. By default, skeleton's actual bind pose is used.
|
|
141
|
+
* @param options.trgPoseMode BindPoseModes enum values. Same as srcPoseMode but for the target avatar.
|
|
142
|
+
|
|
143
|
+
* @param options.srcEmbedWorldTransforms Bool. Retargeting only takes into account transforms from the actual bone objects.
|
|
144
|
+
* If set to true, external (parent) transforms are computed and embedded into the root joint.
|
|
145
|
+
* Afterwards, parent transforms/matrices can be safely modified and will not affect in retargeting.
|
|
146
|
+
* Useful when it is easier to modify the container of the skeleton rather than the actual skeleton in order to align source and target poses
|
|
147
|
+
* @param options.trgEmbedWorldTransforms Same as srcEmbedWorldTransforms but for the target avatar
|
|
148
|
+
* @param options.boneNameMap String-to-string mapping between src and trg through bone names. Only supports one-to-one mapping
|
|
149
|
+
*/
|
|
150
|
+
constructor( srcSkeleton: THREE.Skeleton | THREE.Object3D, trgSkeleton: THREE.Skeleton | THREE.Object3D, options: RetargetingOptions = {} ){
|
|
151
|
+
|
|
152
|
+
this.srcSkeleton = srcSkeleton as THREE.Skeleton; // original ref
|
|
153
|
+
if ( !(srcSkeleton as THREE.Skeleton).boneInverses ){ // find its skeleton
|
|
154
|
+
(srcSkeleton as THREE.Object3D).traverse( (o) => { if( (o as THREE.SkinnedMesh).isSkinnedMesh ){ this.srcSkeleton = (o as THREE.SkinnedMesh).skeleton; } } );
|
|
155
|
+
}
|
|
156
|
+
this.trgSkeleton = trgSkeleton as THREE.Skeleton; // original ref
|
|
157
|
+
if ( !(trgSkeleton as THREE.Skeleton).boneInverses ){ // find its skeleton
|
|
158
|
+
(trgSkeleton as THREE.Object3D).traverse( (o) => { if( (o as THREE.SkinnedMesh).isSkinnedMesh ){ this.trgSkeleton = (o as THREE.SkinnedMesh).skeleton; } } );
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
this.boneMap = this.computeBoneMap( this.srcSkeleton, this.trgSkeleton, options.boneNameMap ); // { idxMap: [], nameMape:{} }
|
|
162
|
+
this.srcBindPose = this.cloneRawSkeleton( this.srcSkeleton, options.srcPoseMode, options.srcEmbedWorldTransforms ); // returns pure skeleton, without any object model applied
|
|
163
|
+
this.trgBindPose = this.cloneRawSkeleton( this.trgSkeleton, options.trgPoseMode, options.trgEmbedWorldTransforms ); // returns pure skeleton, without any object model applied
|
|
164
|
+
|
|
165
|
+
this.precomputedQuats = this._precomputeRetargetingQuats();
|
|
166
|
+
this.proportionRatio = this._computeProportionRatio(); // returns an aproximate ratio of lengths between source skeleton and target skeleton. Used in Position retargeting
|
|
167
|
+
|
|
168
|
+
// Optional axis flips for position retargeting (from target profile)
|
|
169
|
+
this.positionAxisFlips = options.positionAxisFlips ?? { x: false, y: false, z: false };
|
|
170
|
+
this.hipsPositionAxisFlips = options.hipsPositionAxisFlips ?? { x: false, y: false, z: false };
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* creates a Transform object with identity values
|
|
175
|
+
* @returns Transform
|
|
176
|
+
*/
|
|
177
|
+
_newTransform(): Transform { return { p: new THREE.Vector3(0,0,0), q: new THREE.Quaternion(0,0,0,1), s: new THREE.Vector3(1,1,1) }; }
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Deep clone of the skeleton. New bones are generated. Skeleton's parent objects will not be linked to the cloned one
|
|
181
|
+
* Returned skeleton has new attributes:
|
|
182
|
+
* - Always: .parentIndices, .transformsWorld, .transformsWorldInverses
|
|
183
|
+
* - embedWorld == true: .transformsWorldEmbedded
|
|
184
|
+
*/
|
|
185
|
+
cloneRawSkeleton( skeleton: THREE.Skeleton, poseMode?: number, embedWorld = false ): ExtendedSkeleton {
|
|
186
|
+
const bones = skeleton.bones;
|
|
187
|
+
|
|
188
|
+
const resultBones: THREE.Bone[] = new Array( bones.length );
|
|
189
|
+
const parentIndices = new Int16Array( bones.length );
|
|
190
|
+
|
|
191
|
+
// bones[0].clone( true ); // recursive
|
|
192
|
+
for( let i = 0; i < bones.length; ++i ){
|
|
193
|
+
resultBones[i] = bones[i].clone(false);
|
|
194
|
+
resultBones[i].parent = null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
for( let i = 0; i < bones.length; ++i ){
|
|
198
|
+
const parentIdx = findIndexOfBone( skeleton, bones[i].parent as THREE.Bone );
|
|
199
|
+
if ( parentIdx > -1 ){ resultBones[ parentIdx ].add( resultBones[ i ] ); }
|
|
200
|
+
|
|
201
|
+
parentIndices[i] = parentIdx;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
resultBones[0].updateWorldMatrix( false, true ); // assume 0 is root. Update all global matrices (root does not have any parent)
|
|
205
|
+
|
|
206
|
+
// generate skeleton
|
|
207
|
+
let resultSkeleton: ExtendedSkeleton;
|
|
208
|
+
switch(poseMode) {
|
|
209
|
+
case AnimationRetargeting.BindPoseModes.CURRENT:
|
|
210
|
+
resultSkeleton = new THREE.Skeleton( resultBones ) as ExtendedSkeleton; // will automatically compute the inverses from the matrixWorld of each bone
|
|
211
|
+
|
|
212
|
+
break;
|
|
213
|
+
default: {
|
|
214
|
+
const boneInverses: THREE.Matrix4[] = new Array( skeleton.boneInverses.length );
|
|
215
|
+
for( let i = 0; i < boneInverses.length; ++i ) {
|
|
216
|
+
boneInverses[i] = skeleton.boneInverses[i].clone();
|
|
217
|
+
}
|
|
218
|
+
resultSkeleton = new THREE.Skeleton( resultBones, boneInverses ) as ExtendedSkeleton;
|
|
219
|
+
resultSkeleton.pose();
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
resultSkeleton.parentIndices = parentIndices; // add this attribute to the THREE.Skeleton class
|
|
225
|
+
|
|
226
|
+
// precompute transforms (forward and inverse) from world matrices
|
|
227
|
+
const transforms: Transform[] = new Array( skeleton.bones.length );
|
|
228
|
+
const transformsInverses: Transform[] = new Array( skeleton.bones.length );
|
|
229
|
+
for( let i = 0; i < transforms.length; ++i ){
|
|
230
|
+
let t = this._newTransform();
|
|
231
|
+
resultSkeleton.bones[i].matrixWorld.decompose( t.p, t.q, t.s );
|
|
232
|
+
transforms[i] = t;
|
|
233
|
+
|
|
234
|
+
t = this._newTransform();
|
|
235
|
+
resultSkeleton.boneInverses[i].decompose( t.p, t.q, t.s );
|
|
236
|
+
transformsInverses[i] = t;
|
|
237
|
+
}
|
|
238
|
+
resultSkeleton.transformsWorld = transforms;
|
|
239
|
+
resultSkeleton.transformsWorldInverses = transformsInverses;
|
|
240
|
+
|
|
241
|
+
// embedded transform
|
|
242
|
+
if ( embedWorld && bones[0].parent ){
|
|
243
|
+
const embedded: EmbeddedTransforms = { forward: this._newTransform(), inverse: this._newTransform() };
|
|
244
|
+
let t = embedded.forward;
|
|
245
|
+
bones[0].parent.updateWorldMatrix( true, false );
|
|
246
|
+
bones[0].parent.matrixWorld.decompose( t.p, t.q, t.s );
|
|
247
|
+
t = embedded.inverse;
|
|
248
|
+
skeleton.bones[0].parent!.matrixWorld.clone().invert().decompose( t.p, t.q, t.s );
|
|
249
|
+
resultSkeleton.transformsWorldEmbedded = embedded;
|
|
250
|
+
}
|
|
251
|
+
return resultSkeleton;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Maps bones from one skeleton to another given boneMap.
|
|
257
|
+
* Given a null bonemap, an automap is performed
|
|
258
|
+
*/
|
|
259
|
+
computeBoneMap( srcSkeleton: THREE.Skeleton, trgSkeleton: THREE.Skeleton, boneMap: Record<string, string> | null | undefined = null ): BoneMapResult {
|
|
260
|
+
const srcBones = srcSkeleton.bones;
|
|
261
|
+
const result: BoneMapResult = {
|
|
262
|
+
idxMap: new Int16Array( srcBones.length ),
|
|
263
|
+
nameMap: {}
|
|
264
|
+
};
|
|
265
|
+
result.idxMap.fill( -1 ); // default to no map;
|
|
266
|
+
if ( boneMap ) {
|
|
267
|
+
for ( const srcName in boneMap ){
|
|
268
|
+
const idx = findIndexOfBoneByName( srcSkeleton, srcName );
|
|
269
|
+
if ( idx < 0 ){ continue; }
|
|
270
|
+
const trgIdx = findIndexOfBoneByName( trgSkeleton, boneMap[ srcName ] ); // will return either a valid index or -1
|
|
271
|
+
result.idxMap[ idx ] = trgIdx;
|
|
272
|
+
result.nameMap[ srcName ] = boneMap[ srcName ];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
// automap
|
|
277
|
+
const auxBoneMap = Object.keys(AnimationRetargeting.boneMap);
|
|
278
|
+
this.srcBoneMap = computeAutoBoneMap( srcSkeleton );
|
|
279
|
+
this.trgBoneMap = computeAutoBoneMap( trgSkeleton );
|
|
280
|
+
if(this.srcBoneMap.idxMap.length && this.trgBoneMap.idxMap.length) {
|
|
281
|
+
for(let i = 0; i < auxBoneMap.length; i++) {
|
|
282
|
+
const name = auxBoneMap[i];
|
|
283
|
+
if(this.srcBoneMap.idxMap[i] < 0) {
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
result.idxMap[this.srcBoneMap.idxMap[i]] = this.trgBoneMap.idxMap[i];
|
|
287
|
+
result.nameMap[ this.srcBoneMap.nameMap[name]] = this.trgBoneMap.nameMap[name];
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Computes an aproximate ratio of lengths between source skeleton and target skeleton
|
|
297
|
+
*/
|
|
298
|
+
_computeProportionRatio(): number {
|
|
299
|
+
let srcLength = 0;
|
|
300
|
+
// Compute source sum of bone lengths
|
|
301
|
+
for(let i = 1; i < this.srcBindPose.bones.length; i++) {
|
|
302
|
+
const dist = this.srcBindPose.bones[i].getWorldPosition(new THREE.Vector3()).distanceTo(this.srcBindPose.bones[i].parent!.getWorldPosition(new THREE.Vector3()));
|
|
303
|
+
srcLength += dist;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
let trgLength = 0;
|
|
307
|
+
// Compute target sum of bone lengths
|
|
308
|
+
for(let i = 1; i < this.trgBindPose.bones.length; i++) {
|
|
309
|
+
const dist = this.trgBindPose.bones[i].getWorldPosition(new THREE.Vector3()).distanceTo(this.trgBindPose.bones[i].parent!.getWorldPosition(new THREE.Vector3()));
|
|
310
|
+
trgLength += dist;
|
|
311
|
+
}
|
|
312
|
+
return trgLength / srcLength;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
_precomputeRetargetingQuats(): PrecomputedQuats {
|
|
316
|
+
//BASIC ALGORITHM --> trglocal = invBindTrgWorldParent * bindSrcWorldParent * srcLocal * invBindSrcWorld * bindTrgWorld
|
|
317
|
+
// trglocal = invBindTrgWorldParent * invTrgEmbedded * srcEmbedded * bindSrcWorldParent * srcLocal * invBindSrcWorld * invSrcEmbedded * trgEmbedded * bindTrgWorld
|
|
318
|
+
|
|
319
|
+
const left: (THREE.Quaternion | null)[] = new Array( this.srcBindPose.bones.length ); // invBindTrgWorldParent * invTrgEmbedded * srcEmbedded * bindSrcWorldParent
|
|
320
|
+
const right: (THREE.Quaternion | null)[] = new Array( this.srcBindPose.bones.length ); // invBindSrcWorld * invSrcEmbedded * trgEmbedded * bindTrgWorld
|
|
321
|
+
|
|
322
|
+
for( let srcIndex = 0; srcIndex < left.length; ++srcIndex ){
|
|
323
|
+
const trgIndex = this.boneMap.idxMap[ srcIndex ];
|
|
324
|
+
if( trgIndex < 0 ){ // not mapped, cannot precompute
|
|
325
|
+
left[ srcIndex ] = null;
|
|
326
|
+
right[ srcIndex ] = null;
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
let resultQuat = new THREE.Quaternion(0,0,0,1);
|
|
331
|
+
resultQuat.copy( this.trgBindPose.transformsWorld[ trgIndex ].q ); // bindTrgWorld
|
|
332
|
+
if ( this.trgBindPose.transformsWorldEmbedded ) { resultQuat.premultiply( this.trgBindPose.transformsWorldEmbedded.forward.q ); } // trgEmbedded
|
|
333
|
+
if ( this.srcBindPose.transformsWorldEmbedded ) { resultQuat.premultiply( this.srcBindPose.transformsWorldEmbedded.inverse.q ); } // invSrcEmbedded
|
|
334
|
+
resultQuat.premultiply( this.srcBindPose.transformsWorldInverses[ srcIndex ].q ); // invBindSrcWorld
|
|
335
|
+
right[ srcIndex ] = resultQuat;
|
|
336
|
+
|
|
337
|
+
resultQuat = new THREE.Quaternion(0,0,0,1);
|
|
338
|
+
// bindSrcWorldParent
|
|
339
|
+
if ( this.srcBindPose.bones[ srcIndex ].parent ){
|
|
340
|
+
const parentIdx = this.srcBindPose.parentIndices[ srcIndex ];
|
|
341
|
+
resultQuat.premultiply( this.srcBindPose.transformsWorld[ parentIdx ].q );
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if ( this.srcBindPose.transformsWorldEmbedded ) { resultQuat.premultiply( this.srcBindPose.transformsWorldEmbedded.forward.q ); } // srcEmbedded
|
|
345
|
+
if ( this.trgBindPose.transformsWorldEmbedded ) { resultQuat.premultiply( this.trgBindPose.transformsWorldEmbedded.inverse.q ); } // invTrgEmbedded
|
|
346
|
+
|
|
347
|
+
// invBindTrgWorldParent
|
|
348
|
+
if ( this.trgBindPose.bones[ trgIndex ].parent ){
|
|
349
|
+
const parentIdx = this.trgBindPose.parentIndices[ trgIndex ];
|
|
350
|
+
resultQuat.premultiply( this.trgBindPose.transformsWorldInverses[ parentIdx ].q );
|
|
351
|
+
}
|
|
352
|
+
left[ srcIndex ] = resultQuat;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return { left: left, right: right };
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* retargets the bone specified
|
|
360
|
+
* @param srcIndex MUST be a valid MAPPED bone. Otherwise it crashes
|
|
361
|
+
*/
|
|
362
|
+
_retargetQuaternion( srcIndex: number, srcLocalQuat: THREE.Quaternion, resultQuat: THREE.Quaternion | null = null ): THREE.Quaternion {
|
|
363
|
+
resultQuat ??= new THREE.Quaternion(0,0,0,1);
|
|
364
|
+
//BASIC ALGORITHM --> trglocal = invBindTrgWorldParent * bindSrcWorldParent * srcLocal * invBindSrcWorld * bindTrgWorld
|
|
365
|
+
// trglocal = invBindTrgWorldParent * invTrgEmbedded * srcEmbedded * bindSrcWorldParent * srcLocal * invBindSrcWorld * invSrcEmbedded * trgEmbedded * bindTrgWorld
|
|
366
|
+
|
|
367
|
+
// In this order because resultQuat and srcLocalQuat might be the same Quaternion instance
|
|
368
|
+
resultQuat.copy( srcLocalQuat ); // srcLocal
|
|
369
|
+
resultQuat.premultiply( this.precomputedQuats.left[ srcIndex ]! ); // invBindTrgWorldParent * invTrgEmbedded * srcEmbedded * bindSrcWorldParent
|
|
370
|
+
resultQuat.multiply( this.precomputedQuats.right[ srcIndex ]! ); // invBindSrcWorld * invSrcEmbedded * trgEmbedded * bindTrgWorld
|
|
371
|
+
return resultQuat;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Retargets the current whole (mapped) skeleton pose.
|
|
376
|
+
* Currently, only quaternions are retargeted
|
|
377
|
+
*/
|
|
378
|
+
retargetPose(): void {
|
|
379
|
+
|
|
380
|
+
const m = this.boneMap.idxMap;
|
|
381
|
+
for ( let i = 0; i < m.length; ++i ){
|
|
382
|
+
if ( m[i] < 0 ){ continue; }
|
|
383
|
+
this._retargetQuaternion( i, this.srcSkeleton.bones[ i ].quaternion, this.trgSkeleton.bones[ m[i] ].quaternion );
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
*
|
|
389
|
+
* assumes srcTrack IS a position track (VectorKeyframeTrack) with the proper values array and name (boneName.position)
|
|
390
|
+
*/
|
|
391
|
+
retargetPositionTrack( srcTrack: THREE.VectorKeyframeTrack ): THREE.VectorKeyframeTrack | null {
|
|
392
|
+
const boneName = srcTrack.name.slice(0, srcTrack.name.length - 9 ); // remove the ".position"
|
|
393
|
+
const boneIndex = findIndexOfBoneByName( this.srcSkeleton, boneName );
|
|
394
|
+
|
|
395
|
+
if ( boneIndex < 0 || this.boneMap.idxMap[ boneIndex ] < 0 ){
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const trgBoneIndex = this.boneMap.idxMap[ boneIndex ];
|
|
400
|
+
|
|
401
|
+
// Retarget position track
|
|
402
|
+
const srcValues = srcTrack.values;
|
|
403
|
+
const trgValues = new Float32Array( srcValues.length );
|
|
404
|
+
|
|
405
|
+
// Use LOCAL positions - animation track values are in local space
|
|
406
|
+
const srcBindPos = this.srcSkeleton.bones[boneIndex].position.clone();
|
|
407
|
+
const trgBindPos = this.trgSkeleton.bones[trgBoneIndex].position.clone();
|
|
408
|
+
|
|
409
|
+
// For root bone (index 0), use embedded transforms for axis conversion
|
|
410
|
+
// For other bones (hips), use explicit axis flips from profile
|
|
411
|
+
const isRootBone = boneIndex === 0;
|
|
412
|
+
|
|
413
|
+
// Get embedded transforms for root bone axis conversion
|
|
414
|
+
const srcEmbeddedInv = this.srcBindPose.transformsWorldEmbedded?.inverse?.q;
|
|
415
|
+
const trgEmbeddedFwd = this.trgBindPose.transformsWorldEmbedded?.forward?.q;
|
|
416
|
+
|
|
417
|
+
const pos = new THREE.Vector3();
|
|
418
|
+
const diffPosition = new THREE.Vector3();
|
|
419
|
+
|
|
420
|
+
for( let i = 0; i < srcValues.length; i+=3 ){
|
|
421
|
+
|
|
422
|
+
pos.set( srcValues[i], srcValues[i+1], srcValues[i+2]);
|
|
423
|
+
|
|
424
|
+
// Compute difference from source bind position
|
|
425
|
+
diffPosition.subVectors(pos, srcBindPos);
|
|
426
|
+
|
|
427
|
+
if (isRootBone && srcEmbeddedInv && trgEmbeddedFwd) {
|
|
428
|
+
// Apply embedded transforms for coordinate system conversion
|
|
429
|
+
diffPosition.applyQuaternion(srcEmbeddedInv);
|
|
430
|
+
diffPosition.multiplyScalar(this.proportionRatio);
|
|
431
|
+
diffPosition.applyQuaternion(trgEmbeddedFwd);
|
|
432
|
+
// Apply explicit axis flips from target profile (root)
|
|
433
|
+
if (this.positionAxisFlips.x) diffPosition.x = -diffPosition.x;
|
|
434
|
+
if (this.positionAxisFlips.y) diffPosition.y = -diffPosition.y;
|
|
435
|
+
if (this.positionAxisFlips.z) diffPosition.z = -diffPosition.z;
|
|
436
|
+
} else {
|
|
437
|
+
// Scale by proportion ratio
|
|
438
|
+
diffPosition.multiplyScalar(this.proportionRatio);
|
|
439
|
+
// Apply explicit axis flips from target profile (hips)
|
|
440
|
+
if (this.hipsPositionAxisFlips.x) diffPosition.x = -diffPosition.x;
|
|
441
|
+
if (this.hipsPositionAxisFlips.y) diffPosition.y = -diffPosition.y;
|
|
442
|
+
if (this.hipsPositionAxisFlips.z) diffPosition.z = -diffPosition.z;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// Add to target bind position
|
|
446
|
+
diffPosition.add(trgBindPos);
|
|
447
|
+
|
|
448
|
+
trgValues[i] = diffPosition.x ;
|
|
449
|
+
trgValues[i+1] = diffPosition.y ;
|
|
450
|
+
trgValues[i+2] = diffPosition.z ;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// TODO missing interpolation mode. Assuming always linear. Also check if arrays are copied or referenced
|
|
454
|
+
return new THREE.VectorKeyframeTrack( this.boneMap.nameMap[ boneName ] + '.position', srcTrack.times.slice(), trgValues );
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* assumes srcTrack IS a quaternion track with the proper values array and name (boneName.quaternion)
|
|
459
|
+
*/
|
|
460
|
+
retargetQuaternionTrack( srcTrack: THREE.QuaternionKeyframeTrack ): THREE.QuaternionKeyframeTrack | null {
|
|
461
|
+
const boneName = srcTrack.name.slice(0, srcTrack.name.length - 11 ); // remove the ".quaternion"
|
|
462
|
+
const boneIndex = findIndexOfBoneByName( this.srcSkeleton, boneName );
|
|
463
|
+
if ( boneIndex < 0 || this.boneMap.idxMap[ boneIndex ] < 0 ){
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const quat = new THREE.Quaternion( 0,0,0,1 );
|
|
468
|
+
const srcValues = srcTrack.values;
|
|
469
|
+
const trgValues = new Float32Array( srcValues.length );
|
|
470
|
+
for( let i = 0; i < srcValues.length; i+=4 ){
|
|
471
|
+
quat.set( srcValues[i], srcValues[i+1], srcValues[i+2], srcValues[i+3] );
|
|
472
|
+
this._retargetQuaternion( boneIndex, quat, quat );
|
|
473
|
+
trgValues[i] = quat.x;
|
|
474
|
+
trgValues[i+1] = quat.y;
|
|
475
|
+
trgValues[i+2] = quat.z;
|
|
476
|
+
trgValues[i+3] = quat.w;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// TODO missing interpolation mode. Assuming always linear
|
|
480
|
+
return new THREE.QuaternionKeyframeTrack( this.boneMap.nameMap[ boneName ] + '.quaternion', srcTrack.times.slice(), trgValues );
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* assumes srcTrack IS a scale track (VectorKeyframeTrack) with the proper values array and name (boneName.scale)
|
|
485
|
+
*/
|
|
486
|
+
retargetScaleTrack( srcTrack: THREE.VectorKeyframeTrack ): THREE.VectorKeyframeTrack | null {
|
|
487
|
+
const boneName = srcTrack.name.slice(0, srcTrack.name.length - 6 ); // remove the ".scale"
|
|
488
|
+
const boneIndex = findIndexOfBoneByName( this.srcSkeleton, boneName );
|
|
489
|
+
if ( boneIndex < 0 || this.boneMap.idxMap[ boneIndex ] < 0 ){
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
const srcScale = this.srcBindPose.bones[boneIndex].scale;
|
|
493
|
+
const trgScale = this.trgBindPose.bones[ this.boneMap.idxMap[ boneIndex ] ].scale;
|
|
494
|
+
const scaleRatio = trgScale.clone().divide(srcScale);
|
|
495
|
+
|
|
496
|
+
const srcValues = srcTrack.values;
|
|
497
|
+
const trgValues = new Float32Array( srcValues.length );
|
|
498
|
+
for( let i = 0; i < srcValues.length; i+=3 ){
|
|
499
|
+
trgValues[i] = srcValues[i] * scaleRatio.x;
|
|
500
|
+
trgValues[i+1] = srcValues[i+1] * scaleRatio.y;
|
|
501
|
+
trgValues[i+2] = srcValues[i+2] * scaleRatio.z;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
// TODO missing interpolation mode. Assuming always linear. Also check if arrays are copied or referenced
|
|
506
|
+
return new THREE.VectorKeyframeTrack( this.boneMap.nameMap[ boneName ] + '.scale', srcTrack.times.slice(), trgValues );
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Given a clip, all tracks with a mapped bone are retargeted.
|
|
511
|
+
* Currently only quaternions are retargeted
|
|
512
|
+
*/
|
|
513
|
+
retargetAnimation( anim: THREE.AnimationClip ): THREE.AnimationClip {
|
|
514
|
+
const trgTracks: THREE.KeyframeTrack[] = [];
|
|
515
|
+
const srcTracks = anim.tracks;
|
|
516
|
+
|
|
517
|
+
for( let i = 0; i < srcTracks.length; ++i ){
|
|
518
|
+
const t = srcTracks[i];
|
|
519
|
+
let newTrack: THREE.KeyframeTrack | null = null;
|
|
520
|
+
|
|
521
|
+
if ( t.name.endsWith( '.position' ) ) {
|
|
522
|
+
// Only retarget position for root (bones[0]) or hips (bones[1]) bones
|
|
523
|
+
const isRootBone = t.name.includes(this.srcSkeleton.bones[0].name);
|
|
524
|
+
const isHipsBone = this.srcSkeleton.bones[1] && t.name.includes(this.srcSkeleton.bones[1].name);
|
|
525
|
+
if (isRootBone || isHipsBone) {
|
|
526
|
+
newTrack = this.retargetPositionTrack( t as THREE.VectorKeyframeTrack );
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
else if ( t.name.endsWith( '.quaternion' ) ){ newTrack = this.retargetQuaternionTrack( t as THREE.QuaternionKeyframeTrack ); }
|
|
530
|
+
else if ( t.name.endsWith( '.scale' ) ){ newTrack = this.retargetScaleTrack( t as THREE.VectorKeyframeTrack ); }
|
|
531
|
+
|
|
532
|
+
if ( newTrack ){ trgTracks.push( newTrack ); }
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// negative duration: automatically computes proper duration of animation based on tracks
|
|
536
|
+
return new THREE.AnimationClip( anim.name, -1, trgTracks, anim.blendMode );
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// ---- HELPERS ----
|
|
541
|
+
// should be moved into a "utils" file
|
|
542
|
+
|
|
543
|
+
// O(n)
|
|
544
|
+
function findIndexOfBone( skeleton: THREE.Skeleton, bone: THREE.Bone | null ): number {
|
|
545
|
+
if ( !bone ){ return -1;}
|
|
546
|
+
const b = skeleton.bones;
|
|
547
|
+
for( let i = 0; i < b.length; ++i ){
|
|
548
|
+
if ( b[i] == bone ){ return i; }
|
|
549
|
+
}
|
|
550
|
+
return -1;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// O(nm)
|
|
554
|
+
function findIndexOfBoneByName( skeleton: THREE.Skeleton, name: string | null ): number {
|
|
555
|
+
if ( !name ){ return -1; }
|
|
556
|
+
const b = skeleton.bones;
|
|
557
|
+
for( let i = 0; i < b.length; ++i ){
|
|
558
|
+
if ( b[i].name == name ){ return i; }
|
|
559
|
+
}
|
|
560
|
+
return -1;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// sets bind quaternions only. Warning: Not the best function to call every frame.
|
|
564
|
+
function forceBindPoseQuats( skeleton: THREE.Skeleton, skipRoot = false ): void {
|
|
565
|
+
const bones = skeleton.bones;
|
|
566
|
+
const inverses = skeleton.boneInverses;
|
|
567
|
+
if ( inverses.length < 1 ){ return; }
|
|
568
|
+
const boneMat = inverses[0].clone();
|
|
569
|
+
const _ignoreVec3 = new THREE.Vector3();
|
|
570
|
+
for( let i = 0; i < bones.length; ++i ){
|
|
571
|
+
boneMat.copy( inverses[i] ); // World to Local
|
|
572
|
+
boneMat.invert(); // Local to World
|
|
573
|
+
|
|
574
|
+
// get only the local matrix of the bone (root should not need any change)
|
|
575
|
+
const parentIdx = findIndexOfBone( skeleton, bones[i].parent as THREE.Bone );
|
|
576
|
+
if ( parentIdx > -1 ){ boneMat.premultiply( inverses[ parentIdx ] ); }
|
|
577
|
+
else{
|
|
578
|
+
if ( skipRoot ){ continue; }
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
boneMat.decompose( _ignoreVec3, bones[i].quaternion, _ignoreVec3 );
|
|
582
|
+
// bones[i].quaternion.setFromRotationMatrix( boneMat );
|
|
583
|
+
bones[i].quaternion.normalize();
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Apply a T-pose shape facing +Z axis to the passed skeleton.
|
|
589
|
+
*/
|
|
590
|
+
function applyTPose(skeleton: THREE.Skeleton, map?: Record<string, string | null | undefined>): { skeleton: THREE.Skeleton; map: Record<string, string> } {
|
|
591
|
+
let resolvedMap: Record<string, string>;
|
|
592
|
+
if(!map) {
|
|
593
|
+
const autoMap = computeAutoBoneMap(skeleton);
|
|
594
|
+
resolvedMap = autoMap.nameMap;
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
if(Object.values(map).every(value => value === null)) {
|
|
598
|
+
const autoMap = computeAutoBoneMap(skeleton);
|
|
599
|
+
resolvedMap = autoMap.nameMap;
|
|
600
|
+
} else {
|
|
601
|
+
resolvedMap = map as Record<string, string>;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
const resultSkeleton = skeleton;
|
|
606
|
+
|
|
607
|
+
const x_axis = new THREE.Vector3(1, 0, 0);
|
|
608
|
+
const y_axis = new THREE.Vector3(0, 1, 0);
|
|
609
|
+
const z_axis = new THREE.Vector3(0, 0, 1);
|
|
610
|
+
|
|
611
|
+
// Use Hips as spine base (not bones[0] which might be a root bone)
|
|
612
|
+
const hipsName = resolvedMap.Hips ?? resultSkeleton.bones[0].name;
|
|
613
|
+
const hipsBone = resultSkeleton.getBoneByName(hipsName) ?? resultSkeleton.bones[0];
|
|
614
|
+
|
|
615
|
+
// Fully extend the chains
|
|
616
|
+
extendChain( resultSkeleton, hipsName, resolvedMap.ShouldersUnion); // Spine
|
|
617
|
+
extendChain( resultSkeleton, resolvedMap.LUpLeg, resolvedMap.LFoot); // Left Leg
|
|
618
|
+
extendChain( resultSkeleton, resolvedMap.RUpLeg, resolvedMap.RFoot); // Right Leg
|
|
619
|
+
extendChain( resultSkeleton, resolvedMap.LArm, resolvedMap.LWrist); // Left Arm
|
|
620
|
+
extendChain( resultSkeleton, resolvedMap.RArm, resolvedMap.RWrist); // Right Arm
|
|
621
|
+
|
|
622
|
+
const leftHand = resultSkeleton.getBoneByName(resolvedMap.LWrist)!;
|
|
623
|
+
for(let i = 0; i < leftHand.children.length; i++) { // Left Fingers
|
|
624
|
+
extendChain( resultSkeleton, leftHand.children[i] as THREE.Bone);
|
|
625
|
+
extendChain( resultSkeleton, resolvedMap.LWrist, (leftHand.children[i] as THREE.Bone).children[0] as THREE.Bone); // Left Arm
|
|
626
|
+
}
|
|
627
|
+
const rightHand = resultSkeleton.getBoneByName(resolvedMap.RWrist)!;
|
|
628
|
+
for(let i = 0; i < rightHand.children.length; i++) { // Right Fingers
|
|
629
|
+
extendChain( resultSkeleton, rightHand.children[i] as THREE.Bone);
|
|
630
|
+
extendChain( resultSkeleton, resolvedMap.RWrist, (rightHand.children[i] as THREE.Bone).children[0] as THREE.Bone); // Right Arm
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// Forces the pose to face the +Z axis using the left-right arm and spine plane
|
|
634
|
+
const right_arm = resultSkeleton.getBoneByName(resolvedMap.RArm)!;
|
|
635
|
+
const left_arm = resultSkeleton.getBoneByName(resolvedMap.LArm)!;
|
|
636
|
+
|
|
637
|
+
const spine_base = hipsBone;
|
|
638
|
+
const spine_end = resultSkeleton.getBoneByName(resolvedMap.ShouldersUnion)!;
|
|
639
|
+
|
|
640
|
+
const rArmPos = right_arm.getWorldPosition(new THREE.Vector3());
|
|
641
|
+
const lArmPos = left_arm.getWorldPosition(new THREE.Vector3());
|
|
642
|
+
|
|
643
|
+
const basePos = spine_base.getWorldPosition(new THREE.Vector3());
|
|
644
|
+
const endPos = spine_end.getWorldPosition(new THREE.Vector3());
|
|
645
|
+
|
|
646
|
+
const spine_dir = new THREE.Vector3();
|
|
647
|
+
spine_dir.subVectors(endPos, basePos).normalize();
|
|
648
|
+
|
|
649
|
+
const arms_dir = new THREE.Vector3();
|
|
650
|
+
arms_dir.subVectors(lArmPos, rArmPos).normalize();
|
|
651
|
+
// Rotate the skeleton root to face Z+ (if hips has a parent, rotate the parent instead)
|
|
652
|
+
const boneToRotate = hipsBone.parent as THREE.Bone ?? hipsBone;
|
|
653
|
+
lookBoneAtAxis(boneToRotate, arms_dir, spine_dir, z_axis);
|
|
654
|
+
|
|
655
|
+
// Align the 5 chains so that they follow their corresponding axes
|
|
656
|
+
// SPINE
|
|
657
|
+
alignBoneToAxis(resultSkeleton, hipsName, resolvedMap.ShouldersUnion, y_axis);
|
|
658
|
+
|
|
659
|
+
// LEGS
|
|
660
|
+
// check if left leg follows the -Y axis
|
|
661
|
+
const neg_y_axis = y_axis.clone().multiplyScalar(-1);
|
|
662
|
+
alignBoneToAxis(resultSkeleton, resolvedMap.LUpLeg, resolvedMap.LFoot, neg_y_axis);
|
|
663
|
+
// if check right leg follow the -Y axis
|
|
664
|
+
alignBoneToAxis(resultSkeleton, resolvedMap.RUpLeg, resolvedMap.RFoot, neg_y_axis);
|
|
665
|
+
|
|
666
|
+
// ARMS
|
|
667
|
+
// check if left arm follows the X axis
|
|
668
|
+
alignBoneToAxis(resultSkeleton, resolvedMap.LArm, resolvedMap.LWrist, x_axis);
|
|
669
|
+
// if check right arm follow the -X axis
|
|
670
|
+
const neg_x_axis = x_axis.clone().multiplyScalar(-1);
|
|
671
|
+
alignBoneToAxis(resultSkeleton, resolvedMap.RArm, resolvedMap.RWrist, neg_x_axis);
|
|
672
|
+
|
|
673
|
+
for(let i = 0; i < leftHand.children.length; i++) { // Left Fingers
|
|
674
|
+
alignBoneToAxis( resultSkeleton, leftHand.children[i] as THREE.Bone, null, x_axis);
|
|
675
|
+
}
|
|
676
|
+
for(let i = 0; i < rightHand.children.length; i++) { // Right Fingers
|
|
677
|
+
alignBoneToAxis( resultSkeleton, rightHand.children[i] as THREE.Bone, null, neg_x_axis);
|
|
678
|
+
}
|
|
679
|
+
// return new T-pose
|
|
680
|
+
resultSkeleton.update();
|
|
681
|
+
return {skeleton: resultSkeleton, map: resolvedMap};
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Extends all bones in the given chain (origin and end) to follow the direction of the parent bone and updates it to the given pose
|
|
686
|
+
*/
|
|
687
|
+
function extendChain(resultSkeleton: THREE.Skeleton, origin: string | THREE.Bone | undefined, end?: string | THREE.Bone): void {
|
|
688
|
+
if (!origin) return;
|
|
689
|
+
|
|
690
|
+
const base = typeof(origin) == 'string' ? resultSkeleton.getBoneByName(origin) : origin;
|
|
691
|
+
if (!base) return;
|
|
692
|
+
|
|
693
|
+
let previous: THREE.Bone;
|
|
694
|
+
if( !end ) {
|
|
695
|
+
let endBone: THREE.Bone = base;
|
|
696
|
+
while( endBone.children.length ) {
|
|
697
|
+
endBone = endBone.children[0] as THREE.Bone;
|
|
698
|
+
}
|
|
699
|
+
previous = endBone;
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
const resolved = typeof(end) == 'string' ? resultSkeleton.getBoneByName(end) : end;
|
|
703
|
+
if (!resolved) return;
|
|
704
|
+
previous = resolved;
|
|
705
|
+
}
|
|
706
|
+
let current = previous.parent as THREE.Bone;
|
|
707
|
+
if (!current) return;
|
|
708
|
+
let next = current.parent as THREE.Bone;
|
|
709
|
+
|
|
710
|
+
while( next != base.parent ) {
|
|
711
|
+
if (!next) break;
|
|
712
|
+
|
|
713
|
+
// Extend the bone current_id - previous_id to follow the next_id - current_id direction
|
|
714
|
+
const prevPos = previous.getWorldPosition(new THREE.Vector3());
|
|
715
|
+
const currPos = current.getWorldPosition(new THREE.Vector3());
|
|
716
|
+
const nextPos = next.getWorldPosition(new THREE.Vector3());
|
|
717
|
+
|
|
718
|
+
// Direction from the parent joint to the middle joint (desired)
|
|
719
|
+
const desired_dir = new THREE.Vector3();
|
|
720
|
+
desired_dir.subVectors(nextPos, currPos).normalize();
|
|
721
|
+
// Direction from the middle joint to the child joint (current)
|
|
722
|
+
const current_dir = new THREE.Vector3();
|
|
723
|
+
current_dir.subVectors(currPos, prevPos);
|
|
724
|
+
|
|
725
|
+
// Angle to go from the current dir to the desired dir
|
|
726
|
+
const angle = current_dir.angleTo(desired_dir);
|
|
727
|
+
|
|
728
|
+
if (Math.abs(angle) > 0.01) {
|
|
729
|
+
// Axis of rotation (perpendicular): To rotate from the current to the desired direction
|
|
730
|
+
const axis = new THREE.Vector3();
|
|
731
|
+
axis.crossVectors(current_dir, desired_dir).normalize();
|
|
732
|
+
// Rotation from current to the desired direction in quaterion
|
|
733
|
+
const rot = new THREE.Quaternion().setFromAxisAngle(axis, angle);
|
|
734
|
+
// Apply the rotation to the current rotation of the joint in global space
|
|
735
|
+
let currRot = current.getWorldQuaternion(new THREE.Quaternion());
|
|
736
|
+
currRot = rot.multiply(currRot);
|
|
737
|
+
const nextRot = next.getWorldQuaternion(new THREE.Quaternion());
|
|
738
|
+
// Convert the rotation in local space
|
|
739
|
+
const localRot = nextRot.invert().multiply(currRot);
|
|
740
|
+
current.quaternion.copy(localRot);
|
|
741
|
+
current.updateMatrix();
|
|
742
|
+
current.updateMatrixWorld(true);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// Update the ids for the next iteration
|
|
746
|
+
previous = current;
|
|
747
|
+
current = next;
|
|
748
|
+
next = next.parent as THREE.Bone;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Given the vectors that form a plane and the desired direction where to look, rotates the root bone of the given pose to face at the desired axis.
|
|
753
|
+
*/
|
|
754
|
+
function lookBoneAtAxis(bone: THREE.Bone, dir_a: THREE.Vector3, dir_b: THREE.Vector3, axis: THREE.Vector3 ): void {
|
|
755
|
+
|
|
756
|
+
// Face the pose looking at the given axis
|
|
757
|
+
// Normal vector of the plane (perpendicular): Current direction that the character is looking
|
|
758
|
+
const rot_axis = new THREE.Vector3();
|
|
759
|
+
rot_axis.crossVectors(dir_a, dir_b).normalize();
|
|
760
|
+
const angle = rot_axis.angleTo(axis);
|
|
761
|
+
|
|
762
|
+
if (Math.abs(angle) > 0.01) {
|
|
763
|
+
// Axis of rotation (perpendicular): To rotate from the current plane direction to the axis direction
|
|
764
|
+
const new_axis = new THREE.Vector3();
|
|
765
|
+
new_axis.crossVectors(rot_axis, axis).normalize();
|
|
766
|
+
// Rotation from current to the desired direction in quaterion
|
|
767
|
+
const rot = new THREE.Quaternion().setFromAxisAngle(new_axis, angle);
|
|
768
|
+
|
|
769
|
+
// Apply the rotation to the current rotation of the joint in global space
|
|
770
|
+
let global_rot = bone.getWorldQuaternion(new THREE.Quaternion());
|
|
771
|
+
global_rot = rot.multiply(global_rot);
|
|
772
|
+
|
|
773
|
+
// Convert the rotation in local space
|
|
774
|
+
let local_rot = global_rot;
|
|
775
|
+
// Convert the rotation in local space
|
|
776
|
+
if ( bone.parent ) {
|
|
777
|
+
const parent_rot = bone.parent.getWorldQuaternion(new THREE.Quaternion());
|
|
778
|
+
local_rot = parent_rot.invert().multiply(global_rot);
|
|
779
|
+
}
|
|
780
|
+
bone.quaternion.copy(local_rot);
|
|
781
|
+
bone.updateMatrix();
|
|
782
|
+
bone.updateMatrixWorld(true);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Aligns the direction of the origin-end vector to follow the given axis and updates the direction at the given pose
|
|
789
|
+
*/
|
|
790
|
+
function alignBoneToAxis(resultSkeleton: THREE.Skeleton, origin: string | THREE.Bone | undefined, end: string | THREE.Bone | null | undefined, axis: THREE.Vector3 ): void {
|
|
791
|
+
if (!origin) return;
|
|
792
|
+
|
|
793
|
+
// Rotate the direction of the origin-end vector to follow the given axis
|
|
794
|
+
const oBone = typeof(origin) == 'string' ? resultSkeleton.getBoneByName(origin) : origin;
|
|
795
|
+
if (!oBone) return;
|
|
796
|
+
|
|
797
|
+
oBone.updateMatrixWorld(true);
|
|
798
|
+
end ??= oBone.children[0] as THREE.Bone;
|
|
799
|
+
const eBone = typeof(end) == 'string' ? resultSkeleton.getBoneByName(end) : end;
|
|
800
|
+
if (!eBone) return;
|
|
801
|
+
|
|
802
|
+
// Get global positions
|
|
803
|
+
const oPos = oBone.getWorldPosition(new THREE.Vector3());
|
|
804
|
+
const ePos = eBone.getWorldPosition(new THREE.Vector3());
|
|
805
|
+
|
|
806
|
+
// Compute the unitary direction of the bone from its position and its child position
|
|
807
|
+
const dir = new THREE.Vector3();
|
|
808
|
+
dir.subVectors(ePos, oPos).normalize();
|
|
809
|
+
|
|
810
|
+
// Angle between the current direction and the desired direction
|
|
811
|
+
const angle = (dir).angleTo(axis);
|
|
812
|
+
if( Math.abs(angle) > 0.001 ) {
|
|
813
|
+
// Axis of rotation (perpendicular): To rotate from the current to the desired direction
|
|
814
|
+
const new_axis = new THREE.Vector3();
|
|
815
|
+
new_axis.crossVectors(dir, axis).normalize();
|
|
816
|
+
// Rotation from current to the desired direction in quaterion
|
|
817
|
+
const rot = new THREE.Quaternion().setFromAxisAngle(new_axis, angle);
|
|
818
|
+
// Get bone global rotation
|
|
819
|
+
let oRot = oBone.getWorldQuaternion(new THREE.Quaternion());
|
|
820
|
+
// Apply the rotation to the current rotation of the joint in global space
|
|
821
|
+
oRot = rot.multiply(oRot);
|
|
822
|
+
let oLocalRot = oRot;
|
|
823
|
+
// Convert the rotation in local space
|
|
824
|
+
if ( oBone.parent ) {
|
|
825
|
+
const oParentRot = oBone.parent.getWorldQuaternion(new THREE.Quaternion());
|
|
826
|
+
oLocalRot = oParentRot.invert().multiply(oRot);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
oBone.quaternion.copy(oLocalRot);
|
|
830
|
+
oBone.updateMatrix();
|
|
831
|
+
oBone.updateMatrixWorld(true);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Maps automatically bones from the skeleton to an auxiliar map.
|
|
837
|
+
* Given a null bonemap, an automap is performed
|
|
838
|
+
*/
|
|
839
|
+
function computeAutoBoneMap( skeleton: THREE.Skeleton ): BoneMapResult {
|
|
840
|
+
const auxBoneMap = Object.keys(AnimationRetargeting.boneMap);
|
|
841
|
+
const bones = skeleton.bones;
|
|
842
|
+
const result: BoneMapResult = {
|
|
843
|
+
idxMap: new Int16Array( auxBoneMap.length ),
|
|
844
|
+
nameMap: {}
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
result.idxMap.fill( -1 ); // default to no map;
|
|
848
|
+
// automap
|
|
849
|
+
for(let i = 0; i < auxBoneMap.length; i++) {
|
|
850
|
+
const auxName = auxBoneMap[i];
|
|
851
|
+
for( let j = 0; j < bones.length; ++j ){
|
|
852
|
+
let name: string = bones[j].name;
|
|
853
|
+
if ( typeof( name ) !== 'string' ){ continue; }
|
|
854
|
+
name = name.toLowerCase().replace( 'mixamorig', '' ).replace( /[`~!@#$%^&*()_|+\-=?;:'"<>\{\}\\\/]/gi, '' );
|
|
855
|
+
if ( name.length < 1 ){ continue; }
|
|
856
|
+
if(name.toLowerCase().includes(auxName.toLocaleLowerCase()) || name.toLowerCase().includes(AnimationRetargeting.boneMap[auxName].toLocaleLowerCase())) {
|
|
857
|
+
result.nameMap[auxName] = bones[j].name;
|
|
858
|
+
result.idxMap[i] = j;
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return result;
|
|
864
|
+
}
|
|
865
|
+
export { AnimationRetargeting, findIndexOfBone, findIndexOfBoneByName, forceBindPoseQuats, applyTPose, computeAutoBoneMap };
|
|
866
|
+
|