@woosh/meep-engine 2.138.17 → 2.138.19

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 (449) hide show
  1. package/README.md +2 -2
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/editor/actions/concrete/ActionUpdateTexture.d.ts +12 -0
  4. package/editor/actions/concrete/ActionUpdateTexture.d.ts.map +1 -0
  5. package/editor/actions/concrete/ArrayCopyAction.d.ts +20 -0
  6. package/editor/actions/concrete/ArrayCopyAction.d.ts.map +1 -0
  7. package/editor/actions/concrete/ComponentRemoveAction.d.ts +11 -0
  8. package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +1 -0
  9. package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +47 -0
  10. package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts.map +1 -0
  11. package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +38 -0
  12. package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts.map +1 -0
  13. package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +23 -0
  14. package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts.map +1 -0
  15. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +19 -0
  16. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +1 -0
  17. package/editor/actions/concrete/SelectionRemoveAction.d.ts +10 -0
  18. package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +1 -0
  19. package/editor/actions/concrete/WriteGridValueAction.d.ts +15 -0
  20. package/editor/actions/concrete/WriteGridValueAction.d.ts.map +1 -0
  21. package/editor/ecs/component/FieldDescriptor.d.ts +27 -0
  22. package/editor/ecs/component/FieldDescriptor.d.ts.map +1 -0
  23. package/editor/ecs/component/FieldValueAdapter.d.ts +7 -0
  24. package/editor/ecs/component/FieldValueAdapter.d.ts.map +1 -0
  25. package/editor/ecs/component/createFieldEditor.d.ts +9 -0
  26. package/editor/ecs/component/createFieldEditor.d.ts.map +1 -0
  27. package/editor/ecs/component/createObjectEditor.d.ts +14 -0
  28. package/editor/ecs/component/createObjectEditor.d.ts.map +1 -0
  29. package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts.map +1 -1
  30. package/editor/ecs/component/findNearestRegisteredType.d.ts +8 -0
  31. package/editor/ecs/component/findNearestRegisteredType.d.ts.map +1 -0
  32. package/editor/process/ObstacleGridDisplayProcess.d.ts.map +1 -1
  33. package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts.map +1 -1
  34. package/editor/tools/GridPaintTool.d.ts +17 -0
  35. package/editor/tools/GridPaintTool.d.ts.map +1 -0
  36. package/editor/tools/SelectionTool.d.ts +27 -0
  37. package/editor/tools/SelectionTool.d.ts.map +1 -0
  38. package/editor/tools/TopDownCameraControlTool.d.ts +13 -0
  39. package/editor/tools/TopDownCameraControlTool.d.ts.map +1 -0
  40. package/editor/view/ecs/ComponentControlFactory.d.ts.map +1 -0
  41. package/editor/view/ecs/ComponentControlView.d.ts.map +1 -1
  42. package/editor/view/ecs/EntityEditor.d.ts.map +1 -0
  43. package/editor/view/ecs/EntityList.d.ts.map +1 -0
  44. package/editor/view/ecs/HierarchicalEntityListView.d.ts.map +1 -0
  45. package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
  46. package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
  47. package/editor/view/node-graph/NodeView.d.ts.map +1 -1
  48. package/editor/view/node-graph/PortView.d.ts.map +1 -1
  49. package/package.json +1 -1
  50. package/src/core/binary/BinaryBuffer.d.ts +1 -1
  51. package/src/core/binary/BinaryBuffer.js +1 -1
  52. package/src/core/binary/BitSet.d.ts +1 -1
  53. package/src/core/binary/BitSet.js +1 -1
  54. package/src/core/cache/Cache.js +1 -1
  55. package/src/core/cache/LoadingCache.js +1 -1
  56. package/src/core/collection/list/List.js +1 -1
  57. package/src/core/collection/map/HashMap.js +1 -1
  58. package/src/core/collection/table/RowFirstTable.d.ts +1 -1
  59. package/src/core/collection/table/RowFirstTable.js +1 -1
  60. package/src/core/collection/table/RowFirstTableSpec.d.ts +1 -1
  61. package/src/core/collection/table/RowFirstTableSpec.js +1 -1
  62. package/src/core/color/oklab/compute_max_saturation.d.ts +1 -1
  63. package/src/core/color/oklab/compute_max_saturation.js +1 -1
  64. package/src/core/color/oklab/find_cusp.d.ts +1 -1
  65. package/src/core/color/oklab/find_cusp.js +1 -1
  66. package/src/core/color/oklab/find_gamut_intersection.d.ts +1 -1
  67. package/src/core/color/oklab/find_gamut_intersection.js +1 -1
  68. package/src/core/color/oklab/okhsv_to_linear_srgb.d.ts +1 -1
  69. package/src/core/color/oklab/okhsv_to_linear_srgb.js +1 -1
  70. package/src/core/color/oklab/oklab_to_linear_srgb.d.ts +1 -1
  71. package/src/core/color/oklab/oklab_to_linear_srgb.js +1 -1
  72. package/src/core/color/oklab/oklab_to_xyz.d.ts +1 -1
  73. package/src/core/color/oklab/oklab_to_xyz.js +1 -1
  74. package/src/core/color/oklab/xyz_to_oklab.d.ts +1 -1
  75. package/src/core/color/oklab/xyz_to_oklab.js +1 -1
  76. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts +1 -1
  77. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +1 -1
  78. package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.d.ts.map +1 -1
  79. package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.js +57 -65
  80. package/src/core/geom/3d/octahedra/octahedral_uv_wrap.d.ts +1 -1
  81. package/src/core/geom/3d/octahedra/octahedral_uv_wrap.js +1 -1
  82. package/src/core/geom/3d/quaternion/quat_decode_from_uint32.d.ts +1 -1
  83. package/src/core/geom/3d/quaternion/quat_decode_from_uint32.js +1 -1
  84. package/src/core/geom/3d/quaternion/quat_encode_to_uint32.d.ts +1 -1
  85. package/src/core/geom/3d/quaternion/quat_encode_to_uint32.js +1 -1
  86. package/src/core/geom/3d/shape/AbstractShape3D.d.ts +74 -3
  87. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +37 -0
  88. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -0
  89. package/src/core/geom/3d/shape/CapsuleShape3D.js +210 -0
  90. package/src/core/geom/3d/shape/PointShape3D.d.ts +5 -0
  91. package/src/core/geom/3d/shape/PointShape3D.d.ts.map +1 -1
  92. package/src/core/geom/3d/shape/PointShape3D.js +52 -14
  93. package/src/core/geom/3d/shape/TransformedShape3D.d.ts +75 -12
  94. package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
  95. package/src/core/geom/3d/shape/TransformedShape3D.js +12 -3
  96. package/src/core/geom/3d/shape/UnionShape3D.d.ts +47 -5
  97. package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
  98. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +12 -5
  99. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
  100. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +17 -5
  101. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
  102. package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
  103. package/src/core/geom/3d/shape/json/shape_to_type.js +4 -1
  104. package/src/core/geom/3d/shape/json/type_adapters.d.ts +17 -2
  105. package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
  106. package/src/core/geom/3d/shape/json/type_adapters.js +18 -2
  107. package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.d.ts.map +1 -1
  108. package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.js +51 -48
  109. package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.d.ts +1 -1
  110. package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +1 -1
  111. package/src/core/geom/ConicRay.d.ts +1 -1
  112. package/src/core/geom/ConicRay.js +1 -1
  113. package/src/core/geom/Quaternion.d.ts +2 -2
  114. package/src/core/geom/Quaternion.js +2 -2
  115. package/src/core/geom/Vector1.d.ts +1 -1
  116. package/src/core/geom/Vector1.js +1 -1
  117. package/src/core/geom/Vector2.d.ts +1 -1
  118. package/src/core/geom/Vector2.js +1 -1
  119. package/src/core/geom/Vector3.d.ts +1 -1
  120. package/src/core/geom/Vector3.js +1 -1
  121. package/src/core/geom/packing/miniball/Miniball.d.ts +1 -1
  122. package/src/core/geom/packing/miniball/Miniball.js +1 -1
  123. package/src/core/geom/vec3/serialization/v3_binary_equality_decode.d.ts +1 -1
  124. package/src/core/geom/vec3/serialization/v3_binary_equality_decode.js +1 -1
  125. package/src/core/geom/vec3/serialization/v3_binary_equality_encode.d.ts +1 -1
  126. package/src/core/geom/vec3/serialization/v3_binary_equality_encode.js +1 -1
  127. package/src/core/math/spline/spline3_hermite.d.ts +1 -1
  128. package/src/core/math/spline/spline3_hermite.js +1 -1
  129. package/src/core/math/spline/spline3_hermite_bounds.d.ts +1 -1
  130. package/src/core/math/spline/spline3_hermite_bounds.js +1 -1
  131. package/src/core/math/spline/spline3_hermite_bounds_t.d.ts +1 -1
  132. package/src/core/math/spline/spline3_hermite_bounds_t.js +1 -1
  133. package/src/core/math/spline/spline3_hermite_to_monomial.d.ts +1 -1
  134. package/src/core/math/spline/spline3_hermite_to_monomial.js +1 -1
  135. package/src/core/model/ObservedBoolean.d.ts +1 -1
  136. package/src/core/model/ObservedBoolean.js +1 -1
  137. package/src/core/model/ObservedString.d.ts +1 -1
  138. package/src/core/model/ObservedString.js +1 -1
  139. package/src/core/process/undo/Action.js +1 -1
  140. package/src/core/process/undo/ActionProcessor.js +1 -1
  141. package/src/engine/animation/curve/AnimationCurve.d.ts +1 -1
  142. package/src/engine/animation/curve/AnimationCurve.js +1 -1
  143. package/src/engine/animation/curve/Keyframe.d.ts +1 -1
  144. package/src/engine/animation/curve/Keyframe.js +1 -1
  145. package/src/engine/animation/curve/animation_curve_compute_aabb.d.ts +1 -1
  146. package/src/engine/animation/curve/animation_curve_compute_aabb.js +1 -1
  147. package/src/engine/animation/curve/animation_curve_optimize.d.ts +1 -1
  148. package/src/engine/animation/curve/animation_curve_optimize.js +2 -2
  149. package/src/engine/asset/loaders/image/jpeg/JpegImage.js +1 -1
  150. package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
  151. package/src/engine/asset/loaders/image/png/PNGReader.js +27 -7
  152. package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -1
  153. package/src/engine/asset/loaders/image/png/crc32.js +1 -1
  154. package/src/engine/control/first-person/DESIGN.md +616 -0
  155. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +229 -0
  156. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -0
  157. package/src/engine/control/first-person/FirstPersonPlayerController.js +176 -0
  158. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +251 -0
  159. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -0
  160. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +205 -0
  161. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +151 -0
  162. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -0
  163. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +799 -0
  164. package/src/engine/control/first-person/math/computeJumpFromApex.d.ts +23 -0
  165. package/src/engine/control/first-person/math/computeJumpFromApex.d.ts.map +1 -0
  166. package/src/engine/control/first-person/math/computeJumpFromApex.js +23 -0
  167. package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts +23 -0
  168. package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts.map +1 -0
  169. package/src/engine/control/first-person/math/criticallyDampedSpring.js +34 -0
  170. package/src/engine/control/first-person/math/dampedSpringStep.d.ts +23 -0
  171. package/src/engine/control/first-person/math/dampedSpringStep.d.ts.map +1 -0
  172. package/src/engine/control/first-person/math/dampedSpringStep.js +72 -0
  173. package/src/engine/control/first-person/math/stepTowards.d.ts +12 -0
  174. package/src/engine/control/first-person/math/stepTowards.d.ts.map +1 -0
  175. package/src/engine/control/first-person/math/stepTowards.js +20 -0
  176. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +69 -0
  177. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -0
  178. package/src/engine/control/first-person/pose/FirstPersonPose.js +91 -0
  179. package/src/engine/control/first-person/prototype_first_person_controller.d.ts +2 -0
  180. package/src/engine/control/first-person/prototype_first_person_controller.d.ts.map +1 -0
  181. package/src/engine/control/first-person/prototype_first_person_controller.js +314 -0
  182. package/src/engine/ecs/Entity.js +1 -1
  183. package/src/engine/ecs/EntityComponentDataset.js +1 -1
  184. package/src/engine/ecs/EntityManager.d.ts +1 -1
  185. package/src/engine/ecs/EntityManager.js +1 -1
  186. package/src/engine/ecs/EntityObserver.js +1 -1
  187. package/src/engine/ecs/EntityReference.d.ts +1 -1
  188. package/src/engine/ecs/EntityReference.js +1 -1
  189. package/src/engine/ecs/System.js +1 -1
  190. package/src/engine/ecs/attachment/AttachmentSystem.d.ts +2 -2
  191. package/src/engine/ecs/attachment/AttachmentSystem.d.ts.map +1 -1
  192. package/src/engine/ecs/grid/HeightMap2AOMap.d.ts.map +1 -1
  193. package/src/engine/ecs/grid/HeightMap2AOMap.js +3 -2
  194. package/src/engine/ecs/guid/UUID.d.ts +1 -1
  195. package/src/engine/ecs/guid/UUID.js +1 -1
  196. package/src/engine/ecs/name/Name.d.ts +1 -1
  197. package/src/engine/ecs/name/Name.js +1 -1
  198. package/src/engine/ecs/parent/ParentEntity.js +1 -1
  199. package/src/engine/ecs/storage/BinaryBufferDeSerializer.d.ts +1 -1
  200. package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +1 -1
  201. package/src/engine/ecs/storage/BinaryBufferSerializer.d.ts +1 -1
  202. package/src/engine/ecs/storage/BinaryBufferSerializer.js +1 -1
  203. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +1 -1
  204. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +1 -1
  205. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +1 -1
  206. package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.d.ts +1 -1
  207. package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +1 -1
  208. package/src/engine/ecs/transform/Transform.d.ts +1 -1
  209. package/src/engine/ecs/transform/Transform.js +1 -1
  210. package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
  211. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
  212. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +10 -1
  213. package/src/engine/graphics/impostors/voxel/README.md +149 -0
  214. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts +91 -0
  215. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts.map +1 -0
  216. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +376 -0
  217. package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts +128 -0
  218. package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts.map +1 -0
  219. package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.js +141 -0
  220. package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts +38 -0
  221. package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts.map +1 -0
  222. package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.js +338 -0
  223. package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts +43 -0
  224. package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts.map +1 -0
  225. package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.js +192 -0
  226. package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts +2 -0
  227. package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts.map +1 -0
  228. package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.js +343 -0
  229. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts +13 -0
  230. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts.map +1 -0
  231. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.js +99 -0
  232. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts +19 -0
  233. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts.map +1 -0
  234. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.js +231 -0
  235. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts +5 -0
  236. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts.map +1 -0
  237. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.js +70 -0
  238. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts +13 -0
  239. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts.map +1 -0
  240. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.js +127 -0
  241. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts +5 -0
  242. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts.map +1 -0
  243. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.js +68 -0
  244. package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts +27 -0
  245. package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts.map +1 -0
  246. package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.js +96 -0
  247. package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts +113 -29
  248. package/src/engine/graphics/render/forward_plus/SPECIFICATION.md +1 -1
  249. package/src/engine/graphics/shaders/AmbientOcclusionShader.d.ts.map +1 -1
  250. package/src/engine/graphics/shaders/AmbientOcclusionShader.js +20 -5
  251. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +1 -1
  252. package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
  253. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.d.ts +1 -1
  254. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.js +1 -1
  255. package/src/engine/graphics/util/build_max_height_pyramid.d.ts +21 -14
  256. package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
  257. package/src/engine/graphics/util/build_max_height_pyramid.js +107 -70
  258. package/src/engine/input/devices/InputDeviceSwitch.js +1 -1
  259. package/src/engine/input/devices/KeyboardDevice.js +1 -1
  260. package/src/engine/input/devices/PointerDevice.js +1 -1
  261. package/src/engine/intelligence/behavior/Behavior.js +1 -1
  262. package/src/engine/intelligence/behavior/SelectorBehavior.d.ts +1 -1
  263. package/src/engine/intelligence/behavior/SelectorBehavior.js +1 -1
  264. package/src/engine/intelligence/behavior/behavior_to_dot.d.ts +1 -1
  265. package/src/engine/intelligence/behavior/behavior_to_dot.js +1 -1
  266. package/src/engine/intelligence/behavior/composite/CompositeBehavior.d.ts +1 -1
  267. package/src/engine/intelligence/behavior/composite/CompositeBehavior.js +1 -1
  268. package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts +1 -1
  269. package/src/engine/intelligence/behavior/composite/ParallelBehavior.js +1 -1
  270. package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts +1 -1
  271. package/src/engine/intelligence/behavior/composite/SequenceBehavior.js +1 -1
  272. package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts +1 -1
  273. package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +1 -1
  274. package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts +1 -1
  275. package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.js +1 -1
  276. package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts +1 -1
  277. package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.js +1 -1
  278. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts +1 -1
  279. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.js +1 -1
  280. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts +1 -1
  281. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +1 -1
  282. package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts +1 -1
  283. package/src/engine/intelligence/behavior/ecs/BehaviorComponent.js +1 -1
  284. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +1 -1
  285. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.js +1 -1
  286. package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts +1 -1
  287. package/src/engine/intelligence/behavior/ecs/DieBehavior.js +1 -1
  288. package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts +1 -1
  289. package/src/engine/intelligence/behavior/ecs/EntityBehavior.js +1 -1
  290. package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +1 -1
  291. package/src/engine/intelligence/behavior/ecs/KillBehavior.js +1 -1
  292. package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts +1 -1
  293. package/src/engine/intelligence/behavior/ecs/SendEventBehavior.js +1 -1
  294. package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts +1 -1
  295. package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +1 -1
  296. package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +1 -1
  297. package/src/engine/intelligence/behavior/primitive/ActionBehavior.js +1 -1
  298. package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts +1 -1
  299. package/src/engine/intelligence/behavior/primitive/FailingBehavior.js +1 -1
  300. package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts +1 -1
  301. package/src/engine/intelligence/behavior/primitive/PromiseBehavior.js +1 -1
  302. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +1 -1
  303. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.js +1 -1
  304. package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +1 -1
  305. package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
  306. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
  307. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +1 -1
  308. package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts +1 -1
  309. package/src/engine/intelligence/behavior/util/BranchBehavior.js +1 -1
  310. package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts +1 -1
  311. package/src/engine/intelligence/behavior/util/DelayBehavior.js +1 -1
  312. package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts +1 -1
  313. package/src/engine/intelligence/behavior/util/LogMessageBehavior.js +1 -1
  314. package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts +1 -1
  315. package/src/engine/intelligence/behavior/util/RandomDelayBehavior.js +1 -1
  316. package/src/engine/intelligence/blackboard/Blackboard.js +1 -1
  317. package/src/engine/intelligence/mcts/MonteCarlo.d.ts +1 -1
  318. package/src/engine/intelligence/mcts/MonteCarlo.js +1 -1
  319. package/src/engine/intelligence/mcts/MoveEdge.d.ts +1 -1
  320. package/src/engine/intelligence/mcts/MoveEdge.js +1 -1
  321. package/src/engine/intelligence/mcts/StateNode.d.ts +1 -1
  322. package/src/engine/intelligence/mcts/StateNode.js +1 -1
  323. package/src/engine/intelligence/resource/ActionSequence.d.ts +1 -1
  324. package/src/engine/intelligence/resource/ActionSequence.js +1 -1
  325. package/src/engine/intelligence/resource/Resource.d.ts +1 -1
  326. package/src/engine/intelligence/resource/Resource.js +1 -1
  327. package/src/engine/intelligence/resource/ResourceAllocation.d.ts +1 -1
  328. package/src/engine/intelligence/resource/ResourceAllocation.js +1 -1
  329. package/src/engine/intelligence/resource/ResourceAllocationBid.d.ts +1 -1
  330. package/src/engine/intelligence/resource/ResourceAllocationBid.js +1 -1
  331. package/src/engine/intelligence/resource/ResourceAllocationSolver.d.ts +1 -1
  332. package/src/engine/intelligence/resource/ResourceAllocationSolver.js +1 -1
  333. package/src/engine/intelligence/resource/StrategicResourceAllocator.d.ts +1 -1
  334. package/src/engine/intelligence/resource/StrategicResourceAllocator.js +1 -1
  335. package/src/engine/intelligence/resource/TacticalModule.d.ts +1 -1
  336. package/src/engine/intelligence/resource/TacticalModule.js +1 -1
  337. package/src/engine/network/NetworkSession.d.ts +1 -1
  338. package/src/engine/network/NetworkSession.js +1 -1
  339. package/src/engine/network/adapters/QuaternionInterpolationAdapter.d.ts +1 -1
  340. package/src/engine/network/adapters/QuaternionInterpolationAdapter.js +1 -1
  341. package/src/engine/network/adapters/TransformInterpolationAdapter.d.ts +1 -1
  342. package/src/engine/network/adapters/TransformInterpolationAdapter.js +1 -1
  343. package/src/engine/network/adapters/TransformReplicationAdapter.d.ts +1 -1
  344. package/src/engine/network/adapters/TransformReplicationAdapter.js +1 -1
  345. package/src/engine/network/adapters/Vector3InterpolationAdapter.d.ts +1 -1
  346. package/src/engine/network/adapters/Vector3InterpolationAdapter.js +1 -1
  347. package/src/engine/network/core/quantize/quantize_float.d.ts +1 -1
  348. package/src/engine/network/core/quantize/quantize_float.js +1 -1
  349. package/src/engine/network/core/quantize/quantize_position.d.ts +1 -1
  350. package/src/engine/network/core/quantize/quantize_position.js +1 -1
  351. package/src/engine/network/core/sequence/ack_bitfield.d.ts +1 -1
  352. package/src/engine/network/core/sequence/ack_bitfield.js +1 -1
  353. package/src/engine/network/core/sequence/seq16.d.ts +1 -1
  354. package/src/engine/network/core/sequence/seq16.js +1 -1
  355. package/src/engine/network/core/sequence/seq32.d.ts +1 -1
  356. package/src/engine/network/core/sequence/seq32.js +1 -1
  357. package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
  358. package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
  359. package/src/engine/network/diagnostics/ReplayLog.d.ts +1 -1
  360. package/src/engine/network/diagnostics/ReplayLog.js +1 -1
  361. package/src/engine/network/diagnostics/SyncTest.d.ts +1 -1
  362. package/src/engine/network/diagnostics/SyncTest.js +1 -1
  363. package/src/engine/network/ecs/NetworkSystem.d.ts +1 -1
  364. package/src/engine/network/ecs/NetworkSystem.js +1 -1
  365. package/src/engine/network/ecs/components/NetworkIdentity.d.ts +1 -1
  366. package/src/engine/network/ecs/components/NetworkIdentity.js +1 -1
  367. package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts +1 -1
  368. package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.js +1 -1
  369. package/src/engine/network/orchestrator/NetworkPeer.d.ts +1 -1
  370. package/src/engine/network/orchestrator/NetworkPeer.js +1 -1
  371. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +1 -1
  372. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +1 -1
  373. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
  374. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +1 -1
  375. package/src/engine/network/replication/Replicator.d.ts +1 -1
  376. package/src/engine/network/replication/Replicator.js +1 -1
  377. package/src/engine/network/replication/ScopeFilter.d.ts +2 -2
  378. package/src/engine/network/replication/ScopeFilter.js +2 -2
  379. package/src/engine/network/sim/ActionLog.d.ts +1 -1
  380. package/src/engine/network/sim/ActionLog.js +1 -1
  381. package/src/engine/network/sim/BinaryInterpolationAdapter.d.ts +1 -1
  382. package/src/engine/network/sim/BinaryInterpolationAdapter.js +1 -1
  383. package/src/engine/network/sim/InterpolationLog.d.ts +1 -1
  384. package/src/engine/network/sim/InterpolationLog.js +1 -1
  385. package/src/engine/network/sim/ReplicatedComponentRegistry.d.ts +1 -1
  386. package/src/engine/network/sim/ReplicatedComponentRegistry.js +1 -1
  387. package/src/engine/network/sim/RewindEngine.d.ts +1 -1
  388. package/src/engine/network/sim/RewindEngine.js +1 -1
  389. package/src/engine/network/sim/SimAction.d.ts +1 -1
  390. package/src/engine/network/sim/SimAction.js +1 -1
  391. package/src/engine/network/sim/SimActionExecutor.d.ts +1 -1
  392. package/src/engine/network/sim/SimActionExecutor.js +1 -1
  393. package/src/engine/network/sim/SimActionRegistry.d.ts +1 -1
  394. package/src/engine/network/sim/SimActionRegistry.js +1 -1
  395. package/src/engine/network/sim/SmoothingState.js +1 -1
  396. package/src/engine/network/sim/Snapshotter.d.ts +1 -1
  397. package/src/engine/network/sim/Snapshotter.js +1 -1
  398. package/src/engine/network/sim/SpeculationLog.d.ts +1 -1
  399. package/src/engine/network/sim/SpeculationLog.js +1 -1
  400. package/src/engine/network/state/Baseline.d.ts +1 -1
  401. package/src/engine/network/state/Baseline.js +1 -1
  402. package/src/engine/network/state/ChangedEntitySet.d.ts +1 -1
  403. package/src/engine/network/state/ChangedEntitySet.js +1 -1
  404. package/src/engine/network/state/InputRing.d.ts +1 -1
  405. package/src/engine/network/state/InputRing.js +1 -1
  406. package/src/engine/network/state/MutationLedger.d.ts +1 -1
  407. package/src/engine/network/state/MutationLedger.js +1 -1
  408. package/src/engine/network/state/PriorityAccumulator.d.ts +1 -1
  409. package/src/engine/network/state/PriorityAccumulator.js +1 -1
  410. package/src/engine/network/state/ReplicationSlotTable.d.ts +1 -1
  411. package/src/engine/network/state/ReplicationSlotTable.js +1 -1
  412. package/src/engine/network/time/AdaptiveRenderDelay.d.ts +1 -1
  413. package/src/engine/network/time/AdaptiveRenderDelay.js +1 -1
  414. package/src/engine/network/time/JitterBuffer.d.ts +1 -1
  415. package/src/engine/network/time/JitterBuffer.js +1 -1
  416. package/src/engine/network/time/TimeDilation.d.ts +1 -1
  417. package/src/engine/network/time/TimeDilation.js +1 -1
  418. package/src/engine/network/time/TimeSync.d.ts +1 -1
  419. package/src/engine/network/time/TimeSync.js +1 -1
  420. package/src/engine/network/transport/Channel.d.ts.map +1 -1
  421. package/src/engine/network/transport/Channel.js +3 -6
  422. package/src/engine/network/transport/LoopbackTransport.d.ts +1 -1
  423. package/src/engine/network/transport/LoopbackTransport.js +1 -1
  424. package/src/engine/network/transport/ReliableCommandPipeline.d.ts +1 -1
  425. package/src/engine/network/transport/ReliableCommandPipeline.js +1 -1
  426. package/src/engine/network/transport/Transport.d.ts +1 -1
  427. package/src/engine/network/transport/Transport.js +1 -1
  428. package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts +1 -1
  429. package/src/engine/network/transport/adapters/NodeUDPTransport.js +2 -2
  430. package/src/engine/network/transport/adapters/SimulatedTransport.d.ts +1 -1
  431. package/src/engine/network/transport/adapters/SimulatedTransport.js +1 -1
  432. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts +1 -1
  433. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +1 -1
  434. package/src/engine/network/transport/adapters/WebSocketTransport.d.ts +1 -1
  435. package/src/engine/network/transport/adapters/WebSocketTransport.js +1 -1
  436. package/src/engine/network/transport/adapters/WebTransportTransport.d.ts +1 -1
  437. package/src/engine/network/transport/adapters/WebTransportTransport.js +1 -1
  438. package/src/engine/network/transport/fragments/FragmentAssembler.d.ts +1 -1
  439. package/src/engine/network/transport/fragments/FragmentAssembler.js +1 -1
  440. package/src/engine/network/transport/fragments/FragmentRetention.d.ts +1 -1
  441. package/src/engine/network/transport/fragments/FragmentRetention.js +1 -1
  442. package/src/engine/network/transport/fragments/packet_size.d.ts +1 -1
  443. package/src/engine/network/transport/fragments/packet_size.js +1 -1
  444. package/src/engine/simulation/Ticker.d.ts +1 -1
  445. package/src/engine/simulation/Ticker.js +1 -1
  446. package/src/engine/sound/SoundEngine.js +1 -1
  447. package/src/engine/ui/DraggableAspect.d.ts +1 -1
  448. package/src/engine/ui/DraggableAspect.js +1 -1
  449. package/src/view/View.js +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make_voxel_impostor_geometry.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qFAFa,uBAAuB,CA4BnC;wCAxFM,OAAO"}
