@woosh/meep-engine 3.11.2 → 3.12.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 +14 -18
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/SelectionVisualizer.js +127 -127
- package/editor/entity_world_bounds.js +27 -27
- package/editor/particles/rebuildParticleEmitter.js +31 -31
- package/editor/process/SymbolicDisplayProcess.js +1 -1
- package/editor/process/symbolic/CameraSymbolicDisplay.js +146 -146
- package/editor/process/symbolic/LightSymbolicDisplay.js +172 -172
- package/editor/prototypeEditorShell.js +156 -156
- package/editor/selection/editor_pick.js +130 -130
- package/editor/selection/screen_rect_frustum.js +119 -119
- package/editor/tools/v2/TransformControls.js +971 -971
- package/package.json +1 -1
- package/src/engine/Engine.d.ts +3 -3
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +726 -726
- package/src/engine/EngineHarness.d.ts +1 -1
- package/src/engine/EngineHarness.js +590 -590
- package/src/engine/ecs/HIERARCHY_REVIEW.md +717 -717
- package/src/engine/ecs/terrain/ecs/BuildLightTexture.d.ts +1 -1
- package/src/engine/ecs/terrain/ecs/BuildLightTexture.js +27 -27
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts +1 -5
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.js +790 -790
- package/src/engine/ecs/terrain/util/loadVisibleTerrainTiles.js +129 -129
- package/src/engine/graphics/ecs/camera/camera_find_active.d.ts +1 -1
- package/src/engine/graphics/ecs/camera/camera_find_active.js +28 -28
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +428 -428
- package/src/engine/graphics/ecs/water/Water.d.ts +1 -1
- package/src/engine/graphics/ecs/water/Water.js +104 -104
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.d.ts +65 -0
- package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -0
- package/src/engine/graphics3/AnimationGraphSystem.js +329 -0
- package/src/engine/graphics3/AnimationGraphSystem3.d.ts +6 -61
- package/src/engine/graphics3/AnimationGraphSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationGraphSystem3.js +6 -325
- package/src/engine/graphics3/AnimationSystem.d.ts +76 -0
- package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -0
- package/src/engine/graphics3/AnimationSystem.js +352 -0
- package/src/engine/graphics3/AnimationSystem3.d.ts +6 -72
- package/src/engine/graphics3/AnimationSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationSystem3.js +6 -348
- package/src/engine/graphics3/CameraSystem.d.ts +49 -0
- package/src/engine/graphics3/CameraSystem.d.ts.map +1 -0
- package/src/engine/graphics3/CameraSystem.js +170 -0
- package/src/engine/graphics3/CameraSystem3.d.ts +6 -45
- package/src/engine/graphics3/CameraSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/CameraSystem3.js +6 -166
- package/src/engine/graphics3/DebugDrawSystem.d.ts +72 -0
- package/src/engine/graphics3/DebugDrawSystem.d.ts.map +1 -0
- package/src/engine/graphics3/DebugDrawSystem.js +205 -0
- package/src/engine/graphics3/DebugDrawSystem3.d.ts +6 -68
- package/src/engine/graphics3/DebugDrawSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/DebugDrawSystem3.js +6 -201
- package/src/engine/graphics3/DecalSystem.d.ts +81 -0
- package/src/engine/graphics3/DecalSystem.d.ts.map +1 -0
- package/src/engine/graphics3/DecalSystem.js +441 -0
- package/src/engine/graphics3/DecalSystem3.d.ts +6 -77
- package/src/engine/graphics3/DecalSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/DecalSystem3.js +6 -437
- package/src/engine/graphics3/FogOfWarSystem.d.ts +74 -0
- package/src/engine/graphics3/FogOfWarSystem.d.ts.map +1 -0
- package/src/engine/graphics3/FogOfWarSystem.js +265 -0
- package/src/engine/graphics3/FogOfWarSystem3.d.ts +6 -70
- package/src/engine/graphics3/FogOfWarSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/FogOfWarSystem3.js +6 -261
- package/src/engine/graphics3/GraphicsEngine.d.ts +340 -0
- package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -0
- package/src/engine/graphics3/GraphicsEngine.js +790 -0
- package/src/engine/graphics3/GraphicsEngine3.d.ts +6 -336
- package/src/engine/graphics3/GraphicsEngine3.d.ts.map +1 -1
- package/src/engine/graphics3/GraphicsEngine3.js +6 -786
- package/src/engine/graphics3/HighlightSystem.d.ts +82 -0
- package/src/engine/graphics3/HighlightSystem.d.ts.map +1 -0
- package/src/engine/graphics3/HighlightSystem.js +241 -0
- package/src/engine/graphics3/HighlightSystem3.d.ts +6 -78
- package/src/engine/graphics3/HighlightSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/HighlightSystem3.js +6 -237
- package/src/engine/graphics3/LightSystem.d.ts +40 -0
- package/src/engine/graphics3/LightSystem.d.ts.map +1 -0
- package/src/engine/graphics3/LightSystem.js +211 -0
- package/src/engine/graphics3/LightSystem3.d.ts +6 -36
- package/src/engine/graphics3/LightSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/LightSystem3.js +6 -207
- package/src/engine/graphics3/MeshSystem.d.ts +106 -0
- package/src/engine/graphics3/MeshSystem.d.ts.map +1 -0
- package/src/engine/graphics3/MeshSystem.js +647 -0
- package/src/engine/graphics3/MeshSystem3.d.ts +6 -102
- package/src/engine/graphics3/MeshSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/MeshSystem3.js +6 -642
- package/src/engine/graphics3/ParticipatingMedia.d.ts +2 -2
- package/src/engine/graphics3/ParticipatingMedia.js +203 -203
- package/src/engine/graphics3/ParticipatingMediaSystem.d.ts +87 -0
- package/src/engine/graphics3/ParticipatingMediaSystem.d.ts.map +1 -0
- package/src/engine/graphics3/ParticipatingMediaSystem.js +184 -0
- package/src/engine/graphics3/ParticipatingMediaSystem3.d.ts +6 -83
- package/src/engine/graphics3/ParticipatingMediaSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/ParticipatingMediaSystem3.js +6 -180
- package/src/engine/graphics3/ParticleEmitterSystem.d.ts +76 -0
- package/src/engine/graphics3/ParticleEmitterSystem.d.ts.map +1 -0
- package/src/engine/graphics3/ParticleEmitterSystem.js +289 -0
- package/src/engine/graphics3/ParticleEmitterSystem3.d.ts +6 -72
- package/src/engine/graphics3/ParticleEmitterSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/ParticleEmitterSystem3.js +6 -285
- package/src/engine/graphics3/PathDisplaySystem.d.ts +70 -0
- package/src/engine/graphics3/PathDisplaySystem.d.ts.map +1 -0
- package/src/engine/graphics3/PathDisplaySystem.js +309 -0
- package/src/engine/graphics3/PathDisplaySystem3.d.ts +6 -66
- package/src/engine/graphics3/PathDisplaySystem3.d.ts.map +1 -1
- package/src/engine/graphics3/PathDisplaySystem3.js +6 -305
- package/src/engine/graphics3/Pickable.d.ts +1 -1
- package/src/engine/graphics3/Pickable.js +65 -65
- package/src/engine/graphics3/PickingQuery.d.ts +1 -1
- package/src/engine/graphics3/PickingQuery.js +48 -48
- package/src/engine/graphics3/PickingSystem.d.ts +67 -0
- package/src/engine/graphics3/PickingSystem.d.ts.map +1 -0
- package/src/engine/graphics3/PickingSystem.js +273 -0
- package/src/engine/graphics3/PickingSystem3.d.ts +6 -63
- package/src/engine/graphics3/PickingSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/PickingSystem3.js +6 -269
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts +47 -0
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -0
- package/src/engine/graphics3/ShadedGeometrySystem.js +169 -0
- package/src/engine/graphics3/ShadedGeometrySystem3.d.ts +6 -43
- package/src/engine/graphics3/ShadedGeometrySystem3.d.ts.map +1 -1
- package/src/engine/graphics3/ShadedGeometrySystem3.js +6 -165
- package/src/engine/graphics3/TerrainSystem.d.ts +80 -0
- package/src/engine/graphics3/TerrainSystem.d.ts.map +1 -0
- package/src/engine/graphics3/TerrainSystem.js +566 -0
- package/src/engine/graphics3/TerrainSystem3.d.ts +6 -76
- package/src/engine/graphics3/TerrainSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/TerrainSystem3.js +6 -562
- package/src/engine/graphics3/TooltipComponentSystem.d.ts +65 -0
- package/src/engine/graphics3/TooltipComponentSystem.d.ts.map +1 -0
- package/src/engine/graphics3/TooltipComponentSystem.js +328 -0
- package/src/engine/graphics3/TooltipComponentSystem3.d.ts +6 -61
- package/src/engine/graphics3/TooltipComponentSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/TooltipComponentSystem3.js +6 -324
- package/src/engine/graphics3/Trail3DSystem.d.ts +73 -0
- package/src/engine/graphics3/Trail3DSystem.d.ts.map +1 -0
- package/src/engine/graphics3/Trail3DSystem.js +221 -0
- package/src/engine/graphics3/Trail3DSystem3.d.ts +6 -69
- package/src/engine/graphics3/Trail3DSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/Trail3DSystem3.js +6 -217
- package/src/engine/graphics3/VolumetricLightMap.d.ts +2 -2
- package/src/engine/graphics3/VolumetricLightMap.js +2 -2
- package/src/engine/graphics3/VolumetricLightMapSystem.d.ts +98 -0
- package/src/engine/graphics3/VolumetricLightMapSystem.d.ts.map +1 -0
- package/src/engine/graphics3/VolumetricLightMapSystem.js +261 -0
- package/src/engine/graphics3/VolumetricLightMapSystem3.d.ts +6 -94
- package/src/engine/graphics3/VolumetricLightMapSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/VolumetricLightMapSystem3.js +10 -261
- package/src/engine/graphics3/WaterSystem.d.ts +59 -0
- package/src/engine/graphics3/WaterSystem.d.ts.map +1 -0
- package/src/engine/graphics3/WaterSystem.js +293 -0
- package/src/engine/graphics3/WaterSystem3.d.ts +6 -55
- package/src/engine/graphics3/WaterSystem3.d.ts.map +1 -1
- package/src/engine/graphics3/WaterSystem3.js +6 -289
- package/src/engine/graphics3/animation/AnimationGraphController.d.ts +1 -1
- package/src/engine/graphics3/animation/AnimationGraphController.js +518 -518
- package/src/engine/graphics3/animation/ClipListPlayer.d.ts +1 -1
- package/src/engine/graphics3/animation/ClipListPlayer.js +263 -263
- package/src/engine/graphics3/animation/ClipPlayback.d.ts +2 -2
- package/src/engine/graphics3/animation/ClipPlayback.js +84 -84
- package/src/engine/graphics3/decal/graph_build_decal_clusters.d.ts.map +1 -1
- package/src/engine/graphics3/decal/graph_build_decal_clusters.js +6 -8
- package/src/engine/graphics3/decal/shader_cluster_assign_decals.d.ts +0 -7
- package/src/engine/graphics3/decal/shader_cluster_assign_decals.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +1 -1
- package/src/engine/graphics3/decal/shader_cull_decals_frustum.d.ts +0 -4
- package/src/engine/graphics3/decal/shader_cull_decals_frustum.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_cull_decals_frustum.js +1 -1
- package/src/engine/graphics3/highlight/pack_highlight_table.d.ts +2 -2
- package/src/engine/graphics3/highlight/pack_highlight_table.d.ts.map +1 -1
- package/src/engine/graphics3/highlight/pack_highlight_table.js +74 -74
- package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +1 -1
- package/src/engine/graphics3/pose/query_entity_node_world_pose.js +101 -101
- package/src/engine/graphics3/preview/make_model_thumbnail.d.ts +3 -3
- package/src/engine/graphics3/preview/make_model_thumbnail.d.ts.map +1 -1
- package/src/engine/graphics3/preview/make_model_thumbnail.js +48 -48
- package/src/engine/graphics3/shade_camera_projection_ray.d.ts +1 -1
- package/src/engine/graphics3/shade_camera_projection_ray.js +77 -77
- package/src/engine/graphics3/shade_node_to_entity_composition.d.ts +1 -1
- package/src/engine/graphics3/shade_node_to_entity_composition.js +84 -84
- package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.d.ts +16 -2
- package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.js +28 -4
- package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.d.ts +1 -1
- package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.js +5 -2
- package/src/shade/device/IMMEDIATE_DATA_PLAN_2026_08_28.md +564 -451
- package/src/shade/device/ShadeGPUCommandContext.d.ts +18 -2
- package/src/shade/device/ShadeGPUCommandContext.d.ts.map +1 -1
- package/src/shade/device/ShadeGPUCommandContext.js +994 -940
- package/src/shade/device/immediate_data_supported.d.ts +33 -0
- package/src/shade/device/immediate_data_supported.d.ts.map +1 -0
- package/src/shade/device/immediate_data_supported.js +53 -0
- package/src/shade/device/mock/SoftwareGPUCommandEncoder.d.ts +18 -0
- package/src/shade/device/mock/SoftwareGPUCommandEncoder.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUCommandEncoder.js +24 -0
- package/src/shade/device/mock/SoftwareGPUComputePassEncoder.d.ts +7 -0
- package/src/shade/device/mock/SoftwareGPUComputePassEncoder.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUComputePassEncoder.js +49 -1
- package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUDevice.js +20 -2
- package/src/shade/device/mock/SoftwareGPUImmediateData.d.ts +65 -0
- package/src/shade/device/mock/SoftwareGPUImmediateData.d.ts.map +1 -0
- package/src/shade/device/mock/SoftwareGPUImmediateData.js +160 -0
- package/src/shade/device/mock/SoftwareGPURenderPassEncoder.d.ts +7 -0
- package/src/shade/device/mock/SoftwareGPURenderPassEncoder.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPURenderPassEncoder.js +50 -0
- package/src/shade/device/mock/pipeline_immediate_size.d.ts +11 -0
- package/src/shade/device/mock/pipeline_immediate_size.d.ts.map +1 -0
- package/src/shade/device/mock/pipeline_immediate_size.js +18 -0
- package/src/shade/device/pipeline/PipelineLayoutManager.d.ts.map +1 -1
- package/src/shade/device/pipeline/PipelineLayoutManager.js +1 -0
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.js +0 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_points.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_points.js +0 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.js +133 -134
- package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.js +202 -202
- package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.js +249 -249
- package/src/shade/renderer/GraphicsContext.d.ts +9 -2
- package/src/shade/renderer/GraphicsContext.d.ts.map +1 -1
- package/src/shade/renderer/GraphicsContext.js +13 -1
- package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.js +1 -1
- package/src/shade/renderer/animation/pose/PosePlayback.d.ts +2 -1
- package/src/shade/renderer/animation/pose/PosePlayback.d.ts.map +1 -1
- package/src/shade/renderer/animation/pose/PosePlayback.js +2 -1
- package/src/shade/renderer/animation/shader_animation_apply.d.ts.map +1 -1
- package/src/shade/renderer/animation/shader_animation_apply.js +128 -129
- package/src/shade/renderer/animation/shader_animation_pose_resolve.d.ts.map +1 -1
- package/src/shade/renderer/animation/shader_animation_pose_resolve.js +176 -177
- package/src/shade/renderer/animation/shader_animation_tick.d.ts.map +1 -1
- package/src/shade/renderer/animation/shader_animation_tick.js +125 -126
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_geometry_sphere_derive.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_geometry_sphere_derive.js +98 -99
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_meshlet_bounds_reduce.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_meshlet_bounds_reduce.js +212 -213
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_meshlet_bounds_scatter.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_meshlet_bounds_scatter.js +120 -121
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_skinned_mesh_bounds_refresh.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_skinned_mesh_bounds_refresh.js +75 -76
- package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.js +371 -372
- package/src/shade/renderer/animation/skinning/shader_skin_matrix_prep.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/shader_skin_matrix_prep.js +104 -105
- package/src/shade/renderer/atmosphere/GPUSky.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/GPUSky.js +145 -142
- package/src/shade/renderer/atmosphere/MULTISCATTER_LUT_CONFIG.d.ts +34 -0
- package/src/shade/renderer/atmosphere/MULTISCATTER_LUT_CONFIG.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/MULTISCATTER_LUT_CONFIG.js +36 -0
- package/src/shade/renderer/atmosphere/SAMPLER_SKY_LUT.d.ts +20 -0
- package/src/shade/renderer/atmosphere/SAMPLER_SKY_LUT.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/SAMPLER_SKY_LUT.js +25 -0
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.d.ts +14 -1
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.js +163 -177
- package/src/shade/renderer/atmosphere/chunk_multiscatter_sample_direction.d.ts +20 -0
- package/src/shade/renderer/atmosphere/chunk_multiscatter_sample_direction.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/chunk_multiscatter_sample_direction.js +46 -0
- package/src/shade/renderer/atmosphere/chunk_sample_multiscatter_lut.d.ts +11 -1
- package/src/shade/renderer/atmosphere/chunk_sample_multiscatter_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_sample_multiscatter_lut.js +57 -27
- package/src/shade/renderer/atmosphere/chunk_sample_transmittance_lut.d.ts +19 -1
- package/src/shade/renderer/atmosphere/chunk_sample_transmittance_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_sample_transmittance_lut.js +69 -33
- package/src/shade/renderer/atmosphere/chunk_sky_lut_compute_uv.d.ts +13 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_compute_uv.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_sky_lut_compute_uv.js +35 -35
- package/src/shade/renderer/atmosphere/chunk_sky_lut_params.d.ts +13 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_params.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_params.js +38 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_texel_to_unit.d.ts +17 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_texel_to_unit.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_texel_to_unit.js +29 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_uv.d.ts +21 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_uv.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_uv.js +42 -0
- package/src/shade/renderer/atmosphere/shader_multiscatter_lut.d.ts +2 -2
- package/src/shade/renderer/atmosphere/shader_multiscatter_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/shader_multiscatter_lut.js +164 -84
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.js +215 -204
- package/src/shade/renderer/atmosphere/shader_transmittance_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/shader_transmittance_lut.js +79 -67
- package/src/shade/renderer/buffer/graph_inspect_gpu_buffer.js +136 -136
- package/src/shade/renderer/buffer/table/GPUDatabase.d.ts.map +1 -1
- package/src/shade/renderer/buffer/table/GPUDatabase.js +2 -3
- package/src/shade/renderer/buffer/table/single/GPUSingleTypeTable.js +319 -319
- package/src/shade/renderer/buffer/util/shader_buffer_copy_storage_to_storage.d.ts.map +1 -1
- package/src/shade/renderer/buffer/util/shader_buffer_copy_storage_to_storage.js +41 -42
- package/src/shade/renderer/buffer/util/shader_buffer_intra_copy_regions.d.ts.map +1 -1
- package/src/shade/renderer/buffer/util/shader_buffer_intra_copy_regions.js +83 -84
- package/src/shade/renderer/dynamic/shader_dynamic_mesh.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/shader_dynamic_mesh.js +177 -170
- package/src/shade/renderer/extension/RENDER_EXTENSION_DESIGN.md +918 -918
- package/src/shade/renderer/geometry/bvh/record_blas_refit.js +4 -4
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_leaf_bounds.js +121 -122
- package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.js +774 -774
- package/src/shade/renderer/geometry/meshlet/shader_meshlet_metadata_address_patch.d.ts +1 -1
- package/src/shade/renderer/geometry/meshlet/shader_meshlet_metadata_address_patch.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/shader_meshlet_metadata_address_patch.js +69 -70
- package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.js +367 -367
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.js +184 -184
- package/src/shade/renderer/gpu_primitive/bvh/GPU_BVH_BUILD_PLAN.md +1115 -1115
- package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.js +217 -217
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.js +142 -143
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_morton.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_morton.js +0 -1
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_refit.js +140 -141
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.js +0 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.js +0 -1
- package/src/shade/renderer/light/cluster/cull/graph_cull_lights.d.ts.map +1 -1
- package/src/shade/renderer/light/cluster/cull/graph_cull_lights.js +191 -198
- package/src/shade/renderer/light/cluster/cull/shader_cull_lights_frustum.d.ts +0 -6
- package/src/shade/renderer/light/cluster/cull/shader_cull_lights_frustum.d.ts.map +1 -1
- package/src/shade/renderer/light/cluster/cull/shader_cull_lights_frustum.js +120 -120
- package/src/shade/renderer/light/cluster/cull/shader_cull_lights_hzb.d.ts +0 -4
- package/src/shade/renderer/light/cluster/cull/shader_cull_lights_hzb.d.ts.map +1 -1
- package/src/shade/renderer/light/cluster/cull/shader_cull_lights_hzb.js +112 -112
- package/src/shade/renderer/light/cluster/graph_assign_clsuters.d.ts.map +1 -1
- package/src/shade/renderer/light/cluster/graph_assign_clsuters.js +10 -9
- package/src/shade/renderer/light/cluster/shader_cluster_assign_lights.d.ts +0 -6
- package/src/shade/renderer/light/cluster/shader_cluster_assign_lights.d.ts.map +1 -1
- package/src/shade/renderer/light/cluster/shader_cluster_assign_lights.js +1 -1
- package/src/shade/renderer/lightmap/bake/raster/shader_lightmap_to_viz_buffer.js +222 -222
- package/src/shade/renderer/lightmap/bake/tile/shader_lightmap_tile_composit.js +81 -81
- package/src/shade/renderer/material/GPUMaterialContext.js +380 -380
- package/src/shade/renderer/material/standard/fragment_gbuffer_vt.js +169 -169
- package/src/shade/renderer/object_property/shader_object_property_process.d.ts.map +1 -1
- package/src/shade/renderer/object_property/shader_object_property_process.js +83 -84
- package/src/shade/renderer/object_property/shader_refresh_all_mesh_bounds.d.ts.map +1 -1
- package/src/shade/renderer/object_property/shader_refresh_all_mesh_bounds.js +57 -58
- package/src/shade/renderer/particles/prototypeParticleSystem.js +2 -3
- package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_emit.js +117 -118
- package/src/shade/renderer/particles/shaders/shader_particle_finalize.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_finalize.js +77 -79
- package/src/shade/renderer/particles/shaders/shader_particle_render.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_render.js +190 -183
- package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_simulate.js +99 -100
- package/src/shade/renderer/particles/sort/shader_particle_sort.d.ts.map +1 -1
- package/src/shade/renderer/particles/sort/shader_particle_sort.js +158 -161
- package/src/shade/renderer/path_tracer/graph_path_trace_scene.js +184 -184
- package/src/shade/renderer/postprocess/denoise/graph_atorus_denoise_luma.js +119 -119
- package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.js +3 -4
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.js +266 -267
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.js +270 -271
- package/src/shade/renderer/postprocess/gtao/GTAO.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/GTAO.js +4 -0
- package/src/shade/renderer/postprocess/nss/shader_nss_concat.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_concat.js +68 -69
- package/src/shade/renderer/postprocess/nss/shader_nss_conv_layer.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_conv_layer.js +225 -226
- package/src/shade/renderer/postprocess/nss/shader_nss_extract_feedback.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_extract_feedback.js +49 -50
- package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.js +291 -292
- package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.js +230 -231
- package/src/shade/renderer/postprocess/ssr/reproject/shader_ffx_denoiser_reflections_reproject.d.ts +16 -2
- package/src/shade/renderer/postprocess/ssr/reproject/shader_ffx_denoiser_reflections_reproject.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/reproject/shader_ffx_denoiser_reflections_reproject.js +12 -12
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +341 -345
- package/src/shade/renderer/rasterize/bucket/shader_count_meshlets_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/shader_count_meshlets_by_material.js +68 -69
- package/src/shade/renderer/rasterize/bucket/shader_make_meshlet_indirect_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/shader_make_meshlet_indirect_draw_commands_by_material.js +59 -60
- package/src/shade/renderer/rasterize/bucket/shader_read_out_bucket.d.ts +0 -2
- package/src/shade/renderer/rasterize/bucket/shader_read_out_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/shader_read_out_bucket.js +57 -57
- package/src/shade/renderer/rasterize/bucket/shader_sort_meshlets_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/shader_sort_meshlets_by_material.js +64 -65
- package/src/shade/renderer/rasterize/compute/graph_mesh_frustum_cull.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/compute/graph_mesh_frustum_cull.js +168 -169
- package/src/shade/renderer/rasterize/compute/graph_mesh_sphere_cull.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/compute/graph_mesh_sphere_cull.js +160 -161
- package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_mesh_filter_2way.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_mesh_filter_2way.js +109 -110
- package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_meshlet_filter_1way_full.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/cull/hzb/shader_hzb_meshlet_filter_1way_full.js +115 -116
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_classify_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_classify_bucket.js +139 -140
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_count_by_rasterization_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_count_by_rasterization_bucket.js +91 -92
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_rasterization_bucket_sort.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_rasterization_bucket_sort.js +88 -89
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_count_by_rasterization_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_count_by_rasterization_bucket.js +90 -91
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_extract_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_extract_bucket.js +65 -66
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_rasterization_bucket_sort.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_rasterization_bucket_sort.js +89 -90
- package/src/shade/renderer/rasterize/expand/graph_mesh_filter_one_way.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/graph_mesh_filter_one_way.js +169 -170
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +7 -3
- package/src/shade/renderer/rasterize/expand/mesh/shader_mesh_expand_to_meshlets_prefix.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/mesh/shader_mesh_expand_to_meshlets_prefix.js +89 -90
- package/src/shade/renderer/rasterize/expand/mesh/shader_meshes_to_meshlet_counts.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/mesh/shader_meshes_to_meshlet_counts.js +61 -62
- package/src/shade/renderer/rasterize/expand/pass1/filter_meshlets.2-way.compute.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/pass1/filter_meshlets.2-way.compute.js +153 -154
- package/src/shade/renderer/rasterize/fast/graph_extract_meshes_from_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/fast/graph_extract_meshes_from_bucket.js +77 -81
- package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.js +144 -144
- package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_pass_descriptor.js +88 -88
- package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +217 -217
- package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.js +179 -179
- package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments_ibl.js +178 -178
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.js +194 -194
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_opaque_pass_descriptor.js +76 -76
- package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.js +5 -1
- package/src/shade/renderer/restir/di/shader_restir_di_denoise.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/shader_restir_di_denoise.js +136 -137
- package/src/shade/renderer/restir/di/shader_restir_di_resample.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/shader_restir_di_resample.js +129 -130
- package/src/shade/renderer/restir/di/shader_restir_di_resolve.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/shader_restir_di_resolve.js +99 -100
- package/src/shade/renderer/restir/di/shader_restir_di_spatial.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/shader_restir_di_spatial.js +116 -117
- package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.js +383 -383
- package/src/shade/renderer/scene/hierarchy/graph_scene_update_transform_hierarchy_naive.js +123 -123
- package/src/shade/renderer/scene/hierarchy/shader_nodes_record_input_positions.d.ts.map +1 -1
- package/src/shade/renderer/scene/hierarchy/shader_nodes_record_input_positions.js +64 -65
- package/src/shade/renderer/scene/hierarchy/shader_nodes_update_transform_hierarchy.d.ts.map +1 -1
- package/src/shade/renderer/scene/hierarchy/shader_nodes_update_transform_hierarchy.js +372 -373
- package/src/shade/renderer/scene/hierarchy/shader_nodes_update_transform_hierarchy_naive.d.ts.map +1 -1
- package/src/shade/renderer/scene/hierarchy/shader_nodes_update_transform_hierarchy_naive.js +111 -112
- package/src/shade/renderer/scene/shader_bvh_extract_instance_leaves.d.ts.map +1 -1
- package/src/shade/renderer/scene/shader_bvh_extract_instance_leaves.js +0 -1
- package/src/shade/renderer/shader/ComputeShader.d.ts +24 -3
- package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ComputeShader.js +350 -292
- package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ImageShader.js +217 -214
- package/src/shade/renderer/shader/ShaderDescriptor.d.ts +5 -0
- package/src/shade/renderer/shader/ShaderDescriptor.d.ts.map +1 -1
- package/src/shade/renderer/shader/ShaderDescriptor.js +46 -0
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.d.ts +18 -0
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.js +32 -0
- package/src/shade/renderer/shader/chunk/atmosphere/PLANET_CENTER_DECLARATION.d.ts +7 -0
- package/src/shade/renderer/shader/chunk/atmosphere/PLANET_CENTER_DECLARATION.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/PLANET_CENTER_DECLARATION.js +17 -6
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_ray_bounds.d.ts +21 -0
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_ray_bounds.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_ray_bounds.js +69 -0
- package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_contains_aabb3.d.ts +9 -0
- package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_contains_aabb3.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_contains_aabb3.js +22 -0
- package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_from_transformed_corners.d.ts +16 -0
- package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_from_transformed_corners.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/aabb3/chunk_aabb3_from_transformed_corners.js +41 -0
- package/src/shade/renderer/shader/chunk/geometry/frustum/chunk_frustum_transform_m4.d.ts +11 -0
- package/src/shade/renderer/shader/chunk/geometry/frustum/chunk_frustum_transform_m4.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/frustum/chunk_frustum_transform_m4.js +15 -19
- package/src/shade/renderer/shader/chunk/geometry/frustum/chunk_frustum_transform_plane_matrix.d.ts +23 -0
- package/src/shade/renderer/shader/chunk/geometry/frustum/chunk_frustum_transform_plane_matrix.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/frustum/chunk_frustum_transform_plane_matrix.js +44 -0
- package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js +1 -4
- package/src/shade/renderer/shader/compiler/CodeChunk.d.ts +7 -1
- package/src/shade/renderer/shader/compiler/CodeChunk.d.ts.map +1 -1
- package/src/shade/renderer/shader/compiler/CodeChunk.js +37 -2
- package/src/shade/renderer/shader/graph/compute/compute_binding_read_names.d.ts.map +1 -1
- package/src/shade/renderer/shader/graph/compute/compute_binding_read_names.js +6 -0
- package/src/shade/renderer/shader/graph/compute/graph_compute_indirect_pass.js +1 -1
- package/src/shade/renderer/shader/graph/compute/graph_compute_pass.js +1 -1
- package/src/shade/renderer/shader/graph/graph_image_pass.js +1 -1
- package/src/shade/renderer/shader/graph/graph_prepare_bindings.d.ts.map +1 -1
- package/src/shade/renderer/shader/graph/graph_prepare_bindings.js +7 -0
- package/src/shade/renderer/shader/graph/graph_prepare_pass_input_data.d.ts +3 -1
- package/src/shade/renderer/shader/graph/graph_prepare_pass_input_data.d.ts.map +1 -1
- package/src/shade/renderer/shader/graph/graph_prepare_pass_input_data.js +12 -1
- package/src/shade/renderer/shader/pass/RenderPassDescriptor.d.ts.map +1 -1
- package/src/shade/renderer/shader/pass/RenderPassDescriptor.js +1 -0
- package/src/shade/renderer/shader/resource/IMMEDIATE_DATA.d.ts +21 -0
- package/src/shade/renderer/shader/resource/IMMEDIATE_DATA.d.ts.map +1 -0
- package/src/shade/renderer/shader/resource/IMMEDIATE_DATA.js +21 -0
- package/src/shade/renderer/shader/resource/ShaderResourceSetDescriptor.d.ts +59 -1
- package/src/shade/renderer/shader/resource/ShaderResourceSetDescriptor.d.ts.map +1 -1
- package/src/shade/renderer/shader/resource/ShaderResourceSetDescriptor.js +195 -2
- package/src/shade/renderer/shader/type/type_has_arrays.d.ts +14 -0
- package/src/shade/renderer/shader/type/type_has_arrays.d.ts.map +1 -0
- package/src/shade/renderer/shader/type/type_has_arrays.js +33 -0
- package/src/shade/renderer/shader/util/compute_infer_workgroup_size_from_source.d.ts +47 -0
- package/src/shade/renderer/shader/util/compute_infer_workgroup_size_from_source.d.ts.map +1 -0
- package/src/shade/renderer/shader/util/compute_infer_workgroup_size_from_source.js +448 -0
- package/src/shade/renderer/shadow/map/csm/graph_csm_setup_cascades.js +3 -3
- package/src/shade/renderer/shadow/ray/staged/gen/graph_gen_rays.js +3 -3
- package/src/shade/renderer/shadow/ray/staged/trace/graph_trace_rays.js +2 -2
- package/src/shade/renderer/shadow/sdf/cascade/CascadedSceneSDF.js +4 -4
- package/src/shade/renderer/texture/virtual/build_shader_vt_feedback.d.ts.map +1 -1
- package/src/shade/renderer/texture/virtual/build_shader_vt_feedback.js +231 -232
- package/src/shade/renderer/view/GPUViewSkyContext.d.ts.map +1 -1
- package/src/shade/renderer/view/GPUViewSkyContext.js +169 -173
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +1 -1
- package/src/shade/renderer/volumetrics/NOTES.md +238 -0
- package/src/shade/renderer/volumetrics/chunk_volumetrics_local_light_shadow.js +145 -145
- package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_optical_depth.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_optical_depth.js +38 -15
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +14 -2
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +591 -577
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts +17 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +20 -2
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js +29 -18
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.js +260 -260
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_sun_shadow_volume.d.ts +53 -3
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_sun_shadow_volume.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_sun_shadow_volume.js +175 -59
- package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.d.ts +0 -2
- package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.js +17 -6
- package/src/shade/renderer/water/shader_water.js +246 -246
- package/src/shade/vitest.setup.mjs +1 -1
- package/src/shade/wgsl/emulator/ComputeShaderEmulator.js +291 -291
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +8 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +1325 -1297
- package/src/view/minimap/Minimap.d.ts +2 -2
- package/src/view/minimap/Minimap.d.ts.map +1 -1
- package/src/view/minimap/Minimap.js +225 -225
- package/src/view/minimap/dom/MinimapCameraView.d.ts +3 -3
- package/src/view/minimap/dom/MinimapCameraView.d.ts.map +1 -1
- package/src/view/minimap/dom/MinimapCameraView.js +206 -206
- package/src/shade/renderer/shadow/map/csm/shader/shader_setup_cascades.d.ts +0 -3
- package/src/shade/renderer/shadow/map/csm/shader/shader_setup_cascades.d.ts.map +0 -1
- package/src/shade/renderer/shadow/map/csm/shader/shader_setup_cascades.js +0 -20
- package/src/shade/renderer/volumetrics/VOLUMETRICS_WORKGROUP_RESOLUTION.d.ts +0 -2
- package/src/shade/renderer/volumetrics/VOLUMETRICS_WORKGROUP_RESOLUTION.d.ts.map +0 -1
- package/src/shade/renderer/volumetrics/VOLUMETRICS_WORKGROUP_RESOLUTION.js +0 -1
|
@@ -1,518 +1,518 @@
|
|
|
1
|
-
import { assert } from "../../../core/assert.js";
|
|
2
|
-
import { AnimationClipFlag } from "../../graphics/ecs/animation/animator/AnimationClipFlag.js";
|
|
3
|
-
import { AnimationState } from "../../graphics/ecs/animation/animator/graph/AnimationState.js";
|
|
4
|
-
import { AnimationStateType } from "../../graphics/ecs/animation/animator/graph/AnimationStateType.js";
|
|
5
|
-
import { AnimationTransition } from "../../graphics/ecs/animation/animator/graph/AnimationTransition.js";
|
|
6
|
-
import { wrap_clip_time } from "./wrap_clip_time.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* One entity's animation state machine: which state it is in, which transitions are running, what
|
|
10
|
-
* each clip therefore weighs, and — the part the GPU cannot own — what time each of those clips is
|
|
11
|
-
* playing at.
|
|
12
|
-
*
|
|
13
|
-
* **The clock is here and not on the GPU**, and I-4 is what forces it. Shade advances clip time
|
|
14
|
-
* itself in its tick shader, but the time gameplay reads has to be the time the picture is drawn
|
|
15
|
-
* from: notifications fire at authored moments off this clock, and the CPU pose evaluator answers
|
|
16
|
-
* socket queries from it. Two clocks drift, so there is one, and {@link
|
|
17
|
-
* writes it down to the renderer with `set_time` rather than letting the GPU advance anything.
|
|
18
|
-
*
|
|
19
|
-
* The state machine itself is not new — `AnimationState`, `AnimationTransition`, `BlendStateMatrix`
|
|
20
|
-
* and the graph definitions are reused as they stand. What is not reused is the three-only half of
|
|
21
|
-
* the legacy `AnimationGraph`: an `AnimationMixer`, the per-clip `AnimationAction`s it owns, and
|
|
22
|
-
* writing weights onto them.
|
|
23
|
-
*/
|
|
24
|
-
export class AnimationGraphController {
|
|
25
|
-
/**
|
|
26
|
-
* @type {AnimationGraphDefinition}
|
|
27
|
-
*/
|
|
28
|
-
def = null;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @type {AnimationState[]}
|
|
32
|
-
*/
|
|
33
|
-
states = [];
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @type {AnimationTransition[]}
|
|
37
|
-
*/
|
|
38
|
-
transitions = [];
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The state the graph is in. During a transition this is already the target — the source stays
|
|
42
|
-
* in {@link simulatedStates} until the transition finishes.
|
|
43
|
-
*
|
|
44
|
-
* @type {AnimationState}
|
|
45
|
-
*/
|
|
46
|
-
state = null;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @type {AnimationTransition[]}
|
|
50
|
-
*/
|
|
51
|
-
activeTransitions = [];
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Every state whose clock is running: the current one, plus the sources of transitions that
|
|
55
|
-
* have not finished.
|
|
56
|
-
*
|
|
57
|
-
* @type {AnimationState[]}
|
|
58
|
-
*/
|
|
59
|
-
simulatedStates = [];
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Per-clip weights and time scales, in `def.clipIndex` order. The weights are what reaches the
|
|
63
|
-
* GPU; the time scales are consumed here, by {@link AnimationState#tick}, and have no GPU
|
|
64
|
-
* counterpart because the time they scale is already integrated into the state's clock.
|
|
65
|
-
*
|
|
66
|
-
* @type {BlendStateMatrix}
|
|
67
|
-
*/
|
|
68
|
-
blendState = null;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Where in its starting clip the graph begins, as a fraction of that clip's duration.
|
|
72
|
-
*
|
|
73
|
-
* A fraction rather than a time because a clip's duration comes from the model and the model
|
|
74
|
-
* loads long after the entity does. Its purpose is to keep identical units from moving in
|
|
75
|
-
* lockstep, and it is applied once, at {@link link}, without dispatching the notifications it
|
|
76
|
-
* skips over — a unit that spawns mid-stride should not also spawn the footstep it missed.
|
|
77
|
-
*
|
|
78
|
-
* @type {number}
|
|
79
|
-
*/
|
|
80
|
-
start_phase = 0;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* The dataset this graph fires its notifications into.
|
|
84
|
-
*
|
|
85
|
-
* **Public, and named with the leading underscores, because `AnimationState.tick` reads it off
|
|
86
|
-
* the graph by exactly that name.** The state classes are reused as they stand, so this is
|
|
87
|
-
* their interface rather than an accident of style.
|
|
88
|
-
*
|
|
89
|
-
* @type {EntityComponentDataset}
|
|
90
|
-
*/
|
|
91
|
-
__dataset = null;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* The entity those notifications are addressed to. Read by `AnimationState.tick` — see
|
|
95
|
-
* {@link __dataset}.
|
|
96
|
-
*
|
|
97
|
-
* @type {number}
|
|
98
|
-
*/
|
|
99
|
-
__entity = -1;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @type {boolean}
|
|
103
|
-
*/
|
|
104
|
-
#linked = false;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Playback time of each clip, in `def.clipIndex` order, already wrapped or clamped into the
|
|
108
|
-
* clip's own duration — which is what the renderer's clip record wants, and what a pose query
|
|
109
|
-
* has to agree with.
|
|
110
|
-
*
|
|
111
|
-
* @type {Float64Array}
|
|
112
|
-
*/
|
|
113
|
-
#clip_times = new Float64Array(0);
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @returns {boolean}
|
|
117
|
-
*/
|
|
118
|
-
get linked() {
|
|
119
|
-
return this.#linked;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Build the runtime graph — one {@link AnimationState} per state definition, one
|
|
124
|
-
* {@link AnimationTransition} per transition definition, wired to each other.
|
|
125
|
-
*
|
|
126
|
-
* @param {AnimationGraphDefinition} def
|
|
127
|
-
*/
|
|
128
|
-
initialize(def) {
|
|
129
|
-
assert.defined(def, 'def');
|
|
130
|
-
assert.equal(this.#linked, false, 'graph is linked');
|
|
131
|
-
|
|
132
|
-
this.def = def;
|
|
133
|
-
|
|
134
|
-
this.blendState = def.createBlendState();
|
|
135
|
-
this.#clip_times = new Float64Array(def.clipIndex.length);
|
|
136
|
-
|
|
137
|
-
const state_definitions = def.states;
|
|
138
|
-
const state_count = state_definitions.length;
|
|
139
|
-
|
|
140
|
-
this.states = [];
|
|
141
|
-
|
|
142
|
-
for (let i = 0; i < state_count; i++) {
|
|
143
|
-
const state = new AnimationState();
|
|
144
|
-
|
|
145
|
-
state.def = state_definitions[i];
|
|
146
|
-
state.graph = this;
|
|
147
|
-
|
|
148
|
-
this.states[i] = state;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const transition_definitions = def.transitions;
|
|
152
|
-
const transition_count = transition_definitions.length;
|
|
153
|
-
|
|
154
|
-
this.transitions = [];
|
|
155
|
-
|
|
156
|
-
for (let i = 0; i < transition_count; i++) {
|
|
157
|
-
const transition = new AnimationTransition();
|
|
158
|
-
|
|
159
|
-
transition.def = transition_definitions[i];
|
|
160
|
-
transition.graph = this;
|
|
161
|
-
|
|
162
|
-
this.transitions[i] = transition;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
this.state = this.state_by_definition(def.startingSate);
|
|
166
|
-
|
|
167
|
-
for (let i = 0; i < transition_count; i++) {
|
|
168
|
-
const transition = this.transitions[i];
|
|
169
|
-
|
|
170
|
-
transition.source = this.state_by_definition(transition.def.source);
|
|
171
|
-
transition.target = this.state_by_definition(transition.def.target);
|
|
172
|
-
|
|
173
|
-
transition.initialize();
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
for (let i = 0; i < state_count; i++) {
|
|
177
|
-
const state = this.states[i];
|
|
178
|
-
|
|
179
|
-
state.inEdges = state.def.inEdges.map(this.transition_by_definition, this);
|
|
180
|
-
state.outEdges = state.def.outEdges.map(this.transition_by_definition, this);
|
|
181
|
-
|
|
182
|
-
state.initialize();
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* @param {AnimationStateDefinition} definition
|
|
188
|
-
* @returns {AnimationState|undefined}
|
|
189
|
-
*/
|
|
190
|
-
state_by_definition(definition) {
|
|
191
|
-
assert.defined(definition, 'definition');
|
|
192
|
-
|
|
193
|
-
const states = this.states;
|
|
194
|
-
|
|
195
|
-
for (let i = 0; i < states.length; i++) {
|
|
196
|
-
if (states[i].def === definition) {
|
|
197
|
-
return states[i];
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return undefined;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* @param {string} name
|
|
206
|
-
* @returns {AnimationState|undefined}
|
|
207
|
-
*/
|
|
208
|
-
state_by_name(name) {
|
|
209
|
-
const states = this.states;
|
|
210
|
-
|
|
211
|
-
for (let i = 0; i < states.length; i++) {
|
|
212
|
-
if (states[i].def.name === name) {
|
|
213
|
-
return states[i];
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return undefined;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @param {string} name name of the clip the state plays
|
|
222
|
-
* @returns {AnimationState|undefined}
|
|
223
|
-
*/
|
|
224
|
-
state_by_clip_name(name) {
|
|
225
|
-
const states = this.states;
|
|
226
|
-
|
|
227
|
-
for (let i = 0; i < states.length; i++) {
|
|
228
|
-
const definition = states[i].def;
|
|
229
|
-
|
|
230
|
-
if (definition.type !== AnimationStateType.Clip) {
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (definition.motion.def.name === name) {
|
|
235
|
-
return states[i];
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return undefined;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* @param {AnimationTransitionDefinition} definition
|
|
244
|
-
* @returns {AnimationTransition|undefined}
|
|
245
|
-
*/
|
|
246
|
-
transition_by_definition(definition) {
|
|
247
|
-
const transitions = this.transitions;
|
|
248
|
-
|
|
249
|
-
for (let i = 0; i < transitions.length; i++) {
|
|
250
|
-
if (transitions[i].def === definition) {
|
|
251
|
-
return transitions[i];
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return undefined;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Start the graph: take the clip durations the model turned out to have, enter the starting
|
|
260
|
-
* state, and begin listening for the events its transitions fire on.
|
|
261
|
-
*
|
|
262
|
-
* **Durations arrive here rather than at construction** because they are the model's and not
|
|
263
|
-
* the graph's — `animation-graph.json` names clips, the `.glb` says how long they are — and the
|
|
264
|
-
* notification path needs them to be right before a single frame is ticked. They are written
|
|
265
|
-
* onto the shared clip definitions, which is where {@link AnimationClip} reads them.
|
|
266
|
-
*
|
|
267
|
-
* @param {number} entity
|
|
268
|
-
* @param {EntityComponentDataset} ecd
|
|
269
|
-
* @param {ArrayLike<number>} durations seconds, one per `def.clipIndex` entry, in that order
|
|
270
|
-
*/
|
|
271
|
-
link(entity, ecd, durations) {
|
|
272
|
-
assert.isNonNegativeInteger(entity, 'entity');
|
|
273
|
-
assert.defined(ecd, 'ecd');
|
|
274
|
-
assert.equal(this.#linked, false, 'graph is already linked, call unlink first');
|
|
275
|
-
|
|
276
|
-
const clip_index = this.def.clipIndex;
|
|
277
|
-
|
|
278
|
-
assert.equal(durations.length, clip_index.length, 'durations.length');
|
|
279
|
-
|
|
280
|
-
for (let i = 0; i < clip_index.length; i++) {
|
|
281
|
-
clip_index[i].duration = durations[i];
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
this.__entity = entity;
|
|
285
|
-
this.__dataset = ecd;
|
|
286
|
-
|
|
287
|
-
this.#linked = true;
|
|
288
|
-
|
|
289
|
-
this.enter_state(this.state);
|
|
290
|
-
|
|
291
|
-
this.state.time = this.start_phase * this.#state_clip_duration(this.state);
|
|
292
|
-
|
|
293
|
-
this.update_blend_state();
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Stop listening. The graph keeps the state it was in, so a re-link resumes rather than
|
|
298
|
-
* restarts.
|
|
299
|
-
*/
|
|
300
|
-
unlink() {
|
|
301
|
-
if (!this.#linked) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
this.exit_state(this.state);
|
|
306
|
-
|
|
307
|
-
this.#linked = false;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Advance every running clock by `time_delta`, fire whatever notifications were crossed, and
|
|
312
|
-
* recompute the blend.
|
|
313
|
-
*
|
|
314
|
-
* Unconditional by design: §2.6-2's split puts pose evaluation and its events on the CPU
|
|
315
|
-
* precisely so that camera framing cannot decide whether a projectile spawns. The screen-area
|
|
316
|
-
* cull the legacy system applied has no counterpart here.
|
|
317
|
-
*
|
|
318
|
-
* @param {number} time_delta in seconds
|
|
319
|
-
*/
|
|
320
|
-
tick(time_delta) {
|
|
321
|
-
assert.equal(this.#linked, true, 'graph is not linked');
|
|
322
|
-
|
|
323
|
-
const active_transitions = this.activeTransitions;
|
|
324
|
-
|
|
325
|
-
let transition_count = active_transitions.length;
|
|
326
|
-
|
|
327
|
-
transitions: for (let i = 0; i < transition_count; i++) {
|
|
328
|
-
const active = active_transitions[i];
|
|
329
|
-
|
|
330
|
-
active.tick(time_delta);
|
|
331
|
-
|
|
332
|
-
if (!active.isFinished()) {
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
active_transitions.splice(i, 1);
|
|
337
|
-
|
|
338
|
-
transition_count--;
|
|
339
|
-
i--;
|
|
340
|
-
|
|
341
|
-
for (let j = 0; j < transition_count; j++) {
|
|
342
|
-
const other = active_transitions[j];
|
|
343
|
-
|
|
344
|
-
if (other.source === active.source || other.target === active.source) {
|
|
345
|
-
// the state it came from is still in use by another transition
|
|
346
|
-
continue transitions;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
this.stop_state_simulation(active.source);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
const simulated = this.simulatedStates;
|
|
354
|
-
|
|
355
|
-
for (let i = 0; i < simulated.length; i++) {
|
|
356
|
-
simulated[i].tick(time_delta);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
this.update_blend_state();
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* @param {AnimationState} state
|
|
364
|
-
* @returns {boolean} `false` when the state was not being simulated
|
|
365
|
-
*/
|
|
366
|
-
stop_state_simulation(state) {
|
|
367
|
-
const i = this.simulatedStates.indexOf(state);
|
|
368
|
-
|
|
369
|
-
if (i === -1) {
|
|
370
|
-
return false;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
this.simulatedStates.splice(i, 1);
|
|
374
|
-
|
|
375
|
-
return true;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Recompute per-clip weights from the states and transitions that are running, and the time
|
|
380
|
-
* each of those clips is at.
|
|
381
|
-
*/
|
|
382
|
-
update_blend_state() {
|
|
383
|
-
const simulated = this.simulatedStates;
|
|
384
|
-
|
|
385
|
-
for (let i = 0; i < simulated.length; i++) {
|
|
386
|
-
simulated[i].updateBlendState();
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
const active_transitions = this.activeTransitions;
|
|
390
|
-
const transition_count = active_transitions.length;
|
|
391
|
-
|
|
392
|
-
const blend = this.blendState;
|
|
393
|
-
|
|
394
|
-
if (transition_count === 1) {
|
|
395
|
-
const first = active_transitions[0];
|
|
396
|
-
|
|
397
|
-
first.updateBlendsState();
|
|
398
|
-
|
|
399
|
-
blend.copy(first.blendState);
|
|
400
|
-
} else if (transition_count > 1) {
|
|
401
|
-
blend.zero();
|
|
402
|
-
|
|
403
|
-
for (let i = 0; i < transition_count; i++) {
|
|
404
|
-
const active = active_transitions[i];
|
|
405
|
-
|
|
406
|
-
active.updateBlendsState();
|
|
407
|
-
|
|
408
|
-
blend.add(active.blendState);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
blend.weightsMultiplyScalar(1 / transition_count);
|
|
412
|
-
} else {
|
|
413
|
-
blend.copy(this.state.blendState);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
const times = this.#clip_times;
|
|
417
|
-
|
|
418
|
-
for (let i = 0; i < simulated.length; i++) {
|
|
419
|
-
const state = simulated[i];
|
|
420
|
-
|
|
421
|
-
if (state.def.type !== AnimationStateType.Clip) {
|
|
422
|
-
continue;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
const clip = state.def.motion;
|
|
426
|
-
|
|
427
|
-
times[this.def.getClipIndex(clip.def)] = wrap_clip_time(
|
|
428
|
-
state.time,
|
|
429
|
-
clip.def.duration,
|
|
430
|
-
clip.getFlag(AnimationClipFlag.Repeat)
|
|
431
|
-
);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Where clip `clip_index` is playing, in seconds from its own start — wrapped for a looping
|
|
437
|
-
* clip and clamped for a one-shot, so it is directly what the renderer's clip record holds and
|
|
438
|
-
* what a pose query has to be asked at.
|
|
439
|
-
*
|
|
440
|
-
* Only meaningful for a clip the blend gives weight to; a clip nothing is playing keeps
|
|
441
|
-
* whatever time it last stopped at.
|
|
442
|
-
*
|
|
443
|
-
* @param {number} clip_index
|
|
444
|
-
* @returns {number}
|
|
445
|
-
*/
|
|
446
|
-
clip_time(clip_index) {
|
|
447
|
-
return this.#clip_times[clip_index];
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* @param {AnimationState} state
|
|
452
|
-
* @returns {number}
|
|
453
|
-
*/
|
|
454
|
-
#state_clip_duration(state) {
|
|
455
|
-
if (state.def.type !== AnimationStateType.Clip) {
|
|
456
|
-
return 0;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
return state.def.motion.def.duration;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* @param {AnimationState} state
|
|
464
|
-
*/
|
|
465
|
-
enter_state(state) {
|
|
466
|
-
this.state = state;
|
|
467
|
-
|
|
468
|
-
if (this.simulatedStates.indexOf(state) === -1) {
|
|
469
|
-
this.simulatedStates.push(state);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
state.activate(this.__entity, this.__dataset);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* @param {AnimationState} state
|
|
477
|
-
*/
|
|
478
|
-
exit_state(state) {
|
|
479
|
-
state.deactivate(this.__entity, this.__dataset);
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* @param {AnimationState} state
|
|
484
|
-
*/
|
|
485
|
-
activate_state(state) {
|
|
486
|
-
this.exit_state(this.state);
|
|
487
|
-
|
|
488
|
-
this.enter_state(state);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Begin a transition that has just fired.
|
|
493
|
-
*
|
|
494
|
-
* **Named for `AnimationTransition.transition`, which calls it** — the transitions listen to
|
|
495
|
-
* ECS events themselves and push the result back here.
|
|
496
|
-
*
|
|
497
|
-
* @param {AnimationTransition} transition
|
|
498
|
-
*/
|
|
499
|
-
transition(transition) {
|
|
500
|
-
this.activeTransitions.push(transition);
|
|
501
|
-
|
|
502
|
-
this.activate_state(transition.target);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* What the binary serialization registry knows this component by.
|
|
508
|
-
*
|
|
509
|
-
* The controller is built transiently — `CombatUnitEntityDecorator` constructs one from the
|
|
510
|
-
* creature's `animation-graph.json` every time it decorates a unit — so nothing writes one to disk
|
|
511
|
-
* and there is no adapter behind this name. It is here because the registry warns on any component
|
|
512
|
-
* class that reaches it unnamed, once per boot, printing the whole class source; and because a
|
|
513
|
-
* component with no name cannot be told apart from another one later, which is I-13's business
|
|
514
|
-
* whether or not it round-trips today.
|
|
515
|
-
*
|
|
516
|
-
* @type {string}
|
|
517
|
-
*/
|
|
518
|
-
AnimationGraphController.typeName = "AnimationGraphController";
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { AnimationClipFlag } from "../../graphics/ecs/animation/animator/AnimationClipFlag.js";
|
|
3
|
+
import { AnimationState } from "../../graphics/ecs/animation/animator/graph/AnimationState.js";
|
|
4
|
+
import { AnimationStateType } from "../../graphics/ecs/animation/animator/graph/AnimationStateType.js";
|
|
5
|
+
import { AnimationTransition } from "../../graphics/ecs/animation/animator/graph/AnimationTransition.js";
|
|
6
|
+
import { wrap_clip_time } from "./wrap_clip_time.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* One entity's animation state machine: which state it is in, which transitions are running, what
|
|
10
|
+
* each clip therefore weighs, and — the part the GPU cannot own — what time each of those clips is
|
|
11
|
+
* playing at.
|
|
12
|
+
*
|
|
13
|
+
* **The clock is here and not on the GPU**, and I-4 is what forces it. Shade advances clip time
|
|
14
|
+
* itself in its tick shader, but the time gameplay reads has to be the time the picture is drawn
|
|
15
|
+
* from: notifications fire at authored moments off this clock, and the CPU pose evaluator answers
|
|
16
|
+
* socket queries from it. Two clocks drift, so there is one, and {@link AnimationGraphSystem}
|
|
17
|
+
* writes it down to the renderer with `set_time` rather than letting the GPU advance anything.
|
|
18
|
+
*
|
|
19
|
+
* The state machine itself is not new — `AnimationState`, `AnimationTransition`, `BlendStateMatrix`
|
|
20
|
+
* and the graph definitions are reused as they stand. What is not reused is the three-only half of
|
|
21
|
+
* the legacy `AnimationGraph`: an `AnimationMixer`, the per-clip `AnimationAction`s it owns, and
|
|
22
|
+
* writing weights onto them.
|
|
23
|
+
*/
|
|
24
|
+
export class AnimationGraphController {
|
|
25
|
+
/**
|
|
26
|
+
* @type {AnimationGraphDefinition}
|
|
27
|
+
*/
|
|
28
|
+
def = null;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @type {AnimationState[]}
|
|
32
|
+
*/
|
|
33
|
+
states = [];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @type {AnimationTransition[]}
|
|
37
|
+
*/
|
|
38
|
+
transitions = [];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The state the graph is in. During a transition this is already the target — the source stays
|
|
42
|
+
* in {@link simulatedStates} until the transition finishes.
|
|
43
|
+
*
|
|
44
|
+
* @type {AnimationState}
|
|
45
|
+
*/
|
|
46
|
+
state = null;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @type {AnimationTransition[]}
|
|
50
|
+
*/
|
|
51
|
+
activeTransitions = [];
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Every state whose clock is running: the current one, plus the sources of transitions that
|
|
55
|
+
* have not finished.
|
|
56
|
+
*
|
|
57
|
+
* @type {AnimationState[]}
|
|
58
|
+
*/
|
|
59
|
+
simulatedStates = [];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Per-clip weights and time scales, in `def.clipIndex` order. The weights are what reaches the
|
|
63
|
+
* GPU; the time scales are consumed here, by {@link AnimationState#tick}, and have no GPU
|
|
64
|
+
* counterpart because the time they scale is already integrated into the state's clock.
|
|
65
|
+
*
|
|
66
|
+
* @type {BlendStateMatrix}
|
|
67
|
+
*/
|
|
68
|
+
blendState = null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Where in its starting clip the graph begins, as a fraction of that clip's duration.
|
|
72
|
+
*
|
|
73
|
+
* A fraction rather than a time because a clip's duration comes from the model and the model
|
|
74
|
+
* loads long after the entity does. Its purpose is to keep identical units from moving in
|
|
75
|
+
* lockstep, and it is applied once, at {@link link}, without dispatching the notifications it
|
|
76
|
+
* skips over — a unit that spawns mid-stride should not also spawn the footstep it missed.
|
|
77
|
+
*
|
|
78
|
+
* @type {number}
|
|
79
|
+
*/
|
|
80
|
+
start_phase = 0;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The dataset this graph fires its notifications into.
|
|
84
|
+
*
|
|
85
|
+
* **Public, and named with the leading underscores, because `AnimationState.tick` reads it off
|
|
86
|
+
* the graph by exactly that name.** The state classes are reused as they stand, so this is
|
|
87
|
+
* their interface rather than an accident of style.
|
|
88
|
+
*
|
|
89
|
+
* @type {EntityComponentDataset}
|
|
90
|
+
*/
|
|
91
|
+
__dataset = null;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The entity those notifications are addressed to. Read by `AnimationState.tick` — see
|
|
95
|
+
* {@link __dataset}.
|
|
96
|
+
*
|
|
97
|
+
* @type {number}
|
|
98
|
+
*/
|
|
99
|
+
__entity = -1;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @type {boolean}
|
|
103
|
+
*/
|
|
104
|
+
#linked = false;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Playback time of each clip, in `def.clipIndex` order, already wrapped or clamped into the
|
|
108
|
+
* clip's own duration — which is what the renderer's clip record wants, and what a pose query
|
|
109
|
+
* has to agree with.
|
|
110
|
+
*
|
|
111
|
+
* @type {Float64Array}
|
|
112
|
+
*/
|
|
113
|
+
#clip_times = new Float64Array(0);
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @returns {boolean}
|
|
117
|
+
*/
|
|
118
|
+
get linked() {
|
|
119
|
+
return this.#linked;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Build the runtime graph — one {@link AnimationState} per state definition, one
|
|
124
|
+
* {@link AnimationTransition} per transition definition, wired to each other.
|
|
125
|
+
*
|
|
126
|
+
* @param {AnimationGraphDefinition} def
|
|
127
|
+
*/
|
|
128
|
+
initialize(def) {
|
|
129
|
+
assert.defined(def, 'def');
|
|
130
|
+
assert.equal(this.#linked, false, 'graph is linked');
|
|
131
|
+
|
|
132
|
+
this.def = def;
|
|
133
|
+
|
|
134
|
+
this.blendState = def.createBlendState();
|
|
135
|
+
this.#clip_times = new Float64Array(def.clipIndex.length);
|
|
136
|
+
|
|
137
|
+
const state_definitions = def.states;
|
|
138
|
+
const state_count = state_definitions.length;
|
|
139
|
+
|
|
140
|
+
this.states = [];
|
|
141
|
+
|
|
142
|
+
for (let i = 0; i < state_count; i++) {
|
|
143
|
+
const state = new AnimationState();
|
|
144
|
+
|
|
145
|
+
state.def = state_definitions[i];
|
|
146
|
+
state.graph = this;
|
|
147
|
+
|
|
148
|
+
this.states[i] = state;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const transition_definitions = def.transitions;
|
|
152
|
+
const transition_count = transition_definitions.length;
|
|
153
|
+
|
|
154
|
+
this.transitions = [];
|
|
155
|
+
|
|
156
|
+
for (let i = 0; i < transition_count; i++) {
|
|
157
|
+
const transition = new AnimationTransition();
|
|
158
|
+
|
|
159
|
+
transition.def = transition_definitions[i];
|
|
160
|
+
transition.graph = this;
|
|
161
|
+
|
|
162
|
+
this.transitions[i] = transition;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
this.state = this.state_by_definition(def.startingSate);
|
|
166
|
+
|
|
167
|
+
for (let i = 0; i < transition_count; i++) {
|
|
168
|
+
const transition = this.transitions[i];
|
|
169
|
+
|
|
170
|
+
transition.source = this.state_by_definition(transition.def.source);
|
|
171
|
+
transition.target = this.state_by_definition(transition.def.target);
|
|
172
|
+
|
|
173
|
+
transition.initialize();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
for (let i = 0; i < state_count; i++) {
|
|
177
|
+
const state = this.states[i];
|
|
178
|
+
|
|
179
|
+
state.inEdges = state.def.inEdges.map(this.transition_by_definition, this);
|
|
180
|
+
state.outEdges = state.def.outEdges.map(this.transition_by_definition, this);
|
|
181
|
+
|
|
182
|
+
state.initialize();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @param {AnimationStateDefinition} definition
|
|
188
|
+
* @returns {AnimationState|undefined}
|
|
189
|
+
*/
|
|
190
|
+
state_by_definition(definition) {
|
|
191
|
+
assert.defined(definition, 'definition');
|
|
192
|
+
|
|
193
|
+
const states = this.states;
|
|
194
|
+
|
|
195
|
+
for (let i = 0; i < states.length; i++) {
|
|
196
|
+
if (states[i].def === definition) {
|
|
197
|
+
return states[i];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @param {string} name
|
|
206
|
+
* @returns {AnimationState|undefined}
|
|
207
|
+
*/
|
|
208
|
+
state_by_name(name) {
|
|
209
|
+
const states = this.states;
|
|
210
|
+
|
|
211
|
+
for (let i = 0; i < states.length; i++) {
|
|
212
|
+
if (states[i].def.name === name) {
|
|
213
|
+
return states[i];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @param {string} name name of the clip the state plays
|
|
222
|
+
* @returns {AnimationState|undefined}
|
|
223
|
+
*/
|
|
224
|
+
state_by_clip_name(name) {
|
|
225
|
+
const states = this.states;
|
|
226
|
+
|
|
227
|
+
for (let i = 0; i < states.length; i++) {
|
|
228
|
+
const definition = states[i].def;
|
|
229
|
+
|
|
230
|
+
if (definition.type !== AnimationStateType.Clip) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (definition.motion.def.name === name) {
|
|
235
|
+
return states[i];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return undefined;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* @param {AnimationTransitionDefinition} definition
|
|
244
|
+
* @returns {AnimationTransition|undefined}
|
|
245
|
+
*/
|
|
246
|
+
transition_by_definition(definition) {
|
|
247
|
+
const transitions = this.transitions;
|
|
248
|
+
|
|
249
|
+
for (let i = 0; i < transitions.length; i++) {
|
|
250
|
+
if (transitions[i].def === definition) {
|
|
251
|
+
return transitions[i];
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return undefined;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Start the graph: take the clip durations the model turned out to have, enter the starting
|
|
260
|
+
* state, and begin listening for the events its transitions fire on.
|
|
261
|
+
*
|
|
262
|
+
* **Durations arrive here rather than at construction** because they are the model's and not
|
|
263
|
+
* the graph's — `animation-graph.json` names clips, the `.glb` says how long they are — and the
|
|
264
|
+
* notification path needs them to be right before a single frame is ticked. They are written
|
|
265
|
+
* onto the shared clip definitions, which is where {@link AnimationClip} reads them.
|
|
266
|
+
*
|
|
267
|
+
* @param {number} entity
|
|
268
|
+
* @param {EntityComponentDataset} ecd
|
|
269
|
+
* @param {ArrayLike<number>} durations seconds, one per `def.clipIndex` entry, in that order
|
|
270
|
+
*/
|
|
271
|
+
link(entity, ecd, durations) {
|
|
272
|
+
assert.isNonNegativeInteger(entity, 'entity');
|
|
273
|
+
assert.defined(ecd, 'ecd');
|
|
274
|
+
assert.equal(this.#linked, false, 'graph is already linked, call unlink first');
|
|
275
|
+
|
|
276
|
+
const clip_index = this.def.clipIndex;
|
|
277
|
+
|
|
278
|
+
assert.equal(durations.length, clip_index.length, 'durations.length');
|
|
279
|
+
|
|
280
|
+
for (let i = 0; i < clip_index.length; i++) {
|
|
281
|
+
clip_index[i].duration = durations[i];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
this.__entity = entity;
|
|
285
|
+
this.__dataset = ecd;
|
|
286
|
+
|
|
287
|
+
this.#linked = true;
|
|
288
|
+
|
|
289
|
+
this.enter_state(this.state);
|
|
290
|
+
|
|
291
|
+
this.state.time = this.start_phase * this.#state_clip_duration(this.state);
|
|
292
|
+
|
|
293
|
+
this.update_blend_state();
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Stop listening. The graph keeps the state it was in, so a re-link resumes rather than
|
|
298
|
+
* restarts.
|
|
299
|
+
*/
|
|
300
|
+
unlink() {
|
|
301
|
+
if (!this.#linked) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
this.exit_state(this.state);
|
|
306
|
+
|
|
307
|
+
this.#linked = false;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Advance every running clock by `time_delta`, fire whatever notifications were crossed, and
|
|
312
|
+
* recompute the blend.
|
|
313
|
+
*
|
|
314
|
+
* Unconditional by design: §2.6-2's split puts pose evaluation and its events on the CPU
|
|
315
|
+
* precisely so that camera framing cannot decide whether a projectile spawns. The screen-area
|
|
316
|
+
* cull the legacy system applied has no counterpart here.
|
|
317
|
+
*
|
|
318
|
+
* @param {number} time_delta in seconds
|
|
319
|
+
*/
|
|
320
|
+
tick(time_delta) {
|
|
321
|
+
assert.equal(this.#linked, true, 'graph is not linked');
|
|
322
|
+
|
|
323
|
+
const active_transitions = this.activeTransitions;
|
|
324
|
+
|
|
325
|
+
let transition_count = active_transitions.length;
|
|
326
|
+
|
|
327
|
+
transitions: for (let i = 0; i < transition_count; i++) {
|
|
328
|
+
const active = active_transitions[i];
|
|
329
|
+
|
|
330
|
+
active.tick(time_delta);
|
|
331
|
+
|
|
332
|
+
if (!active.isFinished()) {
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
active_transitions.splice(i, 1);
|
|
337
|
+
|
|
338
|
+
transition_count--;
|
|
339
|
+
i--;
|
|
340
|
+
|
|
341
|
+
for (let j = 0; j < transition_count; j++) {
|
|
342
|
+
const other = active_transitions[j];
|
|
343
|
+
|
|
344
|
+
if (other.source === active.source || other.target === active.source) {
|
|
345
|
+
// the state it came from is still in use by another transition
|
|
346
|
+
continue transitions;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
this.stop_state_simulation(active.source);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const simulated = this.simulatedStates;
|
|
354
|
+
|
|
355
|
+
for (let i = 0; i < simulated.length; i++) {
|
|
356
|
+
simulated[i].tick(time_delta);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
this.update_blend_state();
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @param {AnimationState} state
|
|
364
|
+
* @returns {boolean} `false` when the state was not being simulated
|
|
365
|
+
*/
|
|
366
|
+
stop_state_simulation(state) {
|
|
367
|
+
const i = this.simulatedStates.indexOf(state);
|
|
368
|
+
|
|
369
|
+
if (i === -1) {
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
this.simulatedStates.splice(i, 1);
|
|
374
|
+
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Recompute per-clip weights from the states and transitions that are running, and the time
|
|
380
|
+
* each of those clips is at.
|
|
381
|
+
*/
|
|
382
|
+
update_blend_state() {
|
|
383
|
+
const simulated = this.simulatedStates;
|
|
384
|
+
|
|
385
|
+
for (let i = 0; i < simulated.length; i++) {
|
|
386
|
+
simulated[i].updateBlendState();
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const active_transitions = this.activeTransitions;
|
|
390
|
+
const transition_count = active_transitions.length;
|
|
391
|
+
|
|
392
|
+
const blend = this.blendState;
|
|
393
|
+
|
|
394
|
+
if (transition_count === 1) {
|
|
395
|
+
const first = active_transitions[0];
|
|
396
|
+
|
|
397
|
+
first.updateBlendsState();
|
|
398
|
+
|
|
399
|
+
blend.copy(first.blendState);
|
|
400
|
+
} else if (transition_count > 1) {
|
|
401
|
+
blend.zero();
|
|
402
|
+
|
|
403
|
+
for (let i = 0; i < transition_count; i++) {
|
|
404
|
+
const active = active_transitions[i];
|
|
405
|
+
|
|
406
|
+
active.updateBlendsState();
|
|
407
|
+
|
|
408
|
+
blend.add(active.blendState);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
blend.weightsMultiplyScalar(1 / transition_count);
|
|
412
|
+
} else {
|
|
413
|
+
blend.copy(this.state.blendState);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
const times = this.#clip_times;
|
|
417
|
+
|
|
418
|
+
for (let i = 0; i < simulated.length; i++) {
|
|
419
|
+
const state = simulated[i];
|
|
420
|
+
|
|
421
|
+
if (state.def.type !== AnimationStateType.Clip) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
const clip = state.def.motion;
|
|
426
|
+
|
|
427
|
+
times[this.def.getClipIndex(clip.def)] = wrap_clip_time(
|
|
428
|
+
state.time,
|
|
429
|
+
clip.def.duration,
|
|
430
|
+
clip.getFlag(AnimationClipFlag.Repeat)
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Where clip `clip_index` is playing, in seconds from its own start — wrapped for a looping
|
|
437
|
+
* clip and clamped for a one-shot, so it is directly what the renderer's clip record holds and
|
|
438
|
+
* what a pose query has to be asked at.
|
|
439
|
+
*
|
|
440
|
+
* Only meaningful for a clip the blend gives weight to; a clip nothing is playing keeps
|
|
441
|
+
* whatever time it last stopped at.
|
|
442
|
+
*
|
|
443
|
+
* @param {number} clip_index
|
|
444
|
+
* @returns {number}
|
|
445
|
+
*/
|
|
446
|
+
clip_time(clip_index) {
|
|
447
|
+
return this.#clip_times[clip_index];
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* @param {AnimationState} state
|
|
452
|
+
* @returns {number}
|
|
453
|
+
*/
|
|
454
|
+
#state_clip_duration(state) {
|
|
455
|
+
if (state.def.type !== AnimationStateType.Clip) {
|
|
456
|
+
return 0;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return state.def.motion.def.duration;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* @param {AnimationState} state
|
|
464
|
+
*/
|
|
465
|
+
enter_state(state) {
|
|
466
|
+
this.state = state;
|
|
467
|
+
|
|
468
|
+
if (this.simulatedStates.indexOf(state) === -1) {
|
|
469
|
+
this.simulatedStates.push(state);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
state.activate(this.__entity, this.__dataset);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @param {AnimationState} state
|
|
477
|
+
*/
|
|
478
|
+
exit_state(state) {
|
|
479
|
+
state.deactivate(this.__entity, this.__dataset);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* @param {AnimationState} state
|
|
484
|
+
*/
|
|
485
|
+
activate_state(state) {
|
|
486
|
+
this.exit_state(this.state);
|
|
487
|
+
|
|
488
|
+
this.enter_state(state);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Begin a transition that has just fired.
|
|
493
|
+
*
|
|
494
|
+
* **Named for `AnimationTransition.transition`, which calls it** — the transitions listen to
|
|
495
|
+
* ECS events themselves and push the result back here.
|
|
496
|
+
*
|
|
497
|
+
* @param {AnimationTransition} transition
|
|
498
|
+
*/
|
|
499
|
+
transition(transition) {
|
|
500
|
+
this.activeTransitions.push(transition);
|
|
501
|
+
|
|
502
|
+
this.activate_state(transition.target);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* What the binary serialization registry knows this component by.
|
|
508
|
+
*
|
|
509
|
+
* The controller is built transiently — `CombatUnitEntityDecorator` constructs one from the
|
|
510
|
+
* creature's `animation-graph.json` every time it decorates a unit — so nothing writes one to disk
|
|
511
|
+
* and there is no adapter behind this name. It is here because the registry warns on any component
|
|
512
|
+
* class that reaches it unnamed, once per boot, printing the whole class source; and because a
|
|
513
|
+
* component with no name cannot be told apart from another one later, which is I-13's business
|
|
514
|
+
* whether or not it round-trips today.
|
|
515
|
+
*
|
|
516
|
+
* @type {string}
|
|
517
|
+
*/
|
|
518
|
+
AnimationGraphController.typeName = "AnimationGraphController";
|