@woosh/meep-engine 2.54.0 → 2.56.0

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.
Files changed (286) hide show
  1. package/editor/view/node-graph/PortView.js +2 -2
  2. package/package.json +1 -1
  3. package/src/core/__module.js +1 -1
  4. package/src/core/binary/BinaryBuffer.js +2 -1
  5. package/src/core/cache/Cache.js +1 -1
  6. package/src/core/cache/LoadingCache.js +10 -5
  7. package/src/core/collection/Stack.js +11 -14
  8. package/src/core/collection/array/array_contains_duplicates.js +5 -2
  9. package/src/core/collection/array/array_contains_duplicates.spec.js +14 -0
  10. package/src/core/collection/array/array_copy_entire.js +6 -11
  11. package/src/core/collection/array/array_get_index_in_range.js +5 -0
  12. package/src/core/collection/array/array_get_index_in_range.spec.js +16 -0
  13. package/src/core/collection/array/array_remove_element.js +6 -9
  14. package/src/core/collection/array/array_remove_first.js +13 -6
  15. package/src/core/collection/array/array_remove_first.spec.js +39 -0
  16. package/src/core/collection/array/binarySearchHighIndex.spec.js +10 -9
  17. package/src/core/collection/array/groupArrayBy.js +1 -1
  18. package/src/core/collection/array/isArrayEqual.js +4 -1
  19. package/src/core/collection/array/randomizeArrayElementOrder.js +1 -0
  20. package/src/core/collection/array/randomizeArrayElementOrder.spec.js +27 -0
  21. package/src/core/collection/heap/Uin32Heap.spec.js +100 -0
  22. package/src/core/collection/heap/Uint32Heap.js +16 -7
  23. package/src/core/collection/list/List.js +1 -0
  24. package/src/core/collection/{HashMap.js → map/HashMap.js} +10 -10
  25. package/src/core/collection/{HashMap.spec.js → map/HashMap.spec.js} +1 -1
  26. package/src/core/collection/{ObservedMap.js → map/ObservedMap.js} +1 -1
  27. package/src/core/collection/{HashSet.js → set/HashSet.js} +4 -3
  28. package/src/core/collection/{Set.d.ts → set/Set.d.ts} +1 -1
  29. package/src/core/collection/{Set.js → set/Set.js} +17 -14
  30. package/src/core/function/FunctionCompiler.js +4 -4
  31. package/src/core/function/Functions.js +0 -19
  32. package/src/core/geom/2d/aabb/AABB2.js +1 -1
  33. package/src/core/geom/3d/SurfacePoint3.js +30 -20
  34. package/src/core/geom/3d/SurfacePoint3.spec.js +116 -0
  35. package/src/core/geom/3d/aabb/AABB3.js +13 -10
  36. package/src/core/geom/3d/aabb/{aabb3_array_contains_point.js → aabb3_array_intersects_point.js} +4 -1
  37. package/src/core/geom/3d/aabb/aabb3_from_min_max.js +25 -1
  38. package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.js +2 -25
  39. package/src/core/geom/3d/aabb/aabb3_signed_distance_sqr_to_point.js +5 -1
  40. package/src/core/geom/3d/apply_mat4_transform_to_direction_v3_array.js +5 -1
  41. package/src/core/geom/3d/apply_mat4_transform_to_v3_array.js +5 -1
  42. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +2 -2
  43. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_calc_edges.js +1 -1
  44. package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.spec.js +26 -0
  45. package/src/core/geom/3d/v3_compute_triangle_normal.spec.js +18 -0
  46. package/src/core/geom/Vector2.js +1 -1
  47. package/src/core/geom/Vector3.js +1 -1
  48. package/src/core/geom/packing/miniball/Miniball.spec.js +24 -0
  49. package/src/core/math/statistics/computeStatisticalPartialMedian.js +2 -2
  50. package/src/core/model/ObservedInteger.js +12 -7
  51. package/src/core/model/ObservedString.js +10 -8
  52. package/src/core/model/node-graph/visual/NodeGraphVisualData.js +1 -1
  53. package/src/core/model/object/ImmutableObjectPool.js +1 -1
  54. package/src/core/model/object/read_property.js +2 -2
  55. package/src/core/model/object/write_property.js +3 -3
  56. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +1 -1
  57. package/src/core/primitives/numbers/compareNumbers.js +4 -4
  58. package/src/core/primitives/numbers/number_compare_ascending.js +9 -0
  59. package/src/core/primitives/numbers/number_compare_ascending.spec.js +9 -0
  60. package/src/core/primitives/numbers/number_compare_descending.js +9 -0
  61. package/src/core/primitives/numbers/number_compare_descending.spec.js +9 -0
  62. package/src/core/primitives/numbers/number_format_by_thousands.spec.js +12 -0
  63. package/src/core/primitives/numbers/number_pretty_print.js +1 -1
  64. package/src/core/primitives/strings/compareStrings.spec.js +12 -0
  65. package/src/core/primitives/strings/string_capitalize.js +15 -0
  66. package/src/core/primitives/strings/string_capitalize.spec.js +13 -0
  67. package/src/core/primitives/strings/string_compute_byte_size.js +21 -0
  68. package/src/core/primitives/strings/string_compute_common_prefix.js +44 -0
  69. package/src/core/primitives/strings/string_compute_common_prefix.spec.js +23 -0
  70. package/src/core/primitives/strings/string_format_camel_to_kebab.js +9 -0
  71. package/src/core/primitives/strings/string_format_camel_to_kebab.spec.js +8 -0
  72. package/src/core/primitives/strings/string_format_kebab_to_underscore.js +8 -0
  73. package/src/core/time/current_time_in_seconds.js +11 -0
  74. package/src/engine/Clock.js +3 -13
  75. package/src/engine/animation/curve/AnimationCurve.spec.js +27 -0
  76. package/src/engine/asset/AssetManager.js +5 -5
  77. package/src/engine/asset/loaders/GLTFAssetLoader.js +1 -1
  78. package/src/engine/ecs/EntityBlueprint.js +8 -10
  79. package/src/engine/ecs/EntityManager.js +8 -1
  80. package/src/engine/ecs/EntityManager.spec.js +56 -6
  81. package/src/engine/ecs/animation/Animation.spec.js +22 -0
  82. package/src/engine/ecs/animation/AnimationSerializationAdapter.js +2 -5
  83. package/src/engine/ecs/attachment/Attachment.js +24 -25
  84. package/src/engine/ecs/attachment/AttachmentBinding.js +27 -30
  85. package/src/engine/ecs/attachment/AttachmentSystem.js +21 -24
  86. package/src/engine/ecs/attachment/BoneAttachmentBinding.js +6 -9
  87. package/src/engine/ecs/attachment/TransformAttachmentBinding.js +0 -3
  88. package/src/engine/ecs/components/CharacterController.js +24 -18
  89. package/src/engine/ecs/components/Motion.js +0 -27
  90. package/src/engine/ecs/components/MotionSerializationAdapter.js +26 -0
  91. package/src/engine/ecs/components/PropertySet.js +0 -29
  92. package/src/engine/ecs/components/PropertySetSerializationAdapter.js +29 -0
  93. package/src/engine/ecs/components/SerializationMetadata.js +0 -28
  94. package/src/engine/ecs/components/SerializationMetadataSerializationAdapter.js +26 -0
  95. package/src/engine/ecs/components/Steering.js +0 -35
  96. package/src/engine/ecs/components/SteeringSerializationAdapter.js +34 -0
  97. package/src/engine/ecs/components/Tag.js +6 -102
  98. package/src/engine/ecs/components/TagSerializationAdapter.js +44 -0
  99. package/src/engine/ecs/components/TagSerializationUpgrader_0_1.js +18 -0
  100. package/src/engine/ecs/components/Timer.js +1 -1
  101. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +4 -3
  102. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleCooldownDescription.js +10 -14
  103. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +31 -39
  104. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.js +1 -1
  105. package/src/engine/ecs/dynamic_actions/{DynamicRuleDescriptionTable.spec.js → rules/DynamicRuleDescriptionTable.spec.js} +12 -12
  106. package/src/engine/ecs/foliage/ecs/InstancedMeshSerializationAdapter.js +2 -5
  107. package/src/engine/ecs/fow/FogOfWarRevealer.js +2 -3
  108. package/src/engine/ecs/fow/serialization/FogOfWarRevealerSerializationAdapter.js +2 -5
  109. package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.js +5 -8
  110. package/src/engine/ecs/gui/GUIElementSerializationAdapter.js +2 -5
  111. package/src/engine/ecs/gui/hud/HeadsUpDisplaySerializationAdapter.js +3 -6
  112. package/src/engine/ecs/gui/position/ViewportPosition.js +2 -5
  113. package/src/engine/ecs/ik/IKConstraint.js +95 -0
  114. package/src/engine/ecs/ik/IKMath.js +6 -1
  115. package/src/engine/ecs/ik/IKProblem.js +17 -17
  116. package/src/engine/ecs/ik/InverseKinematics.js +14 -174
  117. package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.js +72 -0
  118. package/src/engine/ecs/ik/InverseKinematicsSystem.js +24 -26
  119. package/src/engine/ecs/speaker/Voice.js +5 -8
  120. package/src/engine/ecs/speaker/VoiceSystem.js +15 -19
  121. package/src/engine/ecs/speaker/lines/LineDescription.js +20 -25
  122. package/src/engine/ecs/speaker/lines/sets/LineSetDescription.js +15 -19
  123. package/src/engine/ecs/storage/BinaryBufferSerializer.js +3 -3
  124. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +7 -0
  125. package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +1 -1
  126. package/src/engine/ecs/storage/binary/object/ObjectBasedClassSerializationAdapter.js +6 -9
  127. package/src/engine/ecs/systems/TagSystem.js +1 -6
  128. package/src/engine/ecs/team/TeamSerializationAdapter.js +2 -5
  129. package/src/engine/ecs/terrain/ecs/Terrain.spec.js +5 -0
  130. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +23 -21
  131. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.js +2 -5
  132. package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +2 -2
  133. package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +2 -40
  134. package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.js +7 -10
  135. package/src/engine/ecs/tooltip/TooltipComponent.spec.js +47 -0
  136. package/src/engine/ecs/tooltip/TooltipComponentSerializationAdapter.js +2 -5
  137. package/src/engine/ecs/transform/Transform.spec.js +52 -0
  138. package/src/engine/ecs/transform/TransformSerializationAdapter.js +2 -5
  139. package/src/engine/ecs/transform-attachment/TransformAttachment.js +18 -19
  140. package/src/engine/graphics/ecs/animation/AnimationController.js +20 -129
  141. package/src/engine/graphics/ecs/animation/AnimationControllerSerializationAdapter.js +27 -0
  142. package/src/engine/graphics/ecs/animation/AnimationRule.js +79 -0
  143. package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraphSerializationAdapter.js +9 -11
  144. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionSerializationAdapter.js +3 -5
  145. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.js +2 -5
  146. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationAdapter.js +2 -6
  147. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.js +3 -15
  148. package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.js +2 -4
  149. package/src/engine/graphics/ecs/highlight/HighlightSerializationAdapter.js +2 -5
  150. package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +1 -1
  151. package/src/engine/graphics/ecs/light/LightSerializationAdapter.js +2 -5
  152. package/src/engine/graphics/ecs/mesh/serialization/MeshSerializationAdapter.js +2 -5
  153. package/src/engine/graphics/ecs/mesh/skeleton/BoneMapping.js +2 -2
  154. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +3 -0
  155. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.spec.js +14 -0
  156. package/src/engine/graphics/ecs/mesh-v2/render/adapters/InstancedRendererAdapter.js +1 -1
  157. package/src/engine/graphics/ecs/mesh-v2/render/adapters/SGCacheKey.js +21 -9
  158. package/src/engine/graphics/ecs/mesh-v2/render/adapters/SGCacheKey.spec.js +79 -0
  159. package/src/engine/graphics/ecs/water/WaterSerializationAdapter.js +2 -5
  160. package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
  161. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +1 -1
  162. package/src/engine/graphics/material/manager/MaterialManager.js +1 -1
  163. package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +1 -1
  164. package/src/engine/graphics/particles/node-based/codegen/CodeContext.js +1 -1
  165. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +2 -5
  166. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.js +2 -5
  167. package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.js +1 -1
  168. package/src/engine/graphics/render/visibility/IncrementalDeltaSet.spec.js +7 -6
  169. package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.js +1 -1
  170. package/src/engine/graphics/texture/sampler/serialization/Sampler2DSerializationAdapter.js +2 -5
  171. package/src/engine/grid/grid2transform/GridPosition2Transform.js +11 -13
  172. package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.js +3 -5
  173. package/src/engine/grid/obstacle/GridObstacleSerializationAdapter.js +2 -5
  174. package/src/engine/grid/position/GridPositionSerializationAdapter.js +2 -5
  175. package/src/engine/grid/transform2grid/Transform2GridPosition.js +10 -13
  176. package/src/engine/input/devices/KeyboardDevice.js +5 -2
  177. package/src/engine/input/devices/KeyboardDevice.spec.js +12 -0
  178. package/src/engine/input/devices/PointerDevice.js +5 -1
  179. package/src/engine/input/ecs/components/Input.js +37 -11
  180. package/src/engine/input/ecs/ism/InputBinding.js +30 -12
  181. package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js +7 -10
  182. package/src/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.js +2 -5
  183. package/src/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.js +2 -6
  184. package/src/engine/intelligence/behavior/primitive/SucceedingBehaviorSerializationAdapter.js +2 -5
  185. package/src/engine/intelligence/blackboard/BlackboardSerializationAdapter.js +2 -5
  186. package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +12 -13
  187. package/src/engine/knowledge/database/StaticKnowledgeDatabase.spec.js +23 -0
  188. package/src/engine/navigation/ecs/components/PathSerializationAdapter.js +2 -5
  189. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.js +2 -5
  190. package/src/engine/navigation/grid/find_path_on_grid_astar.spec.js +25 -0
  191. package/src/engine/options/OptionAbstract.js +6 -5
  192. package/src/engine/options/OptionGroup.js +13 -25
  193. package/src/engine/options/OptionGroup.spec.js +61 -0
  194. package/src/engine/save/storage/InMemoryStorage.js +3 -2
  195. package/src/engine/simulation/Ticker.js +17 -20
  196. package/src/engine/sound/ecs/SoundController.js +2 -6
  197. package/src/engine/sound/ecs/SoundListener.js +3 -21
  198. package/src/engine/sound/ecs/emitter/SoundEmitterSerializationAdapter.js +2 -6
  199. package/src/generation/GridTaskGroup.js +5 -9
  200. package/src/generation/filtering/numeric/CellFilterCache.js +12 -16
  201. package/src/generation/filtering/numeric/complex/CellFilterFXAA.js +31 -32
  202. package/src/generation/filtering/numeric/complex/CellFilterLookupTable.js +6 -9
  203. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +7 -10
  204. package/src/generation/filtering/numeric/complex/CellFilterSobel.js +6 -9
  205. package/src/generation/filtering/numeric/math/CellFilterMembershipGeneralizedBell.js +18 -21
  206. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +24 -25
  207. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js +1 -1
  208. package/src/generation/grid/GridData.js +23 -22
  209. package/src/generation/grid/GridData.spec.js +41 -0
  210. package/src/generation/grid/GridTaskGenerator.js +7 -8
  211. package/src/generation/grid/layers/GridDataLayer.js +23 -25
  212. package/src/generation/markers/GridActionRuleSet.js +20 -22
  213. package/src/generation/markers/GridCellActionPlaceMarker.js +40 -43
  214. package/src/generation/markers/GridCellActionPlaceMarkerGroup.js +7 -9
  215. package/src/generation/markers/MarkerNode.js +44 -44
  216. package/src/generation/markers/actions/MarkerNodeActionEntityPlacement.js +15 -18
  217. package/src/generation/markers/actions/MarkerNodeActionSequence.js +6 -9
  218. package/src/generation/markers/actions/MarkerNodeProcessingRuleSet.js +5 -7
  219. package/src/generation/markers/actions/MarkerProcessingRule.js +25 -26
  220. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.js +12 -15
  221. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.js +2 -5
  222. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.js +6 -9
  223. package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.js +8 -11
  224. package/src/generation/markers/actions/probability/MarkerNodeActionWeightedElement.js +13 -13
  225. package/src/generation/markers/actions/util/GridCellActionDebugBreak.js +5 -8
  226. package/src/generation/markers/actions/util/GridCellActionLogToConsole.js +1 -4
  227. package/src/generation/markers/emitter/MarkerNodeConsumerBuffer.js +10 -13
  228. package/src/generation/markers/emitter/MarkerNodeEmitterFromAction.js +5 -9
  229. package/src/generation/markers/emitter/MarkerNodeEmitterGridCellAction.js +12 -15
  230. package/src/generation/markers/emitter/MarkerNodeEmitterGroup.js +5 -8
  231. package/src/generation/markers/emitter/MarkerNodeEmitterPredicated.js +18 -21
  232. package/src/generation/markers/matcher/MarkerNodeMatcher.js +2 -1
  233. package/src/generation/markers/matcher/MarkerNodeMatcherBinary.js +12 -13
  234. package/src/generation/markers/matcher/MarkerNodeMatcherContainsTag.js +7 -9
  235. package/src/generation/markers/matcher/MarkerNodeMatcherNot.js +7 -9
  236. package/src/generation/markers/predicate/GridDataNodePredicateBinary.js +10 -14
  237. package/src/generation/markers/predicate/GridDataNodePredicateNot.js +9 -11
  238. package/src/generation/markers/predicate/GridDataNodePredicateOverlaps.js +6 -9
  239. package/src/generation/markers/transform/MarkerNodeTransformRotateRandom.js +2 -6
  240. package/src/generation/markers/transform/MarkerNodeTransformerAddPositionYFromFilter.js +6 -9
  241. package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.js +1 -4
  242. package/src/generation/markers/transform/MarkerNodeTransformerRecordProperty.js +12 -15
  243. package/src/generation/markers/transform/MarkerNodeTransformerRecordPropertyClosure.js +14 -17
  244. package/src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.js +21 -23
  245. package/src/generation/markers/transform/MarkerNodeTransformerRemoveTag.js +1 -4
  246. package/src/generation/markers/transform/MarkerNodeTransformerSequence.js +6 -9
  247. package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.js +13 -17
  248. package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.js +12 -16
  249. package/src/generation/placement/GridCellActionTransformNearbyMarkers.js +26 -29
  250. package/src/generation/placement/GridCellPlacementRule.js +30 -32
  251. package/src/generation/placement/action/GridCellActionPlaceTags.js +26 -28
  252. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +16 -20
  253. package/src/generation/placement/action/random/weighted/CellActionSelectWeightedRandom.js +13 -16
  254. package/src/generation/placement/action/random/weighted/WeightedGridCellAction.js +11 -14
  255. package/src/generation/placement/action/util/CellMatcherWithinAABB.js +2 -6
  256. package/src/generation/placement/action/util/GridCellActionSequence.js +7 -9
  257. package/src/generation/placement/action/util/GridCellDisplacedAction.js +9 -12
  258. package/src/generation/rules/CellMatcherFromFilter.js +6 -9
  259. package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -9
  260. package/src/generation/rules/GridLayerCellMatcher.js +11 -14
  261. package/src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js +11 -14
  262. package/src/generation/rules/cell/CellMatcherGridPattern.js +6 -8
  263. package/src/generation/rules/cell/GridPatternMatcherCell.js +11 -12
  264. package/src/generation/rules/logic/CellMatcherBinary.js +10 -14
  265. package/src/generation/rules/logic/CellMatcherDecorator.js +5 -8
  266. package/src/generation/theme/AreaMask.js +15 -17
  267. package/src/generation/theme/AreaTheme.js +7 -8
  268. package/src/generation/theme/TerrainLayerDescription.js +10 -12
  269. package/src/generation/theme/TerrainLayerRule.js +11 -13
  270. package/src/generation/theme/TerrainTheme.js +6 -7
  271. package/src/generation/theme/Theme.js +15 -17
  272. package/src/generation/theme/ThemeEngine.js +17 -19
  273. package/src/view/string_tag_to_css_class_name.js +2 -2
  274. package/src/view/tooltip/gml/TooltipParser.js +2 -2
  275. package/src/core/cache/PersistentCacheAdapter.js +0 -378
  276. package/src/core/collection/LazyStream.js +0 -23
  277. package/src/core/collection/LazyStream.spec.js +0 -13
  278. package/src/core/collection/heap/BinaryHeap.js +0 -153
  279. package/src/core/primitives/strings/StringUtils.js +0 -105
  280. package/src/core/primitives/strings/StringUtils.spec.js +0 -42
  281. package/src/engine/ecs/components/GeometryBVH.js +0 -44
  282. package/src/engine/ecs/components/MonsterAI.js +0 -15
  283. package/src/engine/ecs/systems/GeometryBVHSystem.js +0 -36
  284. package/src/generation/markers/MarkerRelation.js +0 -13
  285. /package/src/core/collection/{HashMap.d.ts → map/HashMap.d.ts} +0 -0
  286. /package/src/core/collection/{HashSet.d.ts → set/HashSet.d.ts} +0 -0