@@ -0,0 +1,96 @@
1
+ import {
2
+ BufferAttribute,
3
+ InstancedBufferGeometry,
4
+ InstancedInterleavedBuffer,
5
+ InterleavedBufferAttribute,
6
+ Sphere,
7
+ Vector3
8
+ } from "three";
9
+ import {
10
+ VOXEL_POINT_OFFSET_ALBEDO,
11
+ VOXEL_POINT_OFFSET_NORMAL,
12
+ VOXEL_POINT_OFFSET_ORM,
13
+ VOXEL_POINT_OFFSET_POSITION,
14
+ VOXEL_POINT_STRIDE
15
+ } from "../VoxelImpostorDescription.js";
16
+
17
+
18
+ /**
19
+ * Unit quad in the XY plane, centred on origin. Each instance picks
20
+ * one of these four corners; the shader places it in view space at a
21
+ * world-space offset around the instance's iPosition, producing a
22
+ * camera-facing billboard.
23
+ *
24
+ * @type {Float32Array}
25
+ */
26
+ const QUAD_POSITIONS = new Float32Array([
27
+ -0.5, -0.5, 0,
28
+ 0.5, -0.5, 0,
29
+ 0.5, 0.5, 0,
30
+ -0.5, 0.5, 0,
31
+ ]);
32
+
33
+ const QUAD_UVS = new Float32Array([
34
+ 0, 0,
35
+ 1, 0,
36
+ 1, 1,
37
+ 0, 1,
38
+ ]);
39
+
40
+ const QUAD_INDICES = new Uint16Array([
41
+ 0, 1, 2,
42
+ 0, 2, 3,
43
+ ]);
44
+
45
+
46
+ /**
47
+ * InstancedBufferGeometry with one instance per voxel. Each instance is
48
+ * a unit quad whose vertex shader pushes the quad to a world-space
49
+ * footprint around the voxel's iPosition. Because the splat's size is
50
+ * specified in world units, it scales correctly with viewing distance:
51
+ *
52
+ * - At the impostor's design distance (where one voxel projects to
53
+ * about one screen pixel), the quad covers a single pixel.
54
+ * - Closer in, the quad expands to cover the same voxel cell on
55
+ * screen — no holes.
56
+ * - Farther out, the quad shrinks below a pixel — no z-fighting.
57
+ *
58
+ * This is the camera-facing-billboard reading of the Witcher 4 "voxel
59
+ * point" — the on-screen size of each voxel is whatever its world-space
60
+ * cell projects to, not a fixed screen size. Shadows work for free
61
+ * because the depth caster, rendered with the same shader from the
62
+ * light's view, also produces world-sized splats in light space.
63
+ *
64
+ * The interleaved point buffer is shared across iPosition / iNormal /
65
+ * iAlbedo / iORM via offsets — one GPU upload covers the lot.
66
+ *
67
+ * @param {VoxelImpostorDescription} description
68
+ * @returns {InstancedBufferGeometry}
69
+ */
70
+ export function make_voxel_impostor_geometry(description) {
71
+ const geometry = new InstancedBufferGeometry();
72
+
73
+ geometry.setAttribute('position', new BufferAttribute(QUAD_POSITIONS, 3));
74
+ geometry.setAttribute('uv', new BufferAttribute(QUAD_UVS, 2));
75
+ geometry.setIndex(new BufferAttribute(QUAD_INDICES, 1));
76
+
77
+ const interleaved = new InstancedInterleavedBuffer(description.points, VOXEL_POINT_STRIDE);
78
+
79
+ geometry.setAttribute('iPosition', new InterleavedBufferAttribute(interleaved, 3, VOXEL_POINT_OFFSET_POSITION));
80
+ geometry.setAttribute('iNormal', new InterleavedBufferAttribute(interleaved, 3, VOXEL_POINT_OFFSET_NORMAL));
81
+ geometry.setAttribute('iAlbedo', new InterleavedBufferAttribute(interleaved, 3, VOXEL_POINT_OFFSET_ALBEDO));
82
+ geometry.setAttribute('iORM', new InterleavedBufferAttribute(interleaved, 3, VOXEL_POINT_OFFSET_ORM));
83
+
84
+ geometry.instanceCount = description.point_count;
85
+
86
+ // The point cloud occupies the bake's bounding sphere; each splat
87
+ // extends at most half a voxel-cell past its centre, which is
88
+ // already absorbed by the sphere's bake-time radius. Add a small
89
+ // margin so frustum culling doesn't pop voxels at the edge.
90
+ geometry.boundingSphere = new Sphere(
91
+ new Vector3(description.offset[0], description.offset[1], description.offset[2]),
92
+ description.sphere_radius + description.voxel_size * 0.5
93
+ );
94
+
95
+ return geometry;
96
+ }
@@ -1,29 +1,113 @@
1
- import Entity from "../../../../../../ecs/Entity";
2
- import {AbstractShape3D} from "../../../../../../../core/geom/3d/shape/AbstractShape3D";
3
- import {AttributeValue} from "./AttributeValue";
4
- import {SamplingFunctionKind} from "./SamplingFunctionKind";
5
-
6
- interface Args {
7
- density?: number
8
- particle_size?: number
9
- shape?: AbstractShape3D
10
- sort?: boolean
11
- sprite?: string,
12
- sampling_function?: SamplingFunctionKind
13
- }
14
-
15
- interface Attributes {
16
- readonly color: AttributeValue
17
- }
18
-
19
- export class ParticleVolume {
20
- readonly entity: Entity
21
-
22
- from(args?: Args): void
23
-
24
- fromJSON(json: any): void
25
-
26
- build(): void
27
-
28
- readonly attributes: Attributes
29
- }
1
+ export class ParticleVolume {
2
+ __emitter: ParticleEmitter;
3
+ /**
4
+ *
5
+ * @type {Transform}
6
+ * @private
7
+ */
8
+ private __transform;
9
+ /**
10
+ * Particle count per unit of volume
11
+ * @type {number}
12
+ * @private
13
+ */
14
+ private __density;
15
+ /**
16
+ *
17
+ * @type {AbstractShape3D}
18
+ * @private
19
+ */
20
+ private __shape;
21
+ /**
22
+ *
23
+ * @type {SamplingFunctionKind|number}
24
+ * @private
25
+ */
26
+ private __sampling_function;
27
+ /**
28
+ *
29
+ * @type {Entity}
30
+ */
31
+ entity: Entity;
32
+ /**
33
+ *
34
+ * @type {Object<AttributeValue>}
35
+ */
36
+ attributes: any;
37
+ get shape(): AbstractShape3D;
38
+ /**
39
+ * @private
40
+ */
41
+ private init_attributes;
42
+ get emitter(): ParticleEmitter;
43
+ get transform(): Transform;
44
+ /**
45
+ *
46
+ * @param {number} [density]
47
+ * @param {number} [particle_size]
48
+ * @param {AbstractShape3D} [shape]
49
+ * @param {boolean} sort
50
+ * @param {boolean} lighting
51
+ * @param {string} [sprite]
52
+ * @param {SamplingFunctionKind|number} [sampling_function]
53
+ */
54
+ from({ density, particle_size, shape, sort, lighting, sprite, sampling_function }?: number): void;
55
+ /**
56
+ *
57
+ * @param {number} density
58
+ * @param {boolean} [is_density_size_adjusted]
59
+ * @param {number} [particle_size]
60
+ * @param {Object} shape
61
+ * @param {boolean} [is_sorted]
62
+ * @param {boolean} [is_lit]
63
+ * @param {string} sprite
64
+ * @param {Object<Object>} [attributes]
65
+ * @param {string} [sampling_function]
66
+ */
67
+ fromJSON({ density, is_density_size_adjusted, particle_size, shape, is_sorted, is_lit, sprite, attributes, sampling_function }: number): void;
68
+ /**
69
+ *
70
+ * @private
71
+ */
72
+ private __ensure_initialized;
73
+ __distribute_grid(): void;
74
+ /**
75
+ *
76
+ * @param {function} random
77
+ * @private
78
+ */
79
+ private __distribute;
80
+ /**
81
+ * Distribute particles in the volume
82
+ * @param {function():number} random
83
+ * @private
84
+ */
85
+ private __distribute_random;
86
+ /**
87
+ *
88
+ * @private
89
+ */
90
+ private __write_attributes;
91
+ /**
92
+ *
93
+ * @param {number} index
94
+ * @private
95
+ */
96
+ private __write_attribute;
97
+ build(): void;
98
+ /**
99
+ *
100
+ * @param {number} r
101
+ * @param {number} g
102
+ * @param {number} b
103
+ * @param {number} a
104
+ */
105
+ setColor(r: number, g: number, b: number, a: number): void;
106
+ }
107
+ export namespace ParticleVolume {
108
+ let typeName: string;
109
+ }
110
+ import { ParticleEmitter } from "../../emitter/ParticleEmitter.js";
111
+ import Entity from "../../../../../../ecs/Entity.js";
112
+ import { Transform } from "../../../../../../ecs/transform/Transform.js";
113
+ //# sourceMappingURL=ParticleVolume.d.ts.map
@@ -152,4 +152,4 @@ for(uint i=0u; i < fp_cluster_metadata.y; i++){
152
152
  ---
153
153
  Author: Alexander Goldring, Company Named Limited
154
154
 
155
- Private and confidential, copyright (c) Company Named Limited, 2022
155
+ Private and confidential, copyright (c) Company Named Limited, 2026
@@ -1 +1 @@
1
- {"version":3,"file":"AmbientOcclusionShader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/shaders/AmbientOcclusionShader.js"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH;IAFyB,OAAO,GAArB,MAAM;;;;;;;;;;;;;;;;;;;;;;EA6ShB;wBAhX8B,OAAO"}
1
+ {"version":3,"file":"AmbientOcclusionShader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/shaders/AmbientOcclusionShader.js"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH;IAFyB,OAAO,GAArB,MAAM;;;;;;;;;;;;;;;;;;;;;;EA4ThB;wBA/X8B,OAAO"}
@@ -93,10 +93,15 @@ function AmbientOcclusionShader({ numRays = DEFAULT_NUM_RAYS } = {}) {
93
93
 
94
94
  fragmentShader: `
95
95
  // three.js auto-prefixes float/int precision; declare highp for
96
- // the heightmap sampler so R32F reads keep full precision
97
- precision highp sampler2D;
96
+ // the heightmap sampler so R32F reads keep full precision.
97
+ //
98
+ // The pyramid is stored as a DataTexture2DArray with one mip per
99
+ // layer (all at full mip-0 resolution; smaller mips are nearest-
100
+ // upscaled). This sidesteps a three.js r136 upload bug for
101
+ // DataTexture custom mipmap chains — see build_max_height_pyramid.
102
+ precision highp sampler2DArray;
98
103
 
99
- uniform sampler2D heightMap;
104
+ uniform sampler2DArray heightMap;
100
105
  uniform vec2 worldSize;
101
106
  uniform vec2 heightMapSize;
102
107
  uniform int maxMipLevel;
@@ -217,8 +222,18 @@ function AmbientOcclusionShader({ numRays = DEFAULT_NUM_RAYS } = {}) {
217
222
  // Heightmap utilities
218
223
  // ============================================================
219
224
 
225
+ // Sample mip-0 (the original heightmap) at uv. Layer 0 of the
226
+ // 2D array holds the un-reduced heightmap data.
220
227
  float sample_height(vec2 uv) {
221
- return textureLod(heightMap, uv, 0.0).r;
228
+ return texture(heightMap, vec3(uv, 0.0)).r;
229
+ }
230
+
231
+ // Sample max-height at a specific Hi-Z level. Mip k lives in
232
+ // layer k, nearest-upscaled to mip-0 resolution. NearestFilter
233
+ // on the array snaps the layer to integer 'mip' and returns
234
+ // the underlying mip-k texel containing uv.
235
+ float sample_max_height(vec2 uv, int mip) {
236
+ return texture(heightMap, vec3(uv, float(mip))).r;
222
237
  }
223
238
 
224
239
  // Central-difference normal in world space. Faster than building
@@ -293,7 +308,7 @@ function AmbientOcclusionShader({ numRays = DEFAULT_NUM_RAYS } = {}) {
293
308
  float t_exit = min(t_to_boundary.x, t_to_boundary.y) + T_EPS;
294
309
 
295
310
  // Max occluder height in this cell at this mip
296
- float max_h = textureLod(heightMap, cell_center, float(mip)).r;
311
+ float max_h = sample_max_height(cell_center, mip);
297
312
 
298
313
  // Ray height is linear in t, so the minimum across the
299
314
  // cell is at one of the endpoints
@@ -3,7 +3,7 @@
3
3
  * Inspired by OpenGL's glsl sampler2d API
4
4
  * @class
5
5
  * @author Alex Goldring
6
- * @copyright Company Named Limited (c) 2025
6
+ * @copyright Company Named Limited (c) 2026
7
7
  */
8
8
  export class Sampler2D {
9
9
  /**
@@ -24,7 +24,7 @@ import { computeHashFloat } from "../../../../core/primitives/numbers/computeHas
24
24
  * Inspired by OpenGL's glsl sampler2d API
25
25
  * @class
26
26
  * @author Alex Goldring
27
- * @copyright Company Named Limited (c) 2025
27
+ * @copyright Company Named Limited (c) 2026
28
28
  */
29
29
  export class Sampler2D {
30
30
  /**
@@ -5,7 +5,7 @@
5
5
  * @param {number} emptyValue
6
6
  *
7
7
  * @author Alex Goldring
8
- * @copyright Company Named Limited (c) 2025
8
+ * @copyright Company Named Limited (c) 2026
9
9
  */
10
10
  export function computeSignedDistanceField_NaiveFlood(source: Sampler2D, destination: Sampler2D, emptyValue: number): void;
11
11
  //# sourceMappingURL=computeSignedDistanceField_NaiveFlood.d.ts.map
@@ -8,7 +8,7 @@ import { BitSet } from "../../../../../core/binary/BitSet.js";
8
8
  * @param {number} emptyValue
9
9
  *
10
10
  * @author Alex Goldring
11
- * @copyright Company Named Limited (c) 2025
11
+ * @copyright Company Named Limited (c) 2026
12
12
  */
13
13
  export function computeSignedDistanceField_NaiveFlood(
14
14
  source,
@@ -1,25 +1,32 @@
1
1
  /**
2
- * Build a max-reduction mipmap pyramid (Hi-Z–style height buffer) from a
3
- * single-channel float heightmap sampler.
2
+ * Build a max-reduction Hi-Z height pyramid from a single-channel float
3
+ * heightmap sampler.
4
4
  *
5
- * Each mip level k holds, per texel, the maximum height across the 2×2 block
6
- * of level k-1 it covers. A ray trace can then skip whole cells safely: if
7
- * the ray's height is strictly above the cell's max-height at any mip, the
8
- * cell can be advanced past without checking any finer level.
5
+ * Each pyramid level k holds, per texel, the maximum height across the 2×2
6
+ * block of level k-1 it covers. A ray trace can then skip whole cells
7
+ * safely: if the ray's height is strictly above the cell's max-height at
8
+ * any level, the cell can be advanced past without checking any finer level.
9
9
  *
10
- * The returned texture is configured for explicit-LOD sampling
11
- * (`textureLod(tex, uv, mip)`): NearestMipmapNearestFilter + NearestFilter,
12
- * generateMipmaps disabled, custom mipmap chain assigned to `tex.mipmaps`.
10
+ * Storage layout **DataTexture2DArray, one mip per layer**, all layers at
11
+ * full mip-0 resolution. Smaller mips are nearest-upscaled into their layer.
12
+ * The shader samples mip k via `texture(heightMap, vec3(uv, float(k)))`.
13
13
  *
14
- * The level-0 storage is shared (no copy) with `sampler.data`. Higher levels
15
- * are freshly allocated Float32Array data.
14
+ * This sidesteps the three.js r136 bug in `WebGLTextures.uploadTexture`
15
+ * where DataTexture custom mipmap chains are uploaded with `texSubImage2D`
16
+ * called with level hardcoded to 0 — every "mip" smashes the previous one
17
+ * into level 0 and the actual mip levels 1..N are left uninitialized. The
18
+ * 2DArray upload path uses one `texSubImage3D` call to level 0 covering
19
+ * all layers, so it works correctly.
20
+ *
21
+ * Memory cost is (mip_count × W × H × 4) bytes versus (≈ 4/3 × W × H × 4)
22
+ * for a true mip pyramid — about a 3× overhead, traded for correctness.
16
23
  *
17
24
  * Non-power-of-two heightmaps are handled by halving with floor and stopping
18
25
  * once both dimensions reach 1.
19
26
  *
20
27
  * @param {Sampler2D} sampler single-channel Float32 heightmap (itemSize=1)
21
- * @returns {DataTexture} R32F texture with custom mipmap chain
28
+ * @returns {DataTexture2DArray} R32F array texture; depth = mip count
22
29
  */
23
- export function build_max_height_pyramid(sampler: Sampler2D): DataTexture;
24
- import { DataTexture } from "three";
30
+ export function build_max_height_pyramid(sampler: Sampler2D): DataTexture2DArray;
31
+ import { DataTexture2DArray } from "three";
25
32
  //# sourceMappingURL=build_max_height_pyramid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build_max_height_pyramid.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/util/build_max_height_pyramid.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8DAFa,WAAW,CAsEvB;4BA5FM,OAAO"}
1
+ {"version":3,"file":"build_max_height_pyramid.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/util/build_max_height_pyramid.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,8DAFa,kBAAkB,CA2G9B;mCAxI4F,OAAO"}
@@ -1,100 +1,137 @@
1
- import {
2
- ClampToEdgeWrapping,
3
- DataTexture,
4
- FloatType,
5
- NearestFilter,
6
- NearestMipmapNearestFilter,
7
- RedFormat
8
- } from "three";
1
+ import { ClampToEdgeWrapping, DataTexture2DArray, FloatType, NearestFilter, RedFormat } from "three";
9
2
 
10
3
  /**
11
- * Build a max-reduction mipmap pyramid (Hi-Z–style height buffer) from a
12
- * single-channel float heightmap sampler.
4
+ * Build a max-reduction Hi-Z height pyramid from a single-channel float
5
+ * heightmap sampler.
13
6
  *
14
- * Each mip level k holds, per texel, the maximum height across the 2×2 block
15
- * of level k-1 it covers. A ray trace can then skip whole cells safely: if
16
- * the ray's height is strictly above the cell's max-height at any mip, the
17
- * cell can be advanced past without checking any finer level.
7
+ * Each pyramid level k holds, per texel, the maximum height across the 2×2
8
+ * block of level k-1 it covers. A ray trace can then skip whole cells
9
+ * safely: if the ray's height is strictly above the cell's max-height at
10
+ * any level, the cell can be advanced past without checking any finer level.
18
11
  *
19
- * The returned texture is configured for explicit-LOD sampling
20
- * (`textureLod(tex, uv, mip)`): NearestMipmapNearestFilter + NearestFilter,
21
- * generateMipmaps disabled, custom mipmap chain assigned to `tex.mipmaps`.
12
+ * Storage layout **DataTexture2DArray, one mip per layer**, all layers at
13
+ * full mip-0 resolution. Smaller mips are nearest-upscaled into their layer.
14
+ * The shader samples mip k via `texture(heightMap, vec3(uv, float(k)))`.
22
15
  *
23
- * The level-0 storage is shared (no copy) with `sampler.data`. Higher levels
24
- * are freshly allocated Float32Array data.
16
+ * This sidesteps the three.js r136 bug in `WebGLTextures.uploadTexture`
17
+ * where DataTexture custom mipmap chains are uploaded with `texSubImage2D`
18
+ * called with level hardcoded to 0 — every "mip" smashes the previous one
19
+ * into level 0 and the actual mip levels 1..N are left uninitialized. The
20
+ * 2DArray upload path uses one `texSubImage3D` call to level 0 covering
21
+ * all layers, so it works correctly.
22
+ *
23
+ * Memory cost is (mip_count × W × H × 4) bytes versus (≈ 4/3 × W × H × 4)
24
+ * for a true mip pyramid — about a 3× overhead, traded for correctness.
25
25
  *
26
26
  * Non-power-of-two heightmaps are handled by halving with floor and stopping
27
27
  * once both dimensions reach 1.
28
28
  *
29
29
  * @param {Sampler2D} sampler single-channel Float32 heightmap (itemSize=1)
30
- * @returns {DataTexture} R32F texture with custom mipmap chain
30
+ * @returns {DataTexture2DArray} R32F array texture; depth = mip count
31
31
  */
32
32
  export function build_max_height_pyramid(sampler) {
33
33
  const w0 = sampler.width;
34
34
  const h0 = sampler.height;
35
35
 
36
+ // Step 1: build the conventional mip pyramid in JS
36
37
  /** @type {Array<{data: Float32Array, width: number, height: number}>} */
37
- const mipmaps = [];
38
-
39
- // Level 0: reference original data without copying — the heightmap is the
40
- // ground truth and this saves the allocation
41
- let prevW = w0;
42
- let prevH = h0;
43
- let prevData = sampler.data;
44
-
45
- mipmaps.push({ data: prevData, width: prevW, height: prevH });
46
-
47
- while (prevW > 1 || prevH > 1) {
48
- const curW = Math.max(1, prevW >> 1);
49
- const curH = Math.max(1, prevH >> 1);
50
- const curData = new Float32Array(curW * curH);
51
-
52
- // Source rows/cols beyond the last valid index clamp to the edge so
53
- // a dimension that hits 1 early (and stays at 1 while the other
54
- // shrinks) folds rows together rather than reading garbage
55
- const lastSrcX = prevW - 1;
56
- const lastSrcY = prevH - 1;
57
-
58
- for (let y = 0; y < curH; y++) {
59
- const sy0 = y << 1;
60
- const sy1 = Math.min(sy0 + 1, lastSrcY);
61
- const row0 = sy0 * prevW;
62
- const row1 = sy1 * prevW;
63
-
64
- for (let x = 0; x < curW; x++) {
65
- const sx0 = x << 1;
66
- const sx1 = Math.min(sx0 + 1, lastSrcX);
67
-
68
- const a = prevData[row0 + sx0];
69
- const b = prevData[row0 + sx1];
70
- const c = prevData[row1 + sx0];
71
- const d = prevData[row1 + sx1];
72
-
73
- let m = a > b ? a : b;
74
- if (c > m) m = c;
75
- if (d > m) m = d;
76
-
77
- curData[y * curW + x] = m;
38
+ const mips = [];
39
+ mips.push({ data: sampler.data, width: w0, height: h0 });
40
+
41
+ {
42
+ let prevW = w0;
43
+ let prevH = h0;
44
+ let prevData = sampler.data;
45
+
46
+ while (prevW > 1 || prevH > 1) {
47
+ const curW = Math.max(1, prevW >> 1);
48
+ const curH = Math.max(1, prevH >> 1);
49
+ const curData = new Float32Array(curW * curH);
50
+
51
+ const lastSrcX = prevW - 1;
52
+ const lastSrcY = prevH - 1;
53
+
54
+ for (let y = 0; y < curH; y++) {
55
+ const sy0 = y << 1;
56
+ const sy1 = Math.min(sy0 + 1, lastSrcY);
57
+ const row0 = sy0 * prevW;
58
+ const row1 = sy1 * prevW;
59
+
60
+ for (let x = 0; x < curW; x++) {
61
+ const sx0 = x << 1;
62
+ const sx1 = Math.min(sx0 + 1, lastSrcX);
63
+
64
+ const a = prevData[row0 + sx0];
65
+ const b = prevData[row0 + sx1];
66
+ const c = prevData[row1 + sx0];
67
+ const d = prevData[row1 + sx1];
68
+
69
+ let m = a > b ? a : b;
70
+ if (c > m) m = c;
71
+ if (d > m) m = d;
72
+
73
+ curData[y * curW + x] = m;
74
+ }
78
75
  }
76
+
77
+ mips.push({ data: curData, width: curW, height: curH });
78
+
79
+ prevW = curW;
80
+ prevH = curH;
81
+ prevData = curData;
82
+ }
83
+ }
84
+
85
+ // Step 2: pack each mip nearest-upscaled to w0 × h0 as a layer of the
86
+ // array texture. Layer k holds mip k blown up; sampling with NearestFilter
87
+ // at any uv returns mip k's value at that uv exactly.
88
+ const depth = mips.length;
89
+ const layerSize = w0 * h0;
90
+ const layered = new Float32Array(depth * layerSize);
91
+
92
+ for (let k = 0; k < depth; k++) {
93
+ const mip = mips[k];
94
+ const mw = mip.width;
95
+ const mh = mip.height;
96
+ const mdata = mip.data;
97
+
98
+ const layerOffset = k * layerSize;
99
+
100
+ if (mw === w0 && mh === h0) {
101
+ // Level 0 — direct copy
102
+ layered.set(mdata, layerOffset);
103
+ continue;
79
104
  }
80
105
 
81
- mipmaps.push({ data: curData, width: curW, height: curH });
106
+ // Nearest-upscale: dst (x, y) → src (floor(x * mw / w0), floor(y * mh / h0))
107
+ // Works for both POT and NPO2 reductions.
108
+ for (let y = 0; y < h0; y++) {
109
+ const sy = Math.min(mh - 1, ((y * mh) / h0) | 0);
110
+ const srcRow = sy * mw;
111
+ const dstRow = layerOffset + y * w0;
82
112
 
83
- prevW = curW;
84
- prevH = curH;
85
- prevData = curData;
113
+ for (let x = 0; x < w0; x++) {
114
+ const sx = Math.min(mw - 1, ((x * mw) / w0) | 0);
115
+ layered[dstRow + x] = mdata[srcRow + sx];
116
+ }
117
+ }
86
118
  }
87
119
 
88
- const tex = new DataTexture(mipmaps[0].data, w0, h0, RedFormat, FloatType);
89
- tex.mipmaps = mipmaps;
90
- tex.generateMipmaps = false;
91
- tex.minFilter = NearestMipmapNearestFilter;
120
+ const tex = new DataTexture2DArray(layered, w0, h0, depth);
121
+ tex.format = RedFormat;
122
+ tex.type = FloatType;
123
+ tex.internalFormat = 'R32F';
124
+ tex.minFilter = NearestFilter;
92
125
  tex.magFilter = NearestFilter;
93
126
  tex.wrapS = ClampToEdgeWrapping;
94
127
  tex.wrapT = ClampToEdgeWrapping;
95
- tex.internalFormat = 'R32F';
128
+ tex.generateMipmaps = false;
96
129
  tex.flipY = false;
97
130
  tex.needsUpdate = true;
98
131
 
132
+ // Expose the depth so callers can plumb `maxMipLevel` to the shader
133
+ // without re-deriving it
134
+ tex.userData.mipCount = depth;
135
+
99
136
  return tex;
100
137
  }
@@ -4,7 +4,7 @@ import Signal from "../../../core/events/signal/Signal.js";
4
4
  * Representation of an input device key/button
5
5
  *
6
6
  * @author Alex Goldring
7
- * @copyright Company Named Limited (c) 2025
7
+ * @copyright Company Named Limited (c) 2026
8
8
  */
9
9
  export class InputDeviceSwitch {
10
10
 
@@ -17,7 +17,7 @@ const codeToKeyNameMap = [];
17
17
  * For example, if you hold "A" and click over into another application window - A will be forcibly released with appropriate signal.
18
18
  *
19
19
  * @author Alex Goldring
20
- * @copyright Company Named Limited (c) 2025
20
+ * @copyright Company Named Limited (c) 2026
21
21
  */
22
22
  class KeyboardDevice {
23
23
 
@@ -228,7 +228,7 @@ export function readPositionFromMouseEvent(result, event, source = event.target)
228
228
  * Abstracts Mouse and Touch interfaces as single "pointer" device.
229
229
  *
230
230
  * @author Alex Goldring
231
- * @copyright Company Named Limited (c) 2025
231
+ * @copyright Company Named Limited (c) 2026
232
232
  */
233
233
  export class PointerDevice {
234
234
 
@@ -7,7 +7,7 @@ import { BehaviorStatus } from "./BehaviorStatus.js";
7
7
  * @see https://en.wikipedia.org/wiki/Behavior_tree_(artificial_intelligence,_robotics_and_control)
8
8
  * @template CTX
9
9
  * @author Alex Goldring
10
- * @copyright Company Named Limited (c) 2025
10
+ * @copyright Company Named Limited (c) 2026
11
11
  */
12
12
  export class Behavior {
13
13