@luma.gl/engine 10.0.0-alpha.4 → 10.0.0-alpha.5
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 +9 -0
- package/dist/animation/animation-clip.cjs +36 -0
- package/dist/animation/animation-interpolation.cjs +115 -0
- package/dist/animation/animation-mixer.cjs +302 -0
- package/dist/animation/animation-track.cjs +55 -0
- package/dist/animation/animator.cjs +75 -0
- package/dist/animation/deform-positions.cjs +69 -0
- package/dist/animation/deform-positions.d.ts +13 -0
- package/dist/animation/deform-positions.d.ts.map +1 -0
- package/dist/animation/deform-positions.js +49 -0
- package/dist/animation/deform-positions.js.map +1 -0
- package/dist/animation/key-frames.cjs +81 -0
- package/dist/animation/morph-targets.cjs +162 -0
- package/dist/animation/node-animation-binding.cjs +67 -0
- package/dist/animation/node-animation-binding.d.ts +9 -0
- package/dist/animation/node-animation-binding.d.ts.map +1 -0
- package/dist/animation/node-animation-binding.js +45 -0
- package/dist/animation/node-animation-binding.js.map +1 -0
- package/dist/animation/property-animation-binding.cjs +159 -0
- package/dist/animation/property-animation-binding.d.ts +29 -0
- package/dist/animation/property-animation-binding.d.ts.map +1 -0
- package/dist/animation/property-animation-binding.js +138 -0
- package/dist/animation/property-animation-binding.js.map +1 -0
- package/dist/animation/scenegraph-animator.cjs +122 -0
- package/dist/animation/scenegraph-animator.d.ts +37 -0
- package/dist/animation/scenegraph-animator.d.ts.map +1 -0
- package/dist/animation/scenegraph-animator.js +99 -0
- package/dist/animation/scenegraph-animator.js.map +1 -0
- package/dist/animation/skin.cjs +49 -0
- package/dist/animation/texture-transform.cjs +41 -0
- package/dist/animation/texture-transform.d.ts +8 -0
- package/dist/animation/texture-transform.d.ts.map +1 -0
- package/dist/animation/texture-transform.js +17 -0
- package/dist/animation/texture-transform.js.map +1 -0
- package/dist/animation/timeline.cjs +129 -0
- package/dist/animation-loop/animation-loop-template.cjs +33 -0
- package/dist/animation-loop/animation-loop.cjs +498 -0
- package/dist/animation-loop/animation-loop.d.ts +2 -1
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +9 -3
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/animation-loop/animation-props.cjs +15 -0
- package/dist/animation-loop/make-animation-loop.cjs +104 -0
- package/dist/animation-loop/request-animation-frame.cjs +43 -0
- package/dist/application-utils/load-file.cjs +77 -0
- package/dist/application-utils/random.cjs +38 -0
- package/dist/audio/audio-controller.cjs +429 -0
- package/dist/audio/audio-controller.d.ts +146 -0
- package/dist/audio/audio-controller.d.ts.map +1 -0
- package/dist/audio/audio-controller.js +445 -0
- package/dist/audio/audio-controller.js.map +1 -0
- package/dist/audio/audio-environment.cjs +157 -0
- package/dist/audio/audio-environment.d.ts +49 -0
- package/dist/audio/audio-environment.d.ts.map +1 -0
- package/dist/audio/audio-environment.js +148 -0
- package/dist/audio/audio-environment.js.map +1 -0
- package/dist/audio/audio-graph.cjs +182 -0
- package/dist/audio/audio-graph.d.ts +58 -0
- package/dist/audio/audio-graph.d.ts.map +1 -0
- package/dist/audio/audio-graph.js +181 -0
- package/dist/audio/audio-graph.js.map +1 -0
- package/dist/compute/buffer-transform.cjs +146 -0
- package/dist/compute/buffer-transform.d.ts +15 -5
- package/dist/compute/buffer-transform.d.ts.map +1 -1
- package/dist/compute/buffer-transform.js +56 -12
- package/dist/compute/buffer-transform.js.map +1 -1
- package/dist/compute/computation.cjs +331 -0
- package/dist/compute/computation.d.ts +2 -4
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +3 -14
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/swap.cjs +132 -0
- package/dist/compute/texture-transform.cjs +142 -0
- package/dist/compute/texture-transform.d.ts +11 -7
- package/dist/compute/texture-transform.d.ts.map +1 -1
- package/dist/compute/texture-transform.js +16 -6
- package/dist/compute/texture-transform.js.map +1 -1
- package/dist/controls/orbit-controls.cjs +283 -0
- package/dist/controls/orbit-controls.d.ts +2 -0
- package/dist/controls/orbit-controls.d.ts.map +1 -1
- package/dist/controls/orbit-controls.js +2 -1
- package/dist/controls/orbit-controls.js.map +1 -1
- package/dist/debug/copy-texture-to-image.cjs +84 -0
- package/dist/debug/debug-framebuffer.cjs +113 -0
- package/dist/debug/debug-shader-layout.cjs +45 -0
- package/dist/debug/pixel-data-utils.cjs +54 -0
- package/dist/dist.dev.js +11756 -5632
- package/dist/dist.min.js +39 -35
- package/dist/dynamic-buffer/dynamic-buffer.cjs +39 -0
- package/dist/dynamic-buffer/dynamic-buffer.d.ts +1 -170
- package/dist/dynamic-buffer/dynamic-buffer.d.ts.map +1 -1
- package/dist/dynamic-buffer/dynamic-buffer.js +2 -312
- package/dist/dynamic-buffer/dynamic-buffer.js.map +1 -1
- package/dist/dynamic-texture/dynamic-texture.cjs +27 -0
- package/dist/dynamic-texture/dynamic-texture.d.ts +1 -114
- package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -1
- package/dist/dynamic-texture/dynamic-texture.js +2 -584
- package/dist/dynamic-texture/dynamic-texture.js.map +1 -1
- package/dist/dynamic-texture/texture-binding-source.cjs +31 -0
- package/dist/dynamic-texture/texture-binding-source.d.ts +1 -54
- package/dist/dynamic-texture/texture-binding-source.d.ts.map +1 -1
- package/dist/dynamic-texture/texture-binding-source.js +2 -51
- package/dist/dynamic-texture/texture-binding-source.js.map +1 -1
- package/dist/dynamic-texture/texture-data.cjs +53 -0
- package/dist/dynamic-texture/texture-data.d.ts +1 -145
- package/dist/dynamic-texture/texture-data.d.ts.map +1 -1
- package/dist/dynamic-texture/texture-data.js +2 -209
- package/dist/dynamic-texture/texture-data.js.map +1 -1
- package/dist/dynamic-texture/video-texture.cjs +269 -0
- package/dist/dynamic-texture/video-texture.d.ts +1 -1
- package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
- package/dist/experimental/controls/comparison-splitter.cjs +231 -0
- package/dist/experimental/controls/comparison-splitter.d.ts +54 -0
- package/dist/experimental/controls/comparison-splitter.d.ts.map +1 -0
- package/dist/experimental/controls/comparison-splitter.js +215 -0
- package/dist/experimental/controls/comparison-splitter.js.map +1 -0
- package/dist/experimental/controls/flat-controller.cjs +301 -0
- package/dist/experimental/controls/flat-controller.d.ts +80 -0
- package/dist/experimental/controls/flat-controller.d.ts.map +1 -0
- package/dist/experimental/controls/flat-controller.js +295 -0
- package/dist/experimental/controls/flat-controller.js.map +1 -0
- package/dist/experimental/controls/index.cjs +35 -0
- package/dist/experimental/controls/index.cjs.map +6 -0
- package/dist/experimental/controls/index.d.ts +7 -0
- package/dist/experimental/controls/index.d.ts.map +1 -0
- package/dist/experimental/controls/index.js +7 -0
- package/dist/experimental/controls/index.js.map +1 -0
- package/dist/experimental/controls/orbit-controls.cjs +27 -0
- package/dist/experimental/controls/orbit-controls.d.ts +3 -0
- package/dist/experimental/controls/orbit-controls.d.ts.map +1 -0
- package/dist/experimental/controls/orbit-controls.js +5 -0
- package/dist/experimental/controls/orbit-controls.js.map +1 -0
- package/dist/experimental/materials/emissive-material.cjs +126 -0
- package/dist/experimental/materials/emissive-material.d.ts +38 -0
- package/dist/experimental/materials/emissive-material.d.ts.map +1 -0
- package/dist/experimental/materials/emissive-material.js +100 -0
- package/dist/experimental/materials/emissive-material.js.map +1 -0
- package/dist/experimental/materials/glass-material.cjs +570 -0
- package/dist/experimental/materials/glass-material.d.ts +107 -0
- package/dist/experimental/materials/glass-material.d.ts.map +1 -0
- package/dist/experimental/materials/glass-material.js +544 -0
- package/dist/experimental/materials/glass-material.js.map +1 -0
- package/dist/experimental/materials/glass-transmission.cjs +954 -0
- package/dist/experimental/materials/glass-transmission.d.ts +193 -0
- package/dist/experimental/materials/glass-transmission.d.ts.map +1 -0
- package/dist/experimental/materials/glass-transmission.js +928 -0
- package/dist/experimental/materials/glass-transmission.js.map +1 -0
- package/dist/experimental/materials/index.cjs +61 -0
- package/dist/experimental/materials/index.cjs.map +6 -0
- package/dist/experimental/materials/index.d.ts +14 -0
- package/dist/experimental/materials/index.d.ts.map +1 -0
- package/dist/experimental/materials/index.js +11 -0
- package/dist/experimental/materials/index.js.map +1 -0
- package/dist/experimental/materials/optical-caustics.cjs +201 -0
- package/dist/experimental/materials/optical-caustics.d.ts +69 -0
- package/dist/experimental/materials/optical-caustics.d.ts.map +1 -0
- package/dist/experimental/materials/optical-caustics.js +180 -0
- package/dist/experimental/materials/optical-caustics.js.map +1 -0
- package/dist/experimental/materials/optical-lighting.cjs +169 -0
- package/dist/experimental/materials/optical-lighting.d.ts +7 -0
- package/dist/experimental/materials/optical-lighting.d.ts.map +1 -0
- package/dist/experimental/materials/optical-lighting.js +144 -0
- package/dist/experimental/materials/optical-lighting.js.map +1 -0
- package/dist/experimental/materials/optical-point-lights.cjs +258 -0
- package/dist/experimental/materials/optical-point-lights.d.ts +68 -0
- package/dist/experimental/materials/optical-point-lights.d.ts.map +1 -0
- package/dist/experimental/materials/optical-point-lights.js +237 -0
- package/dist/experimental/materials/optical-point-lights.js.map +1 -0
- package/dist/experimental/materials/reflective-material.cjs +216 -0
- package/dist/experimental/materials/reflective-material.d.ts +46 -0
- package/dist/experimental/materials/reflective-material.d.ts.map +1 -0
- package/dist/experimental/materials/reflective-material.js +190 -0
- package/dist/experimental/materials/reflective-material.js.map +1 -0
- package/dist/experimental/textures/html-texture.cjs +221 -0
- package/dist/experimental/textures/html-texture.d.ts +85 -0
- package/dist/experimental/textures/html-texture.d.ts.map +1 -0
- package/dist/experimental/textures/html-texture.js +206 -0
- package/dist/experimental/textures/html-texture.js.map +1 -0
- package/dist/experimental/textures/index.cjs +33 -0
- package/dist/experimental/textures/index.cjs.map +6 -0
- package/dist/experimental/textures/index.d.ts +5 -0
- package/dist/experimental/textures/index.d.ts.map +1 -0
- package/dist/experimental/textures/index.js +7 -0
- package/dist/experimental/textures/index.js.map +1 -0
- package/dist/experimental/textures/packed-pixels.cjs +248 -0
- package/dist/experimental/textures/packed-pixels.d.ts +17 -0
- package/dist/experimental/textures/packed-pixels.d.ts.map +1 -0
- package/dist/experimental/textures/packed-pixels.js +237 -0
- package/dist/experimental/textures/packed-pixels.js.map +1 -0
- package/dist/experimental/textures/rgba-decoder.cjs +60 -0
- package/dist/experimental/textures/rgba-decoder.d.ts +29 -0
- package/dist/experimental/textures/rgba-decoder.d.ts.map +1 -0
- package/dist/experimental/textures/rgba-decoder.js +43 -0
- package/dist/experimental/textures/rgba-decoder.js.map +1 -0
- package/dist/experimental/webxr/index.cjs +38 -0
- package/dist/experimental/webxr/index.cjs.map +6 -0
- package/dist/experimental/webxr/index.d.ts +9 -0
- package/dist/experimental/webxr/index.d.ts.map +1 -0
- package/dist/experimental/webxr/index.js +8 -0
- package/dist/experimental/webxr/index.js.map +1 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.cjs +38 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts +9 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.js +17 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.js.map +1 -0
- package/dist/experimental/webxr/webxr-camera-texture.cjs +157 -0
- package/dist/experimental/webxr/webxr-camera-texture.d.ts +48 -0
- package/dist/experimental/webxr/webxr-camera-texture.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-camera-texture.js +144 -0
- package/dist/experimental/webxr/webxr-camera-texture.js.map +1 -0
- package/dist/experimental/webxr/webxr-input.cjs +93 -0
- package/dist/experimental/webxr/webxr-input.d.ts +24 -0
- package/dist/experimental/webxr/webxr-input.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-input.js +70 -0
- package/dist/experimental/webxr/webxr-input.js.map +1 -0
- package/dist/experimental/webxr/webxr-manager.cjs +356 -0
- package/dist/experimental/webxr/webxr-manager.d.ts +91 -0
- package/dist/experimental/webxr/webxr-manager.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-manager.js +354 -0
- package/dist/experimental/webxr/webxr-manager.js.map +1 -0
- package/dist/experimental/webxr/webxr-types.cjs +15 -0
- package/dist/experimental/webxr/webxr-types.d.ts +152 -0
- package/dist/experimental/webxr/webxr-types.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-types.js +5 -0
- package/dist/experimental/webxr/webxr-types.js.map +1 -0
- package/dist/geometry/edge-geometry.cjs +171 -0
- package/dist/geometry/geometry-primitives.cjs +189 -0
- package/dist/geometry/geometry-primitives.d.ts +6 -0
- package/dist/geometry/geometry-primitives.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.js +8 -0
- package/dist/geometry/geometry-primitives.js.map +1 -1
- package/dist/geometry/geometry-table.cjs +15 -0
- package/dist/geometry/geometry-utils.cjs +147 -0
- package/dist/geometry/geometry.cjs +90 -0
- package/dist/geometry/gpu-geometry.cjs +130 -0
- package/dist/geometry/gpu-vector-geometry-adapter.cjs +88 -0
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts +5 -0
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -0
- package/dist/geometry/gpu-vector-geometry-adapter.js +73 -0
- package/dist/geometry/gpu-vector-geometry-adapter.js.map +1 -0
- package/dist/geometry/gpu-vector-geometry.cjs +40 -0
- package/dist/geometry/gpu-vector-geometry.d.ts +21 -0
- package/dist/geometry/gpu-vector-geometry.d.ts.map +1 -0
- package/dist/geometry/gpu-vector-geometry.js +19 -0
- package/dist/geometry/gpu-vector-geometry.js.map +1 -0
- package/dist/geometry/mesh-simplification.cjs +385 -0
- package/dist/geometry/ring-geometry.cjs +104 -0
- package/dist/geometry/ring-geometry.d.ts +17 -0
- package/dist/geometry/ring-geometry.d.ts.map +1 -0
- package/dist/geometry/ring-geometry.js +94 -0
- package/dist/geometry/ring-geometry.js.map +1 -0
- package/dist/geometry/stroke-geometry.cjs +171 -0
- package/dist/graph/models/index.cjs +66 -0
- package/dist/graph/models/index.cjs.map +6 -0
- package/dist/graph/models/index.d.ts +7 -0
- package/dist/graph/models/index.d.ts.map +1 -0
- package/dist/graph/models/index.js +10 -0
- package/dist/graph/models/index.js.map +1 -0
- package/dist/graph/models/path/path-attribute-model.cjs +421 -0
- package/dist/graph/models/path/path-attribute-model.d.ts +142 -0
- package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -0
- package/dist/graph/models/path/path-attribute-model.js +409 -0
- package/dist/graph/models/path/path-attribute-model.js.map +1 -0
- package/dist/graph/models/path/path-storage-model.cjs +711 -0
- package/dist/graph/models/path/path-storage-model.d.ts +174 -0
- package/dist/graph/models/path/path-storage-model.d.ts.map +1 -0
- package/dist/graph/models/path/path-storage-model.js +720 -0
- package/dist/graph/models/path/path-storage-model.js.map +1 -0
- package/dist/graph/models/path/path-trips-storage-model.cjs +271 -0
- package/dist/graph/models/path/path-trips-storage-model.d.ts +58 -0
- package/dist/graph/models/path/path-trips-storage-model.d.ts.map +1 -0
- package/dist/graph/models/path/path-trips-storage-model.js +248 -0
- package/dist/graph/models/path/path-trips-storage-model.js.map +1 -0
- package/dist/graph/models/polygon/polygon-attribute-model.cjs +117 -0
- package/dist/graph/models/polygon/polygon-attribute-model.d.ts +53 -0
- package/dist/graph/models/polygon/polygon-attribute-model.d.ts.map +1 -0
- package/dist/graph/models/polygon/polygon-attribute-model.js +101 -0
- package/dist/graph/models/polygon/polygon-attribute-model.js.map +1 -0
- package/dist/graph/models/polygon/polygon-shaders.cjs +283 -0
- package/dist/graph/models/polygon/polygon-shaders.d.ts +77 -0
- package/dist/graph/models/polygon/polygon-shaders.d.ts.map +1 -0
- package/dist/graph/models/polygon/polygon-shaders.js +242 -0
- package/dist/graph/models/polygon/polygon-shaders.js.map +1 -0
- package/dist/graph/models/polygon/polygon-storage-model.cjs +111 -0
- package/dist/graph/models/polygon/polygon-storage-model.d.ts +53 -0
- package/dist/graph/models/polygon/polygon-storage-model.d.ts.map +1 -0
- package/dist/graph/models/polygon/polygon-storage-model.js +92 -0
- package/dist/graph/models/polygon/polygon-storage-model.js.map +1 -0
- package/dist/graph/physics/index.cjs +50 -0
- package/dist/graph/physics/index.cjs.map +6 -0
- package/dist/graph/physics/index.d.ts +12 -0
- package/dist/graph/physics/index.d.ts.map +1 -0
- package/dist/graph/physics/index.js +12 -0
- package/dist/graph/physics/index.js.map +1 -0
- package/dist/graph/physics/physics-scenegraph.cjs +92 -0
- package/dist/graph/physics/physics-scenegraph.d.ts +35 -0
- package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -0
- package/dist/graph/physics/physics-scenegraph.js +80 -0
- package/dist/graph/physics/physics-scenegraph.js.map +1 -0
- package/dist/graph/physics/scenegraph-behaviors.cjs +164 -0
- package/dist/graph/physics/scenegraph-behaviors.d.ts +37 -0
- package/dist/graph/physics/scenegraph-behaviors.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-behaviors.js +145 -0
- package/dist/graph/physics/scenegraph-behaviors.js.map +1 -0
- package/dist/graph/physics/scenegraph-instance.cjs +246 -0
- package/dist/graph/physics/scenegraph-instance.d.ts +59 -0
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-instance.js +241 -0
- package/dist/graph/physics/scenegraph-instance.js.map +1 -0
- package/dist/graph/physics/scenegraph-joints.cjs +51 -0
- package/dist/graph/physics/scenegraph-joints.d.ts +5 -0
- package/dist/graph/physics/scenegraph-joints.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-joints.js +31 -0
- package/dist/graph/physics/scenegraph-joints.js.map +1 -0
- package/dist/graph/physics/scenegraph-motion.cjs +177 -0
- package/dist/graph/physics/scenegraph-motion.d.ts +37 -0
- package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-motion.js +168 -0
- package/dist/graph/physics/scenegraph-motion.js.map +1 -0
- package/dist/graph/physics/scenegraph-properties.cjs +170 -0
- package/dist/graph/physics/scenegraph-properties.d.ts +37 -0
- package/dist/graph/physics/scenegraph-properties.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-properties.js +186 -0
- package/dist/graph/physics/scenegraph-properties.js.map +1 -0
- package/dist/graph/physics/scenegraph-publication.cjs +112 -0
- package/dist/graph/physics/scenegraph-publication.d.ts +23 -0
- package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-publication.js +99 -0
- package/dist/graph/physics/scenegraph-publication.js.map +1 -0
- package/dist/graph/physics/scenegraph-session.cjs +256 -0
- package/dist/graph/physics/scenegraph-session.d.ts +68 -0
- package/dist/graph/physics/scenegraph-session.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-session.js +249 -0
- package/dist/graph/physics/scenegraph-session.js.map +1 -0
- package/dist/graph/tables/gpu-table-geometry.cjs +84 -0
- package/dist/graph/tables/gpu-table-geometry.d.ts +32 -0
- package/dist/graph/tables/gpu-table-geometry.d.ts.map +1 -0
- package/dist/graph/tables/gpu-table-geometry.js +67 -0
- package/dist/graph/tables/gpu-table-geometry.js.map +1 -0
- package/dist/graph/tables/gpu-table-model.cjs +459 -0
- package/dist/graph/tables/gpu-table-model.d.ts +67 -0
- package/dist/graph/tables/gpu-table-model.d.ts.map +1 -0
- package/dist/graph/tables/gpu-table-model.js +457 -0
- package/dist/graph/tables/gpu-table-model.js.map +1 -0
- package/dist/graph/tables/gpu-table-transform.cjs +341 -0
- package/dist/graph/tables/gpu-table-transform.d.ts +61 -0
- package/dist/graph/tables/gpu-table-transform.d.ts.map +1 -0
- package/dist/graph/tables/gpu-table-transform.js +333 -0
- package/dist/graph/tables/gpu-table-transform.js.map +1 -0
- package/dist/graph/tables/index.cjs +33 -0
- package/dist/graph/tables/index.cjs.map +6 -0
- package/dist/graph/tables/index.d.ts +4 -0
- package/dist/graph/tables/index.d.ts.map +1 -0
- package/dist/graph/tables/index.js +7 -0
- package/dist/graph/tables/index.js.map +1 -0
- package/dist/index.cjs +303 -9569
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +32 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/interactivity/interactivity.cjs +570 -0
- package/dist/interactivity/interactivity.d.ts +107 -0
- package/dist/interactivity/interactivity.d.ts.map +1 -0
- package/dist/interactivity/interactivity.js +575 -0
- package/dist/interactivity/interactivity.js.map +1 -0
- package/dist/interactivity/physics.cjs +15 -0
- package/dist/interactivity/physics.d.ts +12 -0
- package/dist/interactivity/physics.d.ts.map +1 -0
- package/dist/interactivity/physics.js +5 -0
- package/dist/interactivity/physics.js.map +1 -0
- package/dist/material/material-factory.cjs +99 -0
- package/dist/material/material-factory.d.ts +1 -1
- package/dist/material/material-factory.d.ts.map +1 -1
- package/dist/material/material.cjs +239 -0
- package/dist/material/material.d.ts +2 -2
- package/dist/material/material.d.ts.map +1 -1
- package/dist/material/material.js +2 -2
- package/dist/material/material.js.map +1 -1
- package/dist/model/gpu-vector-bindings.cjs +226 -0
- package/dist/model/gpu-vector-bindings.d.ts +36 -0
- package/dist/model/gpu-vector-bindings.d.ts.map +1 -0
- package/dist/model/gpu-vector-bindings.js +217 -0
- package/dist/model/gpu-vector-bindings.js.map +1 -0
- package/dist/model/gpu-vector-draw-batches.cjs +82 -0
- package/dist/model/gpu-vector-draw-batches.d.ts +5 -0
- package/dist/model/gpu-vector-draw-batches.d.ts.map +1 -0
- package/dist/model/gpu-vector-draw-batches.js +73 -0
- package/dist/model/gpu-vector-draw-batches.js.map +1 -0
- package/dist/model/gpu-vector-model-batches.cjs +94 -0
- package/dist/model/gpu-vector-model-batches.d.ts +41 -0
- package/dist/model/gpu-vector-model-batches.d.ts.map +1 -0
- package/dist/model/gpu-vector-model-batches.js +77 -0
- package/dist/model/gpu-vector-model-batches.js.map +1 -0
- package/dist/model/gpu-vector-model.cjs +1264 -0
- package/dist/model/gpu-vector-model.d.ts +352 -0
- package/dist/model/gpu-vector-model.d.ts.map +1 -0
- package/dist/model/gpu-vector-model.js +1375 -0
- package/dist/model/gpu-vector-model.js.map +1 -0
- package/dist/model/model.cjs +134 -0
- package/dist/model/model.d.ts +21 -305
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +68 -1092
- package/dist/model/model.js.map +1 -1
- package/dist/model/split-uniforms-and-bindings.cjs +44 -0
- package/dist/model/split-uniforms-and-bindings.d.ts +1 -1
- package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -1
- package/dist/model/split-uniforms-and-bindings.js +5 -2
- package/dist/model/split-uniforms-and-bindings.js.map +1 -1
- package/dist/models/billboard-texture-model.cjs +167 -0
- package/dist/models/billboard-texture-model.d.ts +1 -1
- package/dist/models/billboard-texture-model.d.ts.map +1 -1
- package/dist/models/billboard-texture-model.js +1 -1
- package/dist/models/billboard-texture-model.js.map +1 -1
- package/dist/models/billboard-texture-module.cjs +61 -0
- package/dist/models/clip-space.cjs +103 -0
- package/dist/models/directional-light-model.cjs +45 -0
- package/dist/models/light-model-utils.cjs +426 -0
- package/dist/models/point-light-model.cjs +44 -0
- package/dist/models/spot-light-model.cjs +45 -0
- package/dist/modules/picking/color-picking.cjs +209 -0
- package/dist/modules/picking/color-picking.d.ts +1 -1
- package/dist/modules/picking/index-color-picking.cjs +230 -0
- package/dist/modules/picking/index-color-picking.d.ts +1 -1
- package/dist/modules/picking/index-picking.cjs +201 -0
- package/dist/modules/picking/index-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-color-picking.cjs +28 -0
- package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-picking-manager.cjs +92 -0
- package/dist/modules/picking/picking-manager.cjs +360 -0
- package/dist/modules/picking/picking-uniforms.cjs +140 -0
- package/dist/modules/picking/picking-uniforms.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
- package/dist/modules/picking/picking.cjs +43 -0
- package/dist/modules/picking/picking.d.ts +1 -1
- package/dist/passes/get-fragment-shader.cjs +119 -0
- package/dist/passes/shader-pass-renderer.cjs +722 -0
- package/dist/passes/shader-pass-renderer.d.ts +2 -2
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +1 -1
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/passes/texture-transform-module.cjs +78 -0
- package/dist/scenegraph/controllers/area-light-controller.cjs +143 -0
- package/dist/scenegraph/controllers/area-light-controller.d.ts +31 -0
- package/dist/scenegraph/controllers/area-light-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/area-light-controller.js +130 -0
- package/dist/scenegraph/controllers/area-light-controller.js.map +1 -0
- package/dist/scenegraph/controllers/billboard-controller.cjs +156 -0
- package/dist/scenegraph/controllers/billboard-controller.d.ts +45 -0
- package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/billboard-controller.js +156 -0
- package/dist/scenegraph/controllers/billboard-controller.js.map +1 -0
- package/dist/scenegraph/controllers/joint-controller.cjs +71 -0
- package/dist/scenegraph/controllers/joint-controller.d.ts +30 -0
- package/dist/scenegraph/controllers/joint-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/joint-controller.js +53 -0
- package/dist/scenegraph/controllers/joint-controller.js.map +1 -0
- package/dist/scenegraph/controllers/material-variants.cjs +61 -0
- package/dist/scenegraph/controllers/material-variants.d.ts +42 -0
- package/dist/scenegraph/controllers/material-variants.d.ts.map +1 -0
- package/dist/scenegraph/controllers/material-variants.js +40 -0
- package/dist/scenegraph/controllers/material-variants.js.map +1 -0
- package/dist/scenegraph/controllers/morph-controller.cjs +61 -0
- package/dist/scenegraph/controllers/morph-controller.d.ts +19 -0
- package/dist/scenegraph/controllers/morph-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/morph-controller.js +41 -0
- package/dist/scenegraph/controllers/morph-controller.js.map +1 -0
- package/dist/scenegraph/controllers/skin-controller.cjs +111 -0
- package/dist/scenegraph/controllers/skin-controller.d.ts +36 -0
- package/dist/scenegraph/controllers/skin-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/skin-controller.js +90 -0
- package/dist/scenegraph/controllers/skin-controller.js.map +1 -0
- package/dist/scenegraph/group-node.cjs +129 -0
- package/dist/scenegraph/model-node.cjs +68 -0
- package/dist/scenegraph/physics-transforms.cjs +95 -0
- package/dist/scenegraph/physics-transforms.d.ts +13 -0
- package/dist/scenegraph/physics-transforms.d.ts.map +1 -0
- package/dist/scenegraph/physics-transforms.js +72 -0
- package/dist/scenegraph/physics-transforms.js.map +1 -0
- package/dist/scenegraph/published-transforms.cjs +37 -0
- package/dist/scenegraph/published-transforms.d.ts +17 -0
- package/dist/scenegraph/published-transforms.d.ts.map +1 -0
- package/dist/scenegraph/published-transforms.js +16 -0
- package/dist/scenegraph/published-transforms.js.map +1 -0
- package/dist/scenegraph/scenegraph-bounds.cjs +51 -0
- package/dist/scenegraph/scenegraph-node.cjs +182 -0
- package/dist/shader-inputs.cjs +231 -0
- package/dist/shader-inputs.d.ts +1 -1
- package/dist/shader-inputs.d.ts.map +1 -1
- package/dist/utils/buffer-layout-helper.cjs +52 -0
- package/dist/utils/buffer-layout-order.cjs +37 -0
- package/dist/utils/deep-equal.cjs +65 -0
- package/dist/utils/get-platform-info.cjs +21 -0
- package/dist/utils/get-platform-info.d.ts +2 -0
- package/dist/utils/get-platform-info.d.ts.map +1 -0
- package/dist/utils/get-platform-info.js +5 -0
- package/dist/utils/get-platform-info.js.map +1 -0
- package/dist/utils/gpu-vector-batch-structure.cjs +45 -0
- package/dist/utils/gpu-vector-batch-structure.d.ts +12 -0
- package/dist/utils/gpu-vector-batch-structure.d.ts.map +1 -0
- package/dist/utils/gpu-vector-batch-structure.js +27 -0
- package/dist/utils/gpu-vector-batch-structure.js.map +1 -0
- package/dist/utils/shader-module-utils.cjs +148 -0
- package/dist/utils/uid.cjs +32 -0
- package/package.json +45 -7
- package/src/animation/deform-positions.ts +62 -0
- package/src/animation/node-animation-binding.ts +54 -0
- package/src/animation/property-animation-binding.ts +212 -0
- package/src/animation/scenegraph-animator.ts +117 -0
- package/src/animation/texture-transform.ts +59 -0
- package/src/animation-loop/animation-loop.ts +10 -3
- package/src/audio/audio-controller.ts +583 -0
- package/src/audio/audio-environment.ts +202 -0
- package/src/audio/audio-graph.ts +253 -0
- package/src/compute/buffer-transform.ts +71 -16
- package/src/compute/computation.ts +4 -19
- package/src/compute/texture-transform.ts +25 -12
- package/src/controls/orbit-controls.ts +4 -1
- package/src/dynamic-buffer/dynamic-buffer.ts +15 -449
- package/src/dynamic-texture/dynamic-texture.ts +5 -760
- package/src/dynamic-texture/texture-binding-source.ts +8 -90
- package/src/dynamic-texture/texture-data.ts +31 -340
- package/src/dynamic-texture/video-texture.ts +1 -1
- package/src/experimental/controls/comparison-splitter.ts +269 -0
- package/src/experimental/controls/flat-controller.ts +403 -0
- package/src/experimental/controls/index.ts +16 -0
- package/src/experimental/controls/orbit-controls.ts +6 -0
- package/src/experimental/materials/emissive-material.ts +120 -0
- package/src/experimental/materials/glass-material.ts +607 -0
- package/src/experimental/materials/glass-transmission.ts +1023 -0
- package/src/experimental/materials/index.ts +49 -0
- package/src/experimental/materials/optical-caustics.ts +234 -0
- package/src/experimental/materials/optical-lighting.ts +148 -0
- package/src/experimental/materials/optical-point-lights.ts +288 -0
- package/src/experimental/materials/reflective-material.ts +214 -0
- package/src/experimental/textures/html-texture.ts +285 -0
- package/src/experimental/textures/index.ts +8 -0
- package/src/experimental/textures/packed-pixels.ts +351 -0
- package/src/experimental/textures/rgba-decoder.ts +79 -0
- package/src/experimental/webxr/index.ts +21 -0
- package/src/experimental/webxr/webxr-animation-frame-provider.ts +22 -0
- package/src/experimental/webxr/webxr-camera-texture.ts +195 -0
- package/src/experimental/webxr/webxr-input.ts +117 -0
- package/src/experimental/webxr/webxr-manager.ts +524 -0
- package/src/experimental/webxr/webxr-types.ts +192 -0
- package/src/geometry/geometry-primitives.ts +11 -0
- package/src/geometry/gpu-vector-geometry-adapter.ts +78 -0
- package/src/geometry/gpu-vector-geometry.ts +33 -0
- package/src/geometry/ring-geometry.ts +117 -0
- package/src/graph/models/index.ts +45 -0
- package/src/graph/models/path/path-attribute-model.ts +563 -0
- package/src/graph/models/path/path-storage-model.ts +996 -0
- package/src/graph/models/path/path-trips-storage-model.ts +286 -0
- package/src/graph/models/polygon/polygon-attribute-model.ts +165 -0
- package/src/graph/models/polygon/polygon-shaders.ts +279 -0
- package/src/graph/models/polygon/polygon-storage-model.ts +146 -0
- package/src/graph/physics/index.ts +24 -0
- package/src/graph/physics/physics-scenegraph.ts +112 -0
- package/src/graph/physics/scenegraph-behaviors.ts +169 -0
- package/src/graph/physics/scenegraph-instance.ts +296 -0
- package/src/graph/physics/scenegraph-joints.ts +37 -0
- package/src/graph/physics/scenegraph-motion.ts +175 -0
- package/src/graph/physics/scenegraph-properties.ts +241 -0
- package/src/graph/physics/scenegraph-publication.ts +116 -0
- package/src/graph/physics/scenegraph-session.ts +317 -0
- package/src/graph/tables/gpu-table-geometry.ts +88 -0
- package/src/graph/tables/gpu-table-model.ts +661 -0
- package/src/graph/tables/gpu-table-transform.ts +497 -0
- package/src/graph/tables/index.ts +18 -0
- package/src/index.ts +130 -13
- package/src/interactivity/interactivity.ts +670 -0
- package/src/interactivity/physics.ts +19 -0
- package/src/material/material-factory.ts +1 -1
- package/src/material/material.ts +2 -2
- package/src/model/gpu-vector-bindings.ts +276 -0
- package/src/model/gpu-vector-draw-batches.ts +116 -0
- package/src/model/gpu-vector-model-batches.ts +142 -0
- package/src/model/gpu-vector-model.ts +1819 -0
- package/src/model/model.ts +91 -1444
- package/src/model/split-uniforms-and-bindings.ts +6 -3
- package/src/models/billboard-texture-model.ts +1 -1
- package/src/modules/picking/legacy-picking-manager.ts +1 -1
- package/src/modules/picking/picking-uniforms.ts +1 -1
- package/src/passes/shader-pass-renderer.ts +2 -2
- package/src/scenegraph/controllers/area-light-controller.ts +152 -0
- package/src/scenegraph/controllers/billboard-controller.ts +204 -0
- package/src/scenegraph/controllers/joint-controller.ts +81 -0
- package/src/scenegraph/controllers/material-variants.ts +70 -0
- package/src/scenegraph/controllers/morph-controller.ts +61 -0
- package/src/scenegraph/controllers/skin-controller.ts +125 -0
- package/src/scenegraph/physics-transforms.ts +82 -0
- package/src/scenegraph/published-transforms.ts +18 -0
- package/src/shader-inputs.ts +1 -1
- package/src/utils/get-platform-info.ts +5 -0
- package/src/utils/gpu-vector-batch-structure.ts +36 -0
- package/dist/compute/kernel.d.ts +0 -54
- package/dist/compute/kernel.d.ts.map +0 -1
- package/dist/compute/kernel.js +0 -103
- package/dist/compute/kernel.js.map +0 -1
- package/dist/compute/render-kernel.d.ts +0 -65
- package/dist/compute/render-kernel.d.ts.map +0 -1
- package/dist/compute/render-kernel.js +0 -129
- package/dist/compute/render-kernel.js.map +0 -1
- package/src/compute/kernel.ts +0 -146
- package/src/compute/render-kernel.ts +0 -192
package/README.md
CHANGED
|
@@ -3,3 +3,12 @@
|
|
|
3
3
|
This is the engine layer of luma.gl
|
|
4
4
|
|
|
5
5
|
See [luma.gl](http://luma.gl) for documentation.
|
|
6
|
+
|
|
7
|
+
## Graph integrations
|
|
8
|
+
|
|
9
|
+
Engine builds on `@luma.gl/graph` and `@luma.gl/gpgpu`. Execution primitives remain
|
|
10
|
+
available from engine as compatibility exports, with their implementation owned by gpgpu.
|
|
11
|
+
Use `@luma.gl/engine/tables` for `GPUTableModel` and `GPUTableGeometry`,
|
|
12
|
+
`@luma.gl/engine/physics` for scenegraph physics integration, and
|
|
13
|
+
`@luma.gl/engine/models` for specialized path/polygon rendering models. These optional
|
|
14
|
+
entry points keep scenegraph and rendering integration above graph algorithms.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var animation_clip_exports = {};
|
|
19
|
+
__export(animation_clip_exports, {
|
|
20
|
+
AnimationClip: () => AnimationClip
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(animation_clip_exports);
|
|
23
|
+
class AnimationClip {
|
|
24
|
+
name;
|
|
25
|
+
tracks;
|
|
26
|
+
duration;
|
|
27
|
+
constructor(props) {
|
|
28
|
+
this.name = props.name || "unnamed";
|
|
29
|
+
this.tracks = props.tracks;
|
|
30
|
+
this.duration = props.duration ?? Math.max(0, ...props.tracks.map((track) => track.duration));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
AnimationClip
|
|
36
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var animation_interpolation_exports = {};
|
|
19
|
+
__export(animation_interpolation_exports, {
|
|
20
|
+
evaluateAnimationSampler: () => evaluateAnimationSampler,
|
|
21
|
+
interpolateQuaternion: () => interpolateQuaternion
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(animation_interpolation_exports);
|
|
24
|
+
function evaluateAnimationSampler(time, sampler, valueType = "vector") {
|
|
25
|
+
const { input, output, interpolation = "LINEAR" } = sampler;
|
|
26
|
+
if (!input.length || !output.length || !Number.isFinite(time)) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const lastIndex = input.length - 1;
|
|
30
|
+
if (time <= input[0] || lastIndex === 0) {
|
|
31
|
+
return getKeyframeValue(output, interpolation, 0, valueType);
|
|
32
|
+
}
|
|
33
|
+
if (time >= input[lastIndex]) {
|
|
34
|
+
return getKeyframeValue(output, interpolation, lastIndex, valueType);
|
|
35
|
+
}
|
|
36
|
+
let previousIndex = 0;
|
|
37
|
+
let nextIndex = lastIndex;
|
|
38
|
+
while (nextIndex - previousIndex > 1) {
|
|
39
|
+
const middleIndex = Math.floor((previousIndex + nextIndex) / 2);
|
|
40
|
+
if (input[middleIndex] <= time) {
|
|
41
|
+
previousIndex = middleIndex;
|
|
42
|
+
} else {
|
|
43
|
+
nextIndex = middleIndex;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const previousTime = input[previousIndex];
|
|
47
|
+
const nextTime = input[nextIndex];
|
|
48
|
+
const interval = nextTime - previousTime;
|
|
49
|
+
if (interval <= 0 || interpolation === "STEP") {
|
|
50
|
+
return getKeyframeValue(output, interpolation, previousIndex, valueType);
|
|
51
|
+
}
|
|
52
|
+
const ratio = (time - previousTime) / interval;
|
|
53
|
+
switch (interpolation) {
|
|
54
|
+
case "LINEAR": {
|
|
55
|
+
const previousValue = output[previousIndex];
|
|
56
|
+
const nextValue = output[nextIndex];
|
|
57
|
+
if (!previousValue || !nextValue) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return valueType === "quaternion" ? interpolateQuaternion(previousValue, nextValue, ratio) : interpolateVector(previousValue, nextValue, ratio);
|
|
61
|
+
}
|
|
62
|
+
case "CUBICSPLINE": {
|
|
63
|
+
const previousValue = output[previousIndex * 3 + 1];
|
|
64
|
+
const previousOutTangent = output[previousIndex * 3 + 2];
|
|
65
|
+
const nextInTangent = output[nextIndex * 3];
|
|
66
|
+
const nextValue = output[nextIndex * 3 + 1];
|
|
67
|
+
if (!previousValue || !previousOutTangent || !nextInTangent || !nextValue) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const interpolatedValue = interpolateCubicSpline(previousValue, previousOutTangent, nextInTangent, nextValue, interval, ratio);
|
|
71
|
+
return valueType === "quaternion" ? normalizeQuaternion(interpolatedValue) : interpolatedValue;
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function interpolateQuaternion(start, end, ratio) {
|
|
78
|
+
const normalizedStart = normalizeQuaternion(start);
|
|
79
|
+
const normalizedEnd = normalizeQuaternion(end);
|
|
80
|
+
let dotProduct = normalizedStart.reduce((sum, component, index) => sum + component * normalizedEnd[index], 0);
|
|
81
|
+
const endDirection = dotProduct < 0 ? -1 : 1;
|
|
82
|
+
dotProduct = Math.min(Math.abs(dotProduct), 1);
|
|
83
|
+
if (dotProduct > 0.9995) {
|
|
84
|
+
return normalizeQuaternion(normalizedStart.map((component, index) => component + ratio * (normalizedEnd[index] * endDirection - component)));
|
|
85
|
+
}
|
|
86
|
+
const angle = Math.acos(dotProduct);
|
|
87
|
+
const sineAngle = Math.sin(angle);
|
|
88
|
+
const startWeight = Math.sin((1 - ratio) * angle) / sineAngle;
|
|
89
|
+
const endWeight = Math.sin(ratio * angle) / sineAngle * endDirection;
|
|
90
|
+
return normalizeQuaternion(normalizedStart.map((component, index) => component * startWeight + normalizedEnd[index] * endWeight));
|
|
91
|
+
}
|
|
92
|
+
function getKeyframeValue(output, interpolation, index, valueType) {
|
|
93
|
+
const value = output[interpolation === "CUBICSPLINE" ? index * 3 + 1 : index];
|
|
94
|
+
if (!value) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return valueType === "quaternion" ? normalizeQuaternion(value) : [...value];
|
|
98
|
+
}
|
|
99
|
+
function interpolateVector(start, end, ratio) {
|
|
100
|
+
return start.map((component, index) => (1 - ratio) * component + ratio * end[index]);
|
|
101
|
+
}
|
|
102
|
+
function interpolateCubicSpline(previousValue, previousOutTangent, nextInTangent, nextValue, interval, ratio) {
|
|
103
|
+
const squaredRatio = ratio * ratio;
|
|
104
|
+
const cubedRatio = squaredRatio * ratio;
|
|
105
|
+
return previousValue.map((component, index) => (2 * cubedRatio - 3 * squaredRatio + 1) * component + (cubedRatio - 2 * squaredRatio + ratio) * previousOutTangent[index] * interval + (-2 * cubedRatio + 3 * squaredRatio) * nextValue[index] + (cubedRatio - squaredRatio) * nextInTangent[index] * interval);
|
|
106
|
+
}
|
|
107
|
+
function normalizeQuaternion(value) {
|
|
108
|
+
const length = Math.hypot(...value);
|
|
109
|
+
return length > 0 ? value.map((component) => component / length) : [0, 0, 0, 1];
|
|
110
|
+
}
|
|
111
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
+
0 && (module.exports = {
|
|
113
|
+
evaluateAnimationSampler,
|
|
114
|
+
interpolateQuaternion
|
|
115
|
+
});
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var animation_mixer_exports = {};
|
|
19
|
+
__export(animation_mixer_exports, {
|
|
20
|
+
AnimationAction: () => AnimationAction,
|
|
21
|
+
AnimationMixer: () => AnimationMixer
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(animation_mixer_exports);
|
|
24
|
+
var import_animation_interpolation = require("./animation-interpolation.cjs");
|
|
25
|
+
class AnimationAction {
|
|
26
|
+
clip;
|
|
27
|
+
mixer;
|
|
28
|
+
time = 0;
|
|
29
|
+
timeScale;
|
|
30
|
+
weight;
|
|
31
|
+
loop;
|
|
32
|
+
repetitions;
|
|
33
|
+
paused = false;
|
|
34
|
+
playing = false;
|
|
35
|
+
elapsedTime = 0;
|
|
36
|
+
fade = null;
|
|
37
|
+
constructor(mixer, clip, props = {}) {
|
|
38
|
+
this.mixer = mixer;
|
|
39
|
+
this.clip = clip;
|
|
40
|
+
this.loop = props.loop || "repeat";
|
|
41
|
+
this.repetitions = props.repetitions ?? Number.POSITIVE_INFINITY;
|
|
42
|
+
this.timeScale = props.timeScale ?? 1;
|
|
43
|
+
this.weight = props.weight ?? 1;
|
|
44
|
+
}
|
|
45
|
+
/** Starts or resumes playback. */
|
|
46
|
+
play() {
|
|
47
|
+
this.playing = true;
|
|
48
|
+
this.paused = false;
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
/** Temporarily suspends playback while preserving local time. */
|
|
52
|
+
pause() {
|
|
53
|
+
this.paused = true;
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
/** Continues playback after pausing. */
|
|
57
|
+
resume() {
|
|
58
|
+
this.playing = true;
|
|
59
|
+
this.paused = false;
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
/** Stops playback and restores the initial clip time. */
|
|
63
|
+
stop() {
|
|
64
|
+
this.playing = false;
|
|
65
|
+
this.paused = false;
|
|
66
|
+
this.fade = null;
|
|
67
|
+
return this.reset();
|
|
68
|
+
}
|
|
69
|
+
/** Restores the initial clip time without changing playback state. */
|
|
70
|
+
reset() {
|
|
71
|
+
this.elapsedTime = 0;
|
|
72
|
+
this.time = 0;
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
/** Seeks to the supplied elapsed clip time, in seconds. */
|
|
76
|
+
setTime(time) {
|
|
77
|
+
this.elapsedTime = time;
|
|
78
|
+
this.time = this.resolveLocalTime(time);
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
/** Selects playback loop behavior and an optional traversal count. */
|
|
82
|
+
setLoop(loop, repetitions = Number.POSITIVE_INFINITY) {
|
|
83
|
+
this.loop = loop;
|
|
84
|
+
this.repetitions = repetitions;
|
|
85
|
+
this.time = this.resolveLocalTime(this.elapsedTime);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
/** Sets the action's blend contribution. */
|
|
89
|
+
setEffectiveWeight(weight) {
|
|
90
|
+
this.weight = Math.max(0, weight);
|
|
91
|
+
this.fade = null;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
/** Sets the action's playback speed and direction. */
|
|
95
|
+
setEffectiveTimeScale(timeScale) {
|
|
96
|
+
this.timeScale = timeScale;
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
/** Fades this action's current weight to full influence. */
|
|
100
|
+
fadeIn(duration) {
|
|
101
|
+
return this.scheduleFade(1, duration);
|
|
102
|
+
}
|
|
103
|
+
/** Fades this action's current weight to zero influence. */
|
|
104
|
+
fadeOut(duration) {
|
|
105
|
+
return this.scheduleFade(0, duration);
|
|
106
|
+
}
|
|
107
|
+
/** Fades this action out while another action fades in. */
|
|
108
|
+
crossFadeTo(action, duration) {
|
|
109
|
+
action.weight = 0;
|
|
110
|
+
action.play().fadeIn(duration);
|
|
111
|
+
return this.fadeOut(duration);
|
|
112
|
+
}
|
|
113
|
+
/** Fades another action out while this action fades in. */
|
|
114
|
+
crossFadeFrom(action, duration) {
|
|
115
|
+
action.crossFadeTo(this, duration);
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
118
|
+
/** @internal Advances playback and pending fades by mixer-relative seconds. */
|
|
119
|
+
advance(deltaTime) {
|
|
120
|
+
if (!this.playing || this.paused) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.advanceFade(Math.abs(deltaTime));
|
|
124
|
+
this.elapsedTime += deltaTime * this.timeScale;
|
|
125
|
+
this.time = this.resolveLocalTime(this.elapsedTime);
|
|
126
|
+
if (this.hasFinished()) {
|
|
127
|
+
this.playing = false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** @internal Whether this action should contribute its current sampled value. */
|
|
131
|
+
get shouldApply() {
|
|
132
|
+
return (this.playing || this.hasFinished()) && this.weight > 0;
|
|
133
|
+
}
|
|
134
|
+
scheduleFade(endWeight, duration) {
|
|
135
|
+
if (duration <= 0) {
|
|
136
|
+
this.weight = endWeight;
|
|
137
|
+
this.fade = null;
|
|
138
|
+
return this;
|
|
139
|
+
}
|
|
140
|
+
this.fade = { duration, elapsedTime: 0, startWeight: this.weight, endWeight };
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
advanceFade(deltaTime) {
|
|
144
|
+
if (!this.fade) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this.fade.elapsedTime += deltaTime;
|
|
148
|
+
const ratio = Math.min(this.fade.elapsedTime / this.fade.duration, 1);
|
|
149
|
+
this.weight = this.fade.startWeight + (this.fade.endWeight - this.fade.startWeight) * ratio;
|
|
150
|
+
if (ratio === 1) {
|
|
151
|
+
this.fade = null;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
hasFinished() {
|
|
155
|
+
const duration = this.clip.duration;
|
|
156
|
+
if (duration <= 0) {
|
|
157
|
+
return this.loop === "once";
|
|
158
|
+
}
|
|
159
|
+
if (this.loop === "once") {
|
|
160
|
+
return this.elapsedTime >= duration || this.elapsedTime < 0;
|
|
161
|
+
}
|
|
162
|
+
return Number.isFinite(this.repetitions) && Math.abs(this.elapsedTime) >= duration * this.repetitions;
|
|
163
|
+
}
|
|
164
|
+
resolveLocalTime(elapsedTime) {
|
|
165
|
+
const duration = this.clip.duration;
|
|
166
|
+
if (duration <= 0) {
|
|
167
|
+
return 0;
|
|
168
|
+
}
|
|
169
|
+
if (this.loop === "once") {
|
|
170
|
+
return Math.min(Math.max(elapsedTime, 0), duration);
|
|
171
|
+
}
|
|
172
|
+
if (Number.isFinite(this.repetitions) && Math.abs(elapsedTime) >= duration * this.repetitions) {
|
|
173
|
+
if (this.loop === "ping-pong" && this.repetitions % 2 === 0) {
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
176
|
+
return elapsedTime < 0 ? 0 : duration;
|
|
177
|
+
}
|
|
178
|
+
const wrappedTime = elapsedTime >= 0 && elapsedTime < duration ? elapsedTime : (elapsedTime % duration + duration) % duration;
|
|
179
|
+
if (this.loop === "repeat") {
|
|
180
|
+
return wrappedTime;
|
|
181
|
+
}
|
|
182
|
+
const traversal = Math.floor(elapsedTime / duration);
|
|
183
|
+
return Math.abs(traversal % 2) === 0 ? wrappedTime : duration - wrappedTime;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
class AnimationMixer {
|
|
187
|
+
time = 0;
|
|
188
|
+
timeScale = 1;
|
|
189
|
+
clips = /* @__PURE__ */ new Map();
|
|
190
|
+
actions = /* @__PURE__ */ new Map();
|
|
191
|
+
initialValues = /* @__PURE__ */ new Map();
|
|
192
|
+
constructor(clips = []) {
|
|
193
|
+
clips.forEach((clip) => this.addClip(clip));
|
|
194
|
+
}
|
|
195
|
+
/** Makes a named clip available for playback. */
|
|
196
|
+
addClip(clip) {
|
|
197
|
+
this.clips.set(clip.name, clip);
|
|
198
|
+
return this;
|
|
199
|
+
}
|
|
200
|
+
/** Returns the cached playback action for a clip or registered clip name. */
|
|
201
|
+
clipAction(clip, props) {
|
|
202
|
+
const resolvedClip = typeof clip === "string" ? this.clips.get(clip) : clip;
|
|
203
|
+
if (!resolvedClip) {
|
|
204
|
+
throw new Error(`Unknown animation clip: ${clip}`);
|
|
205
|
+
}
|
|
206
|
+
this.addClip(resolvedClip);
|
|
207
|
+
let action = this.actions.get(resolvedClip);
|
|
208
|
+
if (!action) {
|
|
209
|
+
action = new AnimationAction(this, resolvedClip, props);
|
|
210
|
+
this.actions.set(resolvedClip, action);
|
|
211
|
+
}
|
|
212
|
+
return action;
|
|
213
|
+
}
|
|
214
|
+
/** Returns a previously created named action, if present. */
|
|
215
|
+
getAction(name) {
|
|
216
|
+
const clip = this.clips.get(name);
|
|
217
|
+
return clip ? this.actions.get(clip) : void 0;
|
|
218
|
+
}
|
|
219
|
+
/** Advances playback by seconds, then applies blended animation values. */
|
|
220
|
+
update(deltaTime) {
|
|
221
|
+
this.advance(deltaTime);
|
|
222
|
+
this.applyValues();
|
|
223
|
+
return this;
|
|
224
|
+
}
|
|
225
|
+
/** Advances action clocks and crossfades without evaluating CPU-side animation tracks. */
|
|
226
|
+
advance(deltaTime) {
|
|
227
|
+
const scaledDeltaTime = deltaTime * this.timeScale;
|
|
228
|
+
this.time += scaledDeltaTime;
|
|
229
|
+
this.actions.forEach((action) => action.advance(scaledDeltaTime));
|
|
230
|
+
return this;
|
|
231
|
+
}
|
|
232
|
+
/** Seeks every action to an absolute mixer time, in seconds. */
|
|
233
|
+
setTime(time) {
|
|
234
|
+
this.time = time;
|
|
235
|
+
this.actions.forEach((action) => {
|
|
236
|
+
if (!action.paused) {
|
|
237
|
+
action.setTime(time * action.timeScale);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
this.applyValues();
|
|
241
|
+
return this;
|
|
242
|
+
}
|
|
243
|
+
/** Stops and resets all registered playback actions. */
|
|
244
|
+
stopAllAction() {
|
|
245
|
+
this.actions.forEach((action) => action.stop());
|
|
246
|
+
return this;
|
|
247
|
+
}
|
|
248
|
+
applyValues() {
|
|
249
|
+
const accumulatedValues = /* @__PURE__ */ new Map();
|
|
250
|
+
this.actions.forEach((action) => {
|
|
251
|
+
if (!action.shouldApply && !(action.playing && action.weight === 0)) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
action.clip.tracks.forEach((track) => {
|
|
255
|
+
var _a, _b;
|
|
256
|
+
const value = track.evaluate(action.time);
|
|
257
|
+
if (!value) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const bindingKey = track.binding.id || track.binding;
|
|
261
|
+
if (!this.initialValues.has(bindingKey)) {
|
|
262
|
+
const initialValue = (_b = (_a = track.binding).getValue) == null ? void 0 : _b.call(_a);
|
|
263
|
+
if (initialValue) {
|
|
264
|
+
this.initialValues.set(bindingKey, [...initialValue]);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (action.weight === 0 && !this.initialValues.has(bindingKey)) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const accumulatedValue = accumulatedValues.get(bindingKey);
|
|
271
|
+
if (!accumulatedValue) {
|
|
272
|
+
accumulatedValues.set(bindingKey, {
|
|
273
|
+
binding: track.binding,
|
|
274
|
+
value: [...value],
|
|
275
|
+
valueType: track.valueType,
|
|
276
|
+
weight: action.weight
|
|
277
|
+
});
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (action.weight === 0) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const totalWeight = accumulatedValue.weight + action.weight;
|
|
284
|
+
const ratio = action.weight / totalWeight;
|
|
285
|
+
accumulatedValue.value = track.valueType === "quaternion" ? (0, import_animation_interpolation.interpolateQuaternion)(accumulatedValue.value, value, ratio) : accumulatedValue.value.map((component, index) => component + (value[index] - component) * ratio);
|
|
286
|
+
accumulatedValue.weight = totalWeight;
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
accumulatedValues.forEach(({ binding, value, valueType, weight }, bindingKey) => {
|
|
290
|
+
const baseline = weight < 1 ? this.initialValues.get(bindingKey) : void 0;
|
|
291
|
+
if (baseline && baseline.length === value.length) {
|
|
292
|
+
value = valueType === "quaternion" ? (0, import_animation_interpolation.interpolateQuaternion)(baseline, value, weight) : value.map((component, index) => baseline[index] + (component - baseline[index]) * weight);
|
|
293
|
+
}
|
|
294
|
+
binding.setValue(value);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
299
|
+
0 && (module.exports = {
|
|
300
|
+
AnimationAction,
|
|
301
|
+
AnimationMixer
|
|
302
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var animation_track_exports = {};
|
|
19
|
+
__export(animation_track_exports, {
|
|
20
|
+
AnimationTrack: () => AnimationTrack
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(animation_track_exports);
|
|
23
|
+
var import_animation_interpolation = require("./animation-interpolation.cjs");
|
|
24
|
+
class AnimationTrack {
|
|
25
|
+
name;
|
|
26
|
+
times;
|
|
27
|
+
values;
|
|
28
|
+
interpolation;
|
|
29
|
+
valueType;
|
|
30
|
+
binding;
|
|
31
|
+
constructor(props) {
|
|
32
|
+
this.name = props.name || props.binding.id || "unnamed";
|
|
33
|
+
this.times = props.times;
|
|
34
|
+
this.values = props.values;
|
|
35
|
+
this.interpolation = props.interpolation || "LINEAR";
|
|
36
|
+
this.valueType = props.valueType || "vector";
|
|
37
|
+
this.binding = props.binding;
|
|
38
|
+
}
|
|
39
|
+
/** Last keyframe time, in seconds. */
|
|
40
|
+
get duration() {
|
|
41
|
+
return this.times[this.times.length - 1] || 0;
|
|
42
|
+
}
|
|
43
|
+
/** glTF-compatible read-only view of this track's keyframe data. */
|
|
44
|
+
get sampler() {
|
|
45
|
+
return { input: this.times, output: this.values, interpolation: this.interpolation };
|
|
46
|
+
}
|
|
47
|
+
/** Evaluates the track at an already-resolved clip time, in seconds. */
|
|
48
|
+
evaluate(time) {
|
|
49
|
+
return (0, import_animation_interpolation.evaluateAnimationSampler)(time, this.sampler, this.valueType);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
AnimationTrack
|
|
55
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var animator_exports = {};
|
|
19
|
+
__export(animator_exports, {
|
|
20
|
+
AnimationClipController: () => AnimationClipController,
|
|
21
|
+
Animator: () => Animator
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(animator_exports);
|
|
24
|
+
var import_core = require("@luma.gl/core");
|
|
25
|
+
class AnimationClipController {
|
|
26
|
+
/** Application-visible clip name. */
|
|
27
|
+
name;
|
|
28
|
+
/** Whether playback is currently enabled. */
|
|
29
|
+
playing = true;
|
|
30
|
+
/** Playback speed multiplier. */
|
|
31
|
+
speed = 1;
|
|
32
|
+
/** Start time in seconds relative to wall-clock playback time. */
|
|
33
|
+
startTime = 0;
|
|
34
|
+
constructor(props = {}) {
|
|
35
|
+
this.name = props.name || "unnamed";
|
|
36
|
+
Object.assign(this, props);
|
|
37
|
+
}
|
|
38
|
+
/** Advances the clip to the supplied wall-clock time in milliseconds. */
|
|
39
|
+
setTime(timeMs) {
|
|
40
|
+
if (!this.playing) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const absoluteTimeSeconds = timeMs / 1e3;
|
|
44
|
+
const localTimeSeconds = (absoluteTimeSeconds - this.startTime) * this.speed;
|
|
45
|
+
this.applyTime(localTimeSeconds);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class Animator {
|
|
49
|
+
/** Managed clip list. */
|
|
50
|
+
clips;
|
|
51
|
+
/** Compatibility alias for clip list. */
|
|
52
|
+
animations;
|
|
53
|
+
constructor(clips) {
|
|
54
|
+
this.clips = clips;
|
|
55
|
+
this.animations = clips;
|
|
56
|
+
}
|
|
57
|
+
/** @deprecated Use .setTime(). */
|
|
58
|
+
animate(timeMs) {
|
|
59
|
+
import_core.log.warn(`${this.constructor.name}#animate is deprecated. Use ${this.constructor.name}#setTime instead`)();
|
|
60
|
+
this.setTime(timeMs);
|
|
61
|
+
}
|
|
62
|
+
/** Advances every clip to the supplied wall-clock time in milliseconds. */
|
|
63
|
+
setTime(timeMs) {
|
|
64
|
+
this.clips.forEach((clip) => clip.setTime(timeMs));
|
|
65
|
+
}
|
|
66
|
+
/** Returns the managed animation clips. */
|
|
67
|
+
getAnimations() {
|
|
68
|
+
return this.clips;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
AnimationClipController,
|
|
74
|
+
Animator
|
|
75
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var deform_positions_exports = {};
|
|
19
|
+
__export(deform_positions_exports, {
|
|
20
|
+
deformPositions: () => deformPositions
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(deform_positions_exports);
|
|
23
|
+
var import_morph_targets = require("./morph-targets.cjs");
|
|
24
|
+
function deformPositions(props) {
|
|
25
|
+
const { positions, targets = [], weights = [], jointMatrices, influences = [] } = props;
|
|
26
|
+
if (positions.length % 3 || targets.some((target) => target.length !== positions.length) || !weights.every(Number.isFinite))
|
|
27
|
+
throw new Error("Invalid position deformation");
|
|
28
|
+
const result = (0, import_morph_targets.applyMorphTargets)({ POSITION: positions }, targets.map((POSITION) => ({ POSITION })), weights).POSITION;
|
|
29
|
+
if (!jointMatrices) {
|
|
30
|
+
if (!result.every(Number.isFinite))
|
|
31
|
+
throw new Error("Nonfinite deformation");
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
if (!influences.length || influences.some((influence) => influence.joints.length !== positions.length / 3 * 4 || influence.weights.length !== influence.joints.length))
|
|
35
|
+
throw new Error("Invalid skin influences");
|
|
36
|
+
for (let vertex = 0; vertex < result.length / 3; vertex++) {
|
|
37
|
+
const original = Array.from(result.subarray(vertex * 3, vertex * 3 + 3));
|
|
38
|
+
const point = [0, 0, 0];
|
|
39
|
+
let totalWeight = 0;
|
|
40
|
+
for (const influence of influences)
|
|
41
|
+
for (let component = 0; component < 4; component++) {
|
|
42
|
+
const offset = vertex * 4 + component;
|
|
43
|
+
const weight = influence.weights[offset];
|
|
44
|
+
if (!Number.isFinite(weight) || weight < 0)
|
|
45
|
+
throw new Error("Invalid skin weight");
|
|
46
|
+
if (!weight)
|
|
47
|
+
continue;
|
|
48
|
+
const index = influence.joints[offset];
|
|
49
|
+
const matrix = jointMatrices[index];
|
|
50
|
+
if (!Number.isInteger(index) || !matrix)
|
|
51
|
+
throw new Error("Invalid skin joint");
|
|
52
|
+
const transformed = matrix.transformAsPoint(original);
|
|
53
|
+
for (let axis = 0; axis < 3; axis++)
|
|
54
|
+
point[axis] += weight * transformed[axis];
|
|
55
|
+
totalWeight += weight;
|
|
56
|
+
}
|
|
57
|
+
if (!(totalWeight > 0))
|
|
58
|
+
throw new Error("Empty skin weights");
|
|
59
|
+
for (let axis = 0; axis < 3; axis++)
|
|
60
|
+
result[vertex * 3 + axis] = point[axis] / totalWeight;
|
|
61
|
+
}
|
|
62
|
+
if (!result.every(Number.isFinite))
|
|
63
|
+
throw new Error("Nonfinite deformation");
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
deformPositions
|
|
69
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Matrix4 } from '@math.gl/core';
|
|
2
|
+
/** Explicit CPU snapshot for collision cooking/export. Rendering remains GPU driven. */
|
|
3
|
+
export declare function deformPositions(props: {
|
|
4
|
+
positions: Float32Array;
|
|
5
|
+
targets?: readonly Float32Array[];
|
|
6
|
+
weights?: readonly number[];
|
|
7
|
+
jointMatrices?: readonly Matrix4[];
|
|
8
|
+
influences?: readonly {
|
|
9
|
+
joints: readonly number[];
|
|
10
|
+
weights: readonly number[];
|
|
11
|
+
}[];
|
|
12
|
+
}): Float32Array;
|
|
13
|
+
//# sourceMappingURL=deform-positions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deform-positions.d.ts","sourceRoot":"","sources":["../../src/animation/deform-positions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAGtC,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,UAAU,CAAC,EAAE,SAAS;QAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;KAAC,EAAE,CAAC;CACjF,GAAG,YAAY,CAgDf"}
|