@@ -2,12 +2,9 @@ import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/
2
2
  import { Camera } from "../Camera.js";
3
3
 
4
4
  export class CameraSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.klass = Camera;
9
- this.version = 0;
10
- }
6
+ klass = Camera;
7
+ version = 0;
11
8
 
12
9
  /**
13
10
  *
@@ -3,12 +3,8 @@ import TopDownCameraController from "./TopDownCameraController.js";
3
3
 
4
4
  export class TopDownCameraControllerSerializationAdapter extends BinaryClassSerializationAdapter {
5
5
 
6
- constructor() {
7
- super();
8
-
9
- this.klass = TopDownCameraController;
10
- this.version = 1;
11
- }
6
+ klass = TopDownCameraController;
7
+ version = 1;
12
8
 
13
9
  /**
14
10
  *
@@ -1,26 +1,14 @@
1
1
  import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
2
2
 
3
3
  export class TopDownCameraLander {
4
- constructor() {
5
-
6
- }
7
4
  }
8
5
 
9
6
  TopDownCameraLander.typeName = 'TopDownCameraLander';
10
7
 
11
8
  export class TopDownCameraLanderSerializationAdapter extends BinaryClassSerializationAdapter {
12
- constructor() {
13
- super();
14
-
15
- this.klass = TopDownCameraLander;
16
- this.version = 0;
17
- }
18
-
19
- serialize(buffer, value) {
20
-
21
- }
22
9
 
23
- deserialize(buffer, value) {
10
+ klass = TopDownCameraLander;
11
+ version = 0;
24
12
 
25
- }
13
+ // NO-OP
26
14
  }
@@ -2,11 +2,9 @@ import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/
2
2
  import { Decal } from "./Decal.js";
3
3
 
4
4
  export class DecalSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.klass = Decal;
9
- }
6
+ klass = Decal;
7
+ version = 0;
10
8
 
11
9
  /**
12
10
  *
@@ -6,12 +6,9 @@ import {
6
6
  } from "../../../ecs/storage/COMPONENT_SERIALIZATION_TRANSIENT_FIELD.js";
7
7
 
8
8
  export class HighlightSerializationAdapter extends BinaryClassSerializationAdapter {
9
- constructor() {
10
- super();
11
9
 
12
- this.klass = Highlight;
13
- this.version = 1;
14
- }
10
+ klass = Highlight;
11
+ version = 1;
15
12
 
16
13
  /**
17
14
  *
@@ -22,7 +22,7 @@ import { makeHighlightDecodeShader } from "./HighlightDecodeShader.js";
22
22
  import { makeDilationShader } from "./makeDilationShader.js";
23
23
  import { ScreenSpaceQuadShader } from "../../../shaders/ScreenSpaceQuadShader.js";
24
24
  import { makeGaussianBlurShader } from "./makeGaussianBlurShader.js";
25
- import { HashMap } from "../../../../../core/collection/HashMap.js";
25
+ import { HashMap } from "../../../../../core/collection/map/HashMap.js";
26
26
  import { invokeObjectEquals } from "../../../../../core/model/object/invokeObjectEquals.js";
27
27
  import { invokeObjectHash } from "../../../../../core/model/object/invokeObjectHash.js";
28
28
  import { assert } from "../../../../../core/assert.js";
@@ -3,12 +3,9 @@ import { LightType } from "./LightType.js";
3
3
  import { Light } from "./Light.js";
4
4
 
5
5
  export class LightSerializationAdapter extends BinaryClassSerializationAdapter {
6
- constructor() {
7
- super();
8
6
 
9
- this.klass = Light;
10
- this.version = 0;
11
- }
7
+ klass = Light;
8
+ version = 0;
12
9
 
13
10
  /**
14
11
  *
@@ -2,12 +2,9 @@ import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/
2
2
  import Mesh from "../Mesh.js";
3
3
 
4
4
  export class MeshSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.klass = Mesh;
9
- this.version = 0;
10
- }
6
+ klass = Mesh;
7
+ version = 0;
11
8
 
12
9
 
13
10
  /**
@@ -1,7 +1,7 @@
1
- import { computeCommonPrefix } from "../../../../../core/primitives/strings/StringUtils.js";
2
1
  import { HumanoidBoneType } from "./HumanoidBoneType.js";
3
2
  import { distance as levenshtein_distance } from "fastest-levenshtein";
4
3
  import { assert } from "../../../../../core/assert.js";
4
+ import { string_compute_common_prefix } from "../../../../../core/primitives/strings/string_compute_common_prefix.js";
5
5
 
6
6
 
7
7
  /**
@@ -25,7 +25,7 @@ export class BoneMapping {
25
25
  */
