@aura3d/engine 1.5.1 → 2.0.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 +142 -83
- package/dist/animation/FootIk.d.ts +10 -1
- package/dist/animation/FootIk.d.ts.map +1 -1
- package/dist/animation/FootIk.js.map +1 -1
- package/dist/animation/HumanoidRetargeting.js +1 -1
- package/dist/animation/RigQuality.d.ts +1 -1
- package/dist/animation/RigQuality.js +2 -2
- package/dist/animation/RigQuality.js.map +1 -1
- package/dist/animation/SecondaryAnimationSampling.d.ts +55 -0
- package/dist/animation/SecondaryAnimationSampling.d.ts.map +1 -0
- package/dist/animation/SecondaryAnimationSampling.js +145 -0
- package/dist/animation/SecondaryAnimationSampling.js.map +1 -0
- package/dist/animation/SpringBones.d.ts.map +1 -1
- package/dist/animation/SpringBones.js +1 -2
- package/dist/animation/SpringBones.js.map +1 -1
- package/dist/animation/browser-index.d.ts +0 -2
- package/dist/animation/browser-index.d.ts.map +1 -1
- package/dist/animation/browser-index.js +0 -2
- package/dist/animation/browser-index.js.map +1 -1
- package/dist/animation/index.d.ts +0 -2
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +0 -2
- package/dist/animation/index.js.map +1 -1
- package/dist/assets/GLTFAnimationRuntime.d.ts +4 -0
- package/dist/assets/GLTFAnimationRuntime.d.ts.map +1 -1
- package/dist/assets/GLTFAnimationRuntime.js +29 -6
- package/dist/assets/GLTFAnimationRuntime.js.map +1 -1
- package/dist/assets/GLTFLoader.d.ts.map +1 -1
- package/dist/assets/GLTFLoader.js +13 -4
- package/dist/assets/GLTFLoader.js.map +1 -1
- package/dist/assets/browser-index.d.ts +0 -4
- package/dist/assets/browser-index.d.ts.map +1 -1
- package/dist/assets/browser-index.js +0 -2
- package/dist/assets/browser-index.js.map +1 -1
- package/dist/assets/gltf-runtime.d.ts +6 -0
- package/dist/assets/gltf-runtime.d.ts.map +1 -0
- package/dist/assets/gltf-runtime.js +4 -0
- package/dist/assets/gltf-runtime.js.map +1 -0
- package/dist/assets/index.d.ts +0 -4
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +0 -2
- package/dist/assets/index.js.map +1 -1
- package/dist/audio/AudioBus.d.ts +19 -1
- package/dist/audio/AudioBus.d.ts.map +1 -1
- package/dist/audio/AudioBus.js.map +1 -1
- package/dist/audio/AudioFileManager.d.ts +5 -0
- package/dist/audio/AudioFileManager.d.ts.map +1 -1
- package/dist/audio/AudioFileManager.js +13 -0
- package/dist/audio/AudioFileManager.js.map +1 -1
- package/dist/audio/AudioSource.d.ts +8 -0
- package/dist/audio/AudioSource.d.ts.map +1 -1
- package/dist/audio/AudioSource.js +56 -7
- package/dist/audio/AudioSource.js.map +1 -1
- package/dist/audio/index.d.ts +1 -7
- package/dist/audio/index.d.ts.map +1 -1
- package/dist/audio/index.js +0 -3
- package/dist/audio/index.js.map +1 -1
- package/dist/aura3d-cli/asset-core-types.d.ts +1 -1
- package/dist/aura3d-cli/asset-core-types.d.ts.map +1 -1
- package/dist/aura3d-cli/asset-manifest.d.ts.map +1 -1
- package/dist/aura3d-cli/asset-manifest.js +36 -2
- package/dist/aura3d-cli/asset-manifest.js.map +1 -1
- package/dist/aura3d-cli/asset-role-admission.js +1 -1
- package/dist/aura3d-cli/asset-role-admission.js.map +1 -1
- package/dist/aura3d-cli/cli-help.js +3 -3
- package/dist/aura3d-cli/cli-help.js.map +1 -1
- package/dist/aura3d-cli/cli-options.d.ts +1 -1
- package/dist/aura3d-cli/cli-options.d.ts.map +1 -1
- package/dist/aura3d-cli/cli-options.js +2 -2
- package/dist/aura3d-cli/cli-options.js.map +1 -1
- package/dist/aura3d-cli/cli.js +1 -1
- package/dist/aura3d-cli/cli.js.map +1 -1
- package/dist/aura3d-cli/index.d.ts.map +1 -1
- package/dist/aura3d-cli/index.js +13 -5
- package/dist/aura3d-cli/index.js.map +1 -1
- package/dist/create-aura3d/index.d.ts.map +1 -1
- package/dist/create-aura3d/index.js +10 -4
- package/dist/create-aura3d/index.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-evidence.js +5 -1
- package/dist/create-aura3d/showcase-spec-evidence.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.d.ts +8 -1
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.d.ts.map +1 -1
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.js +191 -31
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-game-template-evidence.d.ts.map +1 -1
- package/dist/create-aura3d/showcase-spec-game-template-evidence.js +7 -0
- package/dist/create-aura3d/showcase-spec-game-template-evidence.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-parser.js +1 -1
- package/dist/create-aura3d/showcase-spec-parser.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-types.d.ts +50 -0
- package/dist/create-aura3d/showcase-spec-types.d.ts.map +1 -1
- package/dist/editor-runtime/index.d.ts +0 -2
- package/dist/editor-runtime/index.d.ts.map +1 -1
- package/dist/editor-runtime/index.js +0 -1
- package/dist/editor-runtime/index.js.map +1 -1
- package/dist/engine/agent-api/GameAssetValidation.js +1 -1
- package/dist/engine/agent-api/GameAssetValidation.js.map +1 -1
- package/dist/engine/agent-api/GameEvidence.js +1 -1
- package/dist/engine/agent-api/GameEvidence.js.map +1 -1
- package/dist/engine/agent-api/GameGenreKits.d.ts +63 -0
- package/dist/engine/agent-api/GameGenreKits.d.ts.map +1 -1
- package/dist/engine/agent-api/GameGenreKits.js +274 -56
- package/dist/engine/agent-api/GameGenreKits.js.map +1 -1
- package/dist/engine/agent-api/GameRuntime.d.ts +38 -1
- package/dist/engine/agent-api/GameRuntime.d.ts.map +1 -1
- package/dist/engine/agent-api/GameRuntime.js +69 -1
- package/dist/engine/agent-api/GameRuntime.js.map +1 -1
- package/dist/engine/agent-api/GameSceneGeometryBindings.d.ts +24 -0
- package/dist/engine/agent-api/GameSceneGeometryBindings.d.ts.map +1 -1
- package/dist/engine/agent-api/GameSceneGeometryBindings.js +52 -0
- package/dist/engine/agent-api/GameSceneGeometryBindings.js.map +1 -1
- package/dist/engine/agent-api/LeanArcadeRuntime.d.ts +111 -0
- package/dist/engine/agent-api/LeanArcadeRuntime.d.ts.map +1 -0
- package/dist/engine/agent-api/LeanArcadeRuntime.js +219 -0
- package/dist/engine/agent-api/LeanArcadeRuntime.js.map +1 -0
- package/dist/engine/agent-api/PhysicsRuntime.d.ts +332 -0
- package/dist/engine/agent-api/PhysicsRuntime.d.ts.map +1 -0
- package/dist/engine/agent-api/PhysicsRuntime.js +619 -0
- package/dist/engine/agent-api/PhysicsRuntime.js.map +1 -0
- package/dist/engine/agent-api/PlatformerMotion.d.ts +124 -0
- package/dist/engine/agent-api/PlatformerMotion.d.ts.map +1 -1
- package/dist/engine/agent-api/PlatformerMotion.js +101 -16
- package/dist/engine/agent-api/PlatformerMotion.js.map +1 -1
- package/dist/engine/agent-api/RootGeometry.d.ts +36 -0
- package/dist/engine/agent-api/RootGeometry.d.ts.map +1 -0
- package/dist/engine/agent-api/RootGeometry.js +152 -0
- package/dist/engine/agent-api/RootGeometry.js.map +1 -0
- package/dist/engine/agent-api/SpatialAnchoring.d.ts +47 -0
- package/dist/engine/agent-api/SpatialAnchoring.d.ts.map +1 -1
- package/dist/engine/agent-api/SpatialAnchoring.js +46 -0
- package/dist/engine/agent-api/SpatialAnchoring.js.map +1 -1
- package/dist/engine/agent-api/VehicleChassis.d.ts +52 -0
- package/dist/engine/agent-api/VehicleChassis.d.ts.map +1 -1
- package/dist/engine/agent-api/VehicleChassis.js +182 -8
- package/dist/engine/agent-api/VehicleChassis.js.map +1 -1
- package/dist/engine/agent-api/WorldLabelRenderer.d.ts +65 -1
- package/dist/engine/agent-api/WorldLabelRenderer.d.ts.map +1 -1
- package/dist/engine/agent-api/WorldLabelRenderer.js +48 -5
- package/dist/engine/agent-api/WorldLabelRenderer.js.map +1 -1
- package/dist/engine/agent-api/humanoid-walk-runtime.d.ts +1 -1
- package/dist/engine/agent-api/index.d.ts +240 -14
- package/dist/engine/agent-api/index.d.ts.map +1 -1
- package/dist/engine/agent-api/index.js +1435 -344
- package/dist/engine/agent-api/index.js.map +1 -1
- package/dist/engine/agent-api/lean-base.d.ts +224 -0
- package/dist/engine/agent-api/lean-base.d.ts.map +1 -0
- package/dist/engine/agent-api/lean-base.js +322 -0
- package/dist/engine/agent-api/lean-base.js.map +1 -0
- package/dist/engine/agent-api/lean-game.d.ts +3 -0
- package/dist/engine/agent-api/lean-game.d.ts.map +1 -0
- package/dist/engine/agent-api/lean-game.js +3 -0
- package/dist/engine/agent-api/lean-game.js.map +1 -0
- package/dist/engine/agent-api/lean-product.d.ts +3 -0
- package/dist/engine/agent-api/lean-product.d.ts.map +1 -0
- package/dist/engine/agent-api/lean-product.js +3 -0
- package/dist/engine/agent-api/lean-product.js.map +1 -0
- package/dist/engine/agent-api/lean.d.ts +3 -0
- package/dist/engine/agent-api/lean.d.ts.map +1 -0
- package/dist/engine/agent-api/lean.js +3 -0
- package/dist/engine/agent-api/lean.js.map +1 -0
- package/dist/engine/agent-api/media-node.d.ts +42 -0
- package/dist/engine/agent-api/media-node.d.ts.map +1 -0
- package/dist/engine/agent-api/media-node.js +44 -0
- package/dist/engine/agent-api/media-node.js.map +1 -0
- package/dist/engine/agent-api/product-viewer-runtime.d.ts.map +1 -1
- package/dist/engine/game/GameAudio.d.ts +5 -0
- package/dist/engine/game/GameAudio.d.ts.map +1 -1
- package/dist/engine/game/GameAudio.js +65 -23
- package/dist/engine/game/GameAudio.js.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.d.ts +9 -1
- package/dist/engine/production-runtime/TypedGLBActor.d.ts.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.js +25 -7
- package/dist/engine/production-runtime/TypedGLBActor.js.map +1 -1
- package/dist/engine/production-runtime/index.d.ts +2 -2
- package/dist/engine/production-runtime/index.d.ts.map +1 -1
- package/dist/engine/threejs-example-parity/FlagshipFoundation.d.ts +3 -3
- package/dist/engine/threejs-example-parity/FlagshipFoundation.d.ts.map +1 -1
- package/dist/environments/index.d.ts +5 -10
- package/dist/environments/index.d.ts.map +1 -1
- package/dist/environments/index.js +0 -3
- package/dist/environments/index.js.map +1 -1
- package/dist/environments/node.d.ts +7 -0
- package/dist/environments/node.d.ts.map +1 -0
- package/dist/environments/node.js +5 -0
- package/dist/environments/node.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/input/InputActionBinding.d.ts +44 -0
- package/dist/input/InputActionBinding.d.ts.map +1 -0
- package/dist/input/InputActionBinding.js +86 -0
- package/dist/input/InputActionBinding.js.map +1 -0
- package/dist/input/InputActionBindingFixtures.d.ts +8 -0
- package/dist/input/InputActionBindingFixtures.d.ts.map +1 -1
- package/dist/input/InputActionBindingFixtures.js +8 -0
- package/dist/input/InputActionBindingFixtures.js.map +1 -1
- package/dist/input/InputValueProcessors.d.ts +19 -0
- package/dist/input/InputValueProcessors.d.ts.map +1 -0
- package/dist/input/InputValueProcessors.js +24 -0
- package/dist/input/InputValueProcessors.js.map +1 -0
- package/dist/input/index.d.ts +2 -6
- package/dist/input/index.d.ts.map +1 -1
- package/dist/input/index.js +1 -3
- package/dist/input/index.js.map +1 -1
- package/dist/lean/ArcadeRuntime.d.ts +111 -0
- package/dist/lean/ArcadeRuntime.d.ts.map +1 -0
- package/dist/lean/ArcadeRuntime.js +219 -0
- package/dist/lean/ArcadeRuntime.js.map +1 -0
- package/dist/lean/base.d.ts +228 -0
- package/dist/lean/base.d.ts.map +1 -0
- package/dist/lean/base.js +322 -0
- package/dist/lean/base.js.map +1 -0
- package/dist/lean/game.d.ts +19 -0
- package/dist/lean/game.d.ts.map +1 -0
- package/dist/lean/game.js +37 -0
- package/dist/lean/game.js.map +1 -0
- package/dist/lean/index.d.ts +4 -0
- package/dist/lean/index.d.ts.map +1 -0
- package/dist/lean/index.js +10 -0
- package/dist/lean/index.js.map +1 -0
- package/dist/lean/product.d.ts +4 -0
- package/dist/lean/product.d.ts.map +1 -0
- package/dist/lean/product.js +55 -0
- package/dist/lean/product.js.map +1 -0
- package/dist/materials/index.d.ts +1 -10
- package/dist/materials/index.d.ts.map +1 -1
- package/dist/materials/index.js +1 -6
- package/dist/materials/index.js.map +1 -1
- package/dist/materials/node.d.ts +4 -0
- package/dist/materials/node.d.ts.map +1 -0
- package/dist/materials/node.js +3 -0
- package/dist/materials/node.js.map +1 -0
- package/dist/physics/ArcadeCharacterController.d.ts +53 -0
- package/dist/physics/ArcadeCharacterController.d.ts.map +1 -0
- package/dist/physics/ArcadeCharacterController.js +98 -0
- package/dist/physics/ArcadeCharacterController.js.map +1 -0
- package/dist/physics/ArcadeVehicleTelemetry.d.ts +162 -0
- package/dist/physics/ArcadeVehicleTelemetry.d.ts.map +1 -0
- package/dist/physics/ArcadeVehicleTelemetry.js +363 -0
- package/dist/physics/ArcadeVehicleTelemetry.js.map +1 -0
- package/dist/physics/CharacterController.d.ts +52 -0
- package/dist/physics/CharacterController.d.ts.map +1 -1
- package/dist/physics/CharacterController.js +380 -7
- package/dist/physics/CharacterController.js.map +1 -1
- package/dist/physics/Constraint.d.ts +20 -4
- package/dist/physics/Constraint.d.ts.map +1 -1
- package/dist/physics/Constraint.js +34 -60
- package/dist/physics/Constraint.js.map +1 -1
- package/dist/physics/FightingCharacterController.d.ts +32 -0
- package/dist/physics/FightingCharacterController.d.ts.map +1 -0
- package/dist/physics/FightingCharacterController.js +76 -0
- package/dist/physics/FightingCharacterController.js.map +1 -0
- package/dist/physics/MeshBVH.d.ts +72 -0
- package/dist/physics/MeshBVH.d.ts.map +1 -0
- package/dist/physics/MeshBVH.js +244 -0
- package/dist/physics/MeshBVH.js.map +1 -0
- package/dist/physics/PathFollowDriver.d.ts +162 -0
- package/dist/physics/PathFollowDriver.d.ts.map +1 -0
- package/dist/physics/PathFollowDriver.js +163 -0
- package/dist/physics/PathFollowDriver.js.map +1 -0
- package/dist/physics/PhysicsDebugDraw.d.ts +40 -1
- package/dist/physics/PhysicsDebugDraw.d.ts.map +1 -1
- package/dist/physics/PhysicsDebugDraw.js +87 -17
- package/dist/physics/PhysicsDebugDraw.js.map +1 -1
- package/dist/physics/PhysicsWorld.d.ts +37 -18
- package/dist/physics/PhysicsWorld.d.ts.map +1 -1
- package/dist/physics/PhysicsWorld.js +231 -630
- package/dist/physics/PhysicsWorld.js.map +1 -1
- package/dist/physics/RacingLineProfile.d.ts +116 -0
- package/dist/physics/RacingLineProfile.d.ts.map +1 -0
- package/dist/physics/RacingLineProfile.js +181 -0
- package/dist/physics/RacingLineProfile.js.map +1 -0
- package/dist/physics/Raycast.d.ts +11 -0
- package/dist/physics/Raycast.d.ts.map +1 -1
- package/dist/physics/Raycast.js +62 -8
- package/dist/physics/Raycast.js.map +1 -1
- package/dist/physics/RigidBody.d.ts +16 -9
- package/dist/physics/RigidBody.d.ts.map +1 -1
- package/dist/physics/RigidBody.js +23 -75
- package/dist/physics/RigidBody.js.map +1 -1
- package/dist/physics/SurfaceQuery.d.ts +72 -0
- package/dist/physics/SurfaceQuery.d.ts.map +1 -0
- package/dist/physics/SurfaceQuery.js +89 -0
- package/dist/physics/SurfaceQuery.js.map +1 -0
- package/dist/physics/VehicleDynamics.d.ts +10 -0
- package/dist/physics/VehicleDynamics.d.ts.map +1 -1
- package/dist/physics/VehicleDynamics.js +31 -3
- package/dist/physics/VehicleDynamics.js.map +1 -1
- package/dist/physics/VehicleMotion.d.ts +125 -0
- package/dist/physics/VehicleMotion.d.ts.map +1 -0
- package/dist/physics/VehicleMotion.js +373 -0
- package/dist/physics/VehicleMotion.js.map +1 -0
- package/dist/physics/index.d.ts +62 -17
- package/dist/physics/index.d.ts.map +1 -1
- package/dist/physics/index.js +70 -17
- package/dist/physics/index.js.map +1 -1
- package/dist/physics/solverless-entry.d.ts +41 -0
- package/dist/physics/solverless-entry.d.ts.map +1 -0
- package/dist/physics/solverless-entry.js +40 -0
- package/dist/physics/solverless-entry.js.map +1 -0
- package/dist/physics/solverless.d.ts +37 -0
- package/dist/physics/solverless.d.ts.map +1 -0
- package/dist/physics/solverless.js +36 -0
- package/dist/physics/solverless.js.map +1 -0
- package/dist/physics/world-entry.d.ts +31 -0
- package/dist/physics/world-entry.d.ts.map +1 -0
- package/dist/physics/world-entry.js +30 -0
- package/dist/physics/world-entry.js.map +1 -0
- package/dist/physics/world.d.ts +18 -0
- package/dist/physics/world.d.ts.map +1 -0
- package/dist/physics/world.js +17 -0
- package/dist/physics/world.js.map +1 -0
- package/dist/physics-rapier/index.d.ts +169 -0
- package/dist/physics-rapier/index.d.ts.map +1 -0
- package/dist/physics-rapier/index.js +311 -0
- package/dist/physics-rapier/index.js.map +1 -0
- package/dist/product-studio/ProductLighting.d.ts.map +1 -1
- package/dist/product-studio/ProductLighting.js +34 -3
- package/dist/product-studio/ProductLighting.js.map +1 -1
- package/dist/rendering/ArchitecturalLighting.d.ts +35 -0
- package/dist/rendering/ArchitecturalLighting.d.ts.map +1 -0
- package/dist/rendering/ArchitecturalLighting.js +162 -0
- package/dist/rendering/ArchitecturalLighting.js.map +1 -0
- package/dist/rendering/ArchitecturalMaterialCatalog.d.ts +1 -1
- package/dist/rendering/ArchitecturalMaterialCatalog.d.ts.map +1 -1
- package/dist/rendering/ArchitecturalMaterialCatalog.js +1 -1
- package/dist/rendering/ArchitecturalMaterialCatalog.js.map +1 -1
- package/dist/rendering/ArchitecturalMeasurement.d.ts +27 -0
- package/dist/rendering/ArchitecturalMeasurement.d.ts.map +1 -0
- package/dist/rendering/ArchitecturalMeasurement.js +112 -0
- package/dist/rendering/ArchitecturalMeasurement.js.map +1 -0
- package/dist/rendering/CameraFraming.d.ts +77 -0
- package/dist/rendering/CameraFraming.d.ts.map +1 -1
- package/dist/rendering/CameraFraming.js +176 -1
- package/dist/rendering/CameraFraming.js.map +1 -1
- package/dist/rendering/CanonicalProductScene.d.ts +13 -0
- package/dist/rendering/CanonicalProductScene.d.ts.map +1 -0
- package/dist/rendering/CanonicalProductScene.js +78 -0
- package/dist/rendering/CanonicalProductScene.js.map +1 -0
- package/dist/rendering/CascadedShadowMaps.d.ts +1 -1
- package/dist/rendering/CascadedShadowMaps.d.ts.map +1 -1
- package/dist/rendering/CascadedShadowMaps.js +1 -1
- package/dist/rendering/CascadedShadowMaps.js.map +1 -1
- package/dist/rendering/DepthPass.d.ts +1 -1
- package/dist/rendering/DepthPass.d.ts.map +1 -1
- package/dist/rendering/DepthPass.js +2 -2
- package/dist/rendering/DepthPass.js.map +1 -1
- package/dist/rendering/EnvironmentBackgroundPass.d.ts +1 -1
- package/dist/rendering/EnvironmentBackgroundPass.d.ts.map +1 -1
- package/dist/rendering/EnvironmentBackgroundPass.js +2 -2
- package/dist/rendering/EnvironmentBackgroundPass.js.map +1 -1
- package/dist/rendering/EnvironmentPlatform.js +2 -2
- package/dist/rendering/EnvironmentPlatform.js.map +1 -1
- package/dist/rendering/ForwardPass.d.ts +1 -1
- package/dist/rendering/ForwardPass.d.ts.map +1 -1
- package/dist/rendering/ForwardPass.js +24 -10
- package/dist/rendering/ForwardPass.js.map +1 -1
- package/dist/rendering/Geometry.d.ts +2 -0
- package/dist/rendering/Geometry.d.ts.map +1 -1
- package/dist/rendering/Geometry.js +15 -0
- package/dist/rendering/Geometry.js.map +1 -1
- package/dist/rendering/InstancedPBRMaterial.js +1 -1
- package/dist/rendering/InstancedPBRMaterial.js.map +1 -1
- package/dist/rendering/InstancedUnlitMaterial.js +1 -1
- package/dist/rendering/InstancedUnlitMaterial.js.map +1 -1
- package/dist/rendering/Material.js +2 -2
- package/dist/rendering/Material.js.map +1 -1
- package/dist/rendering/MaterialBinding.js +4 -4
- package/dist/rendering/MaterialBinding.js.map +1 -1
- package/dist/rendering/MaterialInstance.js +2 -2
- package/dist/rendering/MaterialInstance.js.map +1 -1
- package/dist/rendering/MorphUnlitMaterial.js +1 -1
- package/dist/rendering/MorphUnlitMaterial.js.map +1 -1
- package/dist/rendering/NormalMappedPBRMaterial.js +1 -1
- package/dist/rendering/NormalMappedPBRMaterial.js.map +1 -1
- package/dist/rendering/OceanSurface.d.ts +62 -0
- package/dist/rendering/OceanSurface.d.ts.map +1 -0
- package/dist/rendering/OceanSurface.js +240 -0
- package/dist/rendering/OceanSurface.js.map +1 -0
- package/dist/rendering/PBRMaterial.d.ts.map +1 -1
- package/dist/rendering/PBRMaterial.js +3 -3
- package/dist/rendering/PBRMaterial.js.map +1 -1
- package/dist/rendering/PortableShaderMaterial.d.ts +60 -0
- package/dist/rendering/PortableShaderMaterial.d.ts.map +1 -0
- package/dist/rendering/PortableShaderMaterial.js +223 -0
- package/dist/rendering/PortableShaderMaterial.js.map +1 -0
- package/dist/rendering/PostProcessPass.d.ts.map +1 -1
- package/dist/rendering/PostProcessPass.js +30 -6
- package/dist/rendering/PostProcessPass.js.map +1 -1
- package/dist/rendering/ProceduralTexture.d.ts +27 -0
- package/dist/rendering/ProceduralTexture.d.ts.map +1 -0
- package/dist/rendering/ProceduralTexture.js +336 -0
- package/dist/rendering/ProceduralTexture.js.map +1 -0
- package/dist/rendering/ProductTurntable.d.ts +96 -0
- package/dist/rendering/ProductTurntable.d.ts.map +1 -0
- package/dist/rendering/ProductTurntable.js +639 -0
- package/dist/rendering/ProductTurntable.js.map +1 -0
- package/dist/rendering/RenderDevice.d.ts +30 -0
- package/dist/rendering/RenderDevice.d.ts.map +1 -1
- package/dist/rendering/RenderDevice.js.map +1 -1
- package/dist/rendering/Renderer.d.ts +28 -4
- package/dist/rendering/Renderer.d.ts.map +1 -1
- package/dist/rendering/Renderer.js +34 -12
- package/dist/rendering/Renderer.js.map +1 -1
- package/dist/rendering/RendererPostprocessPlan.js +4 -4
- package/dist/rendering/RendererPostprocessPlan.js.map +1 -1
- package/dist/rendering/ScreenSpaceLineMaterial.js +1 -1
- package/dist/rendering/ScreenSpaceLineMaterial.js.map +1 -1
- package/dist/rendering/ShaderChunks.d.ts.map +1 -1
- package/dist/rendering/ShaderChunks.js +81 -19
- package/dist/rendering/ShaderChunks.js.map +1 -1
- package/dist/rendering/ShaderLibrary.d.ts +2 -78
- package/dist/rendering/ShaderLibrary.d.ts.map +1 -1
- package/dist/rendering/ShaderLibrary.js +127 -793
- package/dist/rendering/ShaderLibrary.js.map +1 -1
- package/dist/rendering/ShaderLibraryCore.d.ts +100 -0
- package/dist/rendering/ShaderLibraryCore.d.ts.map +1 -0
- package/dist/rendering/ShaderLibraryCore.js +800 -0
- package/dist/rendering/ShaderLibraryCore.js.map +1 -0
- package/dist/rendering/ShaderModule.d.ts +1 -1
- package/dist/rendering/ShaderModule.d.ts.map +1 -1
- package/dist/rendering/ShaderModule.js +4 -2
- package/dist/rendering/ShaderModule.js.map +1 -1
- package/dist/rendering/ShadowPass.d.ts +1 -1
- package/dist/rendering/ShadowPass.d.ts.map +1 -1
- package/dist/rendering/ShadowPass.js +6 -4
- package/dist/rendering/ShadowPass.js.map +1 -1
- package/dist/rendering/SkinnedLitMaterial.js +1 -1
- package/dist/rendering/SkinnedLitMaterial.js.map +1 -1
- package/dist/rendering/SkinnedUnlitMaterial.js +1 -1
- package/dist/rendering/SkinnedUnlitMaterial.js.map +1 -1
- package/dist/rendering/SpaceEnvironment.d.ts +54 -0
- package/dist/rendering/SpaceEnvironment.d.ts.map +1 -0
- package/dist/rendering/SpaceEnvironment.js +116 -0
- package/dist/rendering/SpaceEnvironment.js.map +1 -0
- package/dist/rendering/TerrainHeightfield.d.ts +60 -0
- package/dist/rendering/TerrainHeightfield.d.ts.map +1 -0
- package/dist/rendering/TerrainHeightfield.js +239 -0
- package/dist/rendering/TerrainHeightfield.js.map +1 -0
- package/dist/rendering/TextureBinding.d.ts +14 -0
- package/dist/rendering/TextureBinding.d.ts.map +1 -1
- package/dist/rendering/TextureBinding.js +17 -0
- package/dist/rendering/TextureBinding.js.map +1 -1
- package/dist/rendering/TexturedPBRMaterial.js +1 -1
- package/dist/rendering/TexturedPBRMaterial.js.map +1 -1
- package/dist/rendering/TexturedUnlitMaterial.js +1 -1
- package/dist/rendering/TexturedUnlitMaterial.js.map +1 -1
- package/dist/rendering/UnlitMaterial.js +1 -1
- package/dist/rendering/UnlitMaterial.js.map +1 -1
- package/dist/rendering/VegetationFixtures.d.ts +1 -1
- package/dist/rendering/VegetationFixtures.d.ts.map +1 -1
- package/dist/rendering/VegetationFixtures.js +1 -1
- package/dist/rendering/VegetationFixtures.js.map +1 -1
- package/dist/rendering/VegetationScatter.d.ts +68 -0
- package/dist/rendering/VegetationScatter.d.ts.map +1 -0
- package/dist/rendering/VegetationScatter.js +241 -0
- package/dist/rendering/VegetationScatter.js.map +1 -0
- package/dist/rendering/VoxelWorld.d.ts +51 -0
- package/dist/rendering/VoxelWorld.d.ts.map +1 -0
- package/dist/rendering/VoxelWorld.js +183 -0
- package/dist/rendering/VoxelWorld.js.map +1 -0
- package/dist/rendering/Weather.d.ts +44 -0
- package/dist/rendering/Weather.d.ts.map +1 -0
- package/dist/rendering/Weather.js +140 -0
- package/dist/rendering/Weather.js.map +1 -0
- package/dist/rendering/WebGL2Device.d.ts +22 -0
- package/dist/rendering/WebGL2Device.d.ts.map +1 -1
- package/dist/rendering/WebGL2Device.js +134 -23
- package/dist/rendering/WebGL2Device.js.map +1 -1
- package/dist/rendering/WebGPUDevice.d.ts +19 -2
- package/dist/rendering/WebGPUDevice.d.ts.map +1 -1
- package/dist/rendering/WebGPUDevice.js +188 -9
- package/dist/rendering/WebGPUDevice.js.map +1 -1
- package/dist/rendering/index.d.ts +28 -35
- package/dist/rendering/index.d.ts.map +1 -1
- package/dist/rendering/index.js +36 -20
- package/dist/rendering/index.js.map +1 -1
- package/dist/rendering/lean/LeanProductRenderer.d.ts +29 -0
- package/dist/rendering/lean/LeanProductRenderer.d.ts.map +1 -0
- package/dist/rendering/lean/LeanProductRenderer.js +38 -0
- package/dist/rendering/lean/LeanProductRenderer.js.map +1 -0
- package/dist/rendering/lean/LeanProductionRenderer.d.ts +38 -0
- package/dist/rendering/lean/LeanProductionRenderer.d.ts.map +1 -0
- package/dist/rendering/lean/LeanProductionRenderer.js +88 -0
- package/dist/rendering/lean/LeanProductionRenderer.js.map +1 -0
- package/dist/rendering/lean-runtime.d.ts +18 -0
- package/dist/rendering/lean-runtime.d.ts.map +1 -0
- package/dist/rendering/lean-runtime.js +13 -0
- package/dist/rendering/lean-runtime.js.map +1 -0
- package/dist/rendering/postprocess/EffectComposer.d.ts.map +1 -1
- package/dist/rendering/postprocess/EffectComposer.js +1 -3
- package/dist/rendering/postprocess/EffectComposer.js.map +1 -1
- package/dist/rendering/production-runtime/PBRHDRPipeline.d.ts.map +1 -1
- package/dist/rendering/production-runtime/PBRHDRPipeline.js +5 -1
- package/dist/rendering/production-runtime/PBRHDRPipeline.js.map +1 -1
- package/dist/rendering/production-runtime/ProductionRendererTypes.d.ts +9 -0
- package/dist/rendering/production-runtime/ProductionRendererTypes.d.ts.map +1 -1
- package/dist/rendering/production-runtime/ProductionRendererTypes.js.map +1 -1
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.d.ts +5 -0
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.d.ts.map +1 -1
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.js +53 -5
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.js.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.d.ts +10 -0
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.d.ts.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.js +21 -2
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.js.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.js +4 -1
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.js.map +1 -1
- package/dist/rendering/webgpu-device-entry.d.ts +25 -0
- package/dist/rendering/webgpu-device-entry.d.ts.map +1 -0
- package/dist/rendering/webgpu-device-entry.js +24 -0
- package/dist/rendering/webgpu-device-entry.js.map +1 -0
- package/dist/rendering/webgpu.d.ts +25 -0
- package/dist/rendering/webgpu.d.ts.map +1 -0
- package/dist/rendering/webgpu.js +24 -0
- package/dist/rendering/webgpu.js.map +1 -0
- package/dist/scene/MathTypes.d.ts +1 -0
- package/dist/scene/MathTypes.d.ts.map +1 -1
- package/dist/scene/MathTypes.js +3 -0
- package/dist/scene/MathTypes.js.map +1 -1
- package/dist/scene/Renderable.d.ts +6 -0
- package/dist/scene/Renderable.d.ts.map +1 -1
- package/dist/scene/Renderable.js +8 -2
- package/dist/scene/Renderable.js.map +1 -1
- package/dist/scripting/index.d.ts +0 -16
- package/dist/scripting/index.d.ts.map +1 -1
- package/dist/scripting/index.js +0 -8
- package/dist/scripting/index.js.map +1 -1
- package/dist/workflows/production-runtime/ProductionExampleRuntime.d.ts +2 -2
- package/dist/workflows/production-runtime/ProductionExampleRuntime.d.ts.map +1 -1
- package/dist/workflows/production-runtime/ProductionExampleRuntime.js +2 -2
- package/dist/workflows/production-runtime/ProductionExampleRuntime.js.map +1 -1
- package/package.json +243 -127
- package/templates/cinematic-scene/node_modules/.vite/deps/_metadata.json +8 -0
- package/templates/cinematic-scene/node_modules/.vite/deps/package.json +3 -0
- package/templates/cinematic-scene/package.json +1 -1
- package/templates/cinematic-scene/test-results/.last-run.json +6 -0
- package/templates/cinematic-scene/test-results/route-health-Aura3D-cinematic-scene-reaches-ready-state/error-context.md +64 -0
- package/templates/mini-game/README.md +3 -2
- package/templates/mini-game/package.json +1 -1
- package/templates/mini-game/src/aura-assets.ts +1 -1
- package/templates/mini-game/src/main.ts +69 -141
- package/templates/product-viewer/README.md +7 -5
- package/templates/product-viewer/index.html +1 -1
- package/templates/product-viewer/node_modules/.vite/deps/_metadata.json +8 -0
- package/templates/product-viewer/node_modules/.vite/deps/package.json +3 -0
- package/templates/product-viewer/package.json +1 -1
- package/templates/product-viewer/src/aura-assets.ts +1 -1
- package/templates/product-viewer/src/main.ts +29 -23
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validatePlatformerMotion } from "./PlatformerMotion.js";
|
|
2
|
+
import { createGameArcadeVehicle, createGameKinematicBody } from "./GameRuntime.js";
|
|
2
3
|
const DEFAULT_LOCOMOTION_CLIP_MAP = {
|
|
3
4
|
idle: "idle",
|
|
4
5
|
run: "run",
|
|
@@ -176,7 +177,30 @@ export function createGamePlatformerKit(level = {}) {
|
|
|
176
177
|
const playerHeight = config.playerSize[1];
|
|
177
178
|
const surfaceQuery = createGamePlatformerSurfaceQuery(level);
|
|
178
179
|
let state = createPlatformerState(config);
|
|
180
|
+
const createBody = () => createGameKinematicBody({
|
|
181
|
+
id: `${config.id}-player`,
|
|
182
|
+
position: [state.player.x, state.player.y, 0],
|
|
183
|
+
velocity: [state.player.vx, state.player.vy, 0],
|
|
184
|
+
size: [playerWidth, playerHeight, 0.25],
|
|
185
|
+
gravity: config.gravity,
|
|
186
|
+
groundY: -1_000_000,
|
|
187
|
+
friction: 0,
|
|
188
|
+
maxSpeed: Math.max(config.moveSpeed, config.dashSpeed),
|
|
189
|
+
jumpVelocity: config.jumpVelocity,
|
|
190
|
+
coyoteMs: config.coyoteMs,
|
|
191
|
+
jumpBufferMs: config.jumpBufferMs
|
|
192
|
+
});
|
|
193
|
+
let body = createBody();
|
|
179
194
|
let events = [];
|
|
195
|
+
const syncPlayerFromBody = () => {
|
|
196
|
+
const next = body.snapshot();
|
|
197
|
+
state.player.x = next.position[0];
|
|
198
|
+
state.player.y = next.position[1];
|
|
199
|
+
state.player.vx = next.velocity[0];
|
|
200
|
+
state.player.vy = next.velocity[1];
|
|
201
|
+
state.player.facing = next.facing;
|
|
202
|
+
state.player.grounded = next.grounded;
|
|
203
|
+
};
|
|
180
204
|
const snapshot = () => ({
|
|
181
205
|
kind: "aura-game-platformer-kit",
|
|
182
206
|
levelId: config.id,
|
|
@@ -215,15 +239,17 @@ export function createGamePlatformerKit(level = {}) {
|
|
|
215
239
|
vy: 0,
|
|
216
240
|
facing: state.player.facing,
|
|
217
241
|
grounded: false,
|
|
218
|
-
coyote: 0,
|
|
219
|
-
jumpBuffer: 0,
|
|
220
242
|
dashCooldown: 0,
|
|
221
243
|
ridingPlatformId: undefined
|
|
222
244
|
};
|
|
245
|
+
body = createBody();
|
|
223
246
|
// Ignore held directional input briefly after a death so a key that caused
|
|
224
247
|
// the miss cannot immediately carry the fresh spawn off its supporting
|
|
225
248
|
// surface before the player or an automated driver can react.
|
|
226
|
-
|
|
249
|
+
// A released direction unlocks immediately; the bounded fallback keeps
|
|
250
|
+
// continuous-input AI/autoplay controllers from remaining locked forever.
|
|
251
|
+
state.respawnControlLock = 0.75;
|
|
252
|
+
state.respawnAwaitingNeutralInput = true;
|
|
227
253
|
emit("respawn", state.checkpointId);
|
|
228
254
|
};
|
|
229
255
|
return {
|
|
@@ -237,6 +263,7 @@ export function createGamePlatformerKit(level = {}) {
|
|
|
237
263
|
if (input.reset === true) {
|
|
238
264
|
events = [];
|
|
239
265
|
state = createPlatformerState(config);
|
|
266
|
+
body = createBody();
|
|
240
267
|
emit("reset");
|
|
241
268
|
return snapshot();
|
|
242
269
|
}
|
|
@@ -255,44 +282,46 @@ export function createGamePlatformerKit(level = {}) {
|
|
|
255
282
|
? previousMoving.find((platform) => platform.id === state.player.ridingPlatformId)
|
|
256
283
|
: undefined;
|
|
257
284
|
if (carried && carriedPrevious && state.player.grounded) {
|
|
258
|
-
|
|
259
|
-
|
|
285
|
+
body.position = [
|
|
286
|
+
body.position[0] + carried.x - carriedPrevious.x,
|
|
287
|
+
body.position[1] + platformTop(carried) - platformTop(carriedPrevious),
|
|
288
|
+
body.position[2]
|
|
289
|
+
];
|
|
290
|
+
syncPlayerFromBody();
|
|
260
291
|
}
|
|
261
292
|
state.respawnControlLock = Math.max(0, state.respawnControlLock - step);
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
state.
|
|
267
|
-
|
|
268
|
-
|
|
293
|
+
const requestedMoveX = clampNumber(input.moveX ?? 0, -1, 1);
|
|
294
|
+
if (state.respawnAwaitingNeutralInput && Math.abs(requestedMoveX) <= 0.01) {
|
|
295
|
+
state.respawnAwaitingNeutralInput = false;
|
|
296
|
+
}
|
|
297
|
+
if (state.respawnControlLock <= 0)
|
|
298
|
+
state.respawnAwaitingNeutralInput = false;
|
|
299
|
+
const controlsLocked = state.respawnAwaitingNeutralInput;
|
|
300
|
+
const moveX = controlsLocked ? 0 : requestedMoveX;
|
|
301
|
+
body.move(moveX, config.moveSpeed);
|
|
302
|
+
if (input.jumpPressed)
|
|
303
|
+
body.requestJump();
|
|
269
304
|
state.player.dashCooldown = Math.max(0, state.player.dashCooldown - step);
|
|
270
305
|
if (!controlsLocked && input.dashPressed && state.player.dashCooldown <= 0) {
|
|
271
|
-
|
|
306
|
+
body.dash([body.facing, 0, 0], config.dashSpeed);
|
|
272
307
|
state.player.dashCooldown = 0.38;
|
|
273
308
|
emit("dash");
|
|
274
309
|
}
|
|
275
|
-
if (
|
|
276
|
-
state.player.vy = config.jumpVelocity;
|
|
277
|
-
state.player.grounded = false;
|
|
310
|
+
if (body.consumeJump(config.jumpVelocity)) {
|
|
278
311
|
state.player.ridingPlatformId = undefined;
|
|
279
|
-
state.player.coyote = 0;
|
|
280
|
-
state.player.jumpBuffer = 0;
|
|
281
312
|
emit("jump");
|
|
282
313
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
314
|
+
if (input.fastFall && body.velocity[1] < 0) {
|
|
315
|
+
body.velocity = [body.velocity[0], body.velocity[1] + config.gravity * 0.6 * step, body.velocity[2]];
|
|
316
|
+
}
|
|
317
|
+
body.update(step);
|
|
318
|
+
syncPlayerFromBody();
|
|
288
319
|
state.player.ridingPlatformId = undefined;
|
|
289
320
|
const platforms = [...config.platforms, ...moving];
|
|
290
321
|
const groundContact = surfaceQuery.groundContact({ player: state.player, previousPlayer, additionalSurfaces: moving });
|
|
291
322
|
if (groundContact.grounded && groundContact.surfaceId && groundContact.surfaceTop !== undefined) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
state.player.grounded = true;
|
|
295
|
-
state.player.coyote = config.coyoteMs / 1000;
|
|
323
|
+
body.snapToGround(groundContact.surfaceTop);
|
|
324
|
+
syncPlayerFromBody();
|
|
296
325
|
state.player.ridingPlatformId = moving.some((candidate) => candidate.id === groundContact.surfaceId) ? groundContact.surfaceId : undefined;
|
|
297
326
|
if (!previousPlayer.grounded)
|
|
298
327
|
emit("land", groundContact.surfaceId);
|
|
@@ -333,6 +362,7 @@ export function createGamePlatformerKit(level = {}) {
|
|
|
333
362
|
reset(checkpointId) {
|
|
334
363
|
events = [];
|
|
335
364
|
state = createPlatformerState(config, checkpointId);
|
|
365
|
+
body = createBody();
|
|
336
366
|
return snapshot();
|
|
337
367
|
},
|
|
338
368
|
snapshot,
|
|
@@ -408,11 +438,22 @@ export function createGameAssetBoundPlatformerLevel(options) {
|
|
|
408
438
|
* Public asset-bound levels are therefore validated here. `motionTuning: "reported"`
|
|
409
439
|
* keeps the report without throwing, for a route that is deliberately mid-migration.
|
|
410
440
|
*/
|
|
441
|
+
/*
|
|
442
|
+
* The character's height comes from the level itself, so a route does not have to
|
|
443
|
+
* restate it for the check to be character-aware. Without this the floaty ceiling is
|
|
444
|
+
* measured against the tallest step alone, and a mesh-extracted course whose steps are
|
|
445
|
+
* shorter than the character (Skyline: 0.36 steps, 0.52 hero) rejects every jump that
|
|
446
|
+
* is actually visible next to the player.
|
|
447
|
+
*/
|
|
448
|
+
const characterHeight = (level.playerSize ?? DEFAULT_PLATFORMER_LEVEL.playerSize)?.[1];
|
|
411
449
|
const motionReport = validatePlatformerMotion(platforms, {
|
|
412
450
|
gravity: level.gravity ?? DEFAULT_PLATFORMER_LEVEL.gravity,
|
|
413
451
|
jumpVelocity: level.jumpVelocity ?? DEFAULT_PLATFORMER_LEVEL.jumpVelocity,
|
|
414
452
|
moveSpeed
|
|
415
|
-
},
|
|
453
|
+
}, {
|
|
454
|
+
...(characterHeight === undefined ? {} : { characterHeight }),
|
|
455
|
+
...(options.motionLimits ?? {})
|
|
456
|
+
});
|
|
416
457
|
if (!motionReport.passes && (options.motionTuning ?? "enforced") === "enforced") {
|
|
417
458
|
const failures = motionReport.checks.filter((check) => !check.passes);
|
|
418
459
|
throw new Error(`game.assetBoundPlatformerLevel motion tuning is inconsistent with the level geometry: ${failures.map((check) => `${check.id} (${check.detail})`).join("; ")}. Suggested fix: derive gravity, jumpVelocity and moveSpeed with solvePlatformerMotion(level.platforms, { targetSessionSeconds }).`);
|
|
@@ -488,20 +529,43 @@ export function createGameRacingSurfaceQuery(route) {
|
|
|
488
529
|
const roadHalfWidth = (isAssetBoundRacingRoute(route)
|
|
489
530
|
? Math.max(0.002, route.width ?? 1.2)
|
|
490
531
|
: Math.max(0.25, route.width ?? 1.2)) * 0.5;
|
|
532
|
+
const closed = route.closed !== false;
|
|
533
|
+
function sampleAt(progress) {
|
|
534
|
+
const normalized = normalizeProgress(progress);
|
|
535
|
+
const distance = normalized * length;
|
|
536
|
+
let index = segments.findIndex((candidate) => distance >= candidate.start && distance <= candidate.start + candidate.length);
|
|
537
|
+
if (index < 0)
|
|
538
|
+
index = segments.length - 1;
|
|
539
|
+
const segment = segments[index];
|
|
540
|
+
const t = clampNumber((distance - segment.start) / segment.length, 0, 1);
|
|
541
|
+
return {
|
|
542
|
+
x: segment.from.x + (segment.to.x - segment.from.x) * t,
|
|
543
|
+
y: segment.from.y + (segment.to.y - segment.from.y) * t,
|
|
544
|
+
progress: normalized,
|
|
545
|
+
heading: segment.heading,
|
|
546
|
+
curvature: arcCurvature(segments, length, distance, closed)
|
|
547
|
+
};
|
|
548
|
+
}
|
|
491
549
|
return {
|
|
492
550
|
kind: "aura-game-racing-surface-query",
|
|
493
551
|
certified: isAssetBoundRacingRoute(route),
|
|
552
|
+
length,
|
|
553
|
+
roadHalfWidth,
|
|
494
554
|
query(position) {
|
|
495
555
|
const nearest = nearestRacePoint(segments, length, position);
|
|
556
|
+
const line = sampleAt(nearest.progress);
|
|
496
557
|
return {
|
|
497
558
|
onTrack: nearest.offset <= roadHalfWidth,
|
|
498
559
|
progress: nearest.progress,
|
|
499
560
|
distance: nearest.distance,
|
|
500
561
|
trackOffset: nearest.offset,
|
|
501
562
|
signedTrackOffset: nearest.signedOffset,
|
|
502
|
-
roadHalfWidth
|
|
563
|
+
roadHalfWidth,
|
|
564
|
+
tangentHeading: line.heading,
|
|
565
|
+
curvature: line.curvature
|
|
503
566
|
};
|
|
504
|
-
}
|
|
567
|
+
},
|
|
568
|
+
sampleAt
|
|
505
569
|
};
|
|
506
570
|
}
|
|
507
571
|
export function createGameRacingKit(options) {
|
|
@@ -524,12 +588,30 @@ export function createGameRacingKit(options) {
|
|
|
524
588
|
const steerRate = options.steerRate ?? 2.7;
|
|
525
589
|
const boostAcceleration = options.boostAcceleration ?? 9;
|
|
526
590
|
const offTrackDrag = options.offTrackDrag ?? 5.5;
|
|
591
|
+
const boundaryInset = Math.max(0, options.boundaryInset ?? 0);
|
|
592
|
+
const recoveryHeadingLimit = options.recoveryHeadingLimit === undefined
|
|
593
|
+
? undefined
|
|
594
|
+
// Narrow asset-bound circuits may need a much tighter recovery corridor than
|
|
595
|
+
// 0.1 rad (~5.7°): a long open-wheel chassis can put its outside-front contact
|
|
596
|
+
// beyond the mesh while its centre is already recovered. Preserve the caller's
|
|
597
|
+
// physical footprint decision down to a one-hundredth radian.
|
|
598
|
+
: clampNumber(options.recoveryHeadingLimit, 0.01, Math.PI);
|
|
527
599
|
const checkpointRadius = options.checkpointRadius ?? 0.07;
|
|
528
600
|
const lapsToWin = Math.max(1, options.lapsToWin ?? 1);
|
|
601
|
+
const motion = createGameArcadeVehicle({
|
|
602
|
+
maxSpeed,
|
|
603
|
+
acceleration,
|
|
604
|
+
brakeStrength,
|
|
605
|
+
reverseSpeed,
|
|
606
|
+
drag,
|
|
607
|
+
steerRate,
|
|
608
|
+
boostAcceleration
|
|
609
|
+
});
|
|
529
610
|
let events = [];
|
|
530
611
|
let state = createRaceState(options.startProgress ?? 0);
|
|
531
612
|
function createRaceState(progress) {
|
|
532
613
|
const sample = sampleRaceRoute(segments, length, progress);
|
|
614
|
+
const vehicle = motion.reset({ x: sample.x, z: sample.y, heading: sample.heading });
|
|
533
615
|
return {
|
|
534
616
|
frame: 0,
|
|
535
617
|
time: 0,
|
|
@@ -537,15 +619,15 @@ export function createGameRacingKit(options) {
|
|
|
537
619
|
checkpoint: 0,
|
|
538
620
|
lapTime: 0,
|
|
539
621
|
bestTime: undefined,
|
|
540
|
-
speed:
|
|
541
|
-
drift:
|
|
622
|
+
speed: vehicle.speed,
|
|
623
|
+
drift: vehicle.drift,
|
|
542
624
|
offTrack: false,
|
|
543
625
|
progress: normalizeProgress(progress),
|
|
544
626
|
distance: normalizeProgress(progress) * length,
|
|
545
627
|
trackOffset: 0,
|
|
546
628
|
signedTrackOffset: 0,
|
|
547
|
-
position: { x:
|
|
548
|
-
heading:
|
|
629
|
+
position: { x: vehicle.x, y: vehicle.z },
|
|
630
|
+
heading: vehicle.heading,
|
|
549
631
|
status: "running"
|
|
550
632
|
};
|
|
551
633
|
}
|
|
@@ -563,14 +645,21 @@ export function createGameRacingKit(options) {
|
|
|
563
645
|
const placeAtProgress = (progress, offset = 0) => {
|
|
564
646
|
const sample = sampleRaceRoute(segments, length, progress);
|
|
565
647
|
const normal = { x: -Math.sin(sample.heading), y: Math.cos(sample.heading) };
|
|
648
|
+
const vehicle = motion.reset({
|
|
649
|
+
x: sample.x + normal.x * offset,
|
|
650
|
+
z: sample.y + normal.y * offset,
|
|
651
|
+
heading: sample.heading,
|
|
652
|
+
speed: state.speed,
|
|
653
|
+
drift: state.drift
|
|
654
|
+
});
|
|
566
655
|
state = {
|
|
567
656
|
...state,
|
|
568
657
|
progress: normalizeProgress(progress),
|
|
569
658
|
distance: normalizeProgress(progress) * length,
|
|
570
659
|
trackOffset: Math.abs(offset),
|
|
571
660
|
signedTrackOffset: offset,
|
|
572
|
-
position: { x:
|
|
573
|
-
heading:
|
|
661
|
+
position: { x: vehicle.x, y: vehicle.z },
|
|
662
|
+
heading: vehicle.heading
|
|
574
663
|
};
|
|
575
664
|
return snapshot();
|
|
576
665
|
};
|
|
@@ -592,47 +681,75 @@ export function createGameRacingKit(options) {
|
|
|
592
681
|
state = { ...state, frame: state.frame + 1, time: state.time + step, lapTime: state.lapTime + step };
|
|
593
682
|
const throttle = typeof input.throttle === "boolean" ? (input.throttle ? 1 : 0) : clampNumber(input.throttle ?? 0, 0, 1);
|
|
594
683
|
const brake = typeof input.brake === "boolean" ? (input.brake ? 1 : 0) : clampNumber(input.brake ?? 0, 0, 1);
|
|
595
|
-
let speed = state.speed + throttle * acceleration * step - brake * brakeStrength * step;
|
|
596
|
-
if (input.boost && state.drift > 0.18)
|
|
597
|
-
speed += boostAcceleration * step;
|
|
598
|
-
speed -= Math.sign(speed) * Math.min(Math.abs(speed), drag * step);
|
|
599
|
-
speed = clampNumber(speed, -reverseSpeed, maxSpeed);
|
|
600
684
|
const steer = clampNumber(input.steer ?? 0, -1, 1);
|
|
601
|
-
|
|
602
|
-
|
|
685
|
+
let vehicle = motion.step(step, {
|
|
686
|
+
throttle,
|
|
687
|
+
brake,
|
|
688
|
+
steer,
|
|
689
|
+
drifting: input.drift,
|
|
690
|
+
boost: input.boost
|
|
691
|
+
});
|
|
603
692
|
let position = {
|
|
604
|
-
x:
|
|
605
|
-
y:
|
|
693
|
+
x: vehicle.x,
|
|
694
|
+
y: vehicle.z
|
|
606
695
|
};
|
|
607
696
|
let contact = surfaceQuery.query(position);
|
|
608
|
-
const
|
|
697
|
+
const vehicleCenterHalfWidth = boundaryInset > 0
|
|
698
|
+
? Math.max(0.001, contact.roadHalfWidth - Math.min(boundaryInset, contact.roadHalfWidth * 0.95))
|
|
699
|
+
: contact.roadHalfWidth * 0.98;
|
|
700
|
+
// A certified recovery clamps the centre exactly onto the admissible boundary.
|
|
701
|
+
// Floating-point projection can return that same point a few ulps outside on the
|
|
702
|
+
// next frame, which previously left `offTrack` latched forever after one touch.
|
|
703
|
+
// Keep the tolerance proportional to the sampled road width so it is scale-safe
|
|
704
|
+
// while remaining far smaller than a visible tyre/contact-patch displacement.
|
|
705
|
+
const boundaryTolerance = Math.max(1e-6, contact.roadHalfWidth * 0.002);
|
|
706
|
+
const offTrack = !contact.onTrack || contact.trackOffset > vehicleCenterHalfWidth + boundaryTolerance;
|
|
609
707
|
if (offTrack) {
|
|
610
|
-
speed *= Math.max(0, 1 - offTrackDrag * step);
|
|
611
708
|
if (!state.offTrack)
|
|
612
709
|
emit("off-track");
|
|
613
710
|
if (surfaceQuery.certified) {
|
|
614
711
|
const center = sampleRaceRoute(segments, length, contact.progress);
|
|
615
712
|
const dx = position.x - center.x;
|
|
616
713
|
const dy = position.y - center.y;
|
|
617
|
-
|
|
714
|
+
// Recover slightly inside the admissible centre corridor, not exactly on its
|
|
715
|
+
// mathematical edge. A boundary-only clamp lets an inertial vehicle re-trigger
|
|
716
|
+
// recovery every frame and never reaches a visibly settled "on road" state.
|
|
717
|
+
const recoveryHalfWidth = vehicleCenterHalfWidth * 0.92;
|
|
718
|
+
const scale = contact.trackOffset > 0 ? recoveryHalfWidth / contact.trackOffset : 0;
|
|
618
719
|
position = { x: center.x + dx * scale, y: center.y + dy * scale };
|
|
619
720
|
contact = surfaceQuery.query(position);
|
|
620
721
|
}
|
|
722
|
+
const headingError = normalizeRacingAngle(vehicle.heading - contact.tangentHeading);
|
|
723
|
+
const recoveryHeading = recoveryHeadingLimit === undefined
|
|
724
|
+
? undefined
|
|
725
|
+
: contact.tangentHeading + clampNumber(headingError, -recoveryHeadingLimit, recoveryHeadingLimit);
|
|
726
|
+
vehicle = motion.constrain({
|
|
727
|
+
x: position.x,
|
|
728
|
+
z: position.y,
|
|
729
|
+
heading: recoveryHeading,
|
|
730
|
+
speedMultiplier: Math.max(0, 1 - offTrackDrag * step),
|
|
731
|
+
driftMultiplier: recoveryHeadingLimit === undefined ? 1 : Math.max(0, 1 - step * 2.5)
|
|
732
|
+
});
|
|
621
733
|
}
|
|
622
734
|
state = {
|
|
623
735
|
...state,
|
|
624
|
-
speed,
|
|
625
|
-
drift,
|
|
626
|
-
heading,
|
|
627
|
-
position,
|
|
736
|
+
speed: vehicle.speed,
|
|
737
|
+
drift: vehicle.drift,
|
|
738
|
+
heading: vehicle.heading,
|
|
739
|
+
position: { x: vehicle.x, y: vehicle.z },
|
|
628
740
|
progress: contact.progress,
|
|
629
741
|
distance: contact.distance,
|
|
630
742
|
trackOffset: contact.trackOffset,
|
|
631
743
|
signedTrackOffset: contact.signedTrackOffset,
|
|
632
744
|
offTrack
|
|
633
745
|
};
|
|
634
|
-
|
|
635
|
-
|
|
746
|
+
// Once every ordered checkpoint in the lap is credited there is no next
|
|
747
|
+
// checkpoint. Falling back to progress `1` made every frame near the finish
|
|
748
|
+
// line increment the counter again when a noisy nearest-segment projection
|
|
749
|
+
// delayed the lap-wrap transition (Turbo visibly reached "Gate 62" in one
|
|
750
|
+
// stint despite having six gates).
|
|
751
|
+
const target = checkpoints[state.checkpoint];
|
|
752
|
+
if (target !== undefined && progressDistance(state.progress, target) <= checkpointRadius && !offTrack) {
|
|
636
753
|
emit("checkpoint", `checkpoint-${state.checkpoint + 1}`);
|
|
637
754
|
state = { ...state, checkpoint: state.checkpoint + 1 };
|
|
638
755
|
}
|
|
@@ -677,6 +794,14 @@ export function createGameRacingKit(options) {
|
|
|
677
794
|
}
|
|
678
795
|
};
|
|
679
796
|
}
|
|
797
|
+
function normalizeRacingAngle(angle) {
|
|
798
|
+
let normalized = angle;
|
|
799
|
+
while (normalized > Math.PI)
|
|
800
|
+
normalized -= Math.PI * 2;
|
|
801
|
+
while (normalized < -Math.PI)
|
|
802
|
+
normalized += Math.PI * 2;
|
|
803
|
+
return normalized;
|
|
804
|
+
}
|
|
680
805
|
const FALLING_BLOCK_SHAPES = {
|
|
681
806
|
I: [
|
|
682
807
|
[{ x: 0, y: 1 }, { x: 1, y: 1 }, { x: 2, y: 1 }, { x: 3, y: 1 }],
|
|
@@ -999,14 +1124,13 @@ function createPlatformerState(config, checkpointId = "start") {
|
|
|
999
1124
|
vy: 0,
|
|
1000
1125
|
facing: 1,
|
|
1001
1126
|
grounded: false,
|
|
1002
|
-
coyote: 0,
|
|
1003
|
-
jumpBuffer: 0,
|
|
1004
1127
|
dashCooldown: 0
|
|
1005
1128
|
},
|
|
1006
1129
|
score: 0,
|
|
1007
1130
|
lives: config.lives,
|
|
1008
1131
|
deaths: 0,
|
|
1009
1132
|
respawnControlLock: 0,
|
|
1133
|
+
respawnAwaitingNeutralInput: false,
|
|
1010
1134
|
checkpointId,
|
|
1011
1135
|
collected: new Set(),
|
|
1012
1136
|
activatedCheckpoints: checkpointId === "start" ? new Set() : new Set([checkpointId])
|
|
@@ -1067,6 +1191,100 @@ function platformerPlayerRect(player, width, height) {
|
|
|
1067
1191
|
function rectsOverlap(a, b) {
|
|
1068
1192
|
return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y;
|
|
1069
1193
|
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Shortest signed angle from `from` to `to`, radians, in (-pi, pi].
|
|
1196
|
+
*
|
|
1197
|
+
* Steering toward a heading requires the *shortest* way round. Subtracting raw headings makes a car
|
|
1198
|
+
* whose target is just across the +/-pi wrap take the long way and spin.
|
|
1199
|
+
*/
|
|
1200
|
+
function signedAngleDelta(from, to) {
|
|
1201
|
+
let delta = (to - from) % (Math.PI * 2);
|
|
1202
|
+
if (delta > Math.PI)
|
|
1203
|
+
delta -= Math.PI * 2;
|
|
1204
|
+
if (delta <= -Math.PI)
|
|
1205
|
+
delta += Math.PI * 2;
|
|
1206
|
+
return delta;
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Signed curvature of the racing line, as 1/radius in route units, measured over an arc window.
|
|
1210
|
+
*
|
|
1211
|
+
* A polyline has no curvature within a segment and an undefined spike at each vertex. Attributing
|
|
1212
|
+
* the whole heading change at a vertex to that vertex — the obvious approach, and the one this
|
|
1213
|
+
* previously used — makes curvature a function of where the author happened to place vertices
|
|
1214
|
+
* rather than of the shape of the road. On a 33-point circuit that produced an impulse train:
|
|
1215
|
+
* curvature read 0 along a segment then spiked, so the radius reported for one continuous corner
|
|
1216
|
+
* swung 0.69 -> 3.01 -> 6.03 -> 16.17 -> 7.24 within 60 frames. Adjacent samples 0.094 units apart
|
|
1217
|
+
* differed by 2.068 in curvature — larger than the p99 curvature of the whole track, so the signal
|
|
1218
|
+
* was mostly discretisation artefact.
|
|
1219
|
+
*
|
|
1220
|
+
* Both consumers of curvature are harmed by that, and neither can defend itself:
|
|
1221
|
+
*
|
|
1222
|
+
* - A speed profile solves corner entry speed as `sqrt(lateralLimit * radius)`. Fed a spike, it
|
|
1223
|
+
* demands a near-stop at an arbitrary vertex and full speed one sample later.
|
|
1224
|
+
* - A steering feedforward sets `atan(wheelbase * curvature)`. Fed a spike, it commands full lock
|
|
1225
|
+
* for a few frames and zero for the rest, so the car saws through corners and runs wide — the
|
|
1226
|
+
* "car will not turn / slides off on turns" symptom, from the geometry layer rather than the tyre
|
|
1227
|
+
* model that usually gets blamed for it.
|
|
1228
|
+
*
|
|
1229
|
+
* The fix is to measure curvature the way it is defined — over an arc, not at a point. Three points
|
|
1230
|
+
* spaced `window` along the line give the Menger curvature, which is the signed reciprocal radius
|
|
1231
|
+
* of the circle through them. The window is `CURVATURE_WINDOW_SEGMENTS` times the mean segment
|
|
1232
|
+
* length, so it adapts to how finely the route is authored instead of assuming a vertex density.
|
|
1233
|
+
*
|
|
1234
|
+
* Widening the window trades resolution for smoothness, and the trade has a floor and a ceiling:
|
|
1235
|
+
* too narrow and the artefact survives, too wide and a real hairpin is averaged away into a corner
|
|
1236
|
+
* the car takes far too fast. On the certified circuit, 2x cuts the adjacent-sample jump 21x
|
|
1237
|
+
* (2.068 -> 0.098) while *preserving* corner magnitude (p90 |k| 0.736 -> 0.808); 3x smooths further
|
|
1238
|
+
* but understates the tightest corner by 19% (max |k| 0.808 -> 0.565, i.e. minimum radius 1.00 ->
|
|
1239
|
+
* 1.51), which would have the profile carry ~23% too much speed into the hairpin. Hence 2x.
|
|
1240
|
+
*/
|
|
1241
|
+
const CURVATURE_WINDOW_SEGMENTS = 2;
|
|
1242
|
+
function positionAtDistance(segments, totalLength, distance, closed) {
|
|
1243
|
+
const along = closed
|
|
1244
|
+
? ((distance % totalLength) + totalLength) % totalLength
|
|
1245
|
+
: clampNumber(distance, 0, totalLength);
|
|
1246
|
+
let index = segments.findIndex((candidate) => along >= candidate.start && along <= candidate.start + candidate.length);
|
|
1247
|
+
if (index < 0)
|
|
1248
|
+
index = segments.length - 1;
|
|
1249
|
+
const segment = segments[index];
|
|
1250
|
+
const t = clampNumber((along - segment.start) / segment.length, 0, 1);
|
|
1251
|
+
return {
|
|
1252
|
+
x: segment.from.x + (segment.to.x - segment.from.x) * t,
|
|
1253
|
+
y: segment.from.y + (segment.to.y - segment.from.y) * t
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
function arcCurvature(segments, totalLength, distance, closed) {
|
|
1257
|
+
if (segments.length < 2 || totalLength <= 1e-9)
|
|
1258
|
+
return 0;
|
|
1259
|
+
const meanSegment = totalLength / segments.length;
|
|
1260
|
+
/*
|
|
1261
|
+
* On an open path the window has to shrink near the ends rather than clamp: clamping would
|
|
1262
|
+
* collapse two of the three samples onto the same point and report 0 curvature exactly where a
|
|
1263
|
+
* track often turns most.
|
|
1264
|
+
*/
|
|
1265
|
+
const room = closed ? totalLength / 3 : Math.min(distance, totalLength - distance);
|
|
1266
|
+
const window = Math.min(meanSegment * CURVATURE_WINDOW_SEGMENTS, Math.max(1e-6, room));
|
|
1267
|
+
if (window <= 1e-6)
|
|
1268
|
+
return 0;
|
|
1269
|
+
const a = positionAtDistance(segments, totalLength, distance - window, closed);
|
|
1270
|
+
const b = positionAtDistance(segments, totalLength, distance, closed);
|
|
1271
|
+
const c = positionAtDistance(segments, totalLength, distance + window, closed);
|
|
1272
|
+
const abx = b.x - a.x;
|
|
1273
|
+
const aby = b.y - a.y;
|
|
1274
|
+
const bcx = c.x - b.x;
|
|
1275
|
+
const bcy = c.y - b.y;
|
|
1276
|
+
const acx = c.x - a.x;
|
|
1277
|
+
const acy = c.y - a.y;
|
|
1278
|
+
/*
|
|
1279
|
+
* Menger curvature: 4 * area / (|ab| |bc| |ca|), signed by the cross product so a left-hand
|
|
1280
|
+
* corner is positive. The cross product is twice the triangle area, hence the factor 2 here.
|
|
1281
|
+
*/
|
|
1282
|
+
const cross = abx * bcy - aby * bcx;
|
|
1283
|
+
const denominator = Math.hypot(abx, aby) * Math.hypot(bcx, bcy) * Math.hypot(acx, acy);
|
|
1284
|
+
if (denominator <= 1e-12)
|
|
1285
|
+
return 0;
|
|
1286
|
+
return (2 * cross) / denominator;
|
|
1287
|
+
}
|
|
1070
1288
|
function createRaceSegments(route) {
|
|
1071
1289
|
const points = [...route.points];
|
|
1072
1290
|
if (points.length < 2)
|