@aura3d/engine 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -19
- package/dist/animation/library/performanceStateGraph.d.ts +11 -3
- package/dist/animation/library/performanceStateGraph.d.ts.map +1 -1
- package/dist/animation/library/performanceStateGraph.js +61 -5
- package/dist/animation/library/performanceStateGraph.js.map +1 -1
- package/dist/animation/library/standardHumanoidClips.d.ts +3 -3
- package/dist/animation/library/standardHumanoidClips.d.ts.map +1 -1
- package/dist/animation/library/standardHumanoidClips.js +179 -4
- package/dist/animation/library/standardHumanoidClips.js.map +1 -1
- package/dist/assets/GLTFLoader.js +1 -0
- package/dist/assets/GLTFLoader.js.map +1 -1
- package/dist/assets/GLTFRenderResources.d.ts.map +1 -1
- package/dist/assets/GLTFRenderResources.js +68 -16
- package/dist/assets/GLTFRenderResources.js.map +1 -1
- package/dist/assets/KTX2BasisTextureTranscoder.js +1 -0
- package/dist/assets/KTX2BasisTextureTranscoder.js.map +1 -1
- package/dist/aura3d-cli/asset-constants.d.ts +5 -0
- package/dist/aura3d-cli/asset-constants.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-constants.js +5 -0
- package/dist/aura3d-cli/asset-constants.js.map +1 -0
- package/dist/aura3d-cli/asset-core-types.d.ts +206 -0
- package/dist/aura3d-cli/asset-core-types.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-core-types.js +2 -0
- package/dist/aura3d-cli/asset-core-types.js.map +1 -0
- package/dist/aura3d-cli/asset-inspection-types.d.ts +131 -0
- package/dist/aura3d-cli/asset-inspection-types.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-inspection-types.js +2 -0
- package/dist/aura3d-cli/asset-inspection-types.js.map +1 -0
- package/dist/aura3d-cli/asset-manifest.d.ts +8 -0
- package/dist/aura3d-cli/asset-manifest.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-manifest.js +116 -0
- package/dist/aura3d-cli/asset-manifest.js.map +1 -0
- package/dist/aura3d-cli/asset-readiness-types.d.ts +164 -0
- package/dist/aura3d-cli/asset-readiness-types.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-readiness-types.js +2 -0
- package/dist/aura3d-cli/asset-readiness-types.js.map +1 -0
- package/dist/aura3d-cli/asset-source-ast.d.ts +8 -0
- package/dist/aura3d-cli/asset-source-ast.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-source-ast.js +241 -0
- package/dist/aura3d-cli/asset-source-ast.js.map +1 -0
- package/dist/aura3d-cli/asset-source-roles.d.ts +4 -0
- package/dist/aura3d-cli/asset-source-roles.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-source-roles.js +79 -0
- package/dist/aura3d-cli/asset-source-roles.js.map +1 -0
- package/dist/aura3d-cli/asset-source-validation.d.ts +4 -0
- package/dist/aura3d-cli/asset-source-validation.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-source-validation.js +200 -0
- package/dist/aura3d-cli/asset-source-validation.js.map +1 -0
- package/dist/aura3d-cli/character-assembly-types.d.ts +39 -0
- package/dist/aura3d-cli/character-assembly-types.d.ts.map +1 -0
- package/dist/aura3d-cli/character-assembly-types.js +2 -0
- package/dist/aura3d-cli/character-assembly-types.js.map +1 -0
- package/dist/aura3d-cli/cli-help.d.ts +4 -0
- package/dist/aura3d-cli/cli-help.d.ts.map +1 -0
- package/dist/aura3d-cli/cli-help.js +48 -0
- package/dist/aura3d-cli/cli-help.js.map +1 -0
- package/dist/aura3d-cli/cli-options.d.ts +66 -0
- package/dist/aura3d-cli/cli-options.d.ts.map +1 -0
- package/dist/aura3d-cli/cli-options.js +234 -0
- package/dist/aura3d-cli/cli-options.js.map +1 -0
- package/dist/aura3d-cli/cli.js +20 -177
- package/dist/aura3d-cli/cli.js.map +1 -1
- package/dist/aura3d-cli/index.d.ts +12 -402
- package/dist/aura3d-cli/index.d.ts.map +1 -1
- package/dist/aura3d-cli/index.js +948 -90
- package/dist/aura3d-cli/index.js.map +1 -1
- package/dist/aura3d-cli/pull-bridge/adapters.d.ts +4 -0
- package/dist/aura3d-cli/pull-bridge/adapters.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/adapters.js +38 -0
- package/dist/aura3d-cli/pull-bridge/adapters.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/download.d.ts +6 -0
- package/dist/aura3d-cli/pull-bridge/download.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/download.js +208 -0
- package/dist/aura3d-cli/pull-bridge/download.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/profiles.d.ts +14 -0
- package/dist/aura3d-cli/pull-bridge/profiles.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/profiles.js +63 -0
- package/dist/aura3d-cli/pull-bridge/profiles.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/provenance.d.ts +9 -0
- package/dist/aura3d-cli/pull-bridge/provenance.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/provenance.js +99 -0
- package/dist/aura3d-cli/pull-bridge/provenance.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/pullable.d.ts +14 -0
- package/dist/aura3d-cli/pull-bridge/pullable.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/pullable.js +58 -0
- package/dist/aura3d-cli/pull-bridge/pullable.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/scoring.d.ts +21 -0
- package/dist/aura3d-cli/pull-bridge/scoring.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/scoring.js +177 -0
- package/dist/aura3d-cli/pull-bridge/scoring.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/search.d.ts +39 -0
- package/dist/aura3d-cli/pull-bridge/search.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/search.js +114 -0
- package/dist/aura3d-cli/pull-bridge/search.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/types.d.ts +9 -0
- package/dist/aura3d-cli/pull-bridge/types.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/types.js +2 -0
- package/dist/aura3d-cli/pull-bridge/types.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge/vector3.d.ts +2 -0
- package/dist/aura3d-cli/pull-bridge/vector3.d.ts.map +1 -0
- package/dist/aura3d-cli/pull-bridge/vector3.js +4 -0
- package/dist/aura3d-cli/pull-bridge/vector3.js.map +1 -0
- package/dist/aura3d-cli/pull-bridge.d.ts +18 -100
- package/dist/aura3d-cli/pull-bridge.d.ts.map +1 -1
- package/dist/aura3d-cli/pull-bridge.js +59 -526
- package/dist/aura3d-cli/pull-bridge.js.map +1 -1
- package/dist/create-aura3d/cli.js +10 -0
- package/dist/create-aura3d/cli.js.map +1 -1
- package/dist/create-aura3d/index.d.ts +1 -1
- package/dist/create-aura3d/index.d.ts.map +1 -1
- package/dist/create-aura3d/index.js +11 -2
- package/dist/create-aura3d/index.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-artifacts.d.ts +104 -0
- package/dist/create-aura3d/showcase-spec-artifacts.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-artifacts.js +142 -0
- package/dist/create-aura3d/showcase-spec-artifacts.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-category-plan.d.ts +15 -0
- package/dist/create-aura3d/showcase-spec-category-plan.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-category-plan.js +45 -0
- package/dist/create-aura3d/showcase-spec-category-plan.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-compiler.d.ts +5 -0
- package/dist/create-aura3d/showcase-spec-compiler.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-compiler.js +240 -0
- package/dist/create-aura3d/showcase-spec-compiler.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-evidence.d.ts +7 -0
- package/dist/create-aura3d/showcase-spec-evidence.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-evidence.js +815 -0
- package/dist/create-aura3d/showcase-spec-evidence.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.d.ts +21 -0
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.js +725 -0
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-game-replacement-evidence.d.ts +14 -0
- package/dist/create-aura3d/showcase-spec-game-replacement-evidence.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-game-replacement-evidence.js +219 -0
- package/dist/create-aura3d/showcase-spec-game-replacement-evidence.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-game-template-evidence.d.ts +72 -0
- package/dist/create-aura3d/showcase-spec-game-template-evidence.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-game-template-evidence.js +435 -0
- package/dist/create-aura3d/showcase-spec-game-template-evidence.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-gameplay-evidence.d.ts +3 -0
- package/dist/create-aura3d/showcase-spec-gameplay-evidence.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-gameplay-evidence.js +108 -0
- package/dist/create-aura3d/showcase-spec-gameplay-evidence.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-parser.d.ts +3 -0
- package/dist/create-aura3d/showcase-spec-parser.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-parser.js +662 -0
- package/dist/create-aura3d/showcase-spec-parser.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-platformer-artifacts.d.ts +3 -0
- package/dist/create-aura3d/showcase-spec-platformer-artifacts.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-platformer-artifacts.js +276 -0
- package/dist/create-aura3d/showcase-spec-platformer-artifacts.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-racing-artifacts.d.ts +3 -0
- package/dist/create-aura3d/showcase-spec-racing-artifacts.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-racing-artifacts.js +273 -0
- package/dist/create-aura3d/showcase-spec-racing-artifacts.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-apply.d.ts +10 -0
- package/dist/create-aura3d/showcase-spec-replacement-apply.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-apply.js +166 -0
- package/dist/create-aura3d/showcase-spec-replacement-apply.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-candidates.d.ts +16 -0
- package/dist/create-aura3d/showcase-spec-replacement-candidates.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-candidates.js +244 -0
- package/dist/create-aura3d/showcase-spec-replacement-candidates.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-game-geometry.d.ts +4 -0
- package/dist/create-aura3d/showcase-spec-replacement-game-geometry.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-game-geometry.js +175 -0
- package/dist/create-aura3d/showcase-spec-replacement-game-geometry.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-manifest.d.ts +41 -0
- package/dist/create-aura3d/showcase-spec-replacement-manifest.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-manifest.js +62 -0
- package/dist/create-aura3d/showcase-spec-replacement-manifest.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-values.d.ts +9 -0
- package/dist/create-aura3d/showcase-spec-replacement-values.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement-values.js +41 -0
- package/dist/create-aura3d/showcase-spec-replacement-values.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement.d.ts +13 -0
- package/dist/create-aura3d/showcase-spec-replacement.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-replacement.js +144 -0
- package/dist/create-aura3d/showcase-spec-replacement.js.map +1 -0
- package/dist/create-aura3d/showcase-spec-types.d.ts +304 -0
- package/dist/create-aura3d/showcase-spec-types.d.ts.map +1 -0
- package/dist/create-aura3d/showcase-spec-types.js +2 -0
- package/dist/create-aura3d/showcase-spec-types.js.map +1 -0
- package/dist/ecs/SystemScheduler.js +5 -4
- package/dist/ecs/SystemScheduler.js.map +1 -1
- package/dist/ecs/components/CameraComponent.d.ts +30 -0
- package/dist/ecs/components/CameraComponent.d.ts.map +1 -0
- package/dist/ecs/components/CameraComponent.js +27 -0
- package/dist/ecs/components/CameraComponent.js.map +1 -0
- package/dist/ecs/components/HierarchyComponent.d.ts +10 -0
- package/dist/ecs/components/HierarchyComponent.d.ts.map +1 -1
- package/dist/ecs/components/HierarchyComponent.js +10 -0
- package/dist/ecs/components/HierarchyComponent.js.map +1 -1
- package/dist/ecs/components/LightComponent.d.ts +18 -0
- package/dist/ecs/components/LightComponent.d.ts.map +1 -0
- package/dist/ecs/components/LightComponent.js +17 -0
- package/dist/ecs/components/LightComponent.js.map +1 -0
- package/dist/ecs/components/MeshComponent.d.ts +19 -0
- package/dist/ecs/components/MeshComponent.d.ts.map +1 -0
- package/dist/ecs/components/MeshComponent.js +21 -0
- package/dist/ecs/components/MeshComponent.js.map +1 -0
- package/dist/ecs/components/WorldTransformComponent.d.ts +12 -0
- package/dist/ecs/components/WorldTransformComponent.d.ts.map +1 -0
- package/dist/ecs/components/WorldTransformComponent.js +22 -0
- package/dist/ecs/components/WorldTransformComponent.js.map +1 -0
- package/dist/ecs/index.d.ts +4 -0
- package/dist/ecs/index.d.ts.map +1 -1
- package/dist/ecs/index.js +4 -0
- package/dist/ecs/index.js.map +1 -1
- package/dist/ecs/systems/CameraSystem.d.ts +17 -0
- package/dist/ecs/systems/CameraSystem.d.ts.map +1 -0
- package/dist/ecs/systems/CameraSystem.js +38 -0
- package/dist/ecs/systems/CameraSystem.js.map +1 -0
- package/dist/ecs/systems/TransformSystem.d.ts +16 -0
- package/dist/ecs/systems/TransformSystem.d.ts.map +1 -0
- package/dist/ecs/systems/TransformSystem.js +99 -0
- package/dist/ecs/systems/TransformSystem.js.map +1 -0
- package/dist/ecs/systems/index.d.ts +2 -0
- package/dist/ecs/systems/index.d.ts.map +1 -1
- package/dist/ecs/systems/index.js +2 -0
- package/dist/ecs/systems/index.js.map +1 -1
- package/dist/engine/agent-api/GameAssetValidation.d.ts +5 -0
- package/dist/engine/agent-api/GameAssetValidation.d.ts.map +1 -1
- package/dist/engine/agent-api/GameAssetValidation.js +103 -0
- package/dist/engine/agent-api/GameAssetValidation.js.map +1 -1
- package/dist/engine/agent-api/GameEvidence.d.ts +14 -1
- package/dist/engine/agent-api/GameEvidence.d.ts.map +1 -1
- package/dist/engine/agent-api/GameEvidence.js +77 -6
- package/dist/engine/agent-api/GameEvidence.js.map +1 -1
- package/dist/engine/agent-api/GameGenreKits.d.ts +473 -0
- package/dist/engine/agent-api/GameGenreKits.d.ts.map +1 -0
- package/dist/engine/agent-api/GameGenreKits.js +1269 -0
- package/dist/engine/agent-api/GameGenreKits.js.map +1 -0
- package/dist/engine/agent-api/GameRuntime.d.ts +190 -3
- package/dist/engine/agent-api/GameRuntime.d.ts.map +1 -1
- package/dist/engine/agent-api/GameRuntime.js +431 -2
- package/dist/engine/agent-api/GameRuntime.js.map +1 -1
- package/dist/engine/agent-api/GameSceneGeometryBindings.d.ts +181 -0
- package/dist/engine/agent-api/GameSceneGeometryBindings.d.ts.map +1 -0
- package/dist/engine/agent-api/GameSceneGeometryBindings.js +488 -0
- package/dist/engine/agent-api/GameSceneGeometryBindings.js.map +1 -0
- package/dist/engine/agent-api/GameSceneGeometryMath.d.ts +39 -0
- package/dist/engine/agent-api/GameSceneGeometryMath.d.ts.map +1 -0
- package/dist/engine/agent-api/GameSceneGeometryMath.js +89 -0
- package/dist/engine/agent-api/GameSceneGeometryMath.js.map +1 -0
- package/dist/engine/agent-api/RuntimeNodeHandle.d.ts +4 -0
- package/dist/engine/agent-api/RuntimeNodeHandle.d.ts.map +1 -1
- package/dist/engine/agent-api/RuntimeNodeHandle.js +2 -0
- package/dist/engine/agent-api/RuntimeNodeHandle.js.map +1 -1
- package/dist/engine/agent-api/SceneGroundingUtils.d.ts +86 -0
- package/dist/engine/agent-api/SceneGroundingUtils.d.ts.map +1 -1
- package/dist/engine/agent-api/SceneGroundingUtils.js +116 -0
- package/dist/engine/agent-api/SceneGroundingUtils.js.map +1 -1
- package/dist/engine/agent-api/index.d.ts +149 -5
- package/dist/engine/agent-api/index.d.ts.map +1 -1
- package/dist/engine/agent-api/index.js +1964 -141
- package/dist/engine/agent-api/index.js.map +1 -1
- package/dist/engine/agent-api/product-viewer-runtime.d.ts.map +1 -1
- package/dist/engine/ecs/ECSRenderSource.d.ts +29 -0
- package/dist/engine/ecs/ECSRenderSource.d.ts.map +1 -0
- package/dist/engine/ecs/ECSRenderSource.js +189 -0
- package/dist/engine/ecs/ECSRenderSource.js.map +1 -0
- package/dist/engine/index.d.ts +1 -0
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +1 -0
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.d.ts +14 -2
- package/dist/engine/production-runtime/TypedGLBActor.d.ts.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.js +95 -4
- package/dist/engine/production-runtime/TypedGLBActor.js.map +1 -1
- package/dist/physics/Constraint.d.ts.map +1 -1
- package/dist/physics/Constraint.js +3 -3
- package/dist/physics/Constraint.js.map +1 -1
- package/dist/physics/Shape.d.ts +1 -0
- package/dist/physics/Shape.d.ts.map +1 -1
- package/dist/physics/Shape.js +12 -0
- package/dist/physics/Shape.js.map +1 -1
- package/dist/rendering/ForwardPass.d.ts +1 -0
- package/dist/rendering/ForwardPass.d.ts.map +1 -1
- package/dist/rendering/ForwardPass.js +29 -6
- package/dist/rendering/ForwardPass.js.map +1 -1
- package/dist/rendering/MorphTarget.d.ts +1 -0
- package/dist/rendering/MorphTarget.d.ts.map +1 -1
- package/dist/rendering/MorphTarget.js.map +1 -1
- package/dist/rendering/Renderer.js +7 -1
- package/dist/rendering/Renderer.js.map +1 -1
- package/dist/rendering/SkinnedLitMaterial.d.ts +9 -0
- package/dist/rendering/SkinnedLitMaterial.d.ts.map +1 -1
- package/dist/rendering/SkinnedLitMaterial.js +20 -1
- package/dist/rendering/SkinnedLitMaterial.js.map +1 -1
- package/dist/rendering/performance/RenderItemSorting.d.ts +2 -1
- package/dist/rendering/performance/RenderItemSorting.d.ts.map +1 -1
- package/dist/rendering/performance/RenderItemSorting.js +5 -2
- package/dist/rendering/performance/RenderItemSorting.js.map +1 -1
- package/package.json +24 -24
- package/templates/mini-game/README.md +13 -0
- package/templates/mini-game/index.html +1 -1
- package/templates/mini-game/package.json +1 -1
- package/templates/mini-game/src/main.ts +251 -21
- package/templates/mini-game/tests/playable.spec.ts +49 -0
- package/templates/mini-game/tests/screenshot.spec.ts +37 -32
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PhysicsWorld, Shape as PhysicsShapeFactory } from "../../physics/index.js";
|
|
1
2
|
export function createGameLoopPlan(options = {}) {
|
|
2
3
|
return {
|
|
3
4
|
kind: "aura-game-loop-plan",
|
|
@@ -304,6 +305,8 @@ export function createGameInput(options) {
|
|
|
304
305
|
const bufferMs = options.bufferMs ?? 120;
|
|
305
306
|
const activeBindings = new Set();
|
|
306
307
|
const activeActionOverrides = new Set();
|
|
308
|
+
const pendingPressedBindings = new Set();
|
|
309
|
+
const pendingPressedActions = new Set();
|
|
307
310
|
const previousHeld = new Map();
|
|
308
311
|
const currentHeld = new Map();
|
|
309
312
|
const pressedEdges = new Set();
|
|
@@ -339,8 +342,11 @@ export function createGameInput(options) {
|
|
|
339
342
|
};
|
|
340
343
|
const pressBinding = (binding, shouldRecord = true) => {
|
|
341
344
|
activeBindings.add(binding);
|
|
342
|
-
|
|
345
|
+
pendingPressedBindings.add(binding);
|
|
346
|
+
if (actions[binding]) {
|
|
343
347
|
activeActionOverrides.add(binding);
|
|
348
|
+
pendingPressedActions.add(binding);
|
|
349
|
+
}
|
|
344
350
|
if (shouldRecord)
|
|
345
351
|
record("press", binding);
|
|
346
352
|
};
|
|
@@ -443,8 +449,9 @@ export function createGameInput(options) {
|
|
|
443
449
|
for (const action of Object.keys(actions)) {
|
|
444
450
|
const held = resolveHeld(action);
|
|
445
451
|
const wasHeld = previousHeld.get(action) ?? false;
|
|
452
|
+
const pendingPressed = pendingPressedActions.has(action) || (actions[action] ?? []).some((binding) => pendingPressedBindings.has(binding));
|
|
446
453
|
currentHeld.set(action, held);
|
|
447
|
-
if (held && !wasHeld) {
|
|
454
|
+
if ((held && !wasHeld) || pendingPressed) {
|
|
448
455
|
pressedEdges.add(action);
|
|
449
456
|
const nowMs = time * 1000;
|
|
450
457
|
lastPressedAt.set(action, nowMs);
|
|
@@ -456,6 +463,8 @@ export function createGameInput(options) {
|
|
|
456
463
|
releasedEdges.add(action);
|
|
457
464
|
previousHeld.set(action, held);
|
|
458
465
|
}
|
|
466
|
+
pendingPressedBindings.clear();
|
|
467
|
+
pendingPressedActions.clear();
|
|
459
468
|
const axesSnapshot = {};
|
|
460
469
|
for (const axisName of Object.keys(axes)) {
|
|
461
470
|
const raw = resolveAxisRaw(axisName, undefined, undefined, framePointer);
|
|
@@ -598,6 +607,7 @@ export function createGameInput(options) {
|
|
|
598
607
|
setAction(action, held) {
|
|
599
608
|
if (held) {
|
|
600
609
|
activeActionOverrides.add(action);
|
|
610
|
+
pendingPressedActions.add(action);
|
|
601
611
|
record("press", action);
|
|
602
612
|
}
|
|
603
613
|
else {
|
|
@@ -635,6 +645,8 @@ export function createGameInput(options) {
|
|
|
635
645
|
}
|
|
636
646
|
activeBindings.clear();
|
|
637
647
|
activeActionOverrides.clear();
|
|
648
|
+
pendingPressedBindings.clear();
|
|
649
|
+
pendingPressedActions.clear();
|
|
638
650
|
previousHeld.clear();
|
|
639
651
|
currentHeld.clear();
|
|
640
652
|
pressedEdges.clear();
|
|
@@ -836,6 +848,245 @@ export function createGameKinematicBody(options = {}) {
|
|
|
836
848
|
snapshot
|
|
837
849
|
};
|
|
838
850
|
}
|
|
851
|
+
export function createGameCollisionWorld(descriptor = {}) {
|
|
852
|
+
let world = new PhysicsWorld(descriptor);
|
|
853
|
+
const handlesById = new Map();
|
|
854
|
+
const handlesByBodyId = new Map();
|
|
855
|
+
const handlesByColliderId = new Map();
|
|
856
|
+
let lastEvents = [];
|
|
857
|
+
const register = (handle) => {
|
|
858
|
+
handlesById.set(handle.id, handle);
|
|
859
|
+
handlesByBodyId.set(handle.body.id, handle);
|
|
860
|
+
handlesByColliderId.set(handle.collider.id, handle);
|
|
861
|
+
return handle;
|
|
862
|
+
};
|
|
863
|
+
const createHandle = (id, tags, body, collider) => {
|
|
864
|
+
const snapshot = () => ({
|
|
865
|
+
id,
|
|
866
|
+
bodyId: body.id,
|
|
867
|
+
colliderId: collider.id,
|
|
868
|
+
type: body.type,
|
|
869
|
+
position: toGameVec3(body.position),
|
|
870
|
+
velocity: toGameVec3(body.velocity),
|
|
871
|
+
shape: collider.shape,
|
|
872
|
+
sensor: collider.sensor,
|
|
873
|
+
tags,
|
|
874
|
+
layer: collider.filter.layer,
|
|
875
|
+
mask: collider.filter.mask
|
|
876
|
+
});
|
|
877
|
+
return {
|
|
878
|
+
kind: "aura-game-collision-body",
|
|
879
|
+
id,
|
|
880
|
+
body,
|
|
881
|
+
collider,
|
|
882
|
+
tags,
|
|
883
|
+
get position() {
|
|
884
|
+
return toGameVec3(body.position);
|
|
885
|
+
},
|
|
886
|
+
get velocity() {
|
|
887
|
+
return toGameVec3(body.velocity);
|
|
888
|
+
},
|
|
889
|
+
setPosition(position) {
|
|
890
|
+
body.setPosition(vec3(position, body.position));
|
|
891
|
+
return snapshot();
|
|
892
|
+
},
|
|
893
|
+
setVelocity(velocity) {
|
|
894
|
+
body.setVelocity(vec3(velocity, body.velocity));
|
|
895
|
+
return snapshot();
|
|
896
|
+
},
|
|
897
|
+
translate(delta) {
|
|
898
|
+
body.setPosition(addVec3(body.position, vec3(delta, [0, 0, 0])));
|
|
899
|
+
return snapshot();
|
|
900
|
+
},
|
|
901
|
+
snapshot
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
const add = (options) => {
|
|
905
|
+
const id = options.id.trim();
|
|
906
|
+
if (!id) {
|
|
907
|
+
throw new Error("game.collisionWorld body id must be a non-empty string.");
|
|
908
|
+
}
|
|
909
|
+
if (handlesById.has(id)) {
|
|
910
|
+
throw new Error(`game.collisionWorld already has a body named '${id}'.`);
|
|
911
|
+
}
|
|
912
|
+
const body = world.createRigidBody({
|
|
913
|
+
...options.rigidBody,
|
|
914
|
+
type: options.type ?? "dynamic",
|
|
915
|
+
position: vec3(options.position, [0, 0, 0]),
|
|
916
|
+
velocity: vec3(options.velocity, [0, 0, 0])
|
|
917
|
+
});
|
|
918
|
+
const collider = world.createCollider(body, {
|
|
919
|
+
shape: options.shape ?? PhysicsShapeFactory.box(0.5, 0.5, 0.5),
|
|
920
|
+
sensor: options.sensor ?? false,
|
|
921
|
+
filter: {
|
|
922
|
+
layer: options.layer ?? 1,
|
|
923
|
+
mask: options.mask ?? 0xffffffff
|
|
924
|
+
},
|
|
925
|
+
material: options.material
|
|
926
|
+
});
|
|
927
|
+
return register(createHandle(id, [...(options.tags ?? [])], body, collider));
|
|
928
|
+
};
|
|
929
|
+
const requireBody = (id) => {
|
|
930
|
+
const handle = handlesById.get(id);
|
|
931
|
+
if (!handle) {
|
|
932
|
+
throw new Error(`game.collisionWorld missing body '${id}'.`);
|
|
933
|
+
}
|
|
934
|
+
return handle;
|
|
935
|
+
};
|
|
936
|
+
const mapContact = (contact, type) => {
|
|
937
|
+
const a = handlesByColliderId.get(contact.colliderA);
|
|
938
|
+
const b = handlesByColliderId.get(contact.colliderB);
|
|
939
|
+
if (!a || !b) {
|
|
940
|
+
return undefined;
|
|
941
|
+
}
|
|
942
|
+
return {
|
|
943
|
+
kind: "aura-game-collision-contact",
|
|
944
|
+
pairKey: gameCollisionPairKey(contact.colliderA, contact.colliderB),
|
|
945
|
+
type,
|
|
946
|
+
a: gameCollisionParticipant(a),
|
|
947
|
+
b: gameCollisionParticipant(b),
|
|
948
|
+
normal: toGameVec3(contact.normal),
|
|
949
|
+
penetration: contact.penetration,
|
|
950
|
+
sensor: contact.sensor,
|
|
951
|
+
contact
|
|
952
|
+
};
|
|
953
|
+
};
|
|
954
|
+
const mapEvent = (event) => {
|
|
955
|
+
const contact = mapContact(event.contact, event.type);
|
|
956
|
+
if (!contact) {
|
|
957
|
+
return undefined;
|
|
958
|
+
}
|
|
959
|
+
return {
|
|
960
|
+
...contact,
|
|
961
|
+
type: event.type
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
const currentContacts = (filter = {}) => {
|
|
965
|
+
const contacts = [];
|
|
966
|
+
for (const contact of world.snapshot().contacts) {
|
|
967
|
+
const mapped = mapContact(contact);
|
|
968
|
+
if (mapped && gameCollisionContactMatchesFilter(mapped, filter)) {
|
|
969
|
+
contacts.push(mapped);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
return contacts;
|
|
973
|
+
};
|
|
974
|
+
return {
|
|
975
|
+
kind: "aura-game-collision-world",
|
|
976
|
+
add,
|
|
977
|
+
addBox(id, halfExtents, options = {}) {
|
|
978
|
+
return add({
|
|
979
|
+
...options,
|
|
980
|
+
id,
|
|
981
|
+
shape: PhysicsShapeFactory.box(halfExtents[0], halfExtents[1], halfExtents[2])
|
|
982
|
+
});
|
|
983
|
+
},
|
|
984
|
+
addSphere(id, radius, options = {}) {
|
|
985
|
+
return add({
|
|
986
|
+
...options,
|
|
987
|
+
id,
|
|
988
|
+
shape: PhysicsShapeFactory.sphere(radius)
|
|
989
|
+
});
|
|
990
|
+
},
|
|
991
|
+
addCapsule(id, radius, halfHeight, options = {}) {
|
|
992
|
+
return add({
|
|
993
|
+
...options,
|
|
994
|
+
id,
|
|
995
|
+
shape: PhysicsShapeFactory.capsule(radius, halfHeight)
|
|
996
|
+
});
|
|
997
|
+
},
|
|
998
|
+
get(id) {
|
|
999
|
+
return handlesById.get(id);
|
|
1000
|
+
},
|
|
1001
|
+
require: requireBody,
|
|
1002
|
+
remove(id) {
|
|
1003
|
+
const handle = handlesById.get(id);
|
|
1004
|
+
if (!handle) {
|
|
1005
|
+
return false;
|
|
1006
|
+
}
|
|
1007
|
+
handlesById.delete(id);
|
|
1008
|
+
handlesByBodyId.delete(handle.body.id);
|
|
1009
|
+
handlesByColliderId.delete(handle.collider.id);
|
|
1010
|
+
world.removeRigidBody(handle.body.id);
|
|
1011
|
+
return true;
|
|
1012
|
+
},
|
|
1013
|
+
clear() {
|
|
1014
|
+
world = new PhysicsWorld(descriptor);
|
|
1015
|
+
handlesById.clear();
|
|
1016
|
+
handlesByBodyId.clear();
|
|
1017
|
+
handlesByColliderId.clear();
|
|
1018
|
+
lastEvents = [];
|
|
1019
|
+
},
|
|
1020
|
+
step(dt) {
|
|
1021
|
+
const events = dt === undefined ? world.step() : world.step(dt);
|
|
1022
|
+
lastEvents = events.map(mapEvent).filter(isDefined);
|
|
1023
|
+
return lastEvents;
|
|
1024
|
+
},
|
|
1025
|
+
events(filter = {}) {
|
|
1026
|
+
return lastEvents.filter((event) => gameCollisionContactMatchesFilter(event, filter));
|
|
1027
|
+
},
|
|
1028
|
+
overlaps: currentContacts,
|
|
1029
|
+
sweep(id, direction, distance, options = {}) {
|
|
1030
|
+
const source = requireBody(id);
|
|
1031
|
+
if (!Number.isFinite(distance) || distance <= 0) {
|
|
1032
|
+
throw new Error("game.collisionWorld.sweep distance must be a finite positive number.");
|
|
1033
|
+
}
|
|
1034
|
+
const castRadius = options.radius ?? gameCollisionSweepRadius(source.collider.shape);
|
|
1035
|
+
const hits = world.sphereCastAll(source.body.position, castRadius, direction, {
|
|
1036
|
+
maxDistance: distance,
|
|
1037
|
+
mask: options.mask ?? source.collider.filter.mask,
|
|
1038
|
+
includeSensors: options.includeSensors ?? true,
|
|
1039
|
+
includeBackfaces: options.includeBackfaces
|
|
1040
|
+
});
|
|
1041
|
+
const sourceParticipant = gameCollisionParticipant(source);
|
|
1042
|
+
const mapped = [];
|
|
1043
|
+
for (const hit of hits) {
|
|
1044
|
+
if (options.includeSelf !== true && hit.colliderId === source.collider.id) {
|
|
1045
|
+
continue;
|
|
1046
|
+
}
|
|
1047
|
+
const target = handlesByColliderId.get(hit.colliderId);
|
|
1048
|
+
if (!target || !gameCollisionParticipantMatchesFilter(target, options)) {
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1051
|
+
mapped.push({
|
|
1052
|
+
kind: "aura-game-collision-sweep-hit",
|
|
1053
|
+
source: sourceParticipant,
|
|
1054
|
+
target: gameCollisionParticipant(target),
|
|
1055
|
+
point: toGameVec3(hit.point),
|
|
1056
|
+
normal: toGameVec3(hit.normal),
|
|
1057
|
+
distance: hit.distance,
|
|
1058
|
+
castCenter: toGameVec3(hit.castCenter),
|
|
1059
|
+
castRadius: hit.castRadius,
|
|
1060
|
+
hit
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
return mapped;
|
|
1064
|
+
},
|
|
1065
|
+
resolve(id, filter = {}) {
|
|
1066
|
+
const handle = requireBody(id);
|
|
1067
|
+
let position = handle.position;
|
|
1068
|
+
for (const contact of currentContacts({ ...filter, includeSensors: false })) {
|
|
1069
|
+
if (contact.contact.colliderA !== handle.collider.id && contact.contact.colliderB !== handle.collider.id) {
|
|
1070
|
+
continue;
|
|
1071
|
+
}
|
|
1072
|
+
const direction = contact.contact.colliderA === handle.collider.id ? -1 : 1;
|
|
1073
|
+
const correction = scaleVec3(contact.normal, direction * (contact.penetration + 0.0001));
|
|
1074
|
+
position = addVec3(position, correction);
|
|
1075
|
+
}
|
|
1076
|
+
handle.body.setPosition(position);
|
|
1077
|
+
return handle.snapshot();
|
|
1078
|
+
},
|
|
1079
|
+
snapshot() {
|
|
1080
|
+
const physicsSnapshot = world.snapshot();
|
|
1081
|
+
return {
|
|
1082
|
+
kind: "aura-game-collision-world",
|
|
1083
|
+
bodies: Array.from(handlesById.values()).map((handle) => handle.snapshot()),
|
|
1084
|
+
contacts: currentContacts(),
|
|
1085
|
+
stats: physicsSnapshot.stats
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
839
1090
|
export function createGameFighting2DRules(options = {}) {
|
|
840
1091
|
return {
|
|
841
1092
|
kind: "aura-game-fighting-2d-rules",
|
|
@@ -1683,6 +1934,66 @@ function syncBodiesFromActors(bodies, actors) {
|
|
|
1683
1934
|
body.position = actor.position;
|
|
1684
1935
|
}
|
|
1685
1936
|
}
|
|
1937
|
+
function gameCollisionParticipant(handle) {
|
|
1938
|
+
return {
|
|
1939
|
+
id: handle.id,
|
|
1940
|
+
bodyId: handle.body.id,
|
|
1941
|
+
colliderId: handle.collider.id,
|
|
1942
|
+
type: handle.body.type,
|
|
1943
|
+
position: handle.position,
|
|
1944
|
+
tags: handle.tags,
|
|
1945
|
+
sensor: handle.collider.sensor,
|
|
1946
|
+
layer: handle.collider.filter.layer,
|
|
1947
|
+
mask: handle.collider.filter.mask
|
|
1948
|
+
};
|
|
1949
|
+
}
|
|
1950
|
+
function gameCollisionPairKey(colliderA, colliderB) {
|
|
1951
|
+
return colliderA < colliderB ? `${colliderA}:${colliderB}` : `${colliderB}:${colliderA}`;
|
|
1952
|
+
}
|
|
1953
|
+
function gameCollisionSweepRadius(shape) {
|
|
1954
|
+
if (shape.kind === "sphere")
|
|
1955
|
+
return shape.radius;
|
|
1956
|
+
if (shape.kind === "capsule")
|
|
1957
|
+
return shape.radius;
|
|
1958
|
+
if (shape.kind === "box")
|
|
1959
|
+
return Math.max(0.05, Math.min(shape.halfExtents[0], shape.halfExtents[1], shape.halfExtents[2]));
|
|
1960
|
+
return 0.1;
|
|
1961
|
+
}
|
|
1962
|
+
function gameCollisionContactMatchesFilter(contact, filter) {
|
|
1963
|
+
if (filter.includeSensors === false && contact.sensor)
|
|
1964
|
+
return false;
|
|
1965
|
+
if (filter.includeSolids === false && !contact.sensor)
|
|
1966
|
+
return false;
|
|
1967
|
+
if (filter.ids?.length && !filter.ids.includes(contact.a.id) && !filter.ids.includes(contact.b.id))
|
|
1968
|
+
return false;
|
|
1969
|
+
if (filter.tags?.length && !hasAnyGameTag(contact.a.tags, filter.tags) && !hasAnyGameTag(contact.b.tags, filter.tags))
|
|
1970
|
+
return false;
|
|
1971
|
+
if (filter.layerMask !== undefined && (contact.a.layer & filter.layerMask) === 0 && (contact.b.layer & filter.layerMask) === 0)
|
|
1972
|
+
return false;
|
|
1973
|
+
return true;
|
|
1974
|
+
}
|
|
1975
|
+
function gameCollisionParticipantMatchesFilter(handle, filter) {
|
|
1976
|
+
if (filter.includeSensors === false && handle.collider.sensor)
|
|
1977
|
+
return false;
|
|
1978
|
+
if (filter.includeSolids === false && !handle.collider.sensor)
|
|
1979
|
+
return false;
|
|
1980
|
+
if (filter.ids?.length && !filter.ids.includes(handle.id))
|
|
1981
|
+
return false;
|
|
1982
|
+
if (filter.tags?.length && !hasAnyGameTag(handle.tags, filter.tags))
|
|
1983
|
+
return false;
|
|
1984
|
+
if (filter.layerMask !== undefined && (handle.collider.filter.layer & filter.layerMask) === 0)
|
|
1985
|
+
return false;
|
|
1986
|
+
return true;
|
|
1987
|
+
}
|
|
1988
|
+
function hasAnyGameTag(source, expected) {
|
|
1989
|
+
return expected.some((tag) => source.includes(tag));
|
|
1990
|
+
}
|
|
1991
|
+
function toGameVec3(value) {
|
|
1992
|
+
return [value[0], value[1], value[2]];
|
|
1993
|
+
}
|
|
1994
|
+
function isDefined(value) {
|
|
1995
|
+
return value !== undefined;
|
|
1996
|
+
}
|
|
1686
1997
|
function resolvePushboxSeparation(actors, stageBounds, frame, time, events) {
|
|
1687
1998
|
const actorList = [...actors.values()];
|
|
1688
1999
|
for (let leftIndex = 0; leftIndex < actorList.length; leftIndex += 1) {
|
|
@@ -2086,6 +2397,52 @@ function effectToSceneNode(effect) {
|
|
|
2086
2397
|
}
|
|
2087
2398
|
};
|
|
2088
2399
|
}
|
|
2400
|
+
export function createGameEventLog(options = {}) {
|
|
2401
|
+
const label = options.label ?? "game events";
|
|
2402
|
+
const maxEvents = Math.max(1, options.maxEvents ?? 64);
|
|
2403
|
+
let sequence = 0;
|
|
2404
|
+
let records = [];
|
|
2405
|
+
const snapshot = () => ({
|
|
2406
|
+
kind: "aura-game-event-log",
|
|
2407
|
+
label,
|
|
2408
|
+
count: records.length,
|
|
2409
|
+
events: [...records],
|
|
2410
|
+
types: [...new Set(records.map((event) => event.type))].sort(),
|
|
2411
|
+
last: records[records.length - 1]
|
|
2412
|
+
});
|
|
2413
|
+
return {
|
|
2414
|
+
kind: "aura-game-event-log",
|
|
2415
|
+
push(event) {
|
|
2416
|
+
sequence += 1;
|
|
2417
|
+
const record = {
|
|
2418
|
+
kind: "aura-game-event",
|
|
2419
|
+
id: `${event.type}:${sequence}`,
|
|
2420
|
+
type: event.type,
|
|
2421
|
+
label: event.label ?? event.type,
|
|
2422
|
+
targetId: event.targetId,
|
|
2423
|
+
value: event.value,
|
|
2424
|
+
tags: [...(event.tags ?? [])],
|
|
2425
|
+
severity: event.severity ?? "info",
|
|
2426
|
+
frame: event.frame ?? sequence,
|
|
2427
|
+
time: event.time ?? 0
|
|
2428
|
+
};
|
|
2429
|
+
records = [...records, record].slice(-maxEvents);
|
|
2430
|
+
return record;
|
|
2431
|
+
},
|
|
2432
|
+
events() {
|
|
2433
|
+
return [...records];
|
|
2434
|
+
},
|
|
2435
|
+
consume() {
|
|
2436
|
+
const consumed = [...records];
|
|
2437
|
+
records = [];
|
|
2438
|
+
return consumed;
|
|
2439
|
+
},
|
|
2440
|
+
clear() {
|
|
2441
|
+
records = [];
|
|
2442
|
+
},
|
|
2443
|
+
snapshot
|
|
2444
|
+
};
|
|
2445
|
+
}
|
|
2089
2446
|
export function createGameHudHealthBinding(options) {
|
|
2090
2447
|
return createGameHudBinding({
|
|
2091
2448
|
binding: "health",
|
|
@@ -2166,6 +2523,78 @@ export function createGameHudDebugToggleBinding(options = {}) {
|
|
|
2166
2523
|
visibleWhen: options.visibleWhen ?? options.action
|
|
2167
2524
|
});
|
|
2168
2525
|
}
|
|
2526
|
+
export function createGameHudValueBinding(options) {
|
|
2527
|
+
return createGameHudBinding({
|
|
2528
|
+
binding: options.binding ?? "value",
|
|
2529
|
+
id: options.id ?? `hud:${options.binding ?? "value"}:${options.valuePath.replace(/[^a-z0-9]+/gi, "-").replace(/^-|-$/g, "")}`,
|
|
2530
|
+
label: options.label ?? options.binding ?? "value",
|
|
2531
|
+
source: options.source ?? "app-state",
|
|
2532
|
+
targetId: options.targetId,
|
|
2533
|
+
valuePath: options.valuePath,
|
|
2534
|
+
maxPath: options.maxPath,
|
|
2535
|
+
format: options.format ?? "text",
|
|
2536
|
+
a11yLabel: options.a11yLabel ?? options.label ?? options.binding ?? "value",
|
|
2537
|
+
debugOnly: options.debugOnly,
|
|
2538
|
+
interactive: options.interactive,
|
|
2539
|
+
visibleWhen: options.visibleWhen
|
|
2540
|
+
});
|
|
2541
|
+
}
|
|
2542
|
+
export function createGameHudScoreBinding(options = {}) {
|
|
2543
|
+
return createGameHudValueBinding({
|
|
2544
|
+
...options,
|
|
2545
|
+
binding: "score",
|
|
2546
|
+
id: options.id ?? "hud:score",
|
|
2547
|
+
label: options.label ?? "score",
|
|
2548
|
+
valuePath: options.valuePath ?? "appState.score",
|
|
2549
|
+
format: options.format ?? "number",
|
|
2550
|
+
a11yLabel: options.a11yLabel ?? "score"
|
|
2551
|
+
});
|
|
2552
|
+
}
|
|
2553
|
+
export function createGameHudLivesBinding(options = {}) {
|
|
2554
|
+
return createGameHudValueBinding({
|
|
2555
|
+
...options,
|
|
2556
|
+
binding: "lives",
|
|
2557
|
+
id: options.id ?? "hud:lives",
|
|
2558
|
+
label: options.label ?? "lives",
|
|
2559
|
+
valuePath: options.valuePath ?? "appState.lives",
|
|
2560
|
+
format: options.format ?? "number",
|
|
2561
|
+
a11yLabel: options.a11yLabel ?? "lives remaining"
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
export function createGameHudObjectiveBinding(options = {}) {
|
|
2565
|
+
return createGameHudValueBinding({
|
|
2566
|
+
...options,
|
|
2567
|
+
binding: "objective",
|
|
2568
|
+
id: options.id ?? "hud:objective",
|
|
2569
|
+
label: options.label ?? "objective",
|
|
2570
|
+
valuePath: options.valuePath ?? "appState.objective",
|
|
2571
|
+
format: options.format ?? "text",
|
|
2572
|
+
a11yLabel: options.a11yLabel ?? "current objective"
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
export function createGameHudCheckpointBinding(options = {}) {
|
|
2576
|
+
return createGameHudValueBinding({
|
|
2577
|
+
...options,
|
|
2578
|
+
binding: "checkpoint",
|
|
2579
|
+
id: options.id ?? "hud:checkpoint",
|
|
2580
|
+
label: options.label ?? "checkpoint",
|
|
2581
|
+
valuePath: options.valuePath ?? "appState.checkpoint",
|
|
2582
|
+
format: options.format ?? "text",
|
|
2583
|
+
a11yLabel: options.a11yLabel ?? "current checkpoint"
|
|
2584
|
+
});
|
|
2585
|
+
}
|
|
2586
|
+
export function createGameHudEventLogBinding(options = {}) {
|
|
2587
|
+
return createGameHudValueBinding({
|
|
2588
|
+
...options,
|
|
2589
|
+
binding: "event-log",
|
|
2590
|
+
id: options.id ?? "hud:event-log",
|
|
2591
|
+
label: options.label ?? "event log",
|
|
2592
|
+
valuePath: options.valuePath ?? "appState.events",
|
|
2593
|
+
format: options.format ?? "text",
|
|
2594
|
+
a11yLabel: options.a11yLabel ?? "game event log",
|
|
2595
|
+
debugOnly: options.debugOnly ?? true
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2169
2598
|
export function createGameHudBindings(bindings) {
|
|
2170
2599
|
return [...bindings];
|
|
2171
2600
|
}
|