26
26
  build(names) {
27
27
  //strip common prefix
28
- const commonPrefix = computeCommonPrefix(names);
28
+ const commonPrefix = string_compute_common_prefix(names);
29
29
  const commonPrefixLength = commonPrefix.length;
30
30
 
31
31
  const conditionedNames = names.map(function (name) {
@@ -37,6 +37,9 @@ const scratch_m4 = new Float32Array(16);
37
37
  */
38
38
  const scratch_ray_0 = new Float32Array(6);
39
39
 
40
+ /**
41
+ * Represents a primitive 3d object, a combination of a material and geometry
42
+ */
40
43
  export class ShadedGeometry {
41
44
  constructor() {
42
45
  /**
@@ -1,5 +1,19 @@
1
1
  import { ShadedGeometry } from "./ShadedGeometry.js";
2
+ import { BufferGeometry, MeshBasicMaterial } from "three";
2
3
 
3
4
  test("constructor does not throw", () => {
4
5
  expect(() => new ShadedGeometry()).not.toThrow()
5
6
  });
7
+
8
+ test("hash", () => {
9
+ const mesh = new ShadedGeometry();
10
+
11
+ mesh.geometry = new BufferGeometry();
12
+ mesh.material = new MeshBasicMaterial();
13
+
14
+ const hash = mesh.hash();
15
+
16
+ expect(typeof hash).toBe("number")
17
+ expect(Number.isInteger(hash)).toBe(true);
18
+ expect(mesh.hash()).toEqual(hash);
19
+ });
@@ -1,5 +1,5 @@
1
1
  import { AbstractRenderAdapter } from "./AbstractRenderAdapter.js";
2
- import { HashMap } from "../../../../../../core/collection/HashMap.js";
2
+ import { HashMap } from "../../../../../../core/collection/map/HashMap.js";
3
3
  import { InstancedMeshGroup } from "../../../../geometry/instancing/InstancedMeshGroup.js";
4
4
  import { ShadedGeometryFlags } from "../../ShadedGeometryFlags.js";
5
5
  import { StreamDrawUsage } from "three";
@@ -1,7 +1,15 @@
1
1
  import { DrawMode } from "../../DrawMode.js";
2
2
 
3
3
  export class SGCacheKey {
4
+ /**
5
+ * ID of geometry
6
+ * @type {number}
7
+ */
4
8
  geometry = -1;
9
+ /**
10
+ * ID of material
11
+ * @type {number}
12
+ */
5
13
  material = -1;
6
14
  /**
7
15
  *
@@ -9,9 +17,13 @@ export class SGCacheKey {
9
17
  */
10
18
  mode = DrawMode.Triangles;
11
19
 
20
+ /**
21
+ *
22
+ * @type {number}
23
+ */
12
24
  flags = 0;
13
25
 
14
- hash(){
26
+ hash() {
15
27
  return this.geometry ^ this.material;
16
28
  }
17
29
 
@@ -20,29 +32,29 @@ export class SGCacheKey {
20
32
  * @param {SGCacheKey} other
21
33
  * @returns {boolean}
22
34
  */
23
- equals(other){
35
+ equals(other) {
24
36
  return this.geometry === other.geometry
25
- && this.material === other.material
26
- && this.mode === other.mode
27
- && this.flags === other.flags;
37
+ && this.material === other.material
38
+ && this.mode === other.mode
39
+ && this.flags === other.flags;
28
40
  }
29
41
 
30
42
  /**
31
43
  *
32
44
  * @param {SGCacheKey} other
33
45
  */
34
- copy(other){
46
+ copy(other) {
35
47
  this.geometry = other.geometry;
36
48
  this.material = other.material;
37
49
  this.mode = other.mode;
38
50
  this.flags = other.flags;
39
51
  }
40
52
 
41
- clone(){
53
+ clone() {
42
54
  const r = new SGCacheKey();
43
55
 
44
56
  r.copy(this);
45
-
57
+
46
58
  return r;
47
59
  }
48
60
 
@@ -50,7 +62,7 @@ export class SGCacheKey {
50
62
  *
51
63
  * @param {ShadedGeometry} sg
52
64
  */
53
- fromSG(sg){
65
+ fromSG(sg) {
54
66
  this.geometry = sg.geometry.id;
55
67
  this.material = sg.material.id;
56
68
  this.mode = sg.mode;
@@ -0,0 +1,79 @@
1
+ import { SGCacheKey } from "./SGCacheKey.js";
2
+ import { DrawMode } from "../../DrawMode.js";
3
+
4
+ test("constructor does not throw", () => {
5
+ new SGCacheKey()
6
+ });
7
+
8
+ test("equals", () => {
9
+ const a = new SGCacheKey();
10
+
11
+ a.geometry = 3;
12
+ a.material = 7;
13
+ a.mode = DrawMode.Triangles;
14
+ a.flags = 0xBEEF;
15
+
16
+ const b = new SGCacheKey();
17
+
18
+ b.geometry = 3;
19
+ b.material = 7;
20
+ b.mode = DrawMode.Triangles;
21
+ b.flags = 0xBEEF;
22
+
23
+ expect(a.equals(b)).toBe(true);
24
+
25
+ const c = new SGCacheKey();
26
+
27
+ c.geometry = 5;
28
+ c.material = 7;
29
+ c.mode = DrawMode.Triangles;
30
+ c.flags = 0xBEEF;
31
+
32
+ expect(a.equals(c)).toBe(false);
33
+
34
+ const d = new SGCacheKey();
35
+
36
+ d.geometry = 3;
37
+ d.material = 11;
38
+ d.mode = DrawMode.Triangles;
39
+ d.flags = 0xBEEF;
40
+
41
+ expect(a.equals(d)).toBe(false);
42
+
43
+ const e = new SGCacheKey();
44
+
45
+ e.geometry = 3;
46
+ e.material = 7;
47
+ e.mode = DrawMode.Points;
48
+ e.flags = 0xBEEF;
49
+
50
+ expect(a.equals(e)).toBe(false);
51
+
52
+ const f = new SGCacheKey();
53
+
54
+ f.geometry = 3;
55
+ f.material = 7;
56
+ f.mode = DrawMode.Triangles;
57
+ f.flags = 0xCAFE;
58
+
59
+ expect(a.equals(f)).toBe(false);
60
+
61
+ });
62
+
63
+ test("copy", () => {
64
+ const a = new SGCacheKey();
65
+
66
+ a.geometry = 3;
67
+ a.material = 7;
68
+ a.mode = DrawMode.Triangles;
69
+ a.flags = 0xBEEF;
70
+
71
+ const b = new SGCacheKey();
72
+
73
+ b.copy(a);
74
+
75
+ expect(b.geometry).toEqual(3);
76
+ expect(b.material).toEqual(7);
77
+ expect(b.mode).toEqual(DrawMode.Triangles);
78
+ expect(b.flags).toEqual(0xBEEF);
79
+ });
@@ -2,12 +2,9 @@ import { BinaryClassSerializationAdapter } from "../../../ecs/storage/binary/Bin
2
2
  import Water from "./Water.js";
3
3
 
4
4
  export class WaterSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.klass = Water;
9
- this.version = 1;
10
- }
6
+ klass = Water;
7
+ version = 1;
11
8
 
12
9
  /**
13
10
  *
@@ -1,5 +1,5 @@
1
1
  import { StaticMaterialCache } from "../../../../asset/loaders/material/StaticMaterialCache.js";
2
- import { HashMap } from "../../../../../core/collection/HashMap.js";
2
+ import { HashMap } from "../../../../../core/collection/map/HashMap.js";
3
3
  import { computeGeometryEquality } from "../../buffered/computeGeometryEquality.js";
4
4
  import { computeGeometryHash } from "../../buffered/computeGeometryHash.js";
5
5
  import { array_copy } from "../../../../../core/collection/array/array_copy.js";
@@ -7,7 +7,7 @@ import { mat4, vec3 } from "gl-matrix";
7
7
  import { BakeShaderStandard } from "./shader/BakeShaderStandard.js";
8
8
  import { Sampler2D } from "../../texture/sampler/Sampler2D.js";
9
9
  import Signal from "../../../../core/events/signal/Signal.js";
10
- import { HashMap } from "../../../../core/collection/HashMap.js";
10
+ import { HashMap } from "../../../../core/collection/map/HashMap.js";
11
11
  import { computeMaterialHash } from "../../../asset/loaders/material/computeMaterialHash.js";
12
12
  import { computeMaterialEquality } from "../../../asset/loaders/material/computeMaterialEquality.js";
13
13
  import { UvEncoder } from "./grid/UvEncoder.js";
@@ -1,4 +1,4 @@
1
- import { HashMap } from "../../../../core/collection/HashMap.js";
1
+ import { HashMap } from "../../../../core/collection/map/HashMap.js";
2
2
  import { ManagedMaterial } from "./ManagedMaterial.js";
3
3
  import { Cache } from "../../../../core/cache/Cache.js";
4
4
  import { computeMaterialHash } from "../../../asset/loaders/material/computeMaterialHash.js";
@@ -1,6 +1,6 @@
1
1
  import { traverseThreeObject } from "../../ecs/highlight/renderer/traverseThreeObject.js";
2
2
  import { TextureAttachmentsByMaterialType } from "../../../asset/loaders/material/TextureAttachmensByMaterialType.js";
3
- import { HashMap } from "../../../../core/collection/HashMap.js";
3
+ import { HashMap } from "../../../../core/collection/map/HashMap.js";
4
4
  import AABB2 from "../../../../core/geom/AABB2.js";
5
5
  import { MaxRectanglesPacker } from "../../../../core/geom/packing/max-rect/MaxRectangles.js";
6
6
  import { Sampler2D } from "../../texture/sampler/Sampler2D.js";
@@ -1,4 +1,4 @@
1
- import { HashMap } from "../../../../../core/collection/HashMap.js";
1
+ import { HashMap } from "../../../../../core/collection/map/HashMap.js";
2
2
  import { NodeInstancePortReference } from "../../../../../core/model/node-graph/node/NodeInstancePortReference.js";
3
3
 
4
4
  export class CodeContext {
@@ -4,12 +4,9 @@ import {
4
4
  import { ParameterLookupTable } from "../../parameter/ParameterLookupTable.js";
5
5
 
6
6
  export class ParameterLookupTableSerializationAdapter extends BinaryClassSerializationAdapter {
7
- constructor() {
8
- super();
9
7
 
10
- this.klass = ParameterLookupTable;
11
- this.version = 0;
12
- }
8
+ klass = ParameterLookupTable;
9
+ version = 0;
13
10
 
14
11
  /**
15
12
  *
@@ -7,12 +7,9 @@ import { ParticleEmitterFlag } from "../ParticleEmitterFlag.js";
7
7
  import { SimulationStepDefinition } from "../../simulator/SimulationStepDefinition.js";
8
8
 
9
9
  export class ParticleEmitterSerializationAdapter extends BinaryClassSerializationAdapter {
10
- constructor() {
11
- super();
12
10
 
13
- this.klass = ParticleEmitter;
14
- this.version = 1;
15
- }
11
+ klass = ParticleEmitter;
12
+ version = 1;
16
13
 
17
14
  /**
18
15
  *
@@ -10,7 +10,7 @@ import {
10
10
  Vector2 as ThreeVector2
11
11
  } from "three";
12
12
  import Vector2 from "../../../../../../core/geom/Vector2.js";
13
- import { HashMap } from "../../../../../../core/collection/HashMap.js";
13
+ import { HashMap } from "../../../../../../core/collection/map/HashMap.js";
14
14
  import { ParticleEmitterFlag } from "../emitter/ParticleEmitterFlag.js";
15
15
  import { writeSample2DDataToDataTexture } from "../../../../texture/sampler/writeSampler2DDataToDataTexture.js";
16
16
  import { MaterialRecord } from "./MaterialRecord.js";
@@ -1,8 +1,9 @@
1
1
  import { IncrementalDeltaSet } from "./IncrementalDeltaSet.js";
2
- import { compareNumbersAscending } from "../../../../core/function/Functions.js";
2
+
3
+ import { number_compare_ascending } from "../../../../core/primitives/numbers/number_compare_ascending.js";
3
4
 
4
5
  test('set is sorted after insert, push 1,2', () => {
5
- const set = new IncrementalDeltaSet(compareNumbersAscending);
6
+ const set = new IncrementalDeltaSet(number_compare_ascending);
6
7
 
7
8
  set.initializeUpdate();
8
9
 
@@ -16,7 +17,7 @@ test('set is sorted after insert, push 1,2', () => {
16
17
  });
17
18
 
18
19
  test('set is sorted after insert, push 2,1', () => {
19
- const set = new IncrementalDeltaSet(compareNumbersAscending);
20
+ const set = new IncrementalDeltaSet(number_compare_ascending);
20
21
 
21
22
  set.initializeUpdate();
22
23
 
@@ -30,7 +31,7 @@ test('set is sorted after insert, push 2,1', () => {
30
31
  });
31
32
 
32
33
  test('set is sorted after insert, push 1,2,3', () => {
33
- const set = new IncrementalDeltaSet(compareNumbersAscending);
34
+ const set = new IncrementalDeltaSet(number_compare_ascending);
34
35
 
35
36
  set.initializeUpdate();
36
37
 
@@ -46,7 +47,7 @@ test('set is sorted after insert, push 1,2,3', () => {
46
47
  });
47
48
 
48
49
  test('set is sorted after insert, push 3,2,1', () => {
49
- const set = new IncrementalDeltaSet(compareNumbersAscending);
50
+ const set = new IncrementalDeltaSet(number_compare_ascending);
50
51
 
51
52
  set.initializeUpdate();
52
53
 
@@ -63,7 +64,7 @@ test('set is sorted after insert, push 3,2,1', () => {
63
64
 
64
65
 
65
66
  test('add/remove callbacks', () => {
66
- const set = new IncrementalDeltaSet(compareNumbersAscending);
67
+ const set = new IncrementalDeltaSet(number_compare_ascending);
67
68
 
68
69
  const add_listener = jest.fn();
69
70
  const remove_listener = jest.fn();
@@ -2,7 +2,7 @@ import { TextureAtlas } from "./TextureAtlas.js";
2
2
  import { ReferenceManager } from "../../../reference/v1/ReferenceManager.js";
3
3
  import { Sampler2D } from "../sampler/Sampler2D.js";
4
4
  import { GameAssetType } from "../../../asset/GameAssetType.js";
5
- import { HashMap } from "../../../../core/collection/HashMap.js";
5
+ import { HashMap } from "../../../../core/collection/map/HashMap.js";
6
6
  import { strictEquals } from "../../../../core/function/Functions.js";
7
7
  import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
8
8
  import { copy_Sampler2D_channel_data } from "../sampler/copy_Sampler2D_channel_data.js";
@@ -2,12 +2,9 @@ import { BinaryClassSerializationAdapter } from "../../../../ecs/storage/binary/
2
2
  import { Sampler2D } from "../Sampler2D.js";
3
3
 
4
4
  export class Sampler2DSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.version = 0;
9
- this.klass = Sampler2D;
10
- }
6
+ version = 0;
7
+ klass = Sampler2D;
11
8
 
12
9
  /**
13
10
  *
@@ -9,19 +9,17 @@ import { GridPosition2TransformFlags } from "./GridPosition2TransformFlags.js";
9
9
  const DEFAULT_FLAGS = GridPosition2TransformFlags.Immediate;
10
10
 
11
11
  export class GridPosition2Transform {
12
- constructor() {
13
- /**
14
- *
15
- * @type {Vector2}
16
- */
17
- this.offset = new Vector2(0, 0);
18
-
19
- /**
20
- *
21
- * @type {GridPosition2TransformFlags|number}
22
- */
23
- this.flags = DEFAULT_FLAGS;
24
- }
12
+ /**
13
+ *
14
+ * @type {Vector2}
15
+ */
16
+ offset = new Vector2(0, 0);
17
+
18
+ /**
19
+ *
20
+ * @type {GridPosition2TransformFlags|number}
21
+ */
22
+ flags = DEFAULT_FLAGS;
25
23
 
26
24
  /**
27
25
  *
@@ -2,12 +2,10 @@ import { BinaryClassSerializationAdapter } from "../../ecs/storage/binary/Binary
2
2
  import { GridPosition2Transform } from "./GridPosition2Transform.js";
3
3
 
4
4
  export class GridPosition2TransformSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.klass = GridPosition2Transform;
9
- this.version = 1;
10
- }
6
+ klass = GridPosition2Transform;
7
+ version = 1;
8
+
11
9
 
12
10
  /**
13
11
  *
@@ -2,12 +2,9 @@ import { BinaryClassSerializationAdapter } from "../../ecs/storage/binary/Binary
2
2
  import GridObstacle from "./GridObstacle.js";
3
3
 
4
4
  export class GridObstacleSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.klass = GridObstacle;
9
- this.version = 0;
10
- }
6
+ klass = GridObstacle;
7
+ version = 0;
11
8
 
12
9
  /**
13
10
  *
@@ -2,12 +2,9 @@ import { BinaryClassSerializationAdapter } from "../../ecs/storage/binary/Binary
2
2
  import GridPosition from "./GridPosition.js";
3
3
 
4
4
  export class GridPositionSerializationAdapter extends BinaryClassSerializationAdapter {
5
- constructor() {
6
- super();
7
5
 
8
- this.klass = GridPosition;
9
- this.version = 1;
10
- }
6
+ klass = GridPosition;
7
+ version = 1;
11
8
 
12
9
  /**
13
10
  *
@@ -1,19 +1,16 @@
1
1
  import { Transform2GridPositionMode } from "./Transform2GridPositionMode.js";
2
2
 
3
3
  export class Transform2GridPosition {
4
- constructor() {
5
- /**
6
- *
7
- * @type {Transform2GridPositionFlags|number}
8
- */
9
- this.flags = 0;
10
-
11
- /**
12
- *
13
- * @type {number}
14
- */
15
- this.mode = Transform2GridPositionMode.Continuous;
16
- }
4
+ /**
5
+ *
6
+ * @type {Transform2GridPositionFlags|number}
7
+ */
8
+ flags = 0;
9
+ /**
10
+ *
11
+ * @type {number}
12
+ */
13
+ mode= Transform2GridPositionMode.Continuous;
17
14
 
18
15
  /**
19
16
  *
@@ -73,8 +73,11 @@ class KeyboardDevice {
73
73
  /*
74
74
  Only element in focus receives keyboard events, so the element supplied here must be focusable in order to be able to receive events
75
75
  */
76
- if (!isFocusable(domElement) && domElement.getAttribute('tabindex') === null) {
77
- console.error('Supplied element is not inherently focusable and does not have tabindex attribute, so it must have a tabindex attribute in order to be able receive keyboard events. Something like tabindex=0 would suffice.');
76
+ if (
77
+ !isFocusable(domElement)
78
+ && domElement.getAttribute('tabindex') === null
79
+ ) {
80
+ new TypeError('Supplied element is not inherently focusable and does not have tabindex attribute, so it must have a tabindex attribute in order to be able receive keyboard events. Something like tabindex=0 would suffice.');
78
81
  }
79
82
 
80
83
  /**