@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.
- package/README.md +2 -2
- package/build/bundle-worker-image-decoder.js +1 -1
- package/editor/actions/concrete/ActionUpdateTexture.d.ts +12 -0
- package/editor/actions/concrete/ActionUpdateTexture.d.ts.map +1 -0
- package/editor/actions/concrete/ArrayCopyAction.d.ts +20 -0
- package/editor/actions/concrete/ArrayCopyAction.d.ts.map +1 -0
- package/editor/actions/concrete/ComponentRemoveAction.d.ts +11 -0
- package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +1 -0
- package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +47 -0
- package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts.map +1 -0
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +38 -0
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts.map +1 -0
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +23 -0
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts.map +1 -0
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +19 -0
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +1 -0
- package/editor/actions/concrete/SelectionRemoveAction.d.ts +10 -0
- package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +1 -0
- package/editor/actions/concrete/WriteGridValueAction.d.ts +15 -0
- package/editor/actions/concrete/WriteGridValueAction.d.ts.map +1 -0
- package/editor/ecs/component/FieldDescriptor.d.ts +27 -0
- package/editor/ecs/component/FieldDescriptor.d.ts.map +1 -0
- package/editor/ecs/component/FieldValueAdapter.d.ts +7 -0
- package/editor/ecs/component/FieldValueAdapter.d.ts.map +1 -0
- package/editor/ecs/component/createFieldEditor.d.ts +9 -0
- package/editor/ecs/component/createFieldEditor.d.ts.map +1 -0
- package/editor/ecs/component/createObjectEditor.d.ts +14 -0
- package/editor/ecs/component/createObjectEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts.map +1 -1
- package/editor/ecs/component/findNearestRegisteredType.d.ts +8 -0
- package/editor/ecs/component/findNearestRegisteredType.d.ts.map +1 -0
- package/editor/process/ObstacleGridDisplayProcess.d.ts.map +1 -1
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts.map +1 -1
- package/editor/tools/GridPaintTool.d.ts +17 -0
- package/editor/tools/GridPaintTool.d.ts.map +1 -0
- package/editor/tools/SelectionTool.d.ts +27 -0
- package/editor/tools/SelectionTool.d.ts.map +1 -0
- package/editor/tools/TopDownCameraControlTool.d.ts +13 -0
- package/editor/tools/TopDownCameraControlTool.d.ts.map +1 -0
- package/editor/view/ecs/ComponentControlFactory.d.ts.map +1 -0
- package/editor/view/ecs/ComponentControlView.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -0
- package/editor/view/ecs/EntityList.d.ts.map +1 -0
- package/editor/view/ecs/HierarchicalEntityListView.d.ts.map +1 -0
- package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeView.d.ts.map +1 -1
- package/editor/view/node-graph/PortView.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts +1 -1
- package/src/core/binary/BinaryBuffer.js +1 -1
- package/src/core/binary/BitSet.d.ts +1 -1
- package/src/core/binary/BitSet.js +1 -1
- package/src/core/cache/Cache.js +1 -1
- package/src/core/cache/LoadingCache.js +1 -1
- package/src/core/collection/list/List.js +1 -1
- package/src/core/collection/map/HashMap.js +1 -1
- package/src/core/collection/table/RowFirstTable.d.ts +1 -1
- package/src/core/collection/table/RowFirstTable.js +1 -1
- package/src/core/collection/table/RowFirstTableSpec.d.ts +1 -1
- package/src/core/collection/table/RowFirstTableSpec.js +1 -1
- package/src/core/color/oklab/compute_max_saturation.d.ts +1 -1
- package/src/core/color/oklab/compute_max_saturation.js +1 -1
- package/src/core/color/oklab/find_cusp.d.ts +1 -1
- package/src/core/color/oklab/find_cusp.js +1 -1
- package/src/core/color/oklab/find_gamut_intersection.d.ts +1 -1
- package/src/core/color/oklab/find_gamut_intersection.js +1 -1
- package/src/core/color/oklab/okhsv_to_linear_srgb.d.ts +1 -1
- package/src/core/color/oklab/okhsv_to_linear_srgb.js +1 -1
- package/src/core/color/oklab/oklab_to_linear_srgb.d.ts +1 -1
- package/src/core/color/oklab/oklab_to_linear_srgb.js +1 -1
- package/src/core/color/oklab/oklab_to_xyz.d.ts +1 -1
- package/src/core/color/oklab/oklab_to_xyz.js +1 -1
- package/src/core/color/oklab/xyz_to_oklab.d.ts +1 -1
- package/src/core/color/oklab/xyz_to_oklab.js +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.js +57 -65
- package/src/core/geom/3d/octahedra/octahedral_uv_wrap.d.ts +1 -1
- package/src/core/geom/3d/octahedra/octahedral_uv_wrap.js +1 -1
- package/src/core/geom/3d/quaternion/quat_decode_from_uint32.d.ts +1 -1
- package/src/core/geom/3d/quaternion/quat_decode_from_uint32.js +1 -1
- package/src/core/geom/3d/quaternion/quat_encode_to_uint32.d.ts +1 -1
- package/src/core/geom/3d/quaternion/quat_encode_to_uint32.js +1 -1
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts +74 -3
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +37 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.js +210 -0
- package/src/core/geom/3d/shape/PointShape3D.d.ts +5 -0
- package/src/core/geom/3d/shape/PointShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/PointShape3D.js +52 -14
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts +75 -12
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +12 -3
- package/src/core/geom/3d/shape/UnionShape3D.d.ts +47 -5
- package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +12 -5
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +17 -5
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/shape_to_type.js +4 -1
- package/src/core/geom/3d/shape/json/type_adapters.d.ts +17 -2
- package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/type_adapters.js +18 -2
- package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.d.ts.map +1 -1
- package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.js +51 -48
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.d.ts +1 -1
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +1 -1
- package/src/core/geom/ConicRay.d.ts +1 -1
- package/src/core/geom/ConicRay.js +1 -1
- package/src/core/geom/Quaternion.d.ts +2 -2
- package/src/core/geom/Quaternion.js +2 -2
- package/src/core/geom/Vector1.d.ts +1 -1
- package/src/core/geom/Vector1.js +1 -1
- package/src/core/geom/Vector2.d.ts +1 -1
- package/src/core/geom/Vector2.js +1 -1
- package/src/core/geom/Vector3.d.ts +1 -1
- package/src/core/geom/Vector3.js +1 -1
- package/src/core/geom/packing/miniball/Miniball.d.ts +1 -1
- package/src/core/geom/packing/miniball/Miniball.js +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_decode.d.ts +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_decode.js +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_encode.d.ts +1 -1
- package/src/core/geom/vec3/serialization/v3_binary_equality_encode.js +1 -1
- package/src/core/math/spline/spline3_hermite.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite.js +1 -1
- package/src/core/math/spline/spline3_hermite_bounds.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite_bounds.js +1 -1
- package/src/core/math/spline/spline3_hermite_bounds_t.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite_bounds_t.js +1 -1
- package/src/core/math/spline/spline3_hermite_to_monomial.d.ts +1 -1
- package/src/core/math/spline/spline3_hermite_to_monomial.js +1 -1
- package/src/core/model/ObservedBoolean.d.ts +1 -1
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/ObservedString.d.ts +1 -1
- package/src/core/model/ObservedString.js +1 -1
- package/src/core/process/undo/Action.js +1 -1
- package/src/core/process/undo/ActionProcessor.js +1 -1
- package/src/engine/animation/curve/AnimationCurve.d.ts +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +1 -1
- package/src/engine/animation/curve/Keyframe.d.ts +1 -1
- package/src/engine/animation/curve/Keyframe.js +1 -1
- package/src/engine/animation/curve/animation_curve_compute_aabb.d.ts +1 -1
- package/src/engine/animation/curve/animation_curve_compute_aabb.js +1 -1
- package/src/engine/animation/curve/animation_curve_optimize.d.ts +1 -1
- package/src/engine/animation/curve/animation_curve_optimize.js +2 -2
- package/src/engine/asset/loaders/image/jpeg/JpegImage.js +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +27 -7
- package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -1
- package/src/engine/asset/loaders/image/png/crc32.js +1 -1
- package/src/engine/control/first-person/DESIGN.md +616 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +229 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.js +176 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +251 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +205 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +151 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +799 -0
- package/src/engine/control/first-person/math/computeJumpFromApex.d.ts +23 -0
- package/src/engine/control/first-person/math/computeJumpFromApex.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeJumpFromApex.js +23 -0
- package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts +23 -0
- package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts.map +1 -0
- package/src/engine/control/first-person/math/criticallyDampedSpring.js +34 -0
- package/src/engine/control/first-person/math/dampedSpringStep.d.ts +23 -0
- package/src/engine/control/first-person/math/dampedSpringStep.d.ts.map +1 -0
- package/src/engine/control/first-person/math/dampedSpringStep.js +72 -0
- package/src/engine/control/first-person/math/stepTowards.d.ts +12 -0
- package/src/engine/control/first-person/math/stepTowards.d.ts.map +1 -0
- package/src/engine/control/first-person/math/stepTowards.js +20 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +69 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.js +91 -0
- package/src/engine/control/first-person/prototype_first_person_controller.d.ts +2 -0
- package/src/engine/control/first-person/prototype_first_person_controller.d.ts.map +1 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +314 -0
- package/src/engine/ecs/Entity.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +1 -1
- package/src/engine/ecs/EntityManager.d.ts +1 -1
- package/src/engine/ecs/EntityManager.js +1 -1
- package/src/engine/ecs/EntityObserver.js +1 -1
- package/src/engine/ecs/EntityReference.d.ts +1 -1
- package/src/engine/ecs/EntityReference.js +1 -1
- package/src/engine/ecs/System.js +1 -1
- package/src/engine/ecs/attachment/AttachmentSystem.d.ts +2 -2
- package/src/engine/ecs/attachment/AttachmentSystem.d.ts.map +1 -1
- package/src/engine/ecs/grid/HeightMap2AOMap.d.ts.map +1 -1
- package/src/engine/ecs/grid/HeightMap2AOMap.js +3 -2
- package/src/engine/ecs/guid/UUID.d.ts +1 -1
- package/src/engine/ecs/guid/UUID.js +1 -1
- package/src/engine/ecs/name/Name.d.ts +1 -1
- package/src/engine/ecs/name/Name.js +1 -1
- package/src/engine/ecs/parent/ParentEntity.js +1 -1
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.d.ts +1 -1
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +1 -1
- package/src/engine/ecs/storage/BinaryBufferSerializer.d.ts +1 -1
- package/src/engine/ecs/storage/BinaryBufferSerializer.js +1 -1
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.d.ts +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +1 -1
- package/src/engine/ecs/transform/Transform.d.ts +1 -1
- package/src/engine/ecs/transform/Transform.js +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +10 -1
- package/src/engine/graphics/impostors/voxel/README.md +149 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts +91 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +376 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts +128 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.js +141 -0
- package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts +38 -0
- package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.js +338 -0
- package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts +43 -0
- package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.js +192 -0
- package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts +2 -0
- package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.js +343 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts +13 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.js +99 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts +19 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.js +231 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts +5 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.js +70 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts +13 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.js +127 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts +5 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.js +68 -0
- package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts +27 -0
- package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts.map +1 -0
- package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.js +96 -0
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts +113 -29
- package/src/engine/graphics/render/forward_plus/SPECIFICATION.md +1 -1
- package/src/engine/graphics/shaders/AmbientOcclusionShader.d.ts.map +1 -1
- package/src/engine/graphics/shaders/AmbientOcclusionShader.js +20 -5
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.d.ts +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.js +1 -1
- package/src/engine/graphics/util/build_max_height_pyramid.d.ts +21 -14
- package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
- package/src/engine/graphics/util/build_max_height_pyramid.js +107 -70
- package/src/engine/input/devices/InputDeviceSwitch.js +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +1 -1
- package/src/engine/input/devices/PointerDevice.js +1 -1
- package/src/engine/intelligence/behavior/Behavior.js +1 -1
- package/src/engine/intelligence/behavior/SelectorBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/SelectorBehavior.js +1 -1
- package/src/engine/intelligence/behavior/behavior_to_dot.d.ts +1 -1
- package/src/engine/intelligence/behavior/behavior_to_dot.js +1 -1
- package/src/engine/intelligence/behavior/composite/CompositeBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/composite/CompositeBehavior.js +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.js +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.js +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.js +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.js +1 -1
- package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/DieBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/EntityBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/KillBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.js +1 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/FailingBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.js +1 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.js +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/BranchBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/DelayBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/LogMessageBehavior.js +1 -1
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.js +1 -1
- package/src/engine/intelligence/blackboard/Blackboard.js +1 -1
- package/src/engine/intelligence/mcts/MonteCarlo.d.ts +1 -1
- package/src/engine/intelligence/mcts/MonteCarlo.js +1 -1
- package/src/engine/intelligence/mcts/MoveEdge.d.ts +1 -1
- package/src/engine/intelligence/mcts/MoveEdge.js +1 -1
- package/src/engine/intelligence/mcts/StateNode.d.ts +1 -1
- package/src/engine/intelligence/mcts/StateNode.js +1 -1
- package/src/engine/intelligence/resource/ActionSequence.d.ts +1 -1
- package/src/engine/intelligence/resource/ActionSequence.js +1 -1
- package/src/engine/intelligence/resource/Resource.d.ts +1 -1
- package/src/engine/intelligence/resource/Resource.js +1 -1
- package/src/engine/intelligence/resource/ResourceAllocation.d.ts +1 -1
- package/src/engine/intelligence/resource/ResourceAllocation.js +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationBid.d.ts +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationBid.js +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationSolver.d.ts +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationSolver.js +1 -1
- package/src/engine/intelligence/resource/StrategicResourceAllocator.d.ts +1 -1
- package/src/engine/intelligence/resource/StrategicResourceAllocator.js +1 -1
- package/src/engine/intelligence/resource/TacticalModule.d.ts +1 -1
- package/src/engine/intelligence/resource/TacticalModule.js +1 -1
- package/src/engine/network/NetworkSession.d.ts +1 -1
- package/src/engine/network/NetworkSession.js +1 -1
- package/src/engine/network/adapters/QuaternionInterpolationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/QuaternionInterpolationAdapter.js +1 -1
- package/src/engine/network/adapters/TransformInterpolationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/TransformInterpolationAdapter.js +1 -1
- package/src/engine/network/adapters/TransformReplicationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/TransformReplicationAdapter.js +1 -1
- package/src/engine/network/adapters/Vector3InterpolationAdapter.d.ts +1 -1
- package/src/engine/network/adapters/Vector3InterpolationAdapter.js +1 -1
- package/src/engine/network/core/quantize/quantize_float.d.ts +1 -1
- package/src/engine/network/core/quantize/quantize_float.js +1 -1
- package/src/engine/network/core/quantize/quantize_position.d.ts +1 -1
- package/src/engine/network/core/quantize/quantize_position.js +1 -1
- package/src/engine/network/core/sequence/ack_bitfield.d.ts +1 -1
- package/src/engine/network/core/sequence/ack_bitfield.js +1 -1
- package/src/engine/network/core/sequence/seq16.d.ts +1 -1
- package/src/engine/network/core/sequence/seq16.js +1 -1
- package/src/engine/network/core/sequence/seq32.d.ts +1 -1
- package/src/engine/network/core/sequence/seq32.js +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
- package/src/engine/network/diagnostics/ReplayLog.d.ts +1 -1
- package/src/engine/network/diagnostics/ReplayLog.js +1 -1
- package/src/engine/network/diagnostics/SyncTest.d.ts +1 -1
- package/src/engine/network/diagnostics/SyncTest.js +1 -1
- package/src/engine/network/ecs/NetworkSystem.d.ts +1 -1
- package/src/engine/network/ecs/NetworkSystem.js +1 -1
- package/src/engine/network/ecs/components/NetworkIdentity.d.ts +1 -1
- package/src/engine/network/ecs/components/NetworkIdentity.js +1 -1
- package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts +1 -1
- package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.js +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.d.ts +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +1 -1
- package/src/engine/network/replication/Replicator.d.ts +1 -1
- package/src/engine/network/replication/Replicator.js +1 -1
- package/src/engine/network/replication/ScopeFilter.d.ts +2 -2
- package/src/engine/network/replication/ScopeFilter.js +2 -2
- package/src/engine/network/sim/ActionLog.d.ts +1 -1
- package/src/engine/network/sim/ActionLog.js +1 -1
- package/src/engine/network/sim/BinaryInterpolationAdapter.d.ts +1 -1
- package/src/engine/network/sim/BinaryInterpolationAdapter.js +1 -1
- package/src/engine/network/sim/InterpolationLog.d.ts +1 -1
- package/src/engine/network/sim/InterpolationLog.js +1 -1
- package/src/engine/network/sim/ReplicatedComponentRegistry.d.ts +1 -1
- package/src/engine/network/sim/ReplicatedComponentRegistry.js +1 -1
- package/src/engine/network/sim/RewindEngine.d.ts +1 -1
- package/src/engine/network/sim/RewindEngine.js +1 -1
- package/src/engine/network/sim/SimAction.d.ts +1 -1
- package/src/engine/network/sim/SimAction.js +1 -1
- package/src/engine/network/sim/SimActionExecutor.d.ts +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +1 -1
- package/src/engine/network/sim/SimActionRegistry.d.ts +1 -1
- package/src/engine/network/sim/SimActionRegistry.js +1 -1
- package/src/engine/network/sim/SmoothingState.js +1 -1
- package/src/engine/network/sim/Snapshotter.d.ts +1 -1
- package/src/engine/network/sim/Snapshotter.js +1 -1
- package/src/engine/network/sim/SpeculationLog.d.ts +1 -1
- package/src/engine/network/sim/SpeculationLog.js +1 -1
- package/src/engine/network/state/Baseline.d.ts +1 -1
- package/src/engine/network/state/Baseline.js +1 -1
- package/src/engine/network/state/ChangedEntitySet.d.ts +1 -1
- package/src/engine/network/state/ChangedEntitySet.js +1 -1
- package/src/engine/network/state/InputRing.d.ts +1 -1
- package/src/engine/network/state/InputRing.js +1 -1
- package/src/engine/network/state/MutationLedger.d.ts +1 -1
- package/src/engine/network/state/MutationLedger.js +1 -1
- package/src/engine/network/state/PriorityAccumulator.d.ts +1 -1
- package/src/engine/network/state/PriorityAccumulator.js +1 -1
- package/src/engine/network/state/ReplicationSlotTable.d.ts +1 -1
- package/src/engine/network/state/ReplicationSlotTable.js +1 -1
- package/src/engine/network/time/AdaptiveRenderDelay.d.ts +1 -1
- package/src/engine/network/time/AdaptiveRenderDelay.js +1 -1
- package/src/engine/network/time/JitterBuffer.d.ts +1 -1
- package/src/engine/network/time/JitterBuffer.js +1 -1
- package/src/engine/network/time/TimeDilation.d.ts +1 -1
- package/src/engine/network/time/TimeDilation.js +1 -1
- package/src/engine/network/time/TimeSync.d.ts +1 -1
- package/src/engine/network/time/TimeSync.js +1 -1
- package/src/engine/network/transport/Channel.d.ts.map +1 -1
- package/src/engine/network/transport/Channel.js +3 -6
- package/src/engine/network/transport/LoopbackTransport.d.ts +1 -1
- package/src/engine/network/transport/LoopbackTransport.js +1 -1
- package/src/engine/network/transport/ReliableCommandPipeline.d.ts +1 -1
- package/src/engine/network/transport/ReliableCommandPipeline.js +1 -1
- package/src/engine/network/transport/Transport.d.ts +1 -1
- package/src/engine/network/transport/Transport.js +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.js +2 -2
- package/src/engine/network/transport/adapters/SimulatedTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/SimulatedTransport.js +1 -1
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +1 -1
- package/src/engine/network/transport/adapters/WebSocketTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/WebSocketTransport.js +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.d.ts +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.js +1 -1
- package/src/engine/network/transport/fragments/FragmentAssembler.d.ts +1 -1
- package/src/engine/network/transport/fragments/FragmentAssembler.js +1 -1
- package/src/engine/network/transport/fragments/FragmentRetention.d.ts +1 -1
- package/src/engine/network/transport/fragments/FragmentRetention.js +1 -1
- package/src/engine/network/transport/fragments/packet_size.d.ts +1 -1
- package/src/engine/network/transport/fragments/packet_size.js +1 -1
- package/src/engine/simulation/Ticker.d.ts +1 -1
- package/src/engine/simulation/Ticker.js +1 -1
- package/src/engine/sound/SoundEngine.js +1 -1
- package/src/engine/ui/DraggableAspect.d.ts +1 -1
- package/src/engine/ui/DraggableAspect.js +1 -1
- package/src/view/View.js +1 -1
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { BoxGeometry, MeshStandardMaterial } from "three";
|
|
2
|
+
import Vector2 from "../../../core/geom/Vector2.js";
|
|
3
|
+
import Vector3 from "../../../core/geom/Vector3.js";
|
|
4
|
+
import { SerializationMetadata } from "../../ecs/components/SerializationMetadata.js";
|
|
5
|
+
import { Tag } from "../../ecs/components/Tag.js";
|
|
6
|
+
import Entity from "../../ecs/Entity.js";
|
|
7
|
+
import { Transform } from "../../ecs/transform/Transform.js";
|
|
8
|
+
import { EngineHarness } from "../../EngineHarness.js";
|
|
9
|
+
import { CameraSystem } from "../../graphics/ecs/camera/CameraSystem.js";
|
|
10
|
+
import { ShadedGeometry } from "../../graphics/ecs/mesh-v2/ShadedGeometry.js";
|
|
11
|
+
import { ShadedGeometryFlags } from "../../graphics/ecs/mesh-v2/ShadedGeometryFlags.js";
|
|
12
|
+
import { ShadedGeometrySystem } from "../../graphics/ecs/mesh-v2/ShadedGeometrySystem.js";
|
|
13
|
+
import InputController from "../../input/ecs/components/InputController.js";
|
|
14
|
+
import InputControllerSystem from "../../input/ecs/systems/InputControllerSystem.js";
|
|
15
|
+
import { FirstPersonPlayerController } from "./FirstPersonPlayerController.js";
|
|
16
|
+
import { FirstPersonPlayerControllerSystem } from "./FirstPersonPlayerControllerSystem.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Prototype harness for {@link FirstPersonPlayerController}.
|
|
20
|
+
*
|
|
21
|
+
* Controls:
|
|
22
|
+
* - Click to capture mouse (pointer lock); ESC to release
|
|
23
|
+
* - WASD — move
|
|
24
|
+
* - Mouse — look
|
|
25
|
+
* - Space — jump (tap; holding does not auto-repeat)
|
|
26
|
+
* - Shift — sprint (hold while moving forward)
|
|
27
|
+
* - C — crouch (hold)
|
|
28
|
+
*
|
|
29
|
+
* Scene: a flat ground at y=0 with a handful of coloured cubes for spatial
|
|
30
|
+
* reference, lit by the harness's default sun.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
const eh = new EngineHarness();
|
|
34
|
+
|
|
35
|
+
async function main(engine) {
|
|
36
|
+
const em = engine.entityManager;
|
|
37
|
+
const ecd = engine.entityManager.dataset;
|
|
38
|
+
|
|
39
|
+
// -- Systems ---------------------------------------------------------
|
|
40
|
+
EngineHarness.addFpsCounter(engine);
|
|
41
|
+
|
|
42
|
+
await EngineHarness.buildLights({
|
|
43
|
+
engine,
|
|
44
|
+
sunIntensity: 1.0,
|
|
45
|
+
ambientIntensity: 0.25,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (em.getSystem(CameraSystem) === null) {
|
|
49
|
+
await em.addSystem(new CameraSystem(engine.graphics));
|
|
50
|
+
}
|
|
51
|
+
if (em.getSystem(InputControllerSystem) === null) {
|
|
52
|
+
await em.addSystem(new InputControllerSystem(engine.devices));
|
|
53
|
+
}
|
|
54
|
+
if (em.getSystem(ShadedGeometrySystem) === null) {
|
|
55
|
+
await em.addSystem(new ShadedGeometrySystem(engine));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const fpsSystem = new FirstPersonPlayerControllerSystem();
|
|
59
|
+
fpsSystem.useBuiltInFlatGround = true;
|
|
60
|
+
fpsSystem.groundY = 0;
|
|
61
|
+
await em.addSystem(fpsSystem);
|
|
62
|
+
|
|
63
|
+
if (!ecd.isComponentTypeRegistered(Tag)) {
|
|
64
|
+
ecd.registerComponentType(Tag);
|
|
65
|
+
}
|
|
66
|
+
if (!ecd.isComponentTypeRegistered(SerializationMetadata)) {
|
|
67
|
+
ecd.registerComponentType(SerializationMetadata);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// -- World -----------------------------------------------------------
|
|
71
|
+
await EngineHarness.buildTerrain({
|
|
72
|
+
engine,
|
|
73
|
+
size: new Vector2(200, 200),
|
|
74
|
+
resolution: 8,
|
|
75
|
+
enableWater: false,
|
|
76
|
+
diffuse0: "data/textures/materials/terrain_township_set/512/Grass_3.png",
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
addReferenceMarkers(ecd);
|
|
80
|
+
|
|
81
|
+
// -- Player ----------------------------------------------------------
|
|
82
|
+
const player = buildPlayerEntity(ecd);
|
|
83
|
+
|
|
84
|
+
// -- Inputs ----------------------------------------------------------
|
|
85
|
+
buildInputBindings(ecd, player);
|
|
86
|
+
|
|
87
|
+
setupPointerLock(engine);
|
|
88
|
+
|
|
89
|
+
logHelp();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @param {EntityComponentDataset} ecd
|
|
94
|
+
* @returns {{entity:number, controller:FirstPersonPlayerController}}
|
|
95
|
+
*/
|
|
96
|
+
function buildPlayerEntity(ecd) {
|
|
97
|
+
const transform = new Transform();
|
|
98
|
+
// Spawn standing on the ground (body origin sits at the feet)
|
|
99
|
+
transform.position.set(100, 0, 100);
|
|
100
|
+
|
|
101
|
+
const controller = new FirstPersonPlayerController();
|
|
102
|
+
// Most tuning lives at config defaults; mass-tweak example shown for
|
|
103
|
+
// documentation. Comment out for the default soldier feel.
|
|
104
|
+
// controller.config.body.mass = 120;
|
|
105
|
+
// controller.config.bob.verticalAmpAtWalk = 0.08;
|
|
106
|
+
|
|
107
|
+
const eb = new Entity()
|
|
108
|
+
.add(transform)
|
|
109
|
+
.add(controller)
|
|
110
|
+
.add(Tag.fromJSON(["Player"]))
|
|
111
|
+
.add(SerializationMetadata.Transient);
|
|
112
|
+
|
|
113
|
+
eb.build(ecd);
|
|
114
|
+
|
|
115
|
+
return { entity: eb.id, controller };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Wire keyboard + mouse to the controller's intent surface. Uses the same
|
|
120
|
+
* `InputController` plumbing as the orbital-camera controller, so the
|
|
121
|
+
* standard `InputControllerSystem` does the device subscription bookkeeping.
|
|
122
|
+
*
|
|
123
|
+
* @param {EntityComponentDataset} ecd
|
|
124
|
+
* @param {{entity:number, controller:FirstPersonPlayerController}} player
|
|
125
|
+
*/
|
|
126
|
+
function buildInputBindings(ecd, player) {
|
|
127
|
+
const ic = new InputController();
|
|
128
|
+
const intent = player.controller.intent;
|
|
129
|
+
|
|
130
|
+
// Mouse sensitivity — radians of view rotation per pixel of mouse delta.
|
|
131
|
+
// ~1200px sweep = one full 360° turn. Comparable to Source-engine
|
|
132
|
+
// "sensitivity 2" at 800 DPI; calmer than typical web demos.
|
|
133
|
+
const SENSITIVITY = (Math.PI * 2) / 1200;
|
|
134
|
+
|
|
135
|
+
// -- WASD movement --------------------------------------------------
|
|
136
|
+
// Keep a small "held" mirror so we can recompute intent.move whenever
|
|
137
|
+
// any of the four keys change. We can't read intent.move directly
|
|
138
|
+
// because both keys can be pressed simultaneously.
|
|
139
|
+
const held = { w: false, a: false, s: false, d: false };
|
|
140
|
+
|
|
141
|
+
function recomputeMove() {
|
|
142
|
+
let mx = 0, my = 0;
|
|
143
|
+
if (held.d) mx += 1;
|
|
144
|
+
if (held.a) mx -= 1;
|
|
145
|
+
if (held.w) my += 1;
|
|
146
|
+
if (held.s) my -= 1;
|
|
147
|
+
intent.move.set(mx, my);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function bindMoveKey(key, prop) {
|
|
151
|
+
ic.bind(`keyboard/keys/${key}/down`, () => { held[prop] = true; recomputeMove(); });
|
|
152
|
+
ic.bind(`keyboard/keys/${key}/up`, () => { held[prop] = false; recomputeMove(); });
|
|
153
|
+
}
|
|
154
|
+
bindMoveKey("w", "w");
|
|
155
|
+
bindMoveKey("a", "a");
|
|
156
|
+
bindMoveKey("s", "s");
|
|
157
|
+
bindMoveKey("d", "d");
|
|
158
|
+
|
|
159
|
+
// -- Jump (hold-state; the system does the edge detection) -----------
|
|
160
|
+
ic.bind("keyboard/keys/space/down", () => { intent.jump = true; });
|
|
161
|
+
ic.bind("keyboard/keys/space/up", () => { intent.jump = false; });
|
|
162
|
+
|
|
163
|
+
// -- Sprint ----------------------------------------------------------
|
|
164
|
+
ic.bind("keyboard/keys/shift/down", () => { intent.sprint = true; });
|
|
165
|
+
ic.bind("keyboard/keys/shift/up", () => { intent.sprint = false; });
|
|
166
|
+
|
|
167
|
+
// -- Crouch ----------------------------------------------------------
|
|
168
|
+
ic.bind("keyboard/keys/c/down", () => { intent.crouch = true; });
|
|
169
|
+
ic.bind("keyboard/keys/c/up", () => { intent.crouch = false; });
|
|
170
|
+
|
|
171
|
+
// -- Mouse look ------------------------------------------------------
|
|
172
|
+
// Only accumulate look delta while the pointer is captured — otherwise
|
|
173
|
+
// moving the cursor over the page would steer the camera, which is
|
|
174
|
+
// jarring before the user has "claimed" the input surface.
|
|
175
|
+
ic.bind("pointer/on/move", (position, event, delta) => {
|
|
176
|
+
if (document.pointerLockElement === null) return;
|
|
177
|
+
intent.look._add(delta.x * SENSITIVITY, delta.y * SENSITIVITY);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// When the InputController unlinks (e.g. system shutdown), zero
|
|
181
|
+
// everything so a held key doesn't get stuck.
|
|
182
|
+
ic.on.unlinked.add(() => {
|
|
183
|
+
intent.move.set(0, 0);
|
|
184
|
+
intent.look.set(0, 0);
|
|
185
|
+
intent.jump = false;
|
|
186
|
+
intent.crouch = false;
|
|
187
|
+
intent.sprint = false;
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
new Entity()
|
|
191
|
+
.add(ic)
|
|
192
|
+
.add(Tag.fromJSON(["FirstPersonInputBindings"]))
|
|
193
|
+
.add(SerializationMetadata.Transient)
|
|
194
|
+
.build(ecd);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Click to capture; ESC (or other browser-default) to release.
|
|
199
|
+
* @param {Engine} engine
|
|
200
|
+
*/
|
|
201
|
+
function setupPointerLock(engine) {
|
|
202
|
+
const el = engine.graphics.domElement;
|
|
203
|
+
|
|
204
|
+
// The harness wires the engine into the page body via viewStack; the
|
|
205
|
+
// canvas is the actual pointer-lock target. Listen on the viewStack
|
|
206
|
+
// element so clicks anywhere inside the canvas trigger the request.
|
|
207
|
+
const captureEl = engine.viewStack.el;
|
|
208
|
+
|
|
209
|
+
captureEl.addEventListener("click", () => {
|
|
210
|
+
if (document.pointerLockElement !== el && el.requestPointerLock) {
|
|
211
|
+
el.requestPointerLock();
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Suppress the right-click context menu so the canvas stays usable.
|
|
216
|
+
captureEl.addEventListener("contextmenu", (e) => e.preventDefault());
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Spawn a handful of marker entities around the player so motion is
|
|
221
|
+
* visually obvious. All markers go through the standard ECS pipeline
|
|
222
|
+
* (Transform + ShadedGeometry) — same path as gameplay geometry — so
|
|
223
|
+
* shadows and lighting work correctly.
|
|
224
|
+
*
|
|
225
|
+
* @param {EntityComponentDataset} ecd
|
|
226
|
+
*/
|
|
227
|
+
function addReferenceMarkers(ecd) {
|
|
228
|
+
const SPAWN_X = 100, SPAWN_Z = 100;
|
|
229
|
+
|
|
230
|
+
// Share one unit-cube geometry across the ring cubes — cheap and lets
|
|
231
|
+
// the renderer's instancing path kick in if it wants.
|
|
232
|
+
const unitCubeGeom = new BoxGeometry(1, 1, 1);
|
|
233
|
+
const palette = [0xff5555, 0x55ff55, 0x5577ff, 0xffaa44, 0xaa55ff, 0x44ddee, 0xff66cc, 0x66ffcc];
|
|
234
|
+
|
|
235
|
+
// Ring of coloured cubes at radius 6 — circle-strafe targets.
|
|
236
|
+
const RING_N = 8;
|
|
237
|
+
for (let i = 0; i < RING_N; i++) {
|
|
238
|
+
const a = (i / RING_N) * Math.PI * 2;
|
|
239
|
+
spawnMarker({
|
|
240
|
+
ecd,
|
|
241
|
+
geometry: unitCubeGeom,
|
|
242
|
+
color: palette[i % palette.length],
|
|
243
|
+
roughness: 0.8,
|
|
244
|
+
position: new Vector3(SPAWN_X + Math.cos(a) * 6, 0.5, SPAWN_Z + Math.sin(a) * 6),
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Tall pillars further out — for parallax depth-perception while
|
|
249
|
+
// testing bob and breath at distance.
|
|
250
|
+
const pillarGeom = new BoxGeometry(1, 6, 1);
|
|
251
|
+
const PILLAR_N = 6;
|
|
252
|
+
for (let i = 0; i < PILLAR_N; i++) {
|
|
253
|
+
const a = (i / PILLAR_N) * Math.PI * 2 + 0.3;
|
|
254
|
+
const r = 22;
|
|
255
|
+
spawnMarker({
|
|
256
|
+
ecd,
|
|
257
|
+
geometry: pillarGeom,
|
|
258
|
+
color: 0x888888,
|
|
259
|
+
roughness: 0.9,
|
|
260
|
+
position: new Vector3(SPAWN_X + Math.cos(a) * r, 3, SPAWN_Z + Math.sin(a) * r),
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// A low platform next to spawn — easy hop target, plus a chance to see
|
|
265
|
+
// the landing dip when stepping back down.
|
|
266
|
+
spawnMarker({
|
|
267
|
+
ecd,
|
|
268
|
+
geometry: new BoxGeometry(2, 0.4, 2),
|
|
269
|
+
color: 0xddddee,
|
|
270
|
+
roughness: 0.7,
|
|
271
|
+
position: new Vector3(SPAWN_X + 3, 0.2, SPAWN_Z),
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @param {object} p
|
|
277
|
+
* @param {EntityComponentDataset} p.ecd
|
|
278
|
+
* @param {THREE.BufferGeometry} p.geometry
|
|
279
|
+
* @param {number} p.color Hex color, e.g. 0xff5555
|
|
280
|
+
* @param {number} [p.roughness]
|
|
281
|
+
* @param {Vector3} p.position
|
|
282
|
+
*/
|
|
283
|
+
function spawnMarker({ ecd, geometry, color, roughness = 0.8, position }) {
|
|
284
|
+
const material = new MeshStandardMaterial({ color, roughness });
|
|
285
|
+
const sg = ShadedGeometry.from(geometry, material);
|
|
286
|
+
sg.setFlag(ShadedGeometryFlags.CastShadow);
|
|
287
|
+
sg.setFlag(ShadedGeometryFlags.ReceiveShadow);
|
|
288
|
+
sg.setFlag(ShadedGeometryFlags.Visible);
|
|
289
|
+
|
|
290
|
+
const transform = new Transform();
|
|
291
|
+
transform.position.copy(position);
|
|
292
|
+
|
|
293
|
+
new Entity()
|
|
294
|
+
.add(transform)
|
|
295
|
+
.add(sg)
|
|
296
|
+
.add(Tag.fromJSON(["ReferenceMarker"]))
|
|
297
|
+
.add(SerializationMetadata.Transient)
|
|
298
|
+
.build(ecd);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function logHelp() {
|
|
302
|
+
/* eslint-disable no-console */
|
|
303
|
+
console.log("%cFirstPersonPlayerController prototype",
|
|
304
|
+
"color:#88ddff;font-weight:bold;font-size:14px");
|
|
305
|
+
console.log("Click the canvas to capture mouse. ESC to release.");
|
|
306
|
+
console.log("WASD = move | Mouse = look | Space = jump | Shift = sprint | C = crouch");
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
async function init() {
|
|
310
|
+
await eh.initialize();
|
|
311
|
+
await main(eh.engine);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
init();
|
package/src/engine/ecs/Entity.js
CHANGED
|
@@ -140,7 +140,7 @@ const scratch_args = [];
|
|
|
140
140
|
*
|
|
141
141
|
* @see https://en.wikipedia.org/wiki/Entity_component_system
|
|
142
142
|
* @author Alex Goldring
|
|
143
|
-
* @copyright Company Named Limited (c)
|
|
143
|
+
* @copyright Company Named Limited (c) 2026
|
|
144
144
|
*/
|
|
145
145
|
export class EntityComponentDataset {
|
|
146
146
|
|
|
@@ -7,7 +7,7 @@ import { BitSet } from "../../core/binary/BitSet.js";
|
|
|
7
7
|
* see {@link EntityComponentDataset.addObserver}/{@link EntityComponentDataset.removeObserver}.
|
|
8
8
|
*
|
|
9
9
|
* @author Alex Goldring
|
|
10
|
-
* @copyright Company Named Limited (c)
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
11
|
*/
|
|
12
12
|
export class EntityObserver {
|
|
13
13
|
/**
|
package/src/engine/ecs/System.js
CHANGED
|
@@ -13,7 +13,7 @@ import { ResourceAccessKind } from "../../core/model/ResourceAccessKind.js";
|
|
|
13
13
|
* @template C
|
|
14
14
|
*
|
|
15
15
|
* @author Alex Goldring
|
|
16
|
-
* @copyright Company Named Limited (c)
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* class FallDamageSystem{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export class AttachmentSystem extends System<any, any, any, any, any> {
|
|
2
2
|
constructor();
|
|
3
3
|
dependencies: (typeof Transform | typeof Attachment)[];
|
|
4
|
-
components_used: (ResourceAccessSpecification<typeof
|
|
4
|
+
components_used: (ResourceAccessSpecification<typeof Transform> | ResourceAccessSpecification<typeof AttachmentSockets> | ResourceAccessSpecification<typeof Mesh>)[];
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
7
|
* @type {number[]}
|
|
@@ -55,7 +55,7 @@ export class AttachmentSystem extends System<any, any, any, any, any> {
|
|
|
55
55
|
import { System } from "../System.js";
|
|
56
56
|
import { Transform } from "../transform/Transform.js";
|
|
57
57
|
import { Attachment } from "./Attachment.js";
|
|
58
|
-
import { AttachmentSockets } from "../sockets/AttachmentSockets.js";
|
|
59
58
|
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
59
|
+
import { AttachmentSockets } from "../sockets/AttachmentSockets.js";
|
|
60
60
|
import Mesh from "../../graphics/ecs/mesh/Mesh.js";
|
|
61
61
|
//# sourceMappingURL=AttachmentSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/attachment/AttachmentSystem.js"],"names":[],"mappings":"AAWA;IARuC,cAAmB;IAUtD,uDAAuC;IAEvC,sKAIE;IAEF;;;OAGG;IACH,SAFU,MAAM,EAAE,CAEL;IAEb;;;OAGG;IACH,UAFU,IAAI,MAAM,oBAAmB,CAElB;IAErB;;;OAGG;IACH,oBAFU,IAAI,MAAM,EAAE,mBAAmB,CAAC,CAEX;IAG/B;;;;OAIG;IACH,kBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,aAFW,MAAM,QAUhB;IAED;;;;OAIG;IACH,+BAHW,MAAM,GACJ,MAAM,CAwBlB;IAGD;;;;;OAKG;IACH,iBAJW,UAAU,aACV,SAAS,UACT,MAAM,QAKhB;IAED,uBA6IC;IAED;;;;;OAKG;IACH,mBAJW,UAAU,aACV,SAAS,UACT,MAAM,QAqChB;IAED,oBAUC;IAED,6BAaC;CACJ;uBA5TsB,cAAc;0BAEX,2BAA2B;2BAD1B,iBAAiB;
|
|
1
|
+
{"version":3,"file":"AttachmentSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/attachment/AttachmentSystem.js"],"names":[],"mappings":"AAWA;IARuC,cAAmB;IAUtD,uDAAuC;IAEvC,sKAIE;IAEF;;;OAGG;IACH,SAFU,MAAM,EAAE,CAEL;IAEb;;;OAGG;IACH,UAFU,IAAI,MAAM,oBAAmB,CAElB;IAErB;;;OAGG;IACH,oBAFU,IAAI,MAAM,EAAE,mBAAmB,CAAC,CAEX;IAG/B;;;;OAIG;IACH,kBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,aAFW,MAAM,QAUhB;IAED;;;;OAIG;IACH,+BAHW,MAAM,GACJ,MAAM,CAwBlB;IAGD;;;;;OAKG;IACH,iBAJW,UAAU,aACV,SAAS,UACT,MAAM,QAKhB;IAED,uBA6IC;IAED;;;;;OAKG;IACH,mBAJW,UAAU,aACV,SAAS,UACT,MAAM,QAqChB;IAED,oBAUC;IAED,6BAaC;CACJ;uBA5TsB,cAAc;0BAEX,2BAA2B;2BAD1B,iBAAiB;4CAOA,oDAAoD;kCAL9D,iCAAiC;iBAElD,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeightMap2AOMap.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/grid/HeightMap2AOMap.js"],"names":[],"mappings":";AA6BA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qEAPW,SAAS,cACT,OAAO,cACP,OAAO,aAEP,MAAM,GACJ,SAAS,
|
|
1
|
+
{"version":3,"file":"HeightMap2AOMap.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/grid/HeightMap2AOMap.js"],"names":[],"mappings":";AA6BA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qEAPW,SAAS,cACT,OAAO,cACP,OAAO,aAEP,MAAM,GACJ,SAAS,CA8CrB;0BAzFyB,6CAA6C;wBAJiB,OAAO"}
|
|
@@ -57,9 +57,10 @@ function heightMap2AOMap(
|
|
|
57
57
|
const width = resultSize.x;
|
|
58
58
|
const height = resultSize.y;
|
|
59
59
|
|
|
60
|
-
// Pre-pass: max-height pyramid for Hi-Z ray traversal
|
|
60
|
+
// Pre-pass: max-height pyramid for Hi-Z ray traversal.
|
|
61
|
+
// The pyramid is a DataTexture2DArray; each Hi-Z mip is one layer.
|
|
61
62
|
const pyramid_texture = build_max_height_pyramid(heightMap);
|
|
62
|
-
const max_mip_level = pyramid_texture.
|
|
63
|
+
const max_mip_level = pyramid_texture.userData.mipCount - 1;
|
|
63
64
|
|
|
64
65
|
// AO bake
|
|
65
66
|
const shader_ao = AmbientOcclusionShader({ numRays: rayCount });
|
|
@@ -42,7 +42,7 @@ let _clock_seq = ((randomUint8(random) << 8) | randomUint8(random)) & 0x3fff;
|
|
|
42
42
|
* id_a.equals(id_b); // false
|
|
43
43
|
*
|
|
44
44
|
* @author Alex Goldring
|
|
45
|
-
* @copyright Company Named Limited (c)
|
|
45
|
+
* @copyright Company Named Limited (c) 2026
|
|
46
46
|
*/
|
|
47
47
|
export class UUID {
|
|
48
48
|
#data = new Uint8Array(16);
|
|
@@ -10,7 +10,7 @@ import ObservedString from "../../../core/model/ObservedString.js";
|
|
|
10
10
|
* name.getValue() // "Jane"
|
|
11
11
|
*
|
|
12
12
|
* @author Alex Goldring
|
|
13
|
-
* @copyright Company Named Limited (c)
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
14
|
*/
|
|
15
15
|
export class Name extends ObservedString {
|
|
16
16
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Component representing logical attachment to another entity, when the parent disappears - so does the child
|
|
3
3
|
*
|
|
4
4
|
* @author Alex Goldring
|
|
5
|
-
* @copyright Company Named Limited (c)
|
|
5
|
+
* @copyright Company Named Limited (c) 2026
|
|
6
6
|
*/
|
|
7
7
|
export class ParentEntity {
|
|
8
8
|
/**
|
|
@@ -23,7 +23,7 @@ import { BinaryObjectSerializationAdapter } from "./binary/object/BinaryObjectSe
|
|
|
23
23
|
*
|
|
24
24
|
* @template CTX
|
|
25
25
|
* @author Alex Goldring
|
|
26
|
-
* @copyright Company Named Limited (c)
|
|
26
|
+
* @copyright Company Named Limited (c) 2026
|
|
27
27
|
*/
|
|
28
28
|
class BinaryBufferDeSerializer {
|
|
29
29
|
/**
|
|
@@ -67,7 +67,7 @@ function isEntityTransient(entity, dataset, smComponentIndex, componentInstance)
|
|
|
67
67
|
*
|
|
68
68
|
* @template CTX
|
|
69
69
|
* @author Alex Goldring
|
|
70
|
-
* @copyright Company Named Limited (c)
|
|
70
|
+
* @copyright Company Named Limited (c) 2026
|
|
71
71
|
*/
|
|
72
72
|
class BinaryBufferSerializer {
|
|
73
73
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Contains serializers for various data types as well as data upgraders which enable support for serialization format changes
|
|
3
3
|
*
|
|
4
4
|
* @author Alex Goldring
|
|
5
|
-
* @copyright Company Named Limited (c)
|
|
5
|
+
* @copyright Company Named Limited (c) 2026
|
|
6
6
|
*/
|
|
7
7
|
export class BinarySerializationRegistry {
|
|
8
8
|
/**
|
|
@@ -5,7 +5,7 @@ import { Graph } from "../../../../core/graph/v2/Graph.js";
|
|
|
5
5
|
* Contains serializers for various data types as well as data upgraders which enable support for serialization format changes
|
|
6
6
|
*
|
|
7
7
|
* @author Alex Goldring
|
|
8
|
-
* @copyright Company Named Limited (c)
|
|
8
|
+
* @copyright Company Named Limited (c) 2026
|
|
9
9
|
*/
|
|
10
10
|
export class BinarySerializationRegistry {
|
|
11
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathDisplaySystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/path/PathDisplaySystem.js"],"names":[],"mappings":"AAoPA;IACI;;;OAGG;IACH,4BAwCC;IAnCG,mDAGC;IAED,2KAIC;IAED;;;OAGG;IACH,eAAoB;IAEpB;;;OAGG;IACH,iCAAkB;IAElB;;;;OAIG;IACH,wBAAkC;IAElC;;;OAGG;IACH,YAFU,MAAM,CAEc;IAGlC;;;;OAIG;IACH,8BAFW,MAAM,QAQhB;IAED;;;;OAIG;IACH,6BAFW,MAAM,QAIhB;IAED,2CAGC;IAED,4CAGC;IAED,8BA+BC;CACJ;sCA7VqC,8CAA8C;
|
|
1
|
+
{"version":3,"file":"PathDisplaySystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/path/PathDisplaySystem.js"],"names":[],"mappings":"AAoPA;IACI;;;OAGG;IACH,4BAwCC;IAnCG,mDAGC;IAED,2KAIC;IAED;;;OAGG;IACH,eAAoB;IAEpB;;;OAGG;IACH,iCAAkB;IAElB;;;;OAIG;IACH,wBAAkC;IAElC;;;OAGG;IACH,YAFU,MAAM,CAEc;IAGlC;;;;OAIG;IACH,8BAFW,MAAM,QAQhB;IAED;;;;OAIG;IACH,6BAFW,MAAM,QAIhB;IAED,2CAGC;IAED,4CAGC;IAED,8BA+BC;CACJ;sCA7VqC,8CAA8C;iBAGnE,4CAA4C;4BAKjC,kBAAkB;0BANpB,qCAAqC;4CAJnB,uDAAuD;+BAQpE,8BAA8B;6BAPhC,qCAAqC;8BAMpC,gCAAgC;mBAT3C,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImpostorBaker.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/impostors/octahedral/ImpostorBaker.js"],"names":[],"mappings":";AAqBA;IAEI;;;;OAIG;IACH,kBAAiB;IAEjB;;;OAGG;IACH,iDAEC;IAGD;;;;;;;OAOG;IACH,yEANW,MAAM,EAAE,OAAK,uBAgPvB;IAED;;;;;;;OAOG;IACH,4CANW;QAAC,IAAI,iBAAgB;QAAC,SAAS,EAAC,IAAI,CAAA;KAAC,EAAE,GAIrC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ImpostorBaker.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/impostors/octahedral/ImpostorBaker.js"],"names":[],"mappings":";AAqBA;IAEI;;;;OAIG;IACH,kBAAiB;IAEjB;;;OAGG;IACH,iDAEC;IAGD;;;;;;;OAOG;IACH,yEANW,MAAM,EAAE,OAAK,uBAgPvB;IAED;;;;;;;OAOG;IACH,4CANW;QAAC,IAAI,iBAAgB;QAAC,SAAS,EAAC,IAAI,CAAA;KAAC,EAAE,GAIrC,mBAAmB,CA4E/B;CACJ;oCA7VmC,0BAA0B;qBAjBnC,WAAW"}
|
|
@@ -317,8 +317,17 @@ export class ImpostorBaker {
|
|
|
317
317
|
console.warn(`To get results at low frame resolutions number of frames should be a divisor of resolution, instead got [frames=${frames}, resolution=${resolution}, resolution/frames=${frame_resolution}]`);
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
+
// POT is preferred for octahedral runtime sampling (mipmap-friendly),
|
|
321
|
+
// but the voxel impostor pipeline reads the atlas back to CPU and
|
|
322
|
+
// doesn't sample it at runtime, so a non-POT resolution is fine
|
|
323
|
+
// there. Demote the old hard error to a warning so callers that
|
|
324
|
+
// intentionally bake at multiples-of-frames (eg the voxel
|
|
325
|
+
// baker's budget search) aren't blocked.
|
|
320
326
|
if (!isPowerOfTwo(resolution)) {
|
|
321
|
-
|
|
327
|
+
console.warn(`ImpostorBaker: resolution=${resolution} is not a power of two. This is OK for CPU-readback uses (voxel impostor) but may degrade runtime atlas sampling for the octahedral impostor.`);
|
|
328
|
+
}
|
|
329
|
+
if (resolution % frames !== 0) {
|
|
330
|
+
throw new Error(`'resolution' (=${resolution}) must be divisible by 'frames' (=${frames}) so per-frame tiles are integer-sized`);
|
|
322
331
|
}
|
|
323
332
|
|
|
324
333
|
if (frames < 2) {
|