@aura3d/engine 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -0
- package/dist/animation/AnimationAction.d.ts +40 -0
- package/dist/animation/AnimationAction.d.ts.map +1 -0
- package/dist/animation/AnimationAction.js +143 -0
- package/dist/animation/AnimationAction.js.map +1 -0
- package/dist/animation/AnimationClip.d.ts +24 -0
- package/dist/animation/AnimationClip.d.ts.map +1 -0
- package/dist/animation/AnimationClip.js +45 -0
- package/dist/animation/AnimationClip.js.map +1 -0
- package/dist/animation/AnimationEvents.d.ts +10 -0
- package/dist/animation/AnimationEvents.d.ts.map +1 -0
- package/dist/animation/AnimationEvents.js +26 -0
- package/dist/animation/AnimationEvents.js.map +1 -0
- package/dist/animation/AnimationLayer.d.ts +27 -0
- package/dist/animation/AnimationLayer.d.ts.map +1 -0
- package/dist/animation/AnimationLayer.js +53 -0
- package/dist/animation/AnimationLayer.js.map +1 -0
- package/dist/animation/AnimationMixer.d.ts +54 -0
- package/dist/animation/AnimationMixer.d.ts.map +1 -0
- package/dist/animation/AnimationMixer.js +319 -0
- package/dist/animation/AnimationMixer.js.map +1 -0
- package/dist/animation/AnimationStateMachine.d.ts +43 -0
- package/dist/animation/AnimationStateMachine.d.ts.map +1 -0
- package/dist/animation/AnimationStateMachine.js +92 -0
- package/dist/animation/AnimationStateMachine.js.map +1 -0
- package/dist/animation/AnimationTrack.d.ts +23 -0
- package/dist/animation/AnimationTrack.d.ts.map +1 -0
- package/dist/animation/AnimationTrack.js +124 -0
- package/dist/animation/AnimationTrack.js.map +1 -0
- package/dist/animation/BlendTree.d.ts +23 -0
- package/dist/animation/BlendTree.d.ts.map +1 -0
- package/dist/animation/BlendTree.js +68 -0
- package/dist/animation/BlendTree.js.map +1 -0
- package/dist/animation/Bone.d.ts +20 -0
- package/dist/animation/Bone.d.ts.map +1 -0
- package/dist/animation/Bone.js +24 -0
- package/dist/animation/Bone.js.map +1 -0
- package/dist/animation/CrowdAnimation.d.ts +13 -0
- package/dist/animation/CrowdAnimation.d.ts.map +1 -0
- package/dist/animation/CrowdAnimation.js +14 -0
- package/dist/animation/CrowdAnimation.js.map +1 -0
- package/dist/animation/ECSAnimationBridge.d.ts +9 -0
- package/dist/animation/ECSAnimationBridge.d.ts.map +1 -0
- package/dist/animation/ECSAnimationBridge.js +24 -0
- package/dist/animation/ECSAnimationBridge.js.map +1 -0
- package/dist/animation/IK.d.ts +24 -0
- package/dist/animation/IK.d.ts.map +1 -0
- package/dist/animation/IK.js +76 -0
- package/dist/animation/IK.js.map +1 -0
- package/dist/animation/Keyframe.d.ts +50 -0
- package/dist/animation/Keyframe.d.ts.map +1 -0
- package/dist/animation/Keyframe.js +118 -0
- package/dist/animation/Keyframe.js.map +1 -0
- package/dist/animation/LocomotionController.d.ts +47 -0
- package/dist/animation/LocomotionController.d.ts.map +1 -0
- package/dist/animation/LocomotionController.js +106 -0
- package/dist/animation/LocomotionController.js.map +1 -0
- package/dist/animation/MotionMatchingFixtures.d.ts +58 -0
- package/dist/animation/MotionMatchingFixtures.d.ts.map +1 -0
- package/dist/animation/MotionMatchingFixtures.js +175 -0
- package/dist/animation/MotionMatchingFixtures.js.map +1 -0
- package/dist/animation/MotionQuality.d.ts +36 -0
- package/dist/animation/MotionQuality.d.ts.map +1 -0
- package/dist/animation/MotionQuality.js +117 -0
- package/dist/animation/MotionQuality.js.map +1 -0
- package/dist/animation/Retargeting.d.ts +12 -0
- package/dist/animation/Retargeting.d.ts.map +1 -0
- package/dist/animation/Retargeting.js +19 -0
- package/dist/animation/Retargeting.js.map +1 -0
- package/dist/animation/RootMotion.d.ts +21 -0
- package/dist/animation/RootMotion.d.ts.map +1 -0
- package/dist/animation/RootMotion.js +84 -0
- package/dist/animation/RootMotion.js.map +1 -0
- package/dist/animation/SceneAnimationBridge.d.ts +18 -0
- package/dist/animation/SceneAnimationBridge.d.ts.map +1 -0
- package/dist/animation/SceneAnimationBridge.js +69 -0
- package/dist/animation/SceneAnimationBridge.js.map +1 -0
- package/dist/animation/SecondaryAnimationFixtures.d.ts +55 -0
- package/dist/animation/SecondaryAnimationFixtures.d.ts.map +1 -0
- package/dist/animation/SecondaryAnimationFixtures.js +147 -0
- package/dist/animation/SecondaryAnimationFixtures.js.map +1 -0
- package/dist/animation/Skeleton.d.ts +9 -0
- package/dist/animation/Skeleton.d.ts.map +1 -0
- package/dist/animation/Skeleton.js +31 -0
- package/dist/animation/Skeleton.js.map +1 -0
- package/dist/animation/Skinning.d.ts +7 -0
- package/dist/animation/Skinning.d.ts.map +1 -0
- package/dist/animation/Skinning.js +12 -0
- package/dist/animation/Skinning.js.map +1 -0
- package/dist/animation/browser-index.d.ts +21 -0
- package/dist/animation/browser-index.d.ts.map +1 -0
- package/dist/animation/browser-index.js +21 -0
- package/dist/animation/browser-index.js.map +1 -0
- package/dist/animation/index.d.ts +24 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/index.js +24 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationAction.d.ts +16 -0
- package/dist/animation/threejs-compatibility/AnimationAction.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationAction.js +25 -0
- package/dist/animation/threejs-compatibility/AnimationAction.js.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationClip.d.ts +14 -0
- package/dist/animation/threejs-compatibility/AnimationClip.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationClip.js +11 -0
- package/dist/animation/threejs-compatibility/AnimationClip.js.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationDiagnostics.d.ts +44 -0
- package/dist/animation/threejs-compatibility/AnimationDiagnostics.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationDiagnostics.js +31 -0
- package/dist/animation/threejs-compatibility/AnimationDiagnostics.js.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationMixer.d.ts +9 -0
- package/dist/animation/threejs-compatibility/AnimationMixer.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/AnimationMixer.js +24 -0
- package/dist/animation/threejs-compatibility/AnimationMixer.js.map +1 -0
- package/dist/animation/threejs-compatibility/MorphTargetMixer.d.ts +10 -0
- package/dist/animation/threejs-compatibility/MorphTargetMixer.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/MorphTargetMixer.js +10 -0
- package/dist/animation/threejs-compatibility/MorphTargetMixer.js.map +1 -0
- package/dist/animation/threejs-compatibility/Skeleton.d.ts +10 -0
- package/dist/animation/threejs-compatibility/Skeleton.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/Skeleton.js +8 -0
- package/dist/animation/threejs-compatibility/Skeleton.js.map +1 -0
- package/dist/animation/threejs-compatibility/SkinnedMesh.d.ts +11 -0
- package/dist/animation/threejs-compatibility/SkinnedMesh.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/SkinnedMesh.js +16 -0
- package/dist/animation/threejs-compatibility/SkinnedMesh.js.map +1 -0
- package/dist/animation/threejs-compatibility/index.d.ts +12 -0
- package/dist/animation/threejs-compatibility/index.d.ts.map +1 -0
- package/dist/animation/threejs-compatibility/index.js +8 -0
- package/dist/animation/threejs-compatibility/index.js.map +1 -0
- package/dist/apps/index.d.ts +50 -0
- package/dist/apps/index.d.ts.map +1 -0
- package/dist/apps/index.js +99 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/assets/AdvancedAssetCorpus.d.ts +124 -0
- package/dist/assets/AdvancedAssetCorpus.d.ts.map +1 -0
- package/dist/assets/AdvancedAssetCorpus.js +266 -0
- package/dist/assets/AdvancedAssetCorpus.js.map +1 -0
- package/dist/assets/AssetBundleCacheFixtures.d.ts +62 -0
- package/dist/assets/AssetBundleCacheFixtures.d.ts.map +1 -0
- package/dist/assets/AssetBundleCacheFixtures.js +222 -0
- package/dist/assets/AssetBundleCacheFixtures.js.map +1 -0
- package/dist/assets/AssetCache.d.ts +21 -0
- package/dist/assets/AssetCache.d.ts.map +1 -0
- package/dist/assets/AssetCache.js +54 -0
- package/dist/assets/AssetCache.js.map +1 -0
- package/dist/assets/AssetCompatibility.d.ts +54 -0
- package/dist/assets/AssetCompatibility.d.ts.map +1 -0
- package/dist/assets/AssetCompatibility.js +122 -0
- package/dist/assets/AssetCompatibility.js.map +1 -0
- package/dist/assets/AssetCorpus.d.ts +88 -0
- package/dist/assets/AssetCorpus.d.ts.map +1 -0
- package/dist/assets/AssetCorpus.js +215 -0
- package/dist/assets/AssetCorpus.js.map +1 -0
- package/dist/assets/AssetDependencyGraph.d.ts +12 -0
- package/dist/assets/AssetDependencyGraph.d.ts.map +1 -0
- package/dist/assets/AssetDependencyGraph.js +66 -0
- package/dist/assets/AssetDependencyGraph.js.map +1 -0
- package/dist/assets/AssetHandle.d.ts +26 -0
- package/dist/assets/AssetHandle.d.ts.map +1 -0
- package/dist/assets/AssetHandle.js +53 -0
- package/dist/assets/AssetHandle.js.map +1 -0
- package/dist/assets/AssetImportPreflight.d.ts +43 -0
- package/dist/assets/AssetImportPreflight.d.ts.map +1 -0
- package/dist/assets/AssetImportPreflight.js +117 -0
- package/dist/assets/AssetImportPreflight.js.map +1 -0
- package/dist/assets/AssetInspection.d.ts +183 -0
- package/dist/assets/AssetInspection.d.ts.map +1 -0
- package/dist/assets/AssetInspection.js +397 -0
- package/dist/assets/AssetInspection.js.map +1 -0
- package/dist/assets/AssetLoader.d.ts +26 -0
- package/dist/assets/AssetLoader.d.ts.map +1 -0
- package/dist/assets/AssetLoader.js +12 -0
- package/dist/assets/AssetLoader.js.map +1 -0
- package/dist/assets/AssetManager.d.ts +37 -0
- package/dist/assets/AssetManager.d.ts.map +1 -0
- package/dist/assets/AssetManager.js +161 -0
- package/dist/assets/AssetManager.js.map +1 -0
- package/dist/assets/AssetRegistry.d.ts +10 -0
- package/dist/assets/AssetRegistry.d.ts.map +1 -0
- package/dist/assets/AssetRegistry.js +34 -0
- package/dist/assets/AssetRegistry.js.map +1 -0
- package/dist/assets/AssetRenderDefaults.d.ts +13 -0
- package/dist/assets/AssetRenderDefaults.d.ts.map +1 -0
- package/dist/assets/AssetRenderDefaults.js +23 -0
- package/dist/assets/AssetRenderDefaults.js.map +1 -0
- package/dist/assets/AudioLoader.d.ts +17 -0
- package/dist/assets/AudioLoader.d.ts.map +1 -0
- package/dist/assets/AudioLoader.js +23 -0
- package/dist/assets/AudioLoader.js.map +1 -0
- package/dist/assets/BlenderExportValidation.d.ts +64 -0
- package/dist/assets/BlenderExportValidation.d.ts.map +1 -0
- package/dist/assets/BlenderExportValidation.js +143 -0
- package/dist/assets/BlenderExportValidation.js.map +1 -0
- package/dist/assets/CarConceptMaterialStability.d.ts +28 -0
- package/dist/assets/CarConceptMaterialStability.d.ts.map +1 -0
- package/dist/assets/CarConceptMaterialStability.js +1308 -0
- package/dist/assets/CarConceptMaterialStability.js.map +1 -0
- package/dist/assets/EXRLoader.d.ts +2 -0
- package/dist/assets/EXRLoader.d.ts.map +1 -0
- package/dist/assets/EXRLoader.js +2 -0
- package/dist/assets/EXRLoader.js.map +1 -0
- package/dist/assets/ExternalParityGLTFCorpus.d.ts +39 -0
- package/dist/assets/ExternalParityGLTFCorpus.d.ts.map +1 -0
- package/dist/assets/ExternalParityGLTFCorpus.js +32 -0
- package/dist/assets/ExternalParityGLTFCorpus.js.map +1 -0
- package/dist/assets/GLTFAnimationRuntime.d.ts +243 -0
- package/dist/assets/GLTFAnimationRuntime.d.ts.map +1 -0
- package/dist/assets/GLTFAnimationRuntime.js +954 -0
- package/dist/assets/GLTFAnimationRuntime.js.map +1 -0
- package/dist/assets/GLTFCompressionDecoders.d.ts +42 -0
- package/dist/assets/GLTFCompressionDecoders.d.ts.map +1 -0
- package/dist/assets/GLTFCompressionDecoders.js +99 -0
- package/dist/assets/GLTFCompressionDecoders.js.map +1 -0
- package/dist/assets/GLTFExtensionSupport.d.ts +33 -0
- package/dist/assets/GLTFExtensionSupport.d.ts.map +1 -0
- package/dist/assets/GLTFExtensionSupport.js +85 -0
- package/dist/assets/GLTFExtensionSupport.js.map +1 -0
- package/dist/assets/GLTFLoader.d.ts +361 -0
- package/dist/assets/GLTFLoader.d.ts.map +1 -0
- package/dist/assets/GLTFLoader.js +2735 -0
- package/dist/assets/GLTFLoader.js.map +1 -0
- package/dist/assets/GLTFRenderResources.d.ts +162 -0
- package/dist/assets/GLTFRenderResources.d.ts.map +1 -0
- package/dist/assets/GLTFRenderResources.js +1684 -0
- package/dist/assets/GLTFRenderResources.js.map +1 -0
- package/dist/assets/HDRLoader.d.ts +2 -0
- package/dist/assets/HDRLoader.d.ts.map +1 -0
- package/dist/assets/HDRLoader.js +2 -0
- package/dist/assets/HDRLoader.js.map +1 -0
- package/dist/assets/ImageLoader.d.ts +15 -0
- package/dist/assets/ImageLoader.d.ts.map +1 -0
- package/dist/assets/ImageLoader.js +36 -0
- package/dist/assets/ImageLoader.js.map +1 -0
- package/dist/assets/ImportPipeline.d.ts +39 -0
- package/dist/assets/ImportPipeline.d.ts.map +1 -0
- package/dist/assets/ImportPipeline.js +105 -0
- package/dist/assets/ImportPipeline.js.map +1 -0
- package/dist/assets/KTX2BasisTextureTranscoder.d.ts +9 -0
- package/dist/assets/KTX2BasisTextureTranscoder.d.ts.map +1 -0
- package/dist/assets/KTX2BasisTextureTranscoder.js +178 -0
- package/dist/assets/KTX2BasisTextureTranscoder.js.map +1 -0
- package/dist/assets/LoadContext.d.ts +20 -0
- package/dist/assets/LoadContext.d.ts.map +1 -0
- package/dist/assets/LoadContext.js +42 -0
- package/dist/assets/LoadContext.js.map +1 -0
- package/dist/assets/MaterialLoader.d.ts +17 -0
- package/dist/assets/MaterialLoader.d.ts.map +1 -0
- package/dist/assets/MaterialLoader.js +138 -0
- package/dist/assets/MaterialLoader.js.map +1 -0
- package/dist/assets/MeshOptimization.d.ts +20 -0
- package/dist/assets/MeshOptimization.d.ts.map +1 -0
- package/dist/assets/MeshOptimization.js +65 -0
- package/dist/assets/MeshOptimization.js.map +1 -0
- package/dist/assets/OBJLoader.d.ts +13 -0
- package/dist/assets/OBJLoader.d.ts.map +1 -0
- package/dist/assets/OBJLoader.js +492 -0
- package/dist/assets/OBJLoader.js.map +1 -0
- package/dist/assets/SceneAnalysisFixtures.d.ts +100 -0
- package/dist/assets/SceneAnalysisFixtures.d.ts.map +1 -0
- package/dist/assets/SceneAnalysisFixtures.js +331 -0
- package/dist/assets/SceneAnalysisFixtures.js.map +1 -0
- package/dist/assets/SceneLoader.d.ts +27 -0
- package/dist/assets/SceneLoader.d.ts.map +1 -0
- package/dist/assets/SceneLoader.js +40 -0
- package/dist/assets/SceneLoader.js.map +1 -0
- package/dist/assets/ShaderLoader.d.ts +12 -0
- package/dist/assets/ShaderLoader.d.ts.map +1 -0
- package/dist/assets/ShaderLoader.js +18 -0
- package/dist/assets/ShaderLoader.js.map +1 -0
- package/dist/assets/TextureLoader.d.ts +16 -0
- package/dist/assets/TextureLoader.d.ts.map +1 -0
- package/dist/assets/TextureLoader.js +17 -0
- package/dist/assets/TextureLoader.js.map +1 -0
- package/dist/assets/TexturePipeline.d.ts +24 -0
- package/dist/assets/TexturePipeline.d.ts.map +1 -0
- package/dist/assets/TexturePipeline.js +64 -0
- package/dist/assets/TexturePipeline.js.map +1 -0
- package/dist/assets/TextureStreaming.d.ts +10 -0
- package/dist/assets/TextureStreaming.d.ts.map +1 -0
- package/dist/assets/TextureStreaming.js +11 -0
- package/dist/assets/TextureStreaming.js.map +1 -0
- package/dist/assets/WorkerAssetJobs.d.ts +18 -0
- package/dist/assets/WorkerAssetJobs.d.ts.map +1 -0
- package/dist/assets/WorkerAssetJobs.js +37 -0
- package/dist/assets/WorkerAssetJobs.js.map +1 -0
- package/dist/assets/advanced-gallery/index.d.ts +3 -0
- package/dist/assets/advanced-gallery/index.d.ts.map +1 -0
- package/dist/assets/advanced-gallery/index.js +2 -0
- package/dist/assets/advanced-gallery/index.js.map +1 -0
- package/dist/assets/asset-corpus/GLTFSceneLoader.d.ts +3 -0
- package/dist/assets/asset-corpus/GLTFSceneLoader.d.ts.map +1 -0
- package/dist/assets/asset-corpus/GLTFSceneLoader.js +2 -0
- package/dist/assets/asset-corpus/GLTFSceneLoader.js.map +1 -0
- package/dist/assets/asset-corpus/ProductionAssetCorpus.d.ts +89 -0
- package/dist/assets/asset-corpus/ProductionAssetCorpus.d.ts.map +1 -0
- package/dist/assets/asset-corpus/ProductionAssetCorpus.js +116 -0
- package/dist/assets/asset-corpus/ProductionAssetCorpus.js.map +1 -0
- package/dist/assets/asset-corpus/ProductionAssetPipeline.d.ts +3 -0
- package/dist/assets/asset-corpus/ProductionAssetPipeline.d.ts.map +1 -0
- package/dist/assets/asset-corpus/ProductionAssetPipeline.js +3 -0
- package/dist/assets/asset-corpus/ProductionAssetPipeline.js.map +1 -0
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.d.ts +65 -0
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.d.ts.map +1 -0
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.js +110 -0
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.js.map +1 -0
- package/dist/assets/asset-corpus/ProductionHDRTextureLoader.d.ts +8 -0
- package/dist/assets/asset-corpus/ProductionHDRTextureLoader.d.ts.map +1 -0
- package/dist/assets/asset-corpus/ProductionHDRTextureLoader.js +2 -0
- package/dist/assets/asset-corpus/ProductionHDRTextureLoader.js.map +1 -0
- package/dist/assets/asset-corpus/ProductionKTX2TextureLoader.d.ts +7 -0
- package/dist/assets/asset-corpus/ProductionKTX2TextureLoader.d.ts.map +1 -0
- package/dist/assets/asset-corpus/ProductionKTX2TextureLoader.js +2 -0
- package/dist/assets/asset-corpus/ProductionKTX2TextureLoader.js.map +1 -0
- package/dist/assets/asset-corpus/ProductionTextureLoader.d.ts +7 -0
- package/dist/assets/asset-corpus/ProductionTextureLoader.d.ts.map +1 -0
- package/dist/assets/asset-corpus/ProductionTextureLoader.js +2 -0
- package/dist/assets/asset-corpus/ProductionTextureLoader.js.map +1 -0
- package/dist/assets/asset-corpus/index.d.ts +10 -0
- package/dist/assets/asset-corpus/index.d.ts.map +1 -0
- package/dist/assets/asset-corpus/index.js +8 -0
- package/dist/assets/asset-corpus/index.js.map +1 -0
- package/dist/assets/browser-index.d.ts +48 -0
- package/dist/assets/browser-index.d.ts.map +1 -0
- package/dist/assets/browser-index.js +26 -0
- package/dist/assets/browser-index.js.map +1 -0
- package/dist/assets/createRenderableScene.d.ts +23 -0
- package/dist/assets/createRenderableScene.d.ts.map +1 -0
- package/dist/assets/createRenderableScene.js +94 -0
- package/dist/assets/createRenderableScene.js.map +1 -0
- package/dist/assets/index.d.ts +82 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/index.js +45 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/assets/loadRenderableAsset.d.ts +16 -0
- package/dist/assets/loadRenderableAsset.d.ts.map +1 -0
- package/dist/assets/loadRenderableAsset.js +50 -0
- package/dist/assets/loadRenderableAsset.js.map +1 -0
- package/dist/assets/loaders/CubeTextureLoader.d.ts +4 -0
- package/dist/assets/loaders/CubeTextureLoader.d.ts.map +1 -0
- package/dist/assets/loaders/CubeTextureLoader.js +9 -0
- package/dist/assets/loaders/CubeTextureLoader.js.map +1 -0
- package/dist/assets/loaders/EXRLoader.d.ts +4 -0
- package/dist/assets/loaders/EXRLoader.d.ts.map +1 -0
- package/dist/assets/loaders/EXRLoader.js +10 -0
- package/dist/assets/loaders/EXRLoader.js.map +1 -0
- package/dist/assets/loaders/HDRLoader.d.ts +4 -0
- package/dist/assets/loaders/HDRLoader.d.ts.map +1 -0
- package/dist/assets/loaders/HDRLoader.js +7 -0
- package/dist/assets/loaders/HDRLoader.js.map +1 -0
- package/dist/assets/loaders/KTX2Loader.d.ts +4 -0
- package/dist/assets/loaders/KTX2Loader.d.ts.map +1 -0
- package/dist/assets/loaders/KTX2Loader.js +7 -0
- package/dist/assets/loaders/KTX2Loader.js.map +1 -0
- package/dist/assets/loaders/LoaderDiagnostics.d.ts +18 -0
- package/dist/assets/loaders/LoaderDiagnostics.d.ts.map +1 -0
- package/dist/assets/loaders/LoaderDiagnostics.js +18 -0
- package/dist/assets/loaders/LoaderDiagnostics.js.map +1 -0
- package/dist/assets/loaders/MTLLoader.d.ts +10 -0
- package/dist/assets/loaders/MTLLoader.d.ts.map +1 -0
- package/dist/assets/loaders/MTLLoader.js +14 -0
- package/dist/assets/loaders/MTLLoader.js.map +1 -0
- package/dist/assets/loaders/OBJLoader.d.ts +12 -0
- package/dist/assets/loaders/OBJLoader.d.ts.map +1 -0
- package/dist/assets/loaders/OBJLoader.js +16 -0
- package/dist/assets/loaders/OBJLoader.js.map +1 -0
- package/dist/assets/loaders/TextureLoader.d.ts +6 -0
- package/dist/assets/loaders/TextureLoader.d.ts.map +1 -0
- package/dist/assets/loaders/TextureLoader.js +11 -0
- package/dist/assets/loaders/TextureLoader.js.map +1 -0
- package/dist/assets/loaders/ThreeCompatGLTFLoader.d.ts +10 -0
- package/dist/assets/loaders/ThreeCompatGLTFLoader.d.ts.map +1 -0
- package/dist/assets/loaders/ThreeCompatGLTFLoader.js +13 -0
- package/dist/assets/loaders/ThreeCompatGLTFLoader.js.map +1 -0
- package/dist/assets/loaders/index.d.ts +15 -0
- package/dist/assets/loaders/index.d.ts.map +1 -0
- package/dist/assets/loaders/index.js +10 -0
- package/dist/assets/loaders/index.js.map +1 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetProvenance.d.ts +34 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetProvenance.d.ts.map +1 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetProvenance.js +16 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetProvenance.js.map +1 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetRegistry.d.ts +29 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetRegistry.d.ts.map +1 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetRegistry.js +33 -0
- package/dist/assets/threejs-compatibility/ThreeCompatAssetRegistry.js.map +1 -0
- package/dist/assets/threejs-example-parity/index.d.ts +20 -0
- package/dist/assets/threejs-example-parity/index.d.ts.map +1 -0
- package/dist/assets/threejs-example-parity/index.js +218 -0
- package/dist/assets/threejs-example-parity/index.js.map +1 -0
- package/dist/audio/AdaptiveMusicFixtures.d.ts +36 -0
- package/dist/audio/AdaptiveMusicFixtures.d.ts.map +1 -0
- package/dist/audio/AdaptiveMusicFixtures.js +90 -0
- package/dist/audio/AdaptiveMusicFixtures.js.map +1 -0
- package/dist/audio/AudioBus.d.ts +13 -0
- package/dist/audio/AudioBus.d.ts.map +1 -0
- package/dist/audio/AudioBus.js +32 -0
- package/dist/audio/AudioBus.js.map +1 -0
- package/dist/audio/AudioClip.d.ts +13 -0
- package/dist/audio/AudioClip.d.ts.map +1 -0
- package/dist/audio/AudioClip.js +18 -0
- package/dist/audio/AudioClip.js.map +1 -0
- package/dist/audio/AudioContextManager.d.ts +31 -0
- package/dist/audio/AudioContextManager.d.ts.map +1 -0
- package/dist/audio/AudioContextManager.js +49 -0
- package/dist/audio/AudioContextManager.js.map +1 -0
- package/dist/audio/AudioEffect.d.ts +8 -0
- package/dist/audio/AudioEffect.d.ts.map +1 -0
- package/dist/audio/AudioEffect.js +2 -0
- package/dist/audio/AudioEffect.js.map +1 -0
- package/dist/audio/AudioEffectsAnalysisFixtures.d.ts +99 -0
- package/dist/audio/AudioEffectsAnalysisFixtures.d.ts.map +1 -0
- package/dist/audio/AudioEffectsAnalysisFixtures.js +192 -0
- package/dist/audio/AudioEffectsAnalysisFixtures.js.map +1 -0
- package/dist/audio/AudioListener.d.ts +12 -0
- package/dist/audio/AudioListener.d.ts.map +1 -0
- package/dist/audio/AudioListener.js +11 -0
- package/dist/audio/AudioListener.js.map +1 -0
- package/dist/audio/AudioMixer.d.ts +12 -0
- package/dist/audio/AudioMixer.d.ts.map +1 -0
- package/dist/audio/AudioMixer.js +33 -0
- package/dist/audio/AudioMixer.js.map +1 -0
- package/dist/audio/AudioSource.d.ts +25 -0
- package/dist/audio/AudioSource.d.ts.map +1 -0
- package/dist/audio/AudioSource.js +58 -0
- package/dist/audio/AudioSource.js.map +1 -0
- package/dist/audio/AudioSystem.d.ts +13 -0
- package/dist/audio/AudioSystem.d.ts.map +1 -0
- package/dist/audio/AudioSystem.js +28 -0
- package/dist/audio/AudioSystem.js.map +1 -0
- package/dist/audio/SceneAudioBridge.d.ts +19 -0
- package/dist/audio/SceneAudioBridge.d.ts.map +1 -0
- package/dist/audio/SceneAudioBridge.js +37 -0
- package/dist/audio/SceneAudioBridge.js.map +1 -0
- package/dist/audio/SpatialAudio.d.ts +17 -0
- package/dist/audio/SpatialAudio.d.ts.map +1 -0
- package/dist/audio/SpatialAudio.js +22 -0
- package/dist/audio/SpatialAudio.js.map +1 -0
- package/dist/audio/SpatialAudioFixtures.d.ts +38 -0
- package/dist/audio/SpatialAudioFixtures.d.ts.map +1 -0
- package/dist/audio/SpatialAudioFixtures.js +94 -0
- package/dist/audio/SpatialAudioFixtures.js.map +1 -0
- package/dist/audio/effects/Filter.d.ts +13 -0
- package/dist/audio/effects/Filter.d.ts.map +1 -0
- package/dist/audio/effects/Filter.js +31 -0
- package/dist/audio/effects/Filter.js.map +1 -0
- package/dist/audio/effects/Reverb.d.ts +12 -0
- package/dist/audio/effects/Reverb.d.ts.map +1 -0
- package/dist/audio/effects/Reverb.js +23 -0
- package/dist/audio/effects/Reverb.js.map +1 -0
- package/dist/audio/index.d.ts +25 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +15 -0
- package/dist/audio/index.js.map +1 -0
- package/dist/aura3d-cli/cli.d.ts +3 -0
- package/dist/aura3d-cli/cli.d.ts.map +1 -0
- package/dist/aura3d-cli/cli.js +79 -0
- package/dist/aura3d-cli/cli.js.map +1 -0
- package/dist/aura3d-cli/index.d.ts +78 -0
- package/dist/aura3d-cli/index.d.ts.map +1 -0
- package/dist/aura3d-cli/index.js +422 -0
- package/dist/aura3d-cli/index.js.map +1 -0
- package/dist/controls/ControlState.d.ts +14 -0
- package/dist/controls/ControlState.d.ts.map +1 -0
- package/dist/controls/ControlState.js +11 -0
- package/dist/controls/ControlState.js.map +1 -0
- package/dist/controls/DragControls.d.ts +8 -0
- package/dist/controls/DragControls.d.ts.map +1 -0
- package/dist/controls/DragControls.js +14 -0
- package/dist/controls/DragControls.js.map +1 -0
- package/dist/controls/FirstPersonControls.d.ts +5 -0
- package/dist/controls/FirstPersonControls.d.ts.map +1 -0
- package/dist/controls/FirstPersonControls.js +8 -0
- package/dist/controls/FirstPersonControls.js.map +1 -0
- package/dist/controls/FlyControls.d.ts +8 -0
- package/dist/controls/FlyControls.d.ts.map +1 -0
- package/dist/controls/FlyControls.js +12 -0
- package/dist/controls/FlyControls.js.map +1 -0
- package/dist/controls/InteractionControls.d.ts +83 -0
- package/dist/controls/InteractionControls.d.ts.map +1 -0
- package/dist/controls/InteractionControls.js +163 -0
- package/dist/controls/InteractionControls.js.map +1 -0
- package/dist/controls/MapControls.d.ts +6 -0
- package/dist/controls/MapControls.d.ts.map +1 -0
- package/dist/controls/MapControls.js +9 -0
- package/dist/controls/MapControls.js.map +1 -0
- package/dist/controls/NativeControlTypes.d.ts +49 -0
- package/dist/controls/NativeControlTypes.d.ts.map +1 -0
- package/dist/controls/NativeControlTypes.js +58 -0
- package/dist/controls/NativeControlTypes.js.map +1 -0
- package/dist/controls/OrbitControls.d.ts +11 -0
- package/dist/controls/OrbitControls.d.ts.map +1 -0
- package/dist/controls/OrbitControls.js +25 -0
- package/dist/controls/OrbitControls.js.map +1 -0
- package/dist/controls/Picking.d.ts +41 -0
- package/dist/controls/Picking.d.ts.map +1 -0
- package/dist/controls/Picking.js +149 -0
- package/dist/controls/Picking.js.map +1 -0
- package/dist/controls/PickingAnnotations.d.ts +134 -0
- package/dist/controls/PickingAnnotations.d.ts.map +1 -0
- package/dist/controls/PickingAnnotations.js +221 -0
- package/dist/controls/PickingAnnotations.js.map +1 -0
- package/dist/controls/PointerLockControls.d.ts +9 -0
- package/dist/controls/PointerLockControls.d.ts.map +1 -0
- package/dist/controls/PointerLockControls.js +14 -0
- package/dist/controls/PointerLockControls.js.map +1 -0
- package/dist/controls/SelectionManager.d.ts +8 -0
- package/dist/controls/SelectionManager.d.ts.map +1 -0
- package/dist/controls/SelectionManager.js +15 -0
- package/dist/controls/SelectionManager.js.map +1 -0
- package/dist/controls/TrackballControls.d.ts +18 -0
- package/dist/controls/TrackballControls.d.ts.map +1 -0
- package/dist/controls/TrackballControls.js +99 -0
- package/dist/controls/TrackballControls.js.map +1 -0
- package/dist/controls/TransformControls.d.ts +11 -0
- package/dist/controls/TransformControls.d.ts.map +1 -0
- package/dist/controls/TransformControls.js +19 -0
- package/dist/controls/TransformControls.js.map +1 -0
- package/dist/controls/index.d.ts +21 -0
- package/dist/controls/index.d.ts.map +1 -0
- package/dist/controls/index.js +15 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/core/Diagnostics.d.ts +25 -0
- package/dist/core/Diagnostics.d.ts.map +1 -0
- package/dist/core/Diagnostics.js +60 -0
- package/dist/core/Diagnostics.js.map +1 -0
- package/dist/core/Disposable.d.ts +12 -0
- package/dist/core/Disposable.d.ts.map +1 -0
- package/dist/core/Disposable.js +37 -0
- package/dist/core/Disposable.js.map +1 -0
- package/dist/core/Engine.d.ts +46 -0
- package/dist/core/Engine.d.ts.map +1 -0
- package/dist/core/Engine.js +130 -0
- package/dist/core/Engine.js.map +1 -0
- package/dist/core/EngineConfig.d.ts +18 -0
- package/dist/core/EngineConfig.d.ts.map +1 -0
- package/dist/core/EngineConfig.js +23 -0
- package/dist/core/EngineConfig.js.map +1 -0
- package/dist/core/EngineLoop.d.ts +33 -0
- package/dist/core/EngineLoop.d.ts.map +1 -0
- package/dist/core/EngineLoop.js +63 -0
- package/dist/core/EngineLoop.js.map +1 -0
- package/dist/core/Errors.d.ts +14 -0
- package/dist/core/Errors.d.ts.map +1 -0
- package/dist/core/Errors.js +24 -0
- package/dist/core/Errors.js.map +1 -0
- package/dist/core/EventBus.d.ts +18 -0
- package/dist/core/EventBus.d.ts.map +1 -0
- package/dist/core/EventBus.js +45 -0
- package/dist/core/EventBus.js.map +1 -0
- package/dist/core/FixedStepAccumulator.d.ts +15 -0
- package/dist/core/FixedStepAccumulator.d.ts.map +1 -0
- package/dist/core/FixedStepAccumulator.js +34 -0
- package/dist/core/FixedStepAccumulator.js.map +1 -0
- package/dist/core/Logger.d.ts +23 -0
- package/dist/core/Logger.d.ts.map +1 -0
- package/dist/core/Logger.js +53 -0
- package/dist/core/Logger.js.map +1 -0
- package/dist/core/ResourceScope.d.ts +18 -0
- package/dist/core/ResourceScope.d.ts.map +1 -0
- package/dist/core/ResourceScope.js +53 -0
- package/dist/core/ResourceScope.js.map +1 -0
- package/dist/core/Scheduler.d.ts +31 -0
- package/dist/core/Scheduler.d.ts.map +1 -0
- package/dist/core/Scheduler.js +77 -0
- package/dist/core/Scheduler.js.map +1 -0
- package/dist/core/TaskQueue.d.ts +13 -0
- package/dist/core/TaskQueue.d.ts.map +1 -0
- package/dist/core/TaskQueue.js +42 -0
- package/dist/core/TaskQueue.js.map +1 -0
- package/dist/core/Time.d.ts +24 -0
- package/dist/core/Time.d.ts.map +1 -0
- package/dist/core/Time.js +45 -0
- package/dist/core/Time.js.map +1 -0
- package/dist/core/VersionedSerialization.d.ts +96 -0
- package/dist/core/VersionedSerialization.d.ts.map +1 -0
- package/dist/core/VersionedSerialization.js +278 -0
- package/dist/core/VersionedSerialization.js.map +1 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -0
- package/dist/create-aura3d/cli.d.ts +3 -0
- package/dist/create-aura3d/cli.d.ts.map +1 -0
- package/dist/create-aura3d/cli.js +27 -0
- package/dist/create-aura3d/cli.js.map +1 -0
- package/dist/create-aura3d/index.d.ts +16 -0
- package/dist/create-aura3d/index.d.ts.map +1 -0
- package/dist/create-aura3d/index.js +63 -0
- package/dist/create-aura3d/index.js.map +1 -0
- package/dist/debug/AnimationInspector.d.ts +25 -0
- package/dist/debug/AnimationInspector.d.ts.map +1 -0
- package/dist/debug/AnimationInspector.js +46 -0
- package/dist/debug/AnimationInspector.js.map +1 -0
- package/dist/debug/ChromeTraceExporter.d.ts +35 -0
- package/dist/debug/ChromeTraceExporter.d.ts.map +1 -0
- package/dist/debug/ChromeTraceExporter.js +110 -0
- package/dist/debug/ChromeTraceExporter.js.map +1 -0
- package/dist/debug/DebugLineCanvasRenderer.d.ts +24 -0
- package/dist/debug/DebugLineCanvasRenderer.d.ts.map +1 -0
- package/dist/debug/DebugLineCanvasRenderer.js +58 -0
- package/dist/debug/DebugLineCanvasRenderer.js.map +1 -0
- package/dist/debug/DebugOverlay.d.ts +18 -0
- package/dist/debug/DebugOverlay.d.ts.map +1 -0
- package/dist/debug/DebugOverlay.js +19 -0
- package/dist/debug/DebugOverlay.js.map +1 -0
- package/dist/debug/DrawCallTracker.d.ts +22 -0
- package/dist/debug/DrawCallTracker.d.ts.map +1 -0
- package/dist/debug/DrawCallTracker.js +28 -0
- package/dist/debug/DrawCallTracker.js.map +1 -0
- package/dist/debug/ECSInspector.d.ts +16 -0
- package/dist/debug/ECSInspector.d.ts.map +1 -0
- package/dist/debug/ECSInspector.js +12 -0
- package/dist/debug/ECSInspector.js.map +1 -0
- package/dist/debug/GPUProfiler.d.ts +22 -0
- package/dist/debug/GPUProfiler.d.ts.map +1 -0
- package/dist/debug/GPUProfiler.js +32 -0
- package/dist/debug/GPUProfiler.js.map +1 -0
- package/dist/debug/MaterialDiagnostics.d.ts +17 -0
- package/dist/debug/MaterialDiagnostics.d.ts.map +1 -0
- package/dist/debug/MaterialDiagnostics.js +43 -0
- package/dist/debug/MaterialDiagnostics.js.map +1 -0
- package/dist/debug/PhysicsDebugAdapter.d.ts +29 -0
- package/dist/debug/PhysicsDebugAdapter.d.ts.map +1 -0
- package/dist/debug/PhysicsDebugAdapter.js +57 -0
- package/dist/debug/PhysicsDebugAdapter.js.map +1 -0
- package/dist/debug/Profiler.d.ts +24 -0
- package/dist/debug/Profiler.d.ts.map +1 -0
- package/dist/debug/Profiler.js +56 -0
- package/dist/debug/Profiler.js.map +1 -0
- package/dist/debug/RenderStateInspector.d.ts +19 -0
- package/dist/debug/RenderStateInspector.d.ts.map +1 -0
- package/dist/debug/RenderStateInspector.js +33 -0
- package/dist/debug/RenderStateInspector.js.map +1 -0
- package/dist/debug/ReportExporter.d.ts +12 -0
- package/dist/debug/ReportExporter.d.ts.map +1 -0
- package/dist/debug/ReportExporter.js +27 -0
- package/dist/debug/ReportExporter.js.map +1 -0
- package/dist/debug/ResourceTracker.d.ts +23 -0
- package/dist/debug/ResourceTracker.d.ts.map +1 -0
- package/dist/debug/ResourceTracker.js +41 -0
- package/dist/debug/ResourceTracker.js.map +1 -0
- package/dist/debug/SceneHelpers.d.ts +46 -0
- package/dist/debug/SceneHelpers.d.ts.map +1 -0
- package/dist/debug/SceneHelpers.js +137 -0
- package/dist/debug/SceneHelpers.js.map +1 -0
- package/dist/debug/ShaderDiagnostics.d.ts +20 -0
- package/dist/debug/ShaderDiagnostics.d.ts.map +1 -0
- package/dist/debug/ShaderDiagnostics.js +49 -0
- package/dist/debug/ShaderDiagnostics.js.map +1 -0
- package/dist/debug/index.d.ts +31 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +16 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/ecs/Archetype.d.ts +11 -0
- package/dist/ecs/Archetype.d.ts.map +1 -0
- package/dist/ecs/Archetype.js +19 -0
- package/dist/ecs/Archetype.js.map +1 -0
- package/dist/ecs/Bitset.d.ts +12 -0
- package/dist/ecs/Bitset.d.ts.map +1 -0
- package/dist/ecs/Bitset.js +43 -0
- package/dist/ecs/Bitset.js.map +1 -0
- package/dist/ecs/CommandBuffer.d.ts +16 -0
- package/dist/ecs/CommandBuffer.d.ts.map +1 -0
- package/dist/ecs/CommandBuffer.js +86 -0
- package/dist/ecs/CommandBuffer.js.map +1 -0
- package/dist/ecs/Component.d.ts +18 -0
- package/dist/ecs/Component.d.ts.map +1 -0
- package/dist/ecs/Component.js +7 -0
- package/dist/ecs/Component.js.map +1 -0
- package/dist/ecs/ComponentRegistry.d.ts +12 -0
- package/dist/ecs/ComponentRegistry.d.ts.map +1 -0
- package/dist/ecs/ComponentRegistry.js +36 -0
- package/dist/ecs/ComponentRegistry.js.map +1 -0
- package/dist/ecs/ComponentStore.d.ts +21 -0
- package/dist/ecs/ComponentStore.d.ts.map +1 -0
- package/dist/ecs/ComponentStore.js +66 -0
- package/dist/ecs/ComponentStore.js.map +1 -0
- package/dist/ecs/ECSProfiler.d.ts +12 -0
- package/dist/ecs/ECSProfiler.d.ts.map +1 -0
- package/dist/ecs/ECSProfiler.js +13 -0
- package/dist/ecs/ECSProfiler.js.map +1 -0
- package/dist/ecs/ECSSerializer.d.ts +18 -0
- package/dist/ecs/ECSSerializer.d.ts.map +1 -0
- package/dist/ecs/ECSSerializer.js +37 -0
- package/dist/ecs/ECSSerializer.js.map +1 -0
- package/dist/ecs/Entity.d.ts +8 -0
- package/dist/ecs/Entity.d.ts.map +1 -0
- package/dist/ecs/Entity.js +14 -0
- package/dist/ecs/Entity.js.map +1 -0
- package/dist/ecs/EntityManager.d.ts +12 -0
- package/dist/ecs/EntityManager.d.ts.map +1 -0
- package/dist/ecs/EntityManager.js +33 -0
- package/dist/ecs/EntityManager.js.map +1 -0
- package/dist/ecs/Query.d.ts +24 -0
- package/dist/ecs/Query.d.ts.map +1 -0
- package/dist/ecs/Query.js +47 -0
- package/dist/ecs/Query.js.map +1 -0
- package/dist/ecs/SparseSet.d.ts +14 -0
- package/dist/ecs/SparseSet.d.ts.map +1 -0
- package/dist/ecs/SparseSet.js +50 -0
- package/dist/ecs/SparseSet.js.map +1 -0
- package/dist/ecs/System.d.ts +18 -0
- package/dist/ecs/System.d.ts.map +1 -0
- package/dist/ecs/System.js +2 -0
- package/dist/ecs/System.js.map +1 -0
- package/dist/ecs/SystemScheduler.d.ts +10 -0
- package/dist/ecs/SystemScheduler.d.ts.map +1 -0
- package/dist/ecs/SystemScheduler.js +79 -0
- package/dist/ecs/SystemScheduler.js.map +1 -0
- package/dist/ecs/World.d.ts +27 -0
- package/dist/ecs/World.d.ts.map +1 -0
- package/dist/ecs/World.js +68 -0
- package/dist/ecs/World.js.map +1 -0
- package/dist/ecs/components/ActiveComponent.d.ts +16 -0
- package/dist/ecs/components/ActiveComponent.d.ts.map +1 -0
- package/dist/ecs/components/ActiveComponent.js +46 -0
- package/dist/ecs/components/ActiveComponent.js.map +1 -0
- package/dist/ecs/components/HierarchyComponent.d.ts +34 -0
- package/dist/ecs/components/HierarchyComponent.d.ts.map +1 -0
- package/dist/ecs/components/HierarchyComponent.js +103 -0
- package/dist/ecs/components/HierarchyComponent.js.map +1 -0
- package/dist/ecs/components/NameComponent.d.ts +5 -0
- package/dist/ecs/components/NameComponent.d.ts.map +1 -0
- package/dist/ecs/components/NameComponent.js +10 -0
- package/dist/ecs/components/NameComponent.js.map +1 -0
- package/dist/ecs/components/TagComponent.d.ts +5 -0
- package/dist/ecs/components/TagComponent.d.ts.map +1 -0
- package/dist/ecs/components/TagComponent.js +10 -0
- package/dist/ecs/components/TagComponent.js.map +1 -0
- package/dist/ecs/components/TransformComponent.d.ts +18 -0
- package/dist/ecs/components/TransformComponent.d.ts.map +1 -0
- package/dist/ecs/components/TransformComponent.js +27 -0
- package/dist/ecs/components/TransformComponent.js.map +1 -0
- package/dist/ecs/index.d.ts +22 -0
- package/dist/ecs/index.d.ts.map +1 -0
- package/dist/ecs/index.js +22 -0
- package/dist/ecs/index.js.map +1 -0
- package/dist/ecs/systems/ActiveSystem.d.ts +16 -0
- package/dist/ecs/systems/ActiveSystem.d.ts.map +1 -0
- package/dist/ecs/systems/ActiveSystem.js +61 -0
- package/dist/ecs/systems/ActiveSystem.js.map +1 -0
- package/dist/ecs/systems/HierarchySystem.d.ts +25 -0
- package/dist/ecs/systems/HierarchySystem.d.ts.map +1 -0
- package/dist/ecs/systems/HierarchySystem.js +185 -0
- package/dist/ecs/systems/HierarchySystem.js.map +1 -0
- package/dist/ecs/systems/index.d.ts +3 -0
- package/dist/ecs/systems/index.d.ts.map +1 -0
- package/dist/ecs/systems/index.js +3 -0
- package/dist/ecs/systems/index.js.map +1 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +2 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor-runtime/Command.d.ts +11 -0
- package/dist/editor-runtime/Command.d.ts.map +1 -0
- package/dist/editor-runtime/Command.js +2 -0
- package/dist/editor-runtime/Command.js.map +1 -0
- package/dist/editor-runtime/CommandHistory.d.ts +20 -0
- package/dist/editor-runtime/CommandHistory.d.ts.map +1 -0
- package/dist/editor-runtime/CommandHistory.js +124 -0
- package/dist/editor-runtime/CommandHistory.js.map +1 -0
- package/dist/editor-runtime/DiagnosticsOverlayModel.d.ts +30 -0
- package/dist/editor-runtime/DiagnosticsOverlayModel.d.ts.map +1 -0
- package/dist/editor-runtime/DiagnosticsOverlayModel.js +57 -0
- package/dist/editor-runtime/DiagnosticsOverlayModel.js.map +1 -0
- package/dist/editor-runtime/EditorPluginHost.d.ts +46 -0
- package/dist/editor-runtime/EditorPluginHost.d.ts.map +1 -0
- package/dist/editor-runtime/EditorPluginHost.js +57 -0
- package/dist/editor-runtime/EditorPluginHost.js.map +1 -0
- package/dist/editor-runtime/EditorRuntime.d.ts +95 -0
- package/dist/editor-runtime/EditorRuntime.d.ts.map +1 -0
- package/dist/editor-runtime/EditorRuntime.js +277 -0
- package/dist/editor-runtime/EditorRuntime.js.map +1 -0
- package/dist/editor-runtime/EditorStateModel.d.ts +93 -0
- package/dist/editor-runtime/EditorStateModel.d.ts.map +1 -0
- package/dist/editor-runtime/EditorStateModel.js +251 -0
- package/dist/editor-runtime/EditorStateModel.js.map +1 -0
- package/dist/editor-runtime/Gizmo.d.ts +43 -0
- package/dist/editor-runtime/Gizmo.d.ts.map +1 -0
- package/dist/editor-runtime/Gizmo.js +60 -0
- package/dist/editor-runtime/Gizmo.js.map +1 -0
- package/dist/editor-runtime/HierarchyModel.d.ts +21 -0
- package/dist/editor-runtime/HierarchyModel.d.ts.map +1 -0
- package/dist/editor-runtime/HierarchyModel.js +32 -0
- package/dist/editor-runtime/HierarchyModel.js.map +1 -0
- package/dist/editor-runtime/InspectorModel.d.ts +16 -0
- package/dist/editor-runtime/InspectorModel.d.ts.map +1 -0
- package/dist/editor-runtime/InspectorModel.js +53 -0
- package/dist/editor-runtime/InspectorModel.js.map +1 -0
- package/dist/editor-runtime/LocalizationAccessibilityFixtures.d.ts +70 -0
- package/dist/editor-runtime/LocalizationAccessibilityFixtures.d.ts.map +1 -0
- package/dist/editor-runtime/LocalizationAccessibilityFixtures.js +275 -0
- package/dist/editor-runtime/LocalizationAccessibilityFixtures.js.map +1 -0
- package/dist/editor-runtime/MaterialVariantWorkflow.d.ts +19 -0
- package/dist/editor-runtime/MaterialVariantWorkflow.d.ts.map +1 -0
- package/dist/editor-runtime/MaterialVariantWorkflow.js +82 -0
- package/dist/editor-runtime/MaterialVariantWorkflow.js.map +1 -0
- package/dist/editor-runtime/PickingService.d.ts +58 -0
- package/dist/editor-runtime/PickingService.d.ts.map +1 -0
- package/dist/editor-runtime/PickingService.js +119 -0
- package/dist/editor-runtime/PickingService.js.map +1 -0
- package/dist/editor-runtime/PlayModeBridge.d.ts +14 -0
- package/dist/editor-runtime/PlayModeBridge.d.ts.map +1 -0
- package/dist/editor-runtime/PlayModeBridge.js +23 -0
- package/dist/editor-runtime/PlayModeBridge.js.map +1 -0
- package/dist/editor-runtime/PrefabRegistry.d.ts +41 -0
- package/dist/editor-runtime/PrefabRegistry.d.ts.map +1 -0
- package/dist/editor-runtime/PrefabRegistry.js +119 -0
- package/dist/editor-runtime/PrefabRegistry.js.map +1 -0
- package/dist/editor-runtime/ProjectSerializer.d.ts +9 -0
- package/dist/editor-runtime/ProjectSerializer.d.ts.map +1 -0
- package/dist/editor-runtime/ProjectSerializer.js +14 -0
- package/dist/editor-runtime/ProjectSerializer.js.map +1 -0
- package/dist/editor-runtime/RotateGizmo.d.ts +5 -0
- package/dist/editor-runtime/RotateGizmo.d.ts.map +1 -0
- package/dist/editor-runtime/RotateGizmo.js +37 -0
- package/dist/editor-runtime/RotateGizmo.js.map +1 -0
- package/dist/editor-runtime/ScaleGizmo.d.ts +5 -0
- package/dist/editor-runtime/ScaleGizmo.d.ts.map +1 -0
- package/dist/editor-runtime/ScaleGizmo.js +42 -0
- package/dist/editor-runtime/ScaleGizmo.js.map +1 -0
- package/dist/editor-runtime/Selection.d.ts +20 -0
- package/dist/editor-runtime/Selection.d.ts.map +1 -0
- package/dist/editor-runtime/Selection.js +46 -0
- package/dist/editor-runtime/Selection.js.map +1 -0
- package/dist/editor-runtime/ShaderGraphModel.d.ts +69 -0
- package/dist/editor-runtime/ShaderGraphModel.d.ts.map +1 -0
- package/dist/editor-runtime/ShaderGraphModel.js +172 -0
- package/dist/editor-runtime/ShaderGraphModel.js.map +1 -0
- package/dist/editor-runtime/StaticExportRuntime.d.ts +13 -0
- package/dist/editor-runtime/StaticExportRuntime.d.ts.map +1 -0
- package/dist/editor-runtime/StaticExportRuntime.js +307 -0
- package/dist/editor-runtime/StaticExportRuntime.js.map +1 -0
- package/dist/editor-runtime/TimelineModel.d.ts +157 -0
- package/dist/editor-runtime/TimelineModel.d.ts.map +1 -0
- package/dist/editor-runtime/TimelineModel.js +271 -0
- package/dist/editor-runtime/TimelineModel.js.map +1 -0
- package/dist/editor-runtime/TranslateGizmo.d.ts +5 -0
- package/dist/editor-runtime/TranslateGizmo.d.ts.map +1 -0
- package/dist/editor-runtime/TranslateGizmo.js +41 -0
- package/dist/editor-runtime/TranslateGizmo.js.map +1 -0
- package/dist/editor-runtime/commands/CreateNodeCommand.d.ts +14 -0
- package/dist/editor-runtime/commands/CreateNodeCommand.d.ts.map +1 -0
- package/dist/editor-runtime/commands/CreateNodeCommand.js +16 -0
- package/dist/editor-runtime/commands/CreateNodeCommand.js.map +1 -0
- package/dist/editor-runtime/commands/DeleteNodeCommand.d.ts +13 -0
- package/dist/editor-runtime/commands/DeleteNodeCommand.d.ts.map +1 -0
- package/dist/editor-runtime/commands/DeleteNodeCommand.js +55 -0
- package/dist/editor-runtime/commands/DeleteNodeCommand.js.map +1 -0
- package/dist/editor-runtime/commands/ReparentNodeCommand.d.ts +24 -0
- package/dist/editor-runtime/commands/ReparentNodeCommand.d.ts.map +1 -0
- package/dist/editor-runtime/commands/ReparentNodeCommand.js +39 -0
- package/dist/editor-runtime/commands/ReparentNodeCommand.js.map +1 -0
- package/dist/editor-runtime/commands/SetPropertyCommand.d.ts +14 -0
- package/dist/editor-runtime/commands/SetPropertyCommand.d.ts.map +1 -0
- package/dist/editor-runtime/commands/SetPropertyCommand.js +43 -0
- package/dist/editor-runtime/commands/SetPropertyCommand.js.map +1 -0
- package/dist/editor-runtime/commands/TransformCommand.d.ts +42 -0
- package/dist/editor-runtime/commands/TransformCommand.d.ts.map +1 -0
- package/dist/editor-runtime/commands/TransformCommand.js +72 -0
- package/dist/editor-runtime/commands/TransformCommand.js.map +1 -0
- package/dist/editor-runtime/index.d.ts +47 -0
- package/dist/editor-runtime/index.d.ts.map +1 -0
- package/dist/editor-runtime/index.js +28 -0
- package/dist/editor-runtime/index.js.map +1 -0
- package/dist/engine/A3DApp.d.ts +3 -0
- package/dist/engine/A3DApp.d.ts.map +1 -0
- package/dist/engine/A3DApp.js +2 -0
- package/dist/engine/A3DApp.js.map +1 -0
- package/dist/engine/A3DQualityPresets.d.ts +7 -0
- package/dist/engine/A3DQualityPresets.d.ts.map +1 -0
- package/dist/engine/A3DQualityPresets.js +9 -0
- package/dist/engine/A3DQualityPresets.js.map +1 -0
- package/dist/engine/advanced-runtime/A3DAppLifecycle.d.ts +26 -0
- package/dist/engine/advanced-runtime/A3DAppLifecycle.d.ts.map +1 -0
- package/dist/engine/advanced-runtime/A3DAppLifecycle.js +77 -0
- package/dist/engine/advanced-runtime/A3DAppLifecycle.js.map +1 -0
- package/dist/engine/advanced-runtime/A3DRenderer.d.ts +22 -0
- package/dist/engine/advanced-runtime/A3DRenderer.d.ts.map +1 -0
- package/dist/engine/advanced-runtime/A3DRenderer.js +85 -0
- package/dist/engine/advanced-runtime/A3DRenderer.js.map +1 -0
- package/dist/engine/advanced-runtime/A3DScene.d.ts +29 -0
- package/dist/engine/advanced-runtime/A3DScene.d.ts.map +1 -0
- package/dist/engine/advanced-runtime/A3DScene.js +83 -0
- package/dist/engine/advanced-runtime/A3DScene.js.map +1 -0
- package/dist/engine/advanced-runtime/index.d.ts +11 -0
- package/dist/engine/advanced-runtime/index.d.ts.map +1 -0
- package/dist/engine/advanced-runtime/index.js +6 -0
- package/dist/engine/advanced-runtime/index.js.map +1 -0
- package/dist/engine/agent-api/assets/humanoid-fixture.glb +0 -0
- package/dist/engine/agent-api/assets/player-fixture.glb +0 -0
- package/dist/engine/agent-api/humanoid-walk-runtime.d.ts +89 -0
- package/dist/engine/agent-api/humanoid-walk-runtime.d.ts.map +1 -0
- package/dist/engine/agent-api/humanoid-walk-runtime.js +287 -0
- package/dist/engine/agent-api/humanoid-walk-runtime.js.map +1 -0
- package/dist/engine/agent-api/index.d.ts +1592 -0
- package/dist/engine/agent-api/index.d.ts.map +1 -0
- package/dist/engine/agent-api/index.js +8493 -0
- package/dist/engine/agent-api/index.js.map +1 -0
- package/dist/engine/agent-api/particle-fountain-runtime.d.ts +91 -0
- package/dist/engine/agent-api/particle-fountain-runtime.d.ts.map +1 -0
- package/dist/engine/agent-api/particle-fountain-runtime.js +299 -0
- package/dist/engine/agent-api/particle-fountain-runtime.js.map +1 -0
- package/dist/engine/agent-api/product-viewer-runtime.d.ts +115 -0
- package/dist/engine/agent-api/product-viewer-runtime.d.ts.map +1 -0
- package/dist/engine/agent-api/product-viewer-runtime.js +338 -0
- package/dist/engine/agent-api/product-viewer-runtime.js.map +1 -0
- package/dist/engine/devtools/AuraAssetPanel.d.ts +9 -0
- package/dist/engine/devtools/AuraAssetPanel.d.ts.map +1 -0
- package/dist/engine/devtools/AuraAssetPanel.js +9 -0
- package/dist/engine/devtools/AuraAssetPanel.js.map +1 -0
- package/dist/engine/devtools/AuraDiagnosticsOverlay.d.ts +8 -0
- package/dist/engine/devtools/AuraDiagnosticsOverlay.d.ts.map +1 -0
- package/dist/engine/devtools/AuraDiagnosticsOverlay.js +42 -0
- package/dist/engine/devtools/AuraDiagnosticsOverlay.js.map +1 -0
- package/dist/engine/devtools/AuraPerformancePanel.d.ts +10 -0
- package/dist/engine/devtools/AuraPerformancePanel.d.ts.map +1 -0
- package/dist/engine/devtools/AuraPerformancePanel.js +10 -0
- package/dist/engine/devtools/AuraPerformancePanel.js.map +1 -0
- package/dist/engine/index.d.ts +91 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +136 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/production-runtime/index.d.ts +492 -0
- package/dist/engine/production-runtime/index.d.ts.map +1 -0
- package/dist/engine/production-runtime/index.js +1267 -0
- package/dist/engine/production-runtime/index.js.map +1 -0
- package/dist/engine/testing/routeHealth.d.ts +10 -0
- package/dist/engine/testing/routeHealth.d.ts.map +1 -0
- package/dist/engine/testing/routeHealth.js +16 -0
- package/dist/engine/testing/routeHealth.js.map +1 -0
- package/dist/engine/testing/screenshot.d.ts +4 -0
- package/dist/engine/testing/screenshot.d.ts.map +1 -0
- package/dist/engine/testing/screenshot.js +10 -0
- package/dist/engine/testing/screenshot.js.map +1 -0
- package/dist/engine/threejs-example-parity/FlagshipFoundation.d.ts +158 -0
- package/dist/engine/threejs-example-parity/FlagshipFoundation.d.ts.map +1 -0
- package/dist/engine/threejs-example-parity/FlagshipFoundation.js +332 -0
- package/dist/engine/threejs-example-parity/FlagshipFoundation.js.map +1 -0
- package/dist/engine/threejs-example-parity/index.d.ts +113 -0
- package/dist/engine/threejs-example-parity/index.d.ts.map +1 -0
- package/dist/engine/threejs-example-parity/index.js +737 -0
- package/dist/engine/threejs-example-parity/index.js.map +1 -0
- package/dist/environments/EnvironmentPreview.d.ts +13 -0
- package/dist/environments/EnvironmentPreview.d.ts.map +1 -0
- package/dist/environments/EnvironmentPreview.js +16 -0
- package/dist/environments/EnvironmentPreview.js.map +1 -0
- package/dist/environments/EnvironmentRegistry.d.ts +35 -0
- package/dist/environments/EnvironmentRegistry.d.ts.map +1 -0
- package/dist/environments/EnvironmentRegistry.js +39 -0
- package/dist/environments/EnvironmentRegistry.js.map +1 -0
- package/dist/environments/HDRIEnvironment.d.ts +38 -0
- package/dist/environments/HDRIEnvironment.d.ts.map +1 -0
- package/dist/environments/HDRIEnvironment.js +34 -0
- package/dist/environments/HDRIEnvironment.js.map +1 -0
- package/dist/environments/PMREMPreset.d.ts +14 -0
- package/dist/environments/PMREMPreset.d.ts.map +1 -0
- package/dist/environments/PMREMPreset.js +16 -0
- package/dist/environments/PMREMPreset.js.map +1 -0
- package/dist/environments/index.d.ts +11 -0
- package/dist/environments/index.d.ts.map +1 -0
- package/dist/environments/index.js +6 -0
- package/dist/environments/index.js.map +1 -0
- package/dist/environments/production-runtime/ProductionEnvironmentCorpus.d.ts +78 -0
- package/dist/environments/production-runtime/ProductionEnvironmentCorpus.d.ts.map +1 -0
- package/dist/environments/production-runtime/ProductionEnvironmentCorpus.js +67 -0
- package/dist/environments/production-runtime/ProductionEnvironmentCorpus.js.map +1 -0
- package/dist/environments/production-runtime/index.d.ts +3 -0
- package/dist/environments/production-runtime/index.d.ts.map +1 -0
- package/dist/environments/production-runtime/index.js +2 -0
- package/dist/environments/production-runtime/index.js.map +1 -0
- package/dist/environments/threejs-example-parity/index.d.ts +17 -0
- package/dist/environments/threejs-example-parity/index.d.ts.map +1 -0
- package/dist/environments/threejs-example-parity/index.js +49 -0
- package/dist/environments/threejs-example-parity/index.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/input/ActionMap.d.ts +44 -0
- package/dist/input/ActionMap.d.ts.map +1 -0
- package/dist/input/ActionMap.js +74 -0
- package/dist/input/ActionMap.js.map +1 -0
- package/dist/input/GamepadDevice.d.ts +17 -0
- package/dist/input/GamepadDevice.d.ts.map +1 -0
- package/dist/input/GamepadDevice.js +27 -0
- package/dist/input/GamepadDevice.js.map +1 -0
- package/dist/input/GamepadInput.d.ts +3 -0
- package/dist/input/GamepadInput.d.ts.map +1 -0
- package/dist/input/GamepadInput.js +2 -0
- package/dist/input/GamepadInput.js.map +1 -0
- package/dist/input/GestureControls.d.ts +3 -0
- package/dist/input/GestureControls.d.ts.map +1 -0
- package/dist/input/GestureControls.js +2 -0
- package/dist/input/GestureControls.js.map +1 -0
- package/dist/input/GestureHapticsFixtures.d.ts +57 -0
- package/dist/input/GestureHapticsFixtures.d.ts.map +1 -0
- package/dist/input/GestureHapticsFixtures.js +115 -0
- package/dist/input/GestureHapticsFixtures.js.map +1 -0
- package/dist/input/GestureRecognizer.d.ts +19 -0
- package/dist/input/GestureRecognizer.d.ts.map +1 -0
- package/dist/input/GestureRecognizer.js +32 -0
- package/dist/input/GestureRecognizer.js.map +1 -0
- package/dist/input/InputActionBindingFixtures.d.ts +44 -0
- package/dist/input/InputActionBindingFixtures.d.ts.map +1 -0
- package/dist/input/InputActionBindingFixtures.js +86 -0
- package/dist/input/InputActionBindingFixtures.js.map +1 -0
- package/dist/input/InputReplay.d.ts +97 -0
- package/dist/input/InputReplay.d.ts.map +1 -0
- package/dist/input/InputReplay.js +189 -0
- package/dist/input/InputReplay.js.map +1 -0
- package/dist/input/InputSnapshot.d.ts +44 -0
- package/dist/input/InputSnapshot.d.ts.map +1 -0
- package/dist/input/InputSnapshot.js +44 -0
- package/dist/input/InputSnapshot.js.map +1 -0
- package/dist/input/InputSystem.d.ts +24 -0
- package/dist/input/InputSystem.d.ts.map +1 -0
- package/dist/input/InputSystem.js +77 -0
- package/dist/input/InputSystem.js.map +1 -0
- package/dist/input/InteractionSystem.d.ts +42 -0
- package/dist/input/InteractionSystem.d.ts.map +1 -0
- package/dist/input/InteractionSystem.js +80 -0
- package/dist/input/InteractionSystem.js.map +1 -0
- package/dist/input/KeyboardDevice.d.ts +18 -0
- package/dist/input/KeyboardDevice.d.ts.map +1 -0
- package/dist/input/KeyboardDevice.js +22 -0
- package/dist/input/KeyboardDevice.js.map +1 -0
- package/dist/input/PickingRay.d.ts +10 -0
- package/dist/input/PickingRay.d.ts.map +1 -0
- package/dist/input/PickingRay.js +27 -0
- package/dist/input/PickingRay.js.map +1 -0
- package/dist/input/PointerDevice.d.ts +51 -0
- package/dist/input/PointerDevice.d.ts.map +1 -0
- package/dist/input/PointerDevice.js +75 -0
- package/dist/input/PointerDevice.js.map +1 -0
- package/dist/input/VirtualTouchControls.d.ts +57 -0
- package/dist/input/VirtualTouchControls.d.ts.map +1 -0
- package/dist/input/VirtualTouchControls.js +127 -0
- package/dist/input/VirtualTouchControls.js.map +1 -0
- package/dist/input/WebXRSessionController.d.ts +108 -0
- package/dist/input/WebXRSessionController.d.ts.map +1 -0
- package/dist/input/WebXRSessionController.js +143 -0
- package/dist/input/WebXRSessionController.js.map +1 -0
- package/dist/input/XRFixtures.d.ts +65 -0
- package/dist/input/XRFixtures.d.ts.map +1 -0
- package/dist/input/XRFixtures.js +136 -0
- package/dist/input/XRFixtures.js.map +1 -0
- package/dist/input/controls/CameraRig.d.ts +12 -0
- package/dist/input/controls/CameraRig.d.ts.map +1 -0
- package/dist/input/controls/CameraRig.js +32 -0
- package/dist/input/controls/CameraRig.js.map +1 -0
- package/dist/input/controls/ControlTypes.d.ts +17 -0
- package/dist/input/controls/ControlTypes.d.ts.map +1 -0
- package/dist/input/controls/ControlTypes.js +4 -0
- package/dist/input/controls/ControlTypes.js.map +1 -0
- package/dist/input/controls/EditorFlyControls.d.ts +20 -0
- package/dist/input/controls/EditorFlyControls.d.ts.map +1 -0
- package/dist/input/controls/EditorFlyControls.js +44 -0
- package/dist/input/controls/EditorFlyControls.js.map +1 -0
- package/dist/input/controls/FirstPersonControls.d.ts +22 -0
- package/dist/input/controls/FirstPersonControls.d.ts.map +1 -0
- package/dist/input/controls/FirstPersonControls.js +44 -0
- package/dist/input/controls/FirstPersonControls.js.map +1 -0
- package/dist/input/controls/OrbitControls.d.ts +49 -0
- package/dist/input/controls/OrbitControls.d.ts.map +1 -0
- package/dist/input/controls/OrbitControls.js +131 -0
- package/dist/input/controls/OrbitControls.js.map +1 -0
- package/dist/input/controls/PointerLockControls.d.ts +11 -0
- package/dist/input/controls/PointerLockControls.d.ts.map +1 -0
- package/dist/input/controls/PointerLockControls.js +19 -0
- package/dist/input/controls/PointerLockControls.js.map +1 -0
- package/dist/input/controls/SceneCameraAdapter.d.ts +10 -0
- package/dist/input/controls/SceneCameraAdapter.d.ts.map +1 -0
- package/dist/input/controls/SceneCameraAdapter.js +90 -0
- package/dist/input/controls/SceneCameraAdapter.js.map +1 -0
- package/dist/input/controls/ThirdPersonFollowControls.d.ts +20 -0
- package/dist/input/controls/ThirdPersonFollowControls.d.ts.map +1 -0
- package/dist/input/controls/ThirdPersonFollowControls.js +33 -0
- package/dist/input/controls/ThirdPersonFollowControls.js.map +1 -0
- package/dist/input/index.d.ts +47 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/index.js +25 -0
- package/dist/input/index.js.map +1 -0
- package/dist/materials/MaterialPreset.d.ts +30 -0
- package/dist/materials/MaterialPreset.d.ts.map +1 -0
- package/dist/materials/MaterialPreset.js +2 -0
- package/dist/materials/MaterialPreset.js.map +1 -0
- package/dist/materials/MaterialPresets.d.ts +3 -0
- package/dist/materials/MaterialPresets.d.ts.map +1 -0
- package/dist/materials/MaterialPresets.js +2 -0
- package/dist/materials/MaterialPresets.js.map +1 -0
- package/dist/materials/MaterialPreviewScene.d.ts +12 -0
- package/dist/materials/MaterialPreviewScene.d.ts.map +1 -0
- package/dist/materials/MaterialPreviewScene.js +20 -0
- package/dist/materials/MaterialPreviewScene.js.map +1 -0
- package/dist/materials/MaterialValidation.d.ts +14 -0
- package/dist/materials/MaterialValidation.d.ts.map +1 -0
- package/dist/materials/MaterialValidation.js +26 -0
- package/dist/materials/MaterialValidation.js.map +1 -0
- package/dist/materials/NodeMaterial.d.ts +11 -0
- package/dist/materials/NodeMaterial.d.ts.map +1 -0
- package/dist/materials/NodeMaterial.js +15 -0
- package/dist/materials/NodeMaterial.js.map +1 -0
- package/dist/materials/PBRMaterialLibrary.d.ts +7 -0
- package/dist/materials/PBRMaterialLibrary.d.ts.map +1 -0
- package/dist/materials/PBRMaterialLibrary.js +89 -0
- package/dist/materials/PBRMaterialLibrary.js.map +1 -0
- package/dist/materials/TextureSet.d.ts +17 -0
- package/dist/materials/TextureSet.d.ts.map +1 -0
- package/dist/materials/TextureSet.js +40 -0
- package/dist/materials/TextureSet.js.map +1 -0
- package/dist/materials/browser-index.d.ts +9 -0
- package/dist/materials/browser-index.d.ts.map +1 -0
- package/dist/materials/browser-index.js +6 -0
- package/dist/materials/browser-index.js.map +1 -0
- package/dist/materials/index.d.ts +11 -0
- package/dist/materials/index.d.ts.map +1 -0
- package/dist/materials/index.js +7 -0
- package/dist/materials/index.js.map +1 -0
- package/dist/math/Box3.d.ts +19 -0
- package/dist/math/Box3.d.ts.map +1 -0
- package/dist/math/Box3.js +61 -0
- package/dist/math/Box3.js.map +1 -0
- package/dist/math/Color.d.ts +15 -0
- package/dist/math/Color.d.ts.map +1 -0
- package/dist/math/Color.js +41 -0
- package/dist/math/Color.js.map +1 -0
- package/dist/math/Curves.d.ts +22 -0
- package/dist/math/Curves.d.ts.map +1 -0
- package/dist/math/Curves.js +74 -0
- package/dist/math/Curves.js.map +1 -0
- package/dist/math/Easing.d.ts +7 -0
- package/dist/math/Easing.d.ts.map +1 -0
- package/dist/math/Easing.js +24 -0
- package/dist/math/Easing.js.map +1 -0
- package/dist/math/Euler.d.ts +12 -0
- package/dist/math/Euler.d.ts.map +1 -0
- package/dist/math/Euler.js +30 -0
- package/dist/math/Euler.js.map +1 -0
- package/dist/math/Frustum.d.ts +14 -0
- package/dist/math/Frustum.d.ts.map +1 -0
- package/dist/math/Frustum.js +40 -0
- package/dist/math/Frustum.js.map +1 -0
- package/dist/math/Interpolation.d.ts +11 -0
- package/dist/math/Interpolation.d.ts.map +1 -0
- package/dist/math/Interpolation.js +30 -0
- package/dist/math/Interpolation.js.map +1 -0
- package/dist/math/Matrix3.d.ts +9 -0
- package/dist/math/Matrix3.d.ts.map +1 -0
- package/dist/math/Matrix3.js +51 -0
- package/dist/math/Matrix3.js.map +1 -0
- package/dist/math/Matrix4.d.ts +45 -0
- package/dist/math/Matrix4.d.ts.map +1 -0
- package/dist/math/Matrix4.js +204 -0
- package/dist/math/Matrix4.js.map +1 -0
- package/dist/math/Plane.d.ts +11 -0
- package/dist/math/Plane.d.ts.map +1 -0
- package/dist/math/Plane.js +31 -0
- package/dist/math/Plane.js.map +1 -0
- package/dist/math/Quaternion.d.ts +25 -0
- package/dist/math/Quaternion.d.ts.map +1 -0
- package/dist/math/Quaternion.js +121 -0
- package/dist/math/Quaternion.js.map +1 -0
- package/dist/math/Random.d.ts +9 -0
- package/dist/math/Random.d.ts.map +1 -0
- package/dist/math/Random.js +30 -0
- package/dist/math/Random.js.map +1 -0
- package/dist/math/Ray.d.ts +14 -0
- package/dist/math/Ray.d.ts.map +1 -0
- package/dist/math/Ray.js +67 -0
- package/dist/math/Ray.js.map +1 -0
- package/dist/math/Sphere.d.ts +9 -0
- package/dist/math/Sphere.d.ts.map +1 -0
- package/dist/math/Sphere.js +18 -0
- package/dist/math/Sphere.js.map +1 -0
- package/dist/math/Transform.d.ts +14 -0
- package/dist/math/Transform.d.ts.map +1 -0
- package/dist/math/Transform.js +28 -0
- package/dist/math/Transform.js.map +1 -0
- package/dist/math/Vector2.d.ts +22 -0
- package/dist/math/Vector2.d.ts.map +1 -0
- package/dist/math/Vector2.js +54 -0
- package/dist/math/Vector2.js.map +1 -0
- package/dist/math/Vector3.d.ts +34 -0
- package/dist/math/Vector3.d.ts.map +1 -0
- package/dist/math/Vector3.js +77 -0
- package/dist/math/Vector3.js.map +1 -0
- package/dist/math/Vector4.d.ts +19 -0
- package/dist/math/Vector4.d.ts.map +1 -0
- package/dist/math/Vector4.js +43 -0
- package/dist/math/Vector4.js.map +1 -0
- package/dist/math/index.d.ts +19 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/math/index.js +19 -0
- package/dist/math/index.js.map +1 -0
- package/dist/physics/CharacterController.d.ts +52 -0
- package/dist/physics/CharacterController.d.ts.map +1 -0
- package/dist/physics/CharacterController.js +146 -0
- package/dist/physics/CharacterController.js.map +1 -0
- package/dist/physics/ClothFixtures.d.ts +87 -0
- package/dist/physics/ClothFixtures.d.ts.map +1 -0
- package/dist/physics/ClothFixtures.js +264 -0
- package/dist/physics/ClothFixtures.js.map +1 -0
- package/dist/physics/Collider.d.ts +27 -0
- package/dist/physics/Collider.d.ts.map +1 -0
- package/dist/physics/Collider.js +45 -0
- package/dist/physics/Collider.js.map +1 -0
- package/dist/physics/CollisionEvents.d.ts +26 -0
- package/dist/physics/CollisionEvents.d.ts.map +1 -0
- package/dist/physics/CollisionEvents.js +46 -0
- package/dist/physics/CollisionEvents.js.map +1 -0
- package/dist/physics/Constraint.d.ts +31 -0
- package/dist/physics/Constraint.d.ts.map +1 -0
- package/dist/physics/Constraint.js +103 -0
- package/dist/physics/Constraint.js.map +1 -0
- package/dist/physics/Constraints.d.ts +2 -0
- package/dist/physics/Constraints.d.ts.map +1 -0
- package/dist/physics/Constraints.js +2 -0
- package/dist/physics/Constraints.js.map +1 -0
- package/dist/physics/Crowd.d.ts +64 -0
- package/dist/physics/Crowd.d.ts.map +1 -0
- package/dist/physics/Crowd.js +209 -0
- package/dist/physics/Crowd.js.map +1 -0
- package/dist/physics/ECSPhysicsBridge.d.ts +17 -0
- package/dist/physics/ECSPhysicsBridge.d.ts.map +1 -0
- package/dist/physics/ECSPhysicsBridge.js +37 -0
- package/dist/physics/ECSPhysicsBridge.js.map +1 -0
- package/dist/physics/FireSmokeFixtures.d.ts +103 -0
- package/dist/physics/FireSmokeFixtures.d.ts.map +1 -0
- package/dist/physics/FireSmokeFixtures.js +271 -0
- package/dist/physics/FireSmokeFixtures.js.map +1 -0
- package/dist/physics/FluidFixtures.d.ts +75 -0
- package/dist/physics/FluidFixtures.d.ts.map +1 -0
- package/dist/physics/FluidFixtures.js +219 -0
- package/dist/physics/FluidFixtures.js.map +1 -0
- package/dist/physics/FractureFixtures.d.ts +68 -0
- package/dist/physics/FractureFixtures.d.ts.map +1 -0
- package/dist/physics/FractureFixtures.js +199 -0
- package/dist/physics/FractureFixtures.js.map +1 -0
- package/dist/physics/Navigation.d.ts +67 -0
- package/dist/physics/Navigation.d.ts.map +1 -0
- package/dist/physics/Navigation.js +261 -0
- package/dist/physics/Navigation.js.map +1 -0
- package/dist/physics/PhysicsDebugDraw.d.ts +11 -0
- package/dist/physics/PhysicsDebugDraw.d.ts.map +1 -0
- package/dist/physics/PhysicsDebugDraw.js +64 -0
- package/dist/physics/PhysicsDebugDraw.js.map +1 -0
- package/dist/physics/PhysicsSandboxFixtures.d.ts +53 -0
- package/dist/physics/PhysicsSandboxFixtures.d.ts.map +1 -0
- package/dist/physics/PhysicsSandboxFixtures.js +280 -0
- package/dist/physics/PhysicsSandboxFixtures.js.map +1 -0
- package/dist/physics/PhysicsStepper.d.ts +15 -0
- package/dist/physics/PhysicsStepper.d.ts.map +1 -0
- package/dist/physics/PhysicsStepper.js +37 -0
- package/dist/physics/PhysicsStepper.js.map +1 -0
- package/dist/physics/PhysicsWorld.d.ts +101 -0
- package/dist/physics/PhysicsWorld.d.ts.map +1 -0
- package/dist/physics/PhysicsWorld.js +868 -0
- package/dist/physics/PhysicsWorld.js.map +1 -0
- package/dist/physics/PlatformerFixtures.d.ts +70 -0
- package/dist/physics/PlatformerFixtures.d.ts.map +1 -0
- package/dist/physics/PlatformerFixtures.js +120 -0
- package/dist/physics/PlatformerFixtures.js.map +1 -0
- package/dist/physics/Raycast.d.ts +23 -0
- package/dist/physics/Raycast.d.ts.map +1 -0
- package/dist/physics/Raycast.js +271 -0
- package/dist/physics/Raycast.js.map +1 -0
- package/dist/physics/RigidBody.d.ts +69 -0
- package/dist/physics/RigidBody.d.ts.map +1 -0
- package/dist/physics/RigidBody.js +255 -0
- package/dist/physics/RigidBody.js.map +1 -0
- package/dist/physics/ScenePhysicsBridge.d.ts +42 -0
- package/dist/physics/ScenePhysicsBridge.d.ts.map +1 -0
- package/dist/physics/ScenePhysicsBridge.js +168 -0
- package/dist/physics/ScenePhysicsBridge.js.map +1 -0
- package/dist/physics/Shape.d.ts +50 -0
- package/dist/physics/Shape.d.ts.map +1 -0
- package/dist/physics/Shape.js +128 -0
- package/dist/physics/Shape.js.map +1 -0
- package/dist/physics/SoftBodyFixtures.d.ts +70 -0
- package/dist/physics/SoftBodyFixtures.d.ts.map +1 -0
- package/dist/physics/SoftBodyFixtures.js +272 -0
- package/dist/physics/SoftBodyFixtures.js.map +1 -0
- package/dist/physics/Steering.d.ts +161 -0
- package/dist/physics/Steering.d.ts.map +1 -0
- package/dist/physics/Steering.js +347 -0
- package/dist/physics/Steering.js.map +1 -0
- package/dist/physics/VehicleDynamics.d.ts +152 -0
- package/dist/physics/VehicleDynamics.d.ts.map +1 -0
- package/dist/physics/VehicleDynamics.js +335 -0
- package/dist/physics/VehicleDynamics.js.map +1 -0
- package/dist/physics/index.d.ts +25 -0
- package/dist/physics/index.d.ts.map +1 -0
- package/dist/physics/index.js +25 -0
- package/dist/physics/index.js.map +1 -0
- package/dist/product-studio/ProductAsset.d.ts +2 -0
- package/dist/product-studio/ProductAsset.d.ts.map +1 -0
- package/dist/product-studio/ProductAsset.js +2 -0
- package/dist/product-studio/ProductAsset.js.map +1 -0
- package/dist/product-studio/ProductAssetLoader.d.ts +3 -0
- package/dist/product-studio/ProductAssetLoader.d.ts.map +1 -0
- package/dist/product-studio/ProductAssetLoader.js +77 -0
- package/dist/product-studio/ProductAssetLoader.js.map +1 -0
- package/dist/product-studio/ProductCamera.d.ts +4 -0
- package/dist/product-studio/ProductCamera.d.ts.map +1 -0
- package/dist/product-studio/ProductCamera.js +45 -0
- package/dist/product-studio/ProductCamera.js.map +1 -0
- package/dist/product-studio/ProductDiagnostics.d.ts +4 -0
- package/dist/product-studio/ProductDiagnostics.d.ts.map +1 -0
- package/dist/product-studio/ProductDiagnostics.js +21 -0
- package/dist/product-studio/ProductDiagnostics.js.map +1 -0
- package/dist/product-studio/ProductExport.d.ts +4 -0
- package/dist/product-studio/ProductExport.d.ts.map +1 -0
- package/dist/product-studio/ProductExport.js +40 -0
- package/dist/product-studio/ProductExport.js.map +1 -0
- package/dist/product-studio/ProductFloor.d.ts +4 -0
- package/dist/product-studio/ProductFloor.d.ts.map +1 -0
- package/dist/product-studio/ProductFloor.js +15 -0
- package/dist/product-studio/ProductFloor.js.map +1 -0
- package/dist/product-studio/ProductLighting.d.ts +3 -0
- package/dist/product-studio/ProductLighting.d.ts.map +1 -0
- package/dist/product-studio/ProductLighting.js +42 -0
- package/dist/product-studio/ProductLighting.js.map +1 -0
- package/dist/product-studio/ProductMaterials.d.ts +5 -0
- package/dist/product-studio/ProductMaterials.d.ts.map +1 -0
- package/dist/product-studio/ProductMaterials.js +41 -0
- package/dist/product-studio/ProductMaterials.js.map +1 -0
- package/dist/product-studio/ProductRenderScene.d.ts +4 -0
- package/dist/product-studio/ProductRenderScene.d.ts.map +1 -0
- package/dist/product-studio/ProductRenderScene.js +46 -0
- package/dist/product-studio/ProductRenderScene.js.map +1 -0
- package/dist/product-studio/ProductShowcaseLayout.d.ts +32 -0
- package/dist/product-studio/ProductShowcaseLayout.d.ts.map +1 -0
- package/dist/product-studio/ProductShowcaseLayout.js +54 -0
- package/dist/product-studio/ProductShowcaseLayout.js.map +1 -0
- package/dist/product-studio/ProductStudio.d.ts +3 -0
- package/dist/product-studio/ProductStudio.d.ts.map +1 -0
- package/dist/product-studio/ProductStudio.js +51 -0
- package/dist/product-studio/ProductStudio.js.map +1 -0
- package/dist/product-studio/ProductTypes.d.ts +133 -0
- package/dist/product-studio/ProductTypes.d.ts.map +1 -0
- package/dist/product-studio/ProductTypes.js +2 -0
- package/dist/product-studio/ProductTypes.js.map +1 -0
- package/dist/product-studio/index.d.ts +13 -0
- package/dist/product-studio/index.d.ts.map +1 -0
- package/dist/product-studio/index.js +11 -0
- package/dist/product-studio/index.js.map +1 -0
- package/dist/react/index.d.ts +44 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +116 -0
- package/dist/react/index.js.map +1 -0
- package/dist/rendering/ArchitecturalLightingFixtures.d.ts +40 -0
- package/dist/rendering/ArchitecturalLightingFixtures.d.ts.map +1 -0
- package/dist/rendering/ArchitecturalLightingFixtures.js +171 -0
- package/dist/rendering/ArchitecturalLightingFixtures.js.map +1 -0
- package/dist/rendering/ArchitecturalMaterialCatalog.d.ts +30 -0
- package/dist/rendering/ArchitecturalMaterialCatalog.d.ts.map +1 -0
- package/dist/rendering/ArchitecturalMaterialCatalog.js +90 -0
- package/dist/rendering/ArchitecturalMaterialCatalog.js.map +1 -0
- package/dist/rendering/ArchitecturalMeasurementFixtures.d.ts +30 -0
- package/dist/rendering/ArchitecturalMeasurementFixtures.d.ts.map +1 -0
- package/dist/rendering/ArchitecturalMeasurementFixtures.js +115 -0
- package/dist/rendering/ArchitecturalMeasurementFixtures.js.map +1 -0
- package/dist/rendering/BRDFLut.d.ts +13 -0
- package/dist/rendering/BRDFLut.d.ts.map +1 -0
- package/dist/rendering/BRDFLut.js +34 -0
- package/dist/rendering/BRDFLut.js.map +1 -0
- package/dist/rendering/CameraFraming.d.ts +31 -0
- package/dist/rendering/CameraFraming.d.ts.map +1 -0
- package/dist/rendering/CameraFraming.js +143 -0
- package/dist/rendering/CameraFraming.js.map +1 -0
- package/dist/rendering/CanonicalSceneFixtures.d.ts +13 -0
- package/dist/rendering/CanonicalSceneFixtures.d.ts.map +1 -0
- package/dist/rendering/CanonicalSceneFixtures.js +78 -0
- package/dist/rendering/CanonicalSceneFixtures.js.map +1 -0
- package/dist/rendering/CascadedShadowMaps.d.ts +121 -0
- package/dist/rendering/CascadedShadowMaps.d.ts.map +1 -0
- package/dist/rendering/CascadedShadowMaps.js +315 -0
- package/dist/rendering/CascadedShadowMaps.js.map +1 -0
- package/dist/rendering/ColorManagement.d.ts +33 -0
- package/dist/rendering/ColorManagement.d.ts.map +1 -0
- package/dist/rendering/ColorManagement.js +71 -0
- package/dist/rendering/ColorManagement.js.map +1 -0
- package/dist/rendering/CullingFixtures.d.ts +70 -0
- package/dist/rendering/CullingFixtures.d.ts.map +1 -0
- package/dist/rendering/CullingFixtures.js +191 -0
- package/dist/rendering/CullingFixtures.js.map +1 -0
- package/dist/rendering/DecalGeometry.d.ts +3 -0
- package/dist/rendering/DecalGeometry.d.ts.map +1 -0
- package/dist/rendering/DecalGeometry.js +2 -0
- package/dist/rendering/DecalGeometry.js.map +1 -0
- package/dist/rendering/DepthPass.d.ts +23 -0
- package/dist/rendering/DepthPass.d.ts.map +1 -0
- package/dist/rendering/DepthPass.js +99 -0
- package/dist/rendering/DepthPass.js.map +1 -0
- package/dist/rendering/EnvironmentBackgroundPass.d.ts +27 -0
- package/dist/rendering/EnvironmentBackgroundPass.d.ts.map +1 -0
- package/dist/rendering/EnvironmentBackgroundPass.js +167 -0
- package/dist/rendering/EnvironmentBackgroundPass.js.map +1 -0
- package/dist/rendering/EnvironmentBackgroundResources.d.ts +31 -0
- package/dist/rendering/EnvironmentBackgroundResources.d.ts.map +1 -0
- package/dist/rendering/EnvironmentBackgroundResources.js +237 -0
- package/dist/rendering/EnvironmentBackgroundResources.js.map +1 -0
- package/dist/rendering/EnvironmentLighting.d.ts +10 -0
- package/dist/rendering/EnvironmentLighting.d.ts.map +1 -0
- package/dist/rendering/EnvironmentLighting.js +64 -0
- package/dist/rendering/EnvironmentLighting.js.map +1 -0
- package/dist/rendering/EnvironmentMapResources.d.ts +98 -0
- package/dist/rendering/EnvironmentMapResources.d.ts.map +1 -0
- package/dist/rendering/EnvironmentMapResources.js +794 -0
- package/dist/rendering/EnvironmentMapResources.js.map +1 -0
- package/dist/rendering/EnvironmentPipeline.d.ts +21 -0
- package/dist/rendering/EnvironmentPipeline.d.ts.map +1 -0
- package/dist/rendering/EnvironmentPipeline.js +43 -0
- package/dist/rendering/EnvironmentPipeline.js.map +1 -0
- package/dist/rendering/EnvironmentPlatform.d.ts +185 -0
- package/dist/rendering/EnvironmentPlatform.d.ts.map +1 -0
- package/dist/rendering/EnvironmentPlatform.js +922 -0
- package/dist/rendering/EnvironmentPlatform.js.map +1 -0
- package/dist/rendering/EnvironmentPreset.d.ts +35 -0
- package/dist/rendering/EnvironmentPreset.d.ts.map +1 -0
- package/dist/rendering/EnvironmentPreset.js +96 -0
- package/dist/rendering/EnvironmentPreset.js.map +1 -0
- package/dist/rendering/Exposure.d.ts +19 -0
- package/dist/rendering/Exposure.d.ts.map +1 -0
- package/dist/rendering/Exposure.js +34 -0
- package/dist/rendering/Exposure.js.map +1 -0
- package/dist/rendering/ExternalParityRenderPreset.d.ts +149 -0
- package/dist/rendering/ExternalParityRenderPreset.d.ts.map +1 -0
- package/dist/rendering/ExternalParityRenderPreset.js +519 -0
- package/dist/rendering/ExternalParityRenderPreset.js.map +1 -0
- package/dist/rendering/ForwardPass.d.ts +122 -0
- package/dist/rendering/ForwardPass.d.ts.map +1 -0
- package/dist/rendering/ForwardPass.js +1352 -0
- package/dist/rendering/ForwardPass.js.map +1 -0
- package/dist/rendering/FrameVisualMetrics.d.ts +60 -0
- package/dist/rendering/FrameVisualMetrics.d.ts.map +1 -0
- package/dist/rendering/FrameVisualMetrics.js +146 -0
- package/dist/rendering/FrameVisualMetrics.js.map +1 -0
- package/dist/rendering/Geometry.d.ts +50 -0
- package/dist/rendering/Geometry.d.ts.map +1 -0
- package/dist/rendering/Geometry.js +385 -0
- package/dist/rendering/Geometry.js.map +1 -0
- package/dist/rendering/GeometryPrimitives.d.ts +3 -0
- package/dist/rendering/GeometryPrimitives.d.ts.map +1 -0
- package/dist/rendering/GeometryPrimitives.js +2 -0
- package/dist/rendering/GeometryPrimitives.js.map +1 -0
- package/dist/rendering/HDRRenderPipeline.d.ts +27 -0
- package/dist/rendering/HDRRenderPipeline.d.ts.map +1 -0
- package/dist/rendering/HDRRenderPipeline.js +67 -0
- package/dist/rendering/HDRRenderPipeline.js.map +1 -0
- package/dist/rendering/IBL.d.ts +37 -0
- package/dist/rendering/IBL.d.ts.map +1 -0
- package/dist/rendering/IBL.js +48 -0
- package/dist/rendering/IBL.js.map +1 -0
- package/dist/rendering/IndexBuffer.d.ts +15 -0
- package/dist/rendering/IndexBuffer.d.ts.map +1 -0
- package/dist/rendering/IndexBuffer.js +51 -0
- package/dist/rendering/IndexBuffer.js.map +1 -0
- package/dist/rendering/InstancedPBRMaterial.d.ts +33 -0
- package/dist/rendering/InstancedPBRMaterial.d.ts.map +1 -0
- package/dist/rendering/InstancedPBRMaterial.js +147 -0
- package/dist/rendering/InstancedPBRMaterial.js.map +1 -0
- package/dist/rendering/InstancedUnlitMaterial.d.ts +11 -0
- package/dist/rendering/InstancedUnlitMaterial.d.ts.map +1 -0
- package/dist/rendering/InstancedUnlitMaterial.js +50 -0
- package/dist/rendering/InstancedUnlitMaterial.js.map +1 -0
- package/dist/rendering/Instancing.d.ts +7 -0
- package/dist/rendering/Instancing.d.ts.map +1 -0
- package/dist/rendering/Instancing.js +14 -0
- package/dist/rendering/Instancing.js.map +1 -0
- package/dist/rendering/LightCollector.d.ts +24 -0
- package/dist/rendering/LightCollector.d.ts.map +1 -0
- package/dist/rendering/LightCollector.js +56 -0
- package/dist/rendering/LightCollector.js.map +1 -0
- package/dist/rendering/LightUniforms.d.ts +14 -0
- package/dist/rendering/LightUniforms.d.ts.map +1 -0
- package/dist/rendering/LightUniforms.js +37 -0
- package/dist/rendering/LightUniforms.js.map +1 -0
- package/dist/rendering/LightingDebug.d.ts +13 -0
- package/dist/rendering/LightingDebug.d.ts.map +1 -0
- package/dist/rendering/LightingDebug.js +69 -0
- package/dist/rendering/LightingDebug.js.map +1 -0
- package/dist/rendering/LightingDefaults.d.ts +13 -0
- package/dist/rendering/LightingDefaults.d.ts.map +1 -0
- package/dist/rendering/LightingDefaults.js +64 -0
- package/dist/rendering/LightingDefaults.js.map +1 -0
- package/dist/rendering/LightingRig.d.ts +53 -0
- package/dist/rendering/LightingRig.d.ts.map +1 -0
- package/dist/rendering/LightingRig.js +197 -0
- package/dist/rendering/LightingRig.js.map +1 -0
- package/dist/rendering/LineGeometry.d.ts +3 -0
- package/dist/rendering/LineGeometry.d.ts.map +1 -0
- package/dist/rendering/LineGeometry.js +2 -0
- package/dist/rendering/LineGeometry.js.map +1 -0
- package/dist/rendering/Material.d.ts +77 -0
- package/dist/rendering/Material.d.ts.map +1 -0
- package/dist/rendering/Material.js +137 -0
- package/dist/rendering/Material.js.map +1 -0
- package/dist/rendering/MaterialBinding.d.ts +17 -0
- package/dist/rendering/MaterialBinding.d.ts.map +1 -0
- package/dist/rendering/MaterialBinding.js +119 -0
- package/dist/rendering/MaterialBinding.js.map +1 -0
- package/dist/rendering/MaterialInstance.d.ts +16 -0
- package/dist/rendering/MaterialInstance.d.ts.map +1 -0
- package/dist/rendering/MaterialInstance.js +53 -0
- package/dist/rendering/MaterialInstance.js.map +1 -0
- package/dist/rendering/MaterialPresets.d.ts +31 -0
- package/dist/rendering/MaterialPresets.d.ts.map +1 -0
- package/dist/rendering/MaterialPresets.js +219 -0
- package/dist/rendering/MaterialPresets.js.map +1 -0
- package/dist/rendering/MorphTarget.d.ts +10 -0
- package/dist/rendering/MorphTarget.d.ts.map +1 -0
- package/dist/rendering/MorphTarget.js +101 -0
- package/dist/rendering/MorphTarget.js.map +1 -0
- package/dist/rendering/MorphUnlitMaterial.d.ts +11 -0
- package/dist/rendering/MorphUnlitMaterial.d.ts.map +1 -0
- package/dist/rendering/MorphUnlitMaterial.js +45 -0
- package/dist/rendering/MorphUnlitMaterial.js.map +1 -0
- package/dist/rendering/NormalMappedPBRMaterial.d.ts +37 -0
- package/dist/rendering/NormalMappedPBRMaterial.d.ts.map +1 -0
- package/dist/rendering/NormalMappedPBRMaterial.js +148 -0
- package/dist/rendering/NormalMappedPBRMaterial.js.map +1 -0
- package/dist/rendering/OceanFixtures.d.ts +62 -0
- package/dist/rendering/OceanFixtures.d.ts.map +1 -0
- package/dist/rendering/OceanFixtures.js +240 -0
- package/dist/rendering/OceanFixtures.js.map +1 -0
- package/dist/rendering/PBRLightingDefaults.d.ts +4 -0
- package/dist/rendering/PBRLightingDefaults.d.ts.map +1 -0
- package/dist/rendering/PBRLightingDefaults.js +10 -0
- package/dist/rendering/PBRLightingDefaults.js.map +1 -0
- package/dist/rendering/PBRMaterial.d.ts +84 -0
- package/dist/rendering/PBRMaterial.d.ts.map +1 -0
- package/dist/rendering/PBRMaterial.js +349 -0
- package/dist/rendering/PBRMaterial.js.map +1 -0
- package/dist/rendering/PMREM.d.ts +26 -0
- package/dist/rendering/PMREM.d.ts.map +1 -0
- package/dist/rendering/PMREM.js +26 -0
- package/dist/rendering/PMREM.js.map +1 -0
- package/dist/rendering/PbrReference.d.ts +153 -0
- package/dist/rendering/PbrReference.d.ts.map +1 -0
- package/dist/rendering/PbrReference.js +500 -0
- package/dist/rendering/PbrReference.js.map +1 -0
- package/dist/rendering/PostProcessPass.d.ts +439 -0
- package/dist/rendering/PostProcessPass.d.ts.map +1 -0
- package/dist/rendering/PostProcessPass.js +1834 -0
- package/dist/rendering/PostProcessPass.js.map +1 -0
- package/dist/rendering/ProceduralTextureFixtures.d.ts +27 -0
- package/dist/rendering/ProceduralTextureFixtures.d.ts.map +1 -0
- package/dist/rendering/ProceduralTextureFixtures.js +336 -0
- package/dist/rendering/ProceduralTextureFixtures.js.map +1 -0
- package/dist/rendering/ProductTurntableFixtures.d.ts +96 -0
- package/dist/rendering/ProductTurntableFixtures.d.ts.map +1 -0
- package/dist/rendering/ProductTurntableFixtures.js +559 -0
- package/dist/rendering/ProductTurntableFixtures.js.map +1 -0
- package/dist/rendering/Raycaster.d.ts +14 -0
- package/dist/rendering/Raycaster.d.ts.map +1 -0
- package/dist/rendering/Raycaster.js +10 -0
- package/dist/rendering/Raycaster.js.map +1 -0
- package/dist/rendering/ReflectionProbe.d.ts +8 -0
- package/dist/rendering/ReflectionProbe.d.ts.map +1 -0
- package/dist/rendering/ReflectionProbe.js +10 -0
- package/dist/rendering/ReflectionProbe.js.map +1 -0
- package/dist/rendering/ReflectionSurfaces.d.ts +35 -0
- package/dist/rendering/ReflectionSurfaces.d.ts.map +1 -0
- package/dist/rendering/ReflectionSurfaces.js +155 -0
- package/dist/rendering/ReflectionSurfaces.js.map +1 -0
- package/dist/rendering/RenderBackend.d.ts +14 -0
- package/dist/rendering/RenderBackend.d.ts.map +1 -0
- package/dist/rendering/RenderBackend.js +33 -0
- package/dist/rendering/RenderBackend.js.map +1 -0
- package/dist/rendering/RenderDebugViews.d.ts +26 -0
- package/dist/rendering/RenderDebugViews.d.ts.map +1 -0
- package/dist/rendering/RenderDebugViews.js +97 -0
- package/dist/rendering/RenderDebugViews.js.map +1 -0
- package/dist/rendering/RenderDevice.d.ts +280 -0
- package/dist/rendering/RenderDevice.d.ts.map +1 -0
- package/dist/rendering/RenderDevice.js +561 -0
- package/dist/rendering/RenderDevice.js.map +1 -0
- package/dist/rendering/RenderGraph.d.ts +22 -0
- package/dist/rendering/RenderGraph.d.ts.map +1 -0
- package/dist/rendering/RenderGraph.js +159 -0
- package/dist/rendering/RenderGraph.js.map +1 -0
- package/dist/rendering/RenderPass.d.ts +23 -0
- package/dist/rendering/RenderPass.d.ts.map +1 -0
- package/dist/rendering/RenderPass.js +14 -0
- package/dist/rendering/RenderPass.js.map +1 -0
- package/dist/rendering/RenderPipeline.d.ts +39 -0
- package/dist/rendering/RenderPipeline.d.ts.map +1 -0
- package/dist/rendering/RenderPipeline.js +67 -0
- package/dist/rendering/RenderPipeline.js.map +1 -0
- package/dist/rendering/RenderQueue.d.ts +3 -0
- package/dist/rendering/RenderQueue.d.ts.map +1 -0
- package/dist/rendering/RenderQueue.js +2 -0
- package/dist/rendering/RenderQueue.js.map +1 -0
- package/dist/rendering/RenderState.d.ts +3 -0
- package/dist/rendering/RenderState.d.ts.map +1 -0
- package/dist/rendering/RenderState.js +2 -0
- package/dist/rendering/RenderState.js.map +1 -0
- package/dist/rendering/Renderer.d.ts +265 -0
- package/dist/rendering/Renderer.d.ts.map +1 -0
- package/dist/rendering/Renderer.js +2094 -0
- package/dist/rendering/Renderer.js.map +1 -0
- package/dist/rendering/RendererDebugOverlay.d.ts +20 -0
- package/dist/rendering/RendererDebugOverlay.d.ts.map +1 -0
- package/dist/rendering/RendererDebugOverlay.js +54 -0
- package/dist/rendering/RendererDebugOverlay.js.map +1 -0
- package/dist/rendering/RendererFeatureGates.d.ts +17 -0
- package/dist/rendering/RendererFeatureGates.d.ts.map +1 -0
- package/dist/rendering/RendererFeatureGates.js +92 -0
- package/dist/rendering/RendererFeatureGates.js.map +1 -0
- package/dist/rendering/RendererPostprocessPlan.d.ts +59 -0
- package/dist/rendering/RendererPostprocessPlan.d.ts.map +1 -0
- package/dist/rendering/RendererPostprocessPlan.js +155 -0
- package/dist/rendering/RendererPostprocessPlan.js.map +1 -0
- package/dist/rendering/RendererTiming.d.ts +53 -0
- package/dist/rendering/RendererTiming.d.ts.map +1 -0
- package/dist/rendering/RendererTiming.js +186 -0
- package/dist/rendering/RendererTiming.js.map +1 -0
- package/dist/rendering/RendererVisualPipelineReport.d.ts +224 -0
- package/dist/rendering/RendererVisualPipelineReport.d.ts.map +1 -0
- package/dist/rendering/RendererVisualPipelineReport.js +499 -0
- package/dist/rendering/RendererVisualPipelineReport.js.map +1 -0
- package/dist/rendering/ResourceLifecycle.d.ts +8 -0
- package/dist/rendering/ResourceLifecycle.d.ts.map +1 -0
- package/dist/rendering/ResourceLifecycle.js +18 -0
- package/dist/rendering/ResourceLifecycle.js.map +1 -0
- package/dist/rendering/Sampler.d.ts +20 -0
- package/dist/rendering/Sampler.d.ts.map +1 -0
- package/dist/rendering/Sampler.js +19 -0
- package/dist/rendering/Sampler.js.map +1 -0
- package/dist/rendering/SceneOptimization.d.ts +127 -0
- package/dist/rendering/SceneOptimization.d.ts.map +1 -0
- package/dist/rendering/SceneOptimization.js +342 -0
- package/dist/rendering/SceneOptimization.js.map +1 -0
- package/dist/rendering/ShaderChunks.d.ts +8 -0
- package/dist/rendering/ShaderChunks.d.ts.map +1 -0
- package/dist/rendering/ShaderChunks.js +386 -0
- package/dist/rendering/ShaderChunks.js.map +1 -0
- package/dist/rendering/ShaderLibrary.d.ts +63 -0
- package/dist/rendering/ShaderLibrary.d.ts.map +1 -0
- package/dist/rendering/ShaderLibrary.js +2707 -0
- package/dist/rendering/ShaderLibrary.js.map +1 -0
- package/dist/rendering/ShaderModule.d.ts +14 -0
- package/dist/rendering/ShaderModule.d.ts.map +1 -0
- package/dist/rendering/ShaderModule.js +33 -0
- package/dist/rendering/ShaderModule.js.map +1 -0
- package/dist/rendering/ShaderPreprocessor.d.ts +19 -0
- package/dist/rendering/ShaderPreprocessor.d.ts.map +1 -0
- package/dist/rendering/ShaderPreprocessor.js +212 -0
- package/dist/rendering/ShaderPreprocessor.js.map +1 -0
- package/dist/rendering/ShaderReflection.d.ts +23 -0
- package/dist/rendering/ShaderReflection.d.ts.map +1 -0
- package/dist/rendering/ShaderReflection.js +134 -0
- package/dist/rendering/ShaderReflection.js.map +1 -0
- package/dist/rendering/ShadowMap.d.ts +58 -0
- package/dist/rendering/ShadowMap.d.ts.map +1 -0
- package/dist/rendering/ShadowMap.js +183 -0
- package/dist/rendering/ShadowMap.js.map +1 -0
- package/dist/rendering/ShadowPass.d.ts +44 -0
- package/dist/rendering/ShadowPass.d.ts.map +1 -0
- package/dist/rendering/ShadowPass.js +162 -0
- package/dist/rendering/ShadowPass.js.map +1 -0
- package/dist/rendering/ShadowProjection.d.ts +15 -0
- package/dist/rendering/ShadowProjection.d.ts.map +1 -0
- package/dist/rendering/ShadowProjection.js +90 -0
- package/dist/rendering/ShadowProjection.js.map +1 -0
- package/dist/rendering/SkinnedLitMaterial.d.ts +63 -0
- package/dist/rendering/SkinnedLitMaterial.d.ts.map +1 -0
- package/dist/rendering/SkinnedLitMaterial.js +296 -0
- package/dist/rendering/SkinnedLitMaterial.js.map +1 -0
- package/dist/rendering/SkinnedUnlitMaterial.d.ts +13 -0
- package/dist/rendering/SkinnedUnlitMaterial.d.ts.map +1 -0
- package/dist/rendering/SkinnedUnlitMaterial.js +52 -0
- package/dist/rendering/SkinnedUnlitMaterial.js.map +1 -0
- package/dist/rendering/SkinningBounds.d.ts +10 -0
- package/dist/rendering/SkinningBounds.d.ts.map +1 -0
- package/dist/rendering/SkinningBounds.js +107 -0
- package/dist/rendering/SkinningBounds.js.map +1 -0
- package/dist/rendering/SpaceEnvironmentFixtures.d.ts +59 -0
- package/dist/rendering/SpaceEnvironmentFixtures.d.ts.map +1 -0
- package/dist/rendering/SpaceEnvironmentFixtures.js +132 -0
- package/dist/rendering/SpaceEnvironmentFixtures.js.map +1 -0
- package/dist/rendering/SpriteGeometry.d.ts +3 -0
- package/dist/rendering/SpriteGeometry.d.ts.map +1 -0
- package/dist/rendering/SpriteGeometry.js +21 -0
- package/dist/rendering/SpriteGeometry.js.map +1 -0
- package/dist/rendering/StereoCameraRig.d.ts +34 -0
- package/dist/rendering/StereoCameraRig.d.ts.map +1 -0
- package/dist/rendering/StereoCameraRig.js +79 -0
- package/dist/rendering/StereoCameraRig.js.map +1 -0
- package/dist/rendering/StereoEffects.d.ts +90 -0
- package/dist/rendering/StereoEffects.d.ts.map +1 -0
- package/dist/rendering/StereoEffects.js +171 -0
- package/dist/rendering/StereoEffects.js.map +1 -0
- package/dist/rendering/TerrainFixtures.d.ts +36 -0
- package/dist/rendering/TerrainFixtures.d.ts.map +1 -0
- package/dist/rendering/TerrainFixtures.js +143 -0
- package/dist/rendering/TerrainFixtures.js.map +1 -0
- package/dist/rendering/Texture.d.ts +64 -0
- package/dist/rendering/Texture.d.ts.map +1 -0
- package/dist/rendering/Texture.js +257 -0
- package/dist/rendering/Texture.js.map +1 -0
- package/dist/rendering/TextureBinding.d.ts +38 -0
- package/dist/rendering/TextureBinding.d.ts.map +1 -0
- package/dist/rendering/TextureBinding.js +66 -0
- package/dist/rendering/TextureBinding.js.map +1 -0
- package/dist/rendering/TexturedPBRMaterial.d.ts +206 -0
- package/dist/rendering/TexturedPBRMaterial.d.ts.map +1 -0
- package/dist/rendering/TexturedPBRMaterial.js +842 -0
- package/dist/rendering/TexturedPBRMaterial.js.map +1 -0
- package/dist/rendering/TexturedUnlitMaterial.d.ts +19 -0
- package/dist/rendering/TexturedUnlitMaterial.d.ts.map +1 -0
- package/dist/rendering/TexturedUnlitMaterial.js +52 -0
- package/dist/rendering/TexturedUnlitMaterial.js.map +1 -0
- package/dist/rendering/ToneMapping.d.ts +19 -0
- package/dist/rendering/ToneMapping.d.ts.map +1 -0
- package/dist/rendering/ToneMapping.js +53 -0
- package/dist/rendering/ToneMapping.js.map +1 -0
- package/dist/rendering/UniformBinder.d.ts +7 -0
- package/dist/rendering/UniformBinder.d.ts.map +1 -0
- package/dist/rendering/UniformBinder.js +14 -0
- package/dist/rendering/UniformBinder.js.map +1 -0
- package/dist/rendering/UniformLayout.d.ts +19 -0
- package/dist/rendering/UniformLayout.d.ts.map +1 -0
- package/dist/rendering/UniformLayout.js +107 -0
- package/dist/rendering/UniformLayout.js.map +1 -0
- package/dist/rendering/UnlitMaterial.d.ts +16 -0
- package/dist/rendering/UnlitMaterial.d.ts.map +1 -0
- package/dist/rendering/UnlitMaterial.js +60 -0
- package/dist/rendering/UnlitMaterial.js.map +1 -0
- package/dist/rendering/VegetationFixtures.d.ts +68 -0
- package/dist/rendering/VegetationFixtures.d.ts.map +1 -0
- package/dist/rendering/VegetationFixtures.js +241 -0
- package/dist/rendering/VegetationFixtures.js.map +1 -0
- package/dist/rendering/VertexBuffer.d.ts +29 -0
- package/dist/rendering/VertexBuffer.d.ts.map +1 -0
- package/dist/rendering/VertexBuffer.js +106 -0
- package/dist/rendering/VertexBuffer.js.map +1 -0
- package/dist/rendering/VertexFormat.d.ts +36 -0
- package/dist/rendering/VertexFormat.d.ts.map +1 -0
- package/dist/rendering/VertexFormat.js +127 -0
- package/dist/rendering/VertexFormat.js.map +1 -0
- package/dist/rendering/VoxelWorldFixtures.d.ts +54 -0
- package/dist/rendering/VoxelWorldFixtures.d.ts.map +1 -0
- package/dist/rendering/VoxelWorldFixtures.js +186 -0
- package/dist/rendering/VoxelWorldFixtures.js.map +1 -0
- package/dist/rendering/WeatherFixtures.d.ts +46 -0
- package/dist/rendering/WeatherFixtures.d.ts.map +1 -0
- package/dist/rendering/WeatherFixtures.js +142 -0
- package/dist/rendering/WeatherFixtures.js.map +1 -0
- package/dist/rendering/WebGL2Device.d.ts +137 -0
- package/dist/rendering/WebGL2Device.d.ts.map +1 -0
- package/dist/rendering/WebGL2Device.js +2107 -0
- package/dist/rendering/WebGL2Device.js.map +1 -0
- package/dist/rendering/WebGL2StateCache.d.ts +89 -0
- package/dist/rendering/WebGL2StateCache.d.ts.map +1 -0
- package/dist/rendering/WebGL2StateCache.js +265 -0
- package/dist/rendering/WebGL2StateCache.js.map +1 -0
- package/dist/rendering/WebGPUDevice.d.ts +287 -0
- package/dist/rendering/WebGPUDevice.d.ts.map +1 -0
- package/dist/rendering/WebGPUDevice.js +2403 -0
- package/dist/rendering/WebGPUDevice.js.map +1 -0
- package/dist/rendering/WebGPURenderToTextureProof.d.ts +29 -0
- package/dist/rendering/WebGPURenderToTextureProof.d.ts.map +1 -0
- package/dist/rendering/WebGPURenderToTextureProof.js +96 -0
- package/dist/rendering/WebGPURenderToTextureProof.js.map +1 -0
- package/dist/rendering/advanced-runtime/AdvancedRenderer.d.ts +23 -0
- package/dist/rendering/advanced-runtime/AdvancedRenderer.d.ts.map +1 -0
- package/dist/rendering/advanced-runtime/AdvancedRenderer.js +45 -0
- package/dist/rendering/advanced-runtime/AdvancedRenderer.js.map +1 -0
- package/dist/rendering/advanced-runtime/index.d.ts +10 -0
- package/dist/rendering/advanced-runtime/index.d.ts.map +1 -0
- package/dist/rendering/advanced-runtime/index.js +9 -0
- package/dist/rendering/advanced-runtime/index.js.map +1 -0
- package/dist/rendering/cinematic/BloomPass.d.ts +10 -0
- package/dist/rendering/cinematic/BloomPass.d.ts.map +1 -0
- package/dist/rendering/cinematic/BloomPass.js +18 -0
- package/dist/rendering/cinematic/BloomPass.js.map +1 -0
- package/dist/rendering/cinematic/CinematicDepthComposition.d.ts +12 -0
- package/dist/rendering/cinematic/CinematicDepthComposition.d.ts.map +1 -0
- package/dist/rendering/cinematic/CinematicDepthComposition.js +22 -0
- package/dist/rendering/cinematic/CinematicDepthComposition.js.map +1 -0
- package/dist/rendering/cinematic/CinematicEvidence.d.ts +43 -0
- package/dist/rendering/cinematic/CinematicEvidence.d.ts.map +1 -0
- package/dist/rendering/cinematic/CinematicEvidence.js +55 -0
- package/dist/rendering/cinematic/CinematicEvidence.js.map +1 -0
- package/dist/rendering/cinematic/CinematicLightingRig.d.ts +32 -0
- package/dist/rendering/cinematic/CinematicLightingRig.d.ts.map +1 -0
- package/dist/rendering/cinematic/CinematicLightingRig.js +90 -0
- package/dist/rendering/cinematic/CinematicLightingRig.js.map +1 -0
- package/dist/rendering/cinematic/CinematicMaterialPresets.d.ts +16 -0
- package/dist/rendering/cinematic/CinematicMaterialPresets.d.ts.map +1 -0
- package/dist/rendering/cinematic/CinematicMaterialPresets.js +114 -0
- package/dist/rendering/cinematic/CinematicMaterialPresets.js.map +1 -0
- package/dist/rendering/cinematic/CinematicPostProcess.d.ts +25 -0
- package/dist/rendering/cinematic/CinematicPostProcess.d.ts.map +1 -0
- package/dist/rendering/cinematic/CinematicPostProcess.js +64 -0
- package/dist/rendering/cinematic/CinematicPostProcess.js.map +1 -0
- package/dist/rendering/cinematic/DepthHazePass.d.ts +12 -0
- package/dist/rendering/cinematic/DepthHazePass.d.ts.map +1 -0
- package/dist/rendering/cinematic/DepthHazePass.js +20 -0
- package/dist/rendering/cinematic/DepthHazePass.js.map +1 -0
- package/dist/rendering/cinematic/EmissivePracticalLightSystem.d.ts +18 -0
- package/dist/rendering/cinematic/EmissivePracticalLightSystem.d.ts.map +1 -0
- package/dist/rendering/cinematic/EmissivePracticalLightSystem.js +25 -0
- package/dist/rendering/cinematic/EmissivePracticalLightSystem.js.map +1 -0
- package/dist/rendering/cinematic/FilmGrainPass.d.ts +9 -0
- package/dist/rendering/cinematic/FilmGrainPass.d.ts.map +1 -0
- package/dist/rendering/cinematic/FilmGrainPass.js +17 -0
- package/dist/rendering/cinematic/FilmGrainPass.js.map +1 -0
- package/dist/rendering/cinematic/FogVolumeSystem.d.ts +12 -0
- package/dist/rendering/cinematic/FogVolumeSystem.d.ts.map +1 -0
- package/dist/rendering/cinematic/FogVolumeSystem.js +20 -0
- package/dist/rendering/cinematic/FogVolumeSystem.js.map +1 -0
- package/dist/rendering/cinematic/GlowCardSystem.d.ts +17 -0
- package/dist/rendering/cinematic/GlowCardSystem.d.ts.map +1 -0
- package/dist/rendering/cinematic/GlowCardSystem.js +28 -0
- package/dist/rendering/cinematic/GlowCardSystem.js.map +1 -0
- package/dist/rendering/cinematic/RainParticleSystem.d.ts +22 -0
- package/dist/rendering/cinematic/RainParticleSystem.d.ts.map +1 -0
- package/dist/rendering/cinematic/RainParticleSystem.js +114 -0
- package/dist/rendering/cinematic/RainParticleSystem.js.map +1 -0
- package/dist/rendering/cinematic/VignettePass.d.ts +10 -0
- package/dist/rendering/cinematic/VignettePass.d.ts.map +1 -0
- package/dist/rendering/cinematic/VignettePass.js +17 -0
- package/dist/rendering/cinematic/VignettePass.js.map +1 -0
- package/dist/rendering/cinematic/WetReflectionApproximation.d.ts +13 -0
- package/dist/rendering/cinematic/WetReflectionApproximation.d.ts.map +1 -0
- package/dist/rendering/cinematic/WetReflectionApproximation.js +18 -0
- package/dist/rendering/cinematic/WetReflectionApproximation.js.map +1 -0
- package/dist/rendering/cinematic/index.d.ts +15 -0
- package/dist/rendering/cinematic/index.d.ts.map +1 -0
- package/dist/rendering/cinematic/index.js +15 -0
- package/dist/rendering/cinematic/index.js.map +1 -0
- package/dist/rendering/effects/CollisionModule.d.ts +15 -0
- package/dist/rendering/effects/CollisionModule.d.ts.map +1 -0
- package/dist/rendering/effects/CollisionModule.js +46 -0
- package/dist/rendering/effects/CollisionModule.js.map +1 -0
- package/dist/rendering/effects/ColorModule.d.ts +15 -0
- package/dist/rendering/effects/ColorModule.d.ts.map +1 -0
- package/dist/rendering/effects/ColorModule.js +45 -0
- package/dist/rendering/effects/ColorModule.js.map +1 -0
- package/dist/rendering/effects/ForceModule.d.ts +11 -0
- package/dist/rendering/effects/ForceModule.d.ts.map +1 -0
- package/dist/rendering/effects/ForceModule.js +17 -0
- package/dist/rendering/effects/ForceModule.js.map +1 -0
- package/dist/rendering/effects/GPUParticleBackend.d.ts +153 -0
- package/dist/rendering/effects/GPUParticleBackend.d.ts.map +1 -0
- package/dist/rendering/effects/GPUParticleBackend.js +397 -0
- package/dist/rendering/effects/GPUParticleBackend.js.map +1 -0
- package/dist/rendering/effects/Particle.d.ts +49 -0
- package/dist/rendering/effects/Particle.d.ts.map +1 -0
- package/dist/rendering/effects/Particle.js +56 -0
- package/dist/rendering/effects/Particle.js.map +1 -0
- package/dist/rendering/effects/ParticleDiagnostics.d.ts +58 -0
- package/dist/rendering/effects/ParticleDiagnostics.d.ts.map +1 -0
- package/dist/rendering/effects/ParticleDiagnostics.js +145 -0
- package/dist/rendering/effects/ParticleDiagnostics.js.map +1 -0
- package/dist/rendering/effects/ParticleEffectPresets.d.ts +8 -0
- package/dist/rendering/effects/ParticleEffectPresets.d.ts.map +1 -0
- package/dist/rendering/effects/ParticleEffectPresets.js +137 -0
- package/dist/rendering/effects/ParticleEffectPresets.js.map +1 -0
- package/dist/rendering/effects/ParticleEmitter.d.ts +87 -0
- package/dist/rendering/effects/ParticleEmitter.d.ts.map +1 -0
- package/dist/rendering/effects/ParticleEmitter.js +254 -0
- package/dist/rendering/effects/ParticleEmitter.js.map +1 -0
- package/dist/rendering/effects/ParticleModule.d.ts +15 -0
- package/dist/rendering/effects/ParticleModule.d.ts.map +1 -0
- package/dist/rendering/effects/ParticleModule.js +6 -0
- package/dist/rendering/effects/ParticleModule.js.map +1 -0
- package/dist/rendering/effects/ParticleRenderPass.d.ts +35 -0
- package/dist/rendering/effects/ParticleRenderPass.d.ts.map +1 -0
- package/dist/rendering/effects/ParticleRenderPass.js +91 -0
- package/dist/rendering/effects/ParticleRenderPass.js.map +1 -0
- package/dist/rendering/effects/ParticleRenderer.d.ts +34 -0
- package/dist/rendering/effects/ParticleRenderer.d.ts.map +1 -0
- package/dist/rendering/effects/ParticleRenderer.js +93 -0
- package/dist/rendering/effects/ParticleRenderer.js.map +1 -0
- package/dist/rendering/effects/ParticleSystem.d.ts +51 -0
- package/dist/rendering/effects/ParticleSystem.d.ts.map +1 -0
- package/dist/rendering/effects/ParticleSystem.js +261 -0
- package/dist/rendering/effects/ParticleSystem.js.map +1 -0
- package/dist/rendering/effects/SizeModule.d.ts +14 -0
- package/dist/rendering/effects/SizeModule.d.ts.map +1 -0
- package/dist/rendering/effects/SizeModule.js +42 -0
- package/dist/rendering/effects/SizeModule.js.map +1 -0
- package/dist/rendering/effects/TrailModule.d.ts +22 -0
- package/dist/rendering/effects/TrailModule.d.ts.map +1 -0
- package/dist/rendering/effects/TrailModule.js +50 -0
- package/dist/rendering/effects/TrailModule.js.map +1 -0
- package/dist/rendering/effects/VelocityModule.d.ts +15 -0
- package/dist/rendering/effects/VelocityModule.d.ts.map +1 -0
- package/dist/rendering/effects/VelocityModule.js +57 -0
- package/dist/rendering/effects/VelocityModule.js.map +1 -0
- package/dist/rendering/effects/index.d.ts +16 -0
- package/dist/rendering/effects/index.d.ts.map +1 -0
- package/dist/rendering/effects/index.js +16 -0
- package/dist/rendering/effects/index.js.map +1 -0
- package/dist/rendering/index.d.ts +260 -0
- package/dist/rendering/index.d.ts.map +1 -0
- package/dist/rendering/index.js +155 -0
- package/dist/rendering/index.js.map +1 -0
- package/dist/rendering/materials/AlphaSorting.d.ts +8 -0
- package/dist/rendering/materials/AlphaSorting.d.ts.map +1 -0
- package/dist/rendering/materials/AlphaSorting.js +26 -0
- package/dist/rendering/materials/AlphaSorting.js.map +1 -0
- package/dist/rendering/materials/MaterialExtensions.d.ts +10 -0
- package/dist/rendering/materials/MaterialExtensions.d.ts.map +1 -0
- package/dist/rendering/materials/MaterialExtensions.js +20 -0
- package/dist/rendering/materials/MaterialExtensions.js.map +1 -0
- package/dist/rendering/materials/PhysicalMaterial.d.ts +36 -0
- package/dist/rendering/materials/PhysicalMaterial.d.ts.map +1 -0
- package/dist/rendering/materials/PhysicalMaterial.js +79 -0
- package/dist/rendering/materials/PhysicalMaterial.js.map +1 -0
- package/dist/rendering/materials/TransmissionPass.d.ts +16 -0
- package/dist/rendering/materials/TransmissionPass.d.ts.map +1 -0
- package/dist/rendering/materials/TransmissionPass.js +30 -0
- package/dist/rendering/materials/TransmissionPass.js.map +1 -0
- package/dist/rendering/performance/BVH.d.ts +3 -0
- package/dist/rendering/performance/BVH.d.ts.map +1 -0
- package/dist/rendering/performance/BVH.js +2 -0
- package/dist/rendering/performance/BVH.js.map +1 -0
- package/dist/rendering/performance/Batcher.d.ts +3 -0
- package/dist/rendering/performance/Batcher.d.ts.map +1 -0
- package/dist/rendering/performance/Batcher.js +2 -0
- package/dist/rendering/performance/Batcher.js.map +1 -0
- package/dist/rendering/performance/FrustumCuller.d.ts +3 -0
- package/dist/rendering/performance/FrustumCuller.d.ts.map +1 -0
- package/dist/rendering/performance/FrustumCuller.js +5 -0
- package/dist/rendering/performance/FrustumCuller.js.map +1 -0
- package/dist/rendering/performance/LOD.d.ts +8 -0
- package/dist/rendering/performance/LOD.d.ts.map +1 -0
- package/dist/rendering/performance/LOD.js +15 -0
- package/dist/rendering/performance/LOD.js.map +1 -0
- package/dist/rendering/performance/Octree.d.ts +7 -0
- package/dist/rendering/performance/Octree.d.ts.map +1 -0
- package/dist/rendering/performance/Octree.js +4 -0
- package/dist/rendering/performance/Octree.js.map +1 -0
- package/dist/rendering/performance/RenderItemSorting.d.ts +43 -0
- package/dist/rendering/performance/RenderItemSorting.d.ts.map +1 -0
- package/dist/rendering/performance/RenderItemSorting.js +111 -0
- package/dist/rendering/performance/RenderItemSorting.js.map +1 -0
- package/dist/rendering/performance/RendererStats.d.ts +23 -0
- package/dist/rendering/performance/RendererStats.d.ts.map +1 -0
- package/dist/rendering/performance/RendererStats.js +23 -0
- package/dist/rendering/performance/RendererStats.js.map +1 -0
- package/dist/rendering/performance/ResourceBudget.d.ts +19 -0
- package/dist/rendering/performance/ResourceBudget.d.ts.map +1 -0
- package/dist/rendering/performance/ResourceBudget.js +21 -0
- package/dist/rendering/performance/ResourceBudget.js.map +1 -0
- package/dist/rendering/postprocess/BloomPass.d.ts +11 -0
- package/dist/rendering/postprocess/BloomPass.d.ts.map +1 -0
- package/dist/rendering/postprocess/BloomPass.js +14 -0
- package/dist/rendering/postprocess/BloomPass.js.map +1 -0
- package/dist/rendering/postprocess/CinematicDiagnostics.d.ts +112 -0
- package/dist/rendering/postprocess/CinematicDiagnostics.d.ts.map +1 -0
- package/dist/rendering/postprocess/CinematicDiagnostics.js +492 -0
- package/dist/rendering/postprocess/CinematicDiagnostics.js.map +1 -0
- package/dist/rendering/postprocess/ColorGradingPass.d.ts +4 -0
- package/dist/rendering/postprocess/ColorGradingPass.d.ts.map +1 -0
- package/dist/rendering/postprocess/ColorGradingPass.js +15 -0
- package/dist/rendering/postprocess/ColorGradingPass.js.map +1 -0
- package/dist/rendering/postprocess/DepthOfFieldPass.d.ts +3 -0
- package/dist/rendering/postprocess/DepthOfFieldPass.d.ts.map +1 -0
- package/dist/rendering/postprocess/DepthOfFieldPass.js +7 -0
- package/dist/rendering/postprocess/DepthOfFieldPass.js.map +1 -0
- package/dist/rendering/postprocess/EffectComposer.d.ts +110 -0
- package/dist/rendering/postprocess/EffectComposer.d.ts.map +1 -0
- package/dist/rendering/postprocess/EffectComposer.js +249 -0
- package/dist/rendering/postprocess/EffectComposer.js.map +1 -0
- package/dist/rendering/postprocess/SSAOPass.d.ts +6 -0
- package/dist/rendering/postprocess/SSAOPass.d.ts.map +1 -0
- package/dist/rendering/postprocess/SSAOPass.js +18 -0
- package/dist/rendering/postprocess/SSAOPass.js.map +1 -0
- package/dist/rendering/postprocess/index.d.ts +11 -0
- package/dist/rendering/postprocess/index.d.ts.map +1 -0
- package/dist/rendering/postprocess/index.js +7 -0
- package/dist/rendering/postprocess/index.js.map +1 -0
- package/dist/rendering/production-runtime/AnimationControlsPipeline.d.ts +37 -0
- package/dist/rendering/production-runtime/AnimationControlsPipeline.d.ts.map +1 -0
- package/dist/rendering/production-runtime/AnimationControlsPipeline.js +41 -0
- package/dist/rendering/production-runtime/AnimationControlsPipeline.js.map +1 -0
- package/dist/rendering/production-runtime/PBRHDRPipeline.d.ts +81 -0
- package/dist/rendering/production-runtime/PBRHDRPipeline.d.ts.map +1 -0
- package/dist/rendering/production-runtime/PBRHDRPipeline.js +279 -0
- package/dist/rendering/production-runtime/PBRHDRPipeline.js.map +1 -0
- package/dist/rendering/production-runtime/ProductionEffectsPipeline.d.ts +20 -0
- package/dist/rendering/production-runtime/ProductionEffectsPipeline.d.ts.map +1 -0
- package/dist/rendering/production-runtime/ProductionEffectsPipeline.js +65 -0
- package/dist/rendering/production-runtime/ProductionEffectsPipeline.js.map +1 -0
- package/dist/rendering/production-runtime/ProductionRendererTypes.d.ts +97 -0
- package/dist/rendering/production-runtime/ProductionRendererTypes.d.ts.map +1 -0
- package/dist/rendering/production-runtime/ProductionRendererTypes.js +29 -0
- package/dist/rendering/production-runtime/ProductionRendererTypes.js.map +1 -0
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.d.ts +36 -0
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.js +124 -0
- package/dist/rendering/production-runtime/ProductionRuntimeRenderer.js.map +1 -0
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.d.ts +51 -0
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.js +269 -0
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.js.map +1 -0
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.d.ts +69 -0
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.js +313 -0
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.js.map +1 -0
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.d.ts +11 -0
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.d.ts.map +1 -0
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.js +119 -0
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.js.map +1 -0
- package/dist/rendering/production-runtime/animation/MorphTargetRenderer.d.ts +7 -0
- package/dist/rendering/production-runtime/animation/MorphTargetRenderer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/animation/MorphTargetRenderer.js +2 -0
- package/dist/rendering/production-runtime/animation/MorphTargetRenderer.js.map +1 -0
- package/dist/rendering/production-runtime/animation/SkinningRenderer.d.ts +7 -0
- package/dist/rendering/production-runtime/animation/SkinningRenderer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/animation/SkinningRenderer.js +2 -0
- package/dist/rendering/production-runtime/animation/SkinningRenderer.js.map +1 -0
- package/dist/rendering/production-runtime/backends/RendererBackend.d.ts +16 -0
- package/dist/rendering/production-runtime/backends/RendererBackend.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/RendererBackend.js +2 -0
- package/dist/rendering/production-runtime/backends/RendererBackend.js.map +1 -0
- package/dist/rendering/production-runtime/backends/WebGL2RendererBackend.d.ts +15 -0
- package/dist/rendering/production-runtime/backends/WebGL2RendererBackend.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/WebGL2RendererBackend.js +25 -0
- package/dist/rendering/production-runtime/backends/WebGL2RendererBackend.js.map +1 -0
- package/dist/rendering/production-runtime/backends/WebGPURendererBackend.d.ts +20 -0
- package/dist/rendering/production-runtime/backends/WebGPURendererBackend.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/WebGPURendererBackend.js +19 -0
- package/dist/rendering/production-runtime/backends/WebGPURendererBackend.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Buffer.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Buffer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Buffer.js +8 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Buffer.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Capabilities.js +8 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Capabilities.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2RenderTarget.js +8 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2RenderTarget.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Shader.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Shader.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Shader.js +8 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Shader.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2StateCache.d.ts +2 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2StateCache.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2StateCache.js +2 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2StateCache.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Texture.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Texture.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Texture.js +8 -0
- package/dist/rendering/production-runtime/backends/webgl2/WebGL2Texture.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUBuffer.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUBuffer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUBuffer.js +8 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUBuffer.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUCapabilities.js +8 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUCapabilities.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPURenderTarget.js +8 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPURenderTarget.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUShader.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUShader.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUShader.js +8 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUShader.js.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUTexture.d.ts +11 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUTexture.d.ts.map +1 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUTexture.js +8 -0
- package/dist/rendering/production-runtime/backends/webgpu/WebGPUTexture.js.map +1 -0
- package/dist/rendering/production-runtime/color/ColorManagement.d.ts +4 -0
- package/dist/rendering/production-runtime/color/ColorManagement.d.ts.map +1 -0
- package/dist/rendering/production-runtime/color/ColorManagement.js +3 -0
- package/dist/rendering/production-runtime/color/ColorManagement.js.map +1 -0
- package/dist/rendering/production-runtime/color/ToneMapping.d.ts +3 -0
- package/dist/rendering/production-runtime/color/ToneMapping.d.ts.map +1 -0
- package/dist/rendering/production-runtime/color/ToneMapping.js +9 -0
- package/dist/rendering/production-runtime/color/ToneMapping.js.map +1 -0
- package/dist/rendering/production-runtime/diagnostics/FrameCapture.d.ts +7 -0
- package/dist/rendering/production-runtime/diagnostics/FrameCapture.d.ts.map +1 -0
- package/dist/rendering/production-runtime/diagnostics/FrameCapture.js +2 -0
- package/dist/rendering/production-runtime/diagnostics/FrameCapture.js.map +1 -0
- package/dist/rendering/production-runtime/diagnostics/GPUCapabilities.d.ts +9 -0
- package/dist/rendering/production-runtime/diagnostics/GPUCapabilities.d.ts.map +1 -0
- package/dist/rendering/production-runtime/diagnostics/GPUCapabilities.js +2 -0
- package/dist/rendering/production-runtime/diagnostics/GPUCapabilities.js.map +1 -0
- package/dist/rendering/production-runtime/diagnostics/RendererStats.d.ts +9 -0
- package/dist/rendering/production-runtime/diagnostics/RendererStats.d.ts.map +1 -0
- package/dist/rendering/production-runtime/diagnostics/RendererStats.js +2 -0
- package/dist/rendering/production-runtime/diagnostics/RendererStats.js.map +1 -0
- package/dist/rendering/production-runtime/environment/EnvironmentMap.d.ts +8 -0
- package/dist/rendering/production-runtime/environment/EnvironmentMap.d.ts.map +1 -0
- package/dist/rendering/production-runtime/environment/EnvironmentMap.js +2 -0
- package/dist/rendering/production-runtime/environment/EnvironmentMap.js.map +1 -0
- package/dist/rendering/production-runtime/environment/HDRLoader.d.ts +19 -0
- package/dist/rendering/production-runtime/environment/HDRLoader.d.ts.map +1 -0
- package/dist/rendering/production-runtime/environment/HDRLoader.js +22 -0
- package/dist/rendering/production-runtime/environment/HDRLoader.js.map +1 -0
- package/dist/rendering/production-runtime/environment/PMREMGenerator.d.ts +99 -0
- package/dist/rendering/production-runtime/environment/PMREMGenerator.d.ts.map +1 -0
- package/dist/rendering/production-runtime/environment/PMREMGenerator.js +534 -0
- package/dist/rendering/production-runtime/environment/PMREMGenerator.js.map +1 -0
- package/dist/rendering/production-runtime/framegraph/FrameGraph.d.ts +8 -0
- package/dist/rendering/production-runtime/framegraph/FrameGraph.d.ts.map +1 -0
- package/dist/rendering/production-runtime/framegraph/FrameGraph.js +14 -0
- package/dist/rendering/production-runtime/framegraph/FrameGraph.js.map +1 -0
- package/dist/rendering/production-runtime/framegraph/RenderPass.d.ts +14 -0
- package/dist/rendering/production-runtime/framegraph/RenderPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/framegraph/RenderPass.js +2 -0
- package/dist/rendering/production-runtime/framegraph/RenderPass.js.map +1 -0
- package/dist/rendering/production-runtime/geometry/ProjectedDecalGeometry.d.ts +53 -0
- package/dist/rendering/production-runtime/geometry/ProjectedDecalGeometry.d.ts.map +1 -0
- package/dist/rendering/production-runtime/geometry/ProjectedDecalGeometry.js +340 -0
- package/dist/rendering/production-runtime/geometry/ProjectedDecalGeometry.js.map +1 -0
- package/dist/rendering/production-runtime/index.d.ts +73 -0
- package/dist/rendering/production-runtime/index.d.ts.map +1 -0
- package/dist/rendering/production-runtime/index.js +67 -0
- package/dist/rendering/production-runtime/index.js.map +1 -0
- package/dist/rendering/production-runtime/lights/LightManager.d.ts +8 -0
- package/dist/rendering/production-runtime/lights/LightManager.d.ts.map +1 -0
- package/dist/rendering/production-runtime/lights/LightManager.js +7 -0
- package/dist/rendering/production-runtime/lights/LightManager.js.map +1 -0
- package/dist/rendering/production-runtime/lights/ShadowMapRenderer.d.ts +8 -0
- package/dist/rendering/production-runtime/lights/ShadowMapRenderer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/lights/ShadowMapRenderer.js +4 -0
- package/dist/rendering/production-runtime/lights/ShadowMapRenderer.js.map +1 -0
- package/dist/rendering/production-runtime/materials/GLTFMaterialAdapter.d.ts +14 -0
- package/dist/rendering/production-runtime/materials/GLTFMaterialAdapter.d.ts.map +1 -0
- package/dist/rendering/production-runtime/materials/GLTFMaterialAdapter.js +5 -0
- package/dist/rendering/production-runtime/materials/GLTFMaterialAdapter.js.map +1 -0
- package/dist/rendering/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts +3 -0
- package/dist/rendering/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts.map +1 -0
- package/dist/rendering/production-runtime/materials/GLTFPBRMaterialAdapter.js +2 -0
- package/dist/rendering/production-runtime/materials/GLTFPBRMaterialAdapter.js.map +1 -0
- package/dist/rendering/production-runtime/materials/MaterialCompiler.d.ts +9 -0
- package/dist/rendering/production-runtime/materials/MaterialCompiler.d.ts.map +1 -0
- package/dist/rendering/production-runtime/materials/MaterialCompiler.js +5 -0
- package/dist/rendering/production-runtime/materials/MaterialCompiler.js.map +1 -0
- package/dist/rendering/production-runtime/materials/MaterialTextureBindings.d.ts +8 -0
- package/dist/rendering/production-runtime/materials/MaterialTextureBindings.d.ts.map +1 -0
- package/dist/rendering/production-runtime/materials/MaterialTextureBindings.js +4 -0
- package/dist/rendering/production-runtime/materials/MaterialTextureBindings.js.map +1 -0
- package/dist/rendering/production-runtime/materials/PBRMaterial.d.ts +23 -0
- package/dist/rendering/production-runtime/materials/PBRMaterial.d.ts.map +1 -0
- package/dist/rendering/production-runtime/materials/PBRMaterial.js +2 -0
- package/dist/rendering/production-runtime/materials/PBRMaterial.js.map +1 -0
- package/dist/rendering/production-runtime/materials/PBRShaderFeatures.d.ts +13 -0
- package/dist/rendering/production-runtime/materials/PBRShaderFeatures.d.ts.map +1 -0
- package/dist/rendering/production-runtime/materials/PBRShaderFeatures.js +2 -0
- package/dist/rendering/production-runtime/materials/PBRShaderFeatures.js.map +1 -0
- package/dist/rendering/production-runtime/passes/ContactShadowPass.d.ts +40 -0
- package/dist/rendering/production-runtime/passes/ContactShadowPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/passes/ContactShadowPass.js +126 -0
- package/dist/rendering/production-runtime/passes/ContactShadowPass.js.map +1 -0
- package/dist/rendering/production-runtime/passes/DepthPrepass.d.ts +8 -0
- package/dist/rendering/production-runtime/passes/DepthPrepass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/passes/DepthPrepass.js +7 -0
- package/dist/rendering/production-runtime/passes/DepthPrepass.js.map +1 -0
- package/dist/rendering/production-runtime/passes/OpaquePass.d.ts +8 -0
- package/dist/rendering/production-runtime/passes/OpaquePass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/passes/OpaquePass.js +7 -0
- package/dist/rendering/production-runtime/passes/OpaquePass.js.map +1 -0
- package/dist/rendering/production-runtime/passes/ShadowPass.d.ts +8 -0
- package/dist/rendering/production-runtime/passes/ShadowPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/passes/ShadowPass.js +7 -0
- package/dist/rendering/production-runtime/passes/ShadowPass.js.map +1 -0
- package/dist/rendering/production-runtime/passes/SkyboxPass.d.ts +8 -0
- package/dist/rendering/production-runtime/passes/SkyboxPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/passes/SkyboxPass.js +7 -0
- package/dist/rendering/production-runtime/passes/SkyboxPass.js.map +1 -0
- package/dist/rendering/production-runtime/passes/ToneMappingPass.d.ts +8 -0
- package/dist/rendering/production-runtime/passes/ToneMappingPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/passes/ToneMappingPass.js +7 -0
- package/dist/rendering/production-runtime/passes/ToneMappingPass.js.map +1 -0
- package/dist/rendering/production-runtime/passes/TransparentPass.d.ts +8 -0
- package/dist/rendering/production-runtime/passes/TransparentPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/passes/TransparentPass.js +7 -0
- package/dist/rendering/production-runtime/passes/TransparentPass.js.map +1 -0
- package/dist/rendering/production-runtime/postprocess/BloomPass.d.ts +15 -0
- package/dist/rendering/production-runtime/postprocess/BloomPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/postprocess/BloomPass.js +37 -0
- package/dist/rendering/production-runtime/postprocess/BloomPass.js.map +1 -0
- package/dist/rendering/production-runtime/postprocess/ColorGradingPass.d.ts +16 -0
- package/dist/rendering/production-runtime/postprocess/ColorGradingPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/postprocess/ColorGradingPass.js +34 -0
- package/dist/rendering/production-runtime/postprocess/ColorGradingPass.js.map +1 -0
- package/dist/rendering/production-runtime/postprocess/DOFPass.d.ts +16 -0
- package/dist/rendering/production-runtime/postprocess/DOFPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/postprocess/DOFPass.js +31 -0
- package/dist/rendering/production-runtime/postprocess/DOFPass.js.map +1 -0
- package/dist/rendering/production-runtime/postprocess/FXAAPass.d.ts +16 -0
- package/dist/rendering/production-runtime/postprocess/FXAAPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/postprocess/FXAAPass.js +39 -0
- package/dist/rendering/production-runtime/postprocess/FXAAPass.js.map +1 -0
- package/dist/rendering/production-runtime/postprocess/ProductionEffectComposer.d.ts +21 -0
- package/dist/rendering/production-runtime/postprocess/ProductionEffectComposer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/postprocess/ProductionEffectComposer.js +53 -0
- package/dist/rendering/production-runtime/postprocess/ProductionEffectComposer.js.map +1 -0
- package/dist/rendering/production-runtime/postprocess/ProductionPostProcessTypes.d.ts +37 -0
- package/dist/rendering/production-runtime/postprocess/ProductionPostProcessTypes.d.ts.map +1 -0
- package/dist/rendering/production-runtime/postprocess/ProductionPostProcessTypes.js +124 -0
- package/dist/rendering/production-runtime/postprocess/ProductionPostProcessTypes.js.map +1 -0
- package/dist/rendering/production-runtime/postprocess/SSAOPass.d.ts +15 -0
- package/dist/rendering/production-runtime/postprocess/SSAOPass.d.ts.map +1 -0
- package/dist/rendering/production-runtime/postprocess/SSAOPass.js +30 -0
- package/dist/rendering/production-runtime/postprocess/SSAOPass.js.map +1 -0
- package/dist/rendering/production-runtime/resources/GPUBuffer.d.ts +10 -0
- package/dist/rendering/production-runtime/resources/GPUBuffer.d.ts.map +1 -0
- package/dist/rendering/production-runtime/resources/GPUBuffer.js +7 -0
- package/dist/rendering/production-runtime/resources/GPUBuffer.js.map +1 -0
- package/dist/rendering/production-runtime/resources/GPUTexture.d.ts +12 -0
- package/dist/rendering/production-runtime/resources/GPUTexture.d.ts.map +1 -0
- package/dist/rendering/production-runtime/resources/GPUTexture.js +7 -0
- package/dist/rendering/production-runtime/resources/GPUTexture.js.map +1 -0
- package/dist/rendering/production-runtime/resources/RenderTarget.d.ts +11 -0
- package/dist/rendering/production-runtime/resources/RenderTarget.d.ts.map +1 -0
- package/dist/rendering/production-runtime/resources/RenderTarget.js +7 -0
- package/dist/rendering/production-runtime/resources/RenderTarget.js.map +1 -0
- package/dist/rendering/production-runtime/resources/ResourceCache.d.ts +8 -0
- package/dist/rendering/production-runtime/resources/ResourceCache.d.ts.map +1 -0
- package/dist/rendering/production-runtime/resources/ResourceCache.js +8 -0
- package/dist/rendering/production-runtime/resources/ResourceCache.js.map +1 -0
- package/dist/rendering/production-runtime/scene/Camera.d.ts +8 -0
- package/dist/rendering/production-runtime/scene/Camera.d.ts.map +1 -0
- package/dist/rendering/production-runtime/scene/Camera.js +2 -0
- package/dist/rendering/production-runtime/scene/Camera.js.map +1 -0
- package/dist/rendering/production-runtime/scene/Lights.d.ts +9 -0
- package/dist/rendering/production-runtime/scene/Lights.d.ts.map +1 -0
- package/dist/rendering/production-runtime/scene/Lights.js +2 -0
- package/dist/rendering/production-runtime/scene/Lights.js.map +1 -0
- package/dist/rendering/production-runtime/scene/RenderableMesh.d.ts +8 -0
- package/dist/rendering/production-runtime/scene/RenderableMesh.d.ts.map +1 -0
- package/dist/rendering/production-runtime/scene/RenderableMesh.js +2 -0
- package/dist/rendering/production-runtime/scene/RenderableMesh.js.map +1 -0
- package/dist/rendering/production-runtime/scene/RenderablePrimitive.d.ts +8 -0
- package/dist/rendering/production-runtime/scene/RenderablePrimitive.d.ts.map +1 -0
- package/dist/rendering/production-runtime/scene/RenderablePrimitive.js +2 -0
- package/dist/rendering/production-runtime/scene/RenderablePrimitive.js.map +1 -0
- package/dist/rendering/production-runtime/scene/RenderableScene.d.ts +11 -0
- package/dist/rendering/production-runtime/scene/RenderableScene.d.ts.map +1 -0
- package/dist/rendering/production-runtime/scene/RenderableScene.js +2 -0
- package/dist/rendering/production-runtime/scene/RenderableScene.js.map +1 -0
- package/dist/rendering/production-runtime/shaders/ShaderProgramLibrary.d.ts +12 -0
- package/dist/rendering/production-runtime/shaders/ShaderProgramLibrary.d.ts.map +1 -0
- package/dist/rendering/production-runtime/shaders/ShaderProgramLibrary.js +7 -0
- package/dist/rendering/production-runtime/shaders/ShaderProgramLibrary.js.map +1 -0
- package/dist/rendering/shadows/CascadedShadowPipeline.d.ts +25 -0
- package/dist/rendering/shadows/CascadedShadowPipeline.d.ts.map +1 -0
- package/dist/rendering/shadows/CascadedShadowPipeline.js +31 -0
- package/dist/rendering/shadows/CascadedShadowPipeline.js.map +1 -0
- package/dist/rendering/shadows/ContactShadows.d.ts +37 -0
- package/dist/rendering/shadows/ContactShadows.d.ts.map +1 -0
- package/dist/rendering/shadows/ContactShadows.js +68 -0
- package/dist/rendering/shadows/ContactShadows.js.map +1 -0
- package/dist/rendering/shadows/ShadowDebugViews.d.ts +12 -0
- package/dist/rendering/shadows/ShadowDebugViews.d.ts.map +1 -0
- package/dist/rendering/shadows/ShadowDebugViews.js +35 -0
- package/dist/rendering/shadows/ShadowDebugViews.js.map +1 -0
- package/dist/rendering/threejs-compatibility/InstancingSystem.d.ts +10 -0
- package/dist/rendering/threejs-compatibility/InstancingSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/InstancingSystem.js +11 -0
- package/dist/rendering/threejs-compatibility/InstancingSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/LightingSystem.d.ts +11 -0
- package/dist/rendering/threejs-compatibility/LightingSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/LightingSystem.js +14 -0
- package/dist/rendering/threejs-compatibility/LightingSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/MaterialSystem.d.ts +6 -0
- package/dist/rendering/threejs-compatibility/MaterialSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/MaterialSystem.js +7 -0
- package/dist/rendering/threejs-compatibility/MaterialSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/RenderTargetSystem.d.ts +16 -0
- package/dist/rendering/threejs-compatibility/RenderTargetSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/RenderTargetSystem.js +23 -0
- package/dist/rendering/threejs-compatibility/RenderTargetSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/RendererDiagnostics.d.ts +27 -0
- package/dist/rendering/threejs-compatibility/RendererDiagnostics.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/RendererDiagnostics.js +41 -0
- package/dist/rendering/threejs-compatibility/RendererDiagnostics.js.map +1 -0
- package/dist/rendering/threejs-compatibility/SceneRenderer.d.ts +19 -0
- package/dist/rendering/threejs-compatibility/SceneRenderer.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/SceneRenderer.js +18 -0
- package/dist/rendering/threejs-compatibility/SceneRenderer.js.map +1 -0
- package/dist/rendering/threejs-compatibility/ShadowSystem.d.ts +11 -0
- package/dist/rendering/threejs-compatibility/ShadowSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/ShadowSystem.js +12 -0
- package/dist/rendering/threejs-compatibility/ShadowSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/TextureSystem.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/TextureSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/TextureSystem.js +14 -0
- package/dist/rendering/threejs-compatibility/TextureSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/ThreeCompatRenderer.d.ts +37 -0
- package/dist/rendering/threejs-compatibility/ThreeCompatRenderer.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/ThreeCompatRenderer.js +77 -0
- package/dist/rendering/threejs-compatibility/ThreeCompatRenderer.js.map +1 -0
- package/dist/rendering/threejs-compatibility/TransparencySystem.d.ts +11 -0
- package/dist/rendering/threejs-compatibility/TransparencySystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/TransparencySystem.js +12 -0
- package/dist/rendering/threejs-compatibility/TransparencySystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/index.d.ts +25 -0
- package/dist/rendering/threejs-compatibility/index.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/index.js +15 -0
- package/dist/rendering/threejs-compatibility/index.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/BVH.d.ts +11 -0
- package/dist/rendering/threejs-compatibility/performance/BVH.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/BVH.js +10 -0
- package/dist/rendering/threejs-compatibility/performance/BVH.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/FrustumCulling.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/performance/FrustumCulling.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/FrustumCulling.js +5 -0
- package/dist/rendering/threejs-compatibility/performance/FrustumCulling.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/Instancing.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/performance/Instancing.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/Instancing.js +10 -0
- package/dist/rendering/threejs-compatibility/performance/Instancing.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/LODSystem.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/performance/LODSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/LODSystem.js +11 -0
- package/dist/rendering/threejs-compatibility/performance/LODSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/OcclusionCulling.d.ts +3 -0
- package/dist/rendering/threejs-compatibility/performance/OcclusionCulling.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/OcclusionCulling.js +5 -0
- package/dist/rendering/threejs-compatibility/performance/OcclusionCulling.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/RaycastAcceleration.d.ts +8 -0
- package/dist/rendering/threejs-compatibility/performance/RaycastAcceleration.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/RaycastAcceleration.js +11 -0
- package/dist/rendering/threejs-compatibility/performance/RaycastAcceleration.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/RendererProfiler.d.ts +11 -0
- package/dist/rendering/threejs-compatibility/performance/RendererProfiler.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/RendererProfiler.js +10 -0
- package/dist/rendering/threejs-compatibility/performance/RendererProfiler.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/TextureStreaming.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/performance/TextureStreaming.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/TextureStreaming.js +10 -0
- package/dist/rendering/threejs-compatibility/performance/TextureStreaming.js.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/index.d.ts +13 -0
- package/dist/rendering/threejs-compatibility/performance/index.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/performance/index.js +9 -0
- package/dist/rendering/threejs-compatibility/performance/index.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/BloomPass.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/postprocess/BloomPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/BloomPass.js +14 -0
- package/dist/rendering/threejs-compatibility/postprocess/BloomPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/ColorGradingPass.d.ts +10 -0
- package/dist/rendering/threejs-compatibility/postprocess/ColorGradingPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/ColorGradingPass.js +16 -0
- package/dist/rendering/threejs-compatibility/postprocess/ColorGradingPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/DepthOfFieldPass.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/postprocess/DepthOfFieldPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/DepthOfFieldPass.js +19 -0
- package/dist/rendering/threejs-compatibility/postprocess/DepthOfFieldPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/EffectComposer.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/postprocess/EffectComposer.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/EffectComposer.js +11 -0
- package/dist/rendering/threejs-compatibility/postprocess/EffectComposer.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/FXAAPass.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/postprocess/FXAAPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/FXAAPass.js +10 -0
- package/dist/rendering/threejs-compatibility/postprocess/FXAAPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/MotionBlurPass.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/postprocess/MotionBlurPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/MotionBlurPass.js +18 -0
- package/dist/rendering/threejs-compatibility/postprocess/MotionBlurPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/OutlinePass.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/postprocess/OutlinePass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/OutlinePass.js +19 -0
- package/dist/rendering/threejs-compatibility/postprocess/OutlinePass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/PostProcessTypes.d.ts +42 -0
- package/dist/rendering/threejs-compatibility/postprocess/PostProcessTypes.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/PostProcessTypes.js +123 -0
- package/dist/rendering/threejs-compatibility/postprocess/PostProcessTypes.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/RenderPass.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/postprocess/RenderPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/RenderPass.js +8 -0
- package/dist/rendering/threejs-compatibility/postprocess/RenderPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/SMAAPass.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/postprocess/SMAAPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/SMAAPass.js +10 -0
- package/dist/rendering/threejs-compatibility/postprocess/SMAAPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/SSAOPass.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/postprocess/SSAOPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/SSAOPass.js +19 -0
- package/dist/rendering/threejs-compatibility/postprocess/SSAOPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/ShaderPass.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/postprocess/ShaderPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/ShaderPass.js +11 -0
- package/dist/rendering/threejs-compatibility/postprocess/ShaderPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/TAAPass.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/postprocess/TAAPass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/TAAPass.js +10 -0
- package/dist/rendering/threejs-compatibility/postprocess/TAAPass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/VignettePass.d.ts +9 -0
- package/dist/rendering/threejs-compatibility/postprocess/VignettePass.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/VignettePass.js +14 -0
- package/dist/rendering/threejs-compatibility/postprocess/VignettePass.js.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/index.d.ts +16 -0
- package/dist/rendering/threejs-compatibility/postprocess/index.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/postprocess/index.js +15 -0
- package/dist/rendering/threejs-compatibility/postprocess/index.js.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/NodeMaterial.d.ts +14 -0
- package/dist/rendering/threejs-compatibility/shaders/NodeMaterial.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/NodeMaterial.js +15 -0
- package/dist/rendering/threejs-compatibility/shaders/NodeMaterial.js.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/RawShaderMaterial.d.ts +6 -0
- package/dist/rendering/threejs-compatibility/shaders/RawShaderMaterial.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/RawShaderMaterial.js +6 -0
- package/dist/rendering/threejs-compatibility/shaders/RawShaderMaterial.js.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderDiagnostics.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderDiagnostics.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderDiagnostics.js +12 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderDiagnostics.js.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderMaterial.d.ts +12 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderMaterial.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderMaterial.js +20 -0
- package/dist/rendering/threejs-compatibility/shaders/ShaderMaterial.js.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/ThreeCompatShaderChunks.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/shaders/ThreeCompatShaderChunks.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/ThreeCompatShaderChunks.js +7 -0
- package/dist/rendering/threejs-compatibility/shaders/ThreeCompatShaderChunks.js.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/Uniforms.d.ts +8 -0
- package/dist/rendering/threejs-compatibility/shaders/Uniforms.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/Uniforms.js +14 -0
- package/dist/rendering/threejs-compatibility/shaders/Uniforms.js.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/index.d.ts +10 -0
- package/dist/rendering/threejs-compatibility/shaders/index.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/shaders/index.js +7 -0
- package/dist/rendering/threejs-compatibility/shaders/index.js.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/GPUPointCloud.d.ts +7 -0
- package/dist/rendering/threejs-compatibility/vfx/GPUPointCloud.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/GPUPointCloud.js +12 -0
- package/dist/rendering/threejs-compatibility/vfx/GPUPointCloud.js.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/LineRenderer.d.ts +10 -0
- package/dist/rendering/threejs-compatibility/vfx/LineRenderer.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/LineRenderer.js +7 -0
- package/dist/rendering/threejs-compatibility/vfx/LineRenderer.js.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/ParticleSystem.d.ts +12 -0
- package/dist/rendering/threejs-compatibility/vfx/ParticleSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/ParticleSystem.js +15 -0
- package/dist/rendering/threejs-compatibility/vfx/ParticleSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/SpriteSystem.d.ts +11 -0
- package/dist/rendering/threejs-compatibility/vfx/SpriteSystem.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/SpriteSystem.js +7 -0
- package/dist/rendering/threejs-compatibility/vfx/SpriteSystem.js.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/TrailRenderer.d.ts +5 -0
- package/dist/rendering/threejs-compatibility/vfx/TrailRenderer.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/TrailRenderer.js +9 -0
- package/dist/rendering/threejs-compatibility/vfx/TrailRenderer.js.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/VFXDiagnostics.d.ts +21 -0
- package/dist/rendering/threejs-compatibility/vfx/VFXDiagnostics.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/VFXDiagnostics.js +12 -0
- package/dist/rendering/threejs-compatibility/vfx/VFXDiagnostics.js.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/index.d.ts +10 -0
- package/dist/rendering/threejs-compatibility/vfx/index.d.ts.map +1 -0
- package/dist/rendering/threejs-compatibility/vfx/index.js +7 -0
- package/dist/rendering/threejs-compatibility/vfx/index.js.map +1 -0
- package/dist/rendering/threejs-example-parity/index.d.ts +57 -0
- package/dist/rendering/threejs-example-parity/index.d.ts.map +1 -0
- package/dist/rendering/threejs-example-parity/index.js +139 -0
- package/dist/rendering/threejs-example-parity/index.js.map +1 -0
- package/dist/rendering/webgpu/WebGPUBuffer.d.ts +2 -0
- package/dist/rendering/webgpu/WebGPUBuffer.d.ts.map +1 -0
- package/dist/rendering/webgpu/WebGPUBuffer.js +2 -0
- package/dist/rendering/webgpu/WebGPUBuffer.js.map +1 -0
- package/dist/rendering/webgpu/WebGPUCompute.d.ts +3 -0
- package/dist/rendering/webgpu/WebGPUCompute.d.ts.map +1 -0
- package/dist/rendering/webgpu/WebGPUCompute.js +2 -0
- package/dist/rendering/webgpu/WebGPUCompute.js.map +1 -0
- package/dist/rendering/webgpu/WebGPUPipelineCache.d.ts +6 -0
- package/dist/rendering/webgpu/WebGPUPipelineCache.d.ts.map +1 -0
- package/dist/rendering/webgpu/WebGPUPipelineCache.js +15 -0
- package/dist/rendering/webgpu/WebGPUPipelineCache.js.map +1 -0
- package/dist/rendering/webgpu/WebGPUPostProcess.d.ts +3 -0
- package/dist/rendering/webgpu/WebGPUPostProcess.d.ts.map +1 -0
- package/dist/rendering/webgpu/WebGPUPostProcess.js +2 -0
- package/dist/rendering/webgpu/WebGPUPostProcess.js.map +1 -0
- package/dist/rendering/webgpu/WebGPUTexture.d.ts +3 -0
- package/dist/rendering/webgpu/WebGPUTexture.d.ts.map +1 -0
- package/dist/rendering/webgpu/WebGPUTexture.js +2 -0
- package/dist/rendering/webgpu/WebGPUTexture.js.map +1 -0
- package/dist/scene/Bounds.d.ts +18 -0
- package/dist/scene/Bounds.d.ts.map +1 -0
- package/dist/scene/Bounds.js +55 -0
- package/dist/scene/Bounds.js.map +1 -0
- package/dist/scene/Camera.d.ts +22 -0
- package/dist/scene/Camera.d.ts.map +1 -0
- package/dist/scene/Camera.js +44 -0
- package/dist/scene/Camera.js.map +1 -0
- package/dist/scene/DirectionalLight.d.ts +7 -0
- package/dist/scene/DirectionalLight.d.ts.map +1 -0
- package/dist/scene/DirectionalLight.js +12 -0
- package/dist/scene/DirectionalLight.js.map +1 -0
- package/dist/scene/Hierarchy.d.ts +6 -0
- package/dist/scene/Hierarchy.d.ts.map +1 -0
- package/dist/scene/Hierarchy.js +19 -0
- package/dist/scene/Hierarchy.js.map +1 -0
- package/dist/scene/Layers.d.ts +8 -0
- package/dist/scene/Layers.d.ts.map +1 -0
- package/dist/scene/Layers.js +21 -0
- package/dist/scene/Layers.js.map +1 -0
- package/dist/scene/Light.d.ts +14 -0
- package/dist/scene/Light.d.ts.map +1 -0
- package/dist/scene/Light.js +23 -0
- package/dist/scene/Light.js.map +1 -0
- package/dist/scene/Lights.d.ts +6 -0
- package/dist/scene/Lights.d.ts.map +1 -0
- package/dist/scene/Lights.js +5 -0
- package/dist/scene/Lights.js.map +1 -0
- package/dist/scene/MathTypes.d.ts +52 -0
- package/dist/scene/MathTypes.d.ts.map +1 -0
- package/dist/scene/MathTypes.js +119 -0
- package/dist/scene/MathTypes.js.map +1 -0
- package/dist/scene/Object3D.d.ts +48 -0
- package/dist/scene/Object3D.d.ts.map +1 -0
- package/dist/scene/Object3D.js +122 -0
- package/dist/scene/Object3D.js.map +1 -0
- package/dist/scene/OrthographicCamera.d.ts +29 -0
- package/dist/scene/OrthographicCamera.d.ts.map +1 -0
- package/dist/scene/OrthographicCamera.js +59 -0
- package/dist/scene/OrthographicCamera.js.map +1 -0
- package/dist/scene/PerspectiveCamera.d.ts +20 -0
- package/dist/scene/PerspectiveCamera.d.ts.map +1 -0
- package/dist/scene/PerspectiveCamera.js +42 -0
- package/dist/scene/PerspectiveCamera.js.map +1 -0
- package/dist/scene/PointLight.d.ts +10 -0
- package/dist/scene/PointLight.d.ts.map +1 -0
- package/dist/scene/PointLight.js +22 -0
- package/dist/scene/PointLight.js.map +1 -0
- package/dist/scene/Renderable.d.ts +30 -0
- package/dist/scene/Renderable.d.ts.map +1 -0
- package/dist/scene/Renderable.js +54 -0
- package/dist/scene/Renderable.js.map +1 -0
- package/dist/scene/Scene.d.ts +45 -0
- package/dist/scene/Scene.d.ts.map +1 -0
- package/dist/scene/Scene.js +117 -0
- package/dist/scene/Scene.js.map +1 -0
- package/dist/scene/SceneMetadata.d.ts +79 -0
- package/dist/scene/SceneMetadata.d.ts.map +1 -0
- package/dist/scene/SceneMetadata.js +130 -0
- package/dist/scene/SceneMetadata.js.map +1 -0
- package/dist/scene/SceneNode.d.ts +42 -0
- package/dist/scene/SceneNode.d.ts.map +1 -0
- package/dist/scene/SceneNode.js +126 -0
- package/dist/scene/SceneNode.js.map +1 -0
- package/dist/scene/SceneQuery.d.ts +16 -0
- package/dist/scene/SceneQuery.d.ts.map +1 -0
- package/dist/scene/SceneQuery.js +37 -0
- package/dist/scene/SceneQuery.js.map +1 -0
- package/dist/scene/SceneSerializer.d.ts +59 -0
- package/dist/scene/SceneSerializer.d.ts.map +1 -0
- package/dist/scene/SceneSerializer.js +127 -0
- package/dist/scene/SceneSerializer.js.map +1 -0
- package/dist/scene/SpotLight.d.ts +14 -0
- package/dist/scene/SpotLight.d.ts.map +1 -0
- package/dist/scene/SpotLight.js +35 -0
- package/dist/scene/SpotLight.js.map +1 -0
- package/dist/scene/TransformNode.d.ts +26 -0
- package/dist/scene/TransformNode.d.ts.map +1 -0
- package/dist/scene/TransformNode.js +98 -0
- package/dist/scene/TransformNode.js.map +1 -0
- package/dist/scene/index.d.ts +21 -0
- package/dist/scene/index.d.ts.map +1 -0
- package/dist/scene/index.js +21 -0
- package/dist/scene/index.js.map +1 -0
- package/dist/scripting/AdaptiveDifficultyFixtures.d.ts +58 -0
- package/dist/scripting/AdaptiveDifficultyFixtures.d.ts.map +1 -0
- package/dist/scripting/AdaptiveDifficultyFixtures.js +228 -0
- package/dist/scripting/AdaptiveDifficultyFixtures.js.map +1 -0
- package/dist/scripting/AnalyticsPrivacyFixtures.d.ts +63 -0
- package/dist/scripting/AnalyticsPrivacyFixtures.d.ts.map +1 -0
- package/dist/scripting/AnalyticsPrivacyFixtures.js +120 -0
- package/dist/scripting/AnalyticsPrivacyFixtures.js.map +1 -0
- package/dist/scripting/Behavior.d.ts +10 -0
- package/dist/scripting/Behavior.d.ts.map +1 -0
- package/dist/scripting/Behavior.js +2 -0
- package/dist/scripting/Behavior.js.map +1 -0
- package/dist/scripting/BehaviorHost.d.ts +17 -0
- package/dist/scripting/BehaviorHost.d.ts.map +1 -0
- package/dist/scripting/BehaviorHost.js +39 -0
- package/dist/scripting/BehaviorHost.js.map +1 -0
- package/dist/scripting/BehaviorRegistry.d.ts +8 -0
- package/dist/scripting/BehaviorRegistry.d.ts.map +1 -0
- package/dist/scripting/BehaviorRegistry.js +17 -0
- package/dist/scripting/BehaviorRegistry.js.map +1 -0
- package/dist/scripting/BehaviorSystem.d.ts +26 -0
- package/dist/scripting/BehaviorSystem.d.ts.map +1 -0
- package/dist/scripting/BehaviorSystem.js +76 -0
- package/dist/scripting/BehaviorSystem.js.map +1 -0
- package/dist/scripting/BehaviorTree.d.ts +75 -0
- package/dist/scripting/BehaviorTree.d.ts.map +1 -0
- package/dist/scripting/BehaviorTree.js +204 -0
- package/dist/scripting/BehaviorTree.js.map +1 -0
- package/dist/scripting/CloudServiceFixtures.d.ts +81 -0
- package/dist/scripting/CloudServiceFixtures.d.ts.map +1 -0
- package/dist/scripting/CloudServiceFixtures.js +144 -0
- package/dist/scripting/CloudServiceFixtures.js.map +1 -0
- package/dist/scripting/CulturalBehaviorFixtures.d.ts +75 -0
- package/dist/scripting/CulturalBehaviorFixtures.d.ts.map +1 -0
- package/dist/scripting/CulturalBehaviorFixtures.js +180 -0
- package/dist/scripting/CulturalBehaviorFixtures.js.map +1 -0
- package/dist/scripting/DecisionTree.d.ts +42 -0
- package/dist/scripting/DecisionTree.d.ts.map +1 -0
- package/dist/scripting/DecisionTree.js +125 -0
- package/dist/scripting/DecisionTree.js.map +1 -0
- package/dist/scripting/GOAP.d.ts +51 -0
- package/dist/scripting/GOAP.d.ts.map +1 -0
- package/dist/scripting/GOAP.js +105 -0
- package/dist/scripting/GOAP.js.map +1 -0
- package/dist/scripting/HTN.d.ts +58 -0
- package/dist/scripting/HTN.d.ts.map +1 -0
- package/dist/scripting/HTN.js +115 -0
- package/dist/scripting/HTN.js.map +1 -0
- package/dist/scripting/LearningAgentFixtures.d.ts +60 -0
- package/dist/scripting/LearningAgentFixtures.d.ts.map +1 -0
- package/dist/scripting/LearningAgentFixtures.js +122 -0
- package/dist/scripting/LearningAgentFixtures.js.map +1 -0
- package/dist/scripting/NetworkReplicationFixtures.d.ts +82 -0
- package/dist/scripting/NetworkReplicationFixtures.d.ts.map +1 -0
- package/dist/scripting/NetworkReplicationFixtures.js +330 -0
- package/dist/scripting/NetworkReplicationFixtures.js.map +1 -0
- package/dist/scripting/Perception.d.ts +58 -0
- package/dist/scripting/Perception.d.ts.map +1 -0
- package/dist/scripting/Perception.js +111 -0
- package/dist/scripting/Perception.js.map +1 -0
- package/dist/scripting/PlayerBehaviorTelemetryFixtures.d.ts +74 -0
- package/dist/scripting/PlayerBehaviorTelemetryFixtures.d.ts.map +1 -0
- package/dist/scripting/PlayerBehaviorTelemetryFixtures.js +189 -0
- package/dist/scripting/PlayerBehaviorTelemetryFixtures.js.map +1 -0
- package/dist/scripting/ProceduralContentAdaptationFixtures.d.ts +52 -0
- package/dist/scripting/ProceduralContentAdaptationFixtures.d.ts.map +1 -0
- package/dist/scripting/ProceduralContentAdaptationFixtures.js +149 -0
- package/dist/scripting/ProceduralContentAdaptationFixtures.js.map +1 -0
- package/dist/scripting/ScriptContext.d.ts +18 -0
- package/dist/scripting/ScriptContext.d.ts.map +1 -0
- package/dist/scripting/ScriptContext.js +21 -0
- package/dist/scripting/ScriptContext.js.map +1 -0
- package/dist/scripting/StateMachine.d.ts +52 -0
- package/dist/scripting/StateMachine.d.ts.map +1 -0
- package/dist/scripting/StateMachine.js +117 -0
- package/dist/scripting/StateMachine.js.map +1 -0
- package/dist/scripting/UtilityAI.d.ts +55 -0
- package/dist/scripting/UtilityAI.d.ts.map +1 -0
- package/dist/scripting/UtilityAI.js +113 -0
- package/dist/scripting/UtilityAI.js.map +1 -0
- package/dist/scripting/VisualGraph.d.ts +19 -0
- package/dist/scripting/VisualGraph.d.ts.map +1 -0
- package/dist/scripting/VisualGraph.js +74 -0
- package/dist/scripting/VisualGraph.js.map +1 -0
- package/dist/scripting/VisualGraphExecutor.d.ts +11 -0
- package/dist/scripting/VisualGraphExecutor.d.ts.map +1 -0
- package/dist/scripting/VisualGraphExecutor.js +214 -0
- package/dist/scripting/VisualGraphExecutor.js.map +1 -0
- package/dist/scripting/VisualNode.d.ts +17 -0
- package/dist/scripting/VisualNode.d.ts.map +1 -0
- package/dist/scripting/VisualNode.js +24 -0
- package/dist/scripting/VisualNode.js.map +1 -0
- package/dist/scripting/VisualNodeCatalog.d.ts +14 -0
- package/dist/scripting/VisualNodeCatalog.d.ts.map +1 -0
- package/dist/scripting/VisualNodeCatalog.js +82 -0
- package/dist/scripting/VisualNodeCatalog.js.map +1 -0
- package/dist/scripting/WeaponSystem.d.ts +228 -0
- package/dist/scripting/WeaponSystem.d.ts.map +1 -0
- package/dist/scripting/WeaponSystem.js +530 -0
- package/dist/scripting/WeaponSystem.js.map +1 -0
- package/dist/scripting/index.d.ts +50 -0
- package/dist/scripting/index.d.ts.map +1 -0
- package/dist/scripting/index.js +25 -0
- package/dist/scripting/index.js.map +1 -0
- package/dist/three-compat/ThreeApiInventory.d.ts +18 -0
- package/dist/three-compat/ThreeApiInventory.d.ts.map +1 -0
- package/dist/three-compat/ThreeApiInventory.js +99 -0
- package/dist/three-compat/ThreeApiInventory.js.map +1 -0
- package/dist/three-compat/ThreeCompatibilityMatrix.d.ts +30 -0
- package/dist/three-compat/ThreeCompatibilityMatrix.d.ts.map +1 -0
- package/dist/three-compat/ThreeCompatibilityMatrix.js +69 -0
- package/dist/three-compat/ThreeCompatibilityMatrix.js.map +1 -0
- package/dist/three-compat/animation/index.d.ts +3 -0
- package/dist/three-compat/animation/index.d.ts.map +1 -0
- package/dist/three-compat/animation/index.js +2 -0
- package/dist/three-compat/animation/index.js.map +1 -0
- package/dist/three-compat/cameras/index.d.ts +24 -0
- package/dist/three-compat/cameras/index.d.ts.map +1 -0
- package/dist/three-compat/cameras/index.js +44 -0
- package/dist/three-compat/cameras/index.js.map +1 -0
- package/dist/three-compat/controls/index.d.ts +3 -0
- package/dist/three-compat/controls/index.d.ts.map +1 -0
- package/dist/three-compat/controls/index.js +2 -0
- package/dist/three-compat/controls/index.js.map +1 -0
- package/dist/three-compat/core/Object3DCompat.d.ts +62 -0
- package/dist/three-compat/core/Object3DCompat.d.ts.map +1 -0
- package/dist/three-compat/core/Object3DCompat.js +112 -0
- package/dist/three-compat/core/Object3DCompat.js.map +1 -0
- package/dist/three-compat/core/RaycasterCompat.d.ts +18 -0
- package/dist/three-compat/core/RaycasterCompat.d.ts.map +1 -0
- package/dist/three-compat/core/RaycasterCompat.js +28 -0
- package/dist/three-compat/core/RaycasterCompat.js.map +1 -0
- package/dist/three-compat/core/SceneCompat.d.ts +8 -0
- package/dist/three-compat/core/SceneCompat.d.ts.map +1 -0
- package/dist/three-compat/core/SceneCompat.js +8 -0
- package/dist/three-compat/core/SceneCompat.js.map +1 -0
- package/dist/three-compat/geometries/index.d.ts +67 -0
- package/dist/three-compat/geometries/index.d.ts.map +1 -0
- package/dist/three-compat/geometries/index.js +114 -0
- package/dist/three-compat/geometries/index.js.map +1 -0
- package/dist/three-compat/helpers/index.d.ts +40 -0
- package/dist/three-compat/helpers/index.d.ts.map +1 -0
- package/dist/three-compat/helpers/index.js +129 -0
- package/dist/three-compat/helpers/index.js.map +1 -0
- package/dist/three-compat/index.d.ts +32 -0
- package/dist/three-compat/index.d.ts.map +1 -0
- package/dist/three-compat/index.js +22 -0
- package/dist/three-compat/index.js.map +1 -0
- package/dist/three-compat/lights/index.d.ts +35 -0
- package/dist/three-compat/lights/index.d.ts.map +1 -0
- package/dist/three-compat/lights/index.js +39 -0
- package/dist/three-compat/lights/index.js.map +1 -0
- package/dist/three-compat/loaders/index.d.ts +54 -0
- package/dist/three-compat/loaders/index.d.ts.map +1 -0
- package/dist/three-compat/loaders/index.js +79 -0
- package/dist/three-compat/loaders/index.js.map +1 -0
- package/dist/three-compat/materials/index.d.ts +70 -0
- package/dist/three-compat/materials/index.d.ts.map +1 -0
- package/dist/three-compat/materials/index.js +85 -0
- package/dist/three-compat/materials/index.js.map +1 -0
- package/dist/three-compat/math/index.d.ts +34 -0
- package/dist/three-compat/math/index.d.ts.map +1 -0
- package/dist/three-compat/math/index.js +90 -0
- package/dist/three-compat/math/index.js.map +1 -0
- package/dist/three-compat/migration/CompatibilityWarnings.d.ts +6 -0
- package/dist/three-compat/migration/CompatibilityWarnings.d.ts.map +1 -0
- package/dist/three-compat/migration/CompatibilityWarnings.js +8 -0
- package/dist/three-compat/migration/CompatibilityWarnings.js.map +1 -0
- package/dist/three-compat/migration/ImportMap.d.ts +2 -0
- package/dist/three-compat/migration/ImportMap.d.ts.map +1 -0
- package/dist/three-compat/migration/ImportMap.js +10 -0
- package/dist/three-compat/migration/ImportMap.js.map +1 -0
- package/dist/three-compat/migration/ThreeToA3DAdapter.d.ts +8 -0
- package/dist/three-compat/migration/ThreeToA3DAdapter.d.ts.map +1 -0
- package/dist/three-compat/migration/ThreeToA3DAdapter.js +20 -0
- package/dist/three-compat/migration/ThreeToA3DAdapter.js.map +1 -0
- package/dist/three-compat/postprocessing/index.d.ts +2 -0
- package/dist/three-compat/postprocessing/index.d.ts.map +1 -0
- package/dist/three-compat/postprocessing/index.js +2 -0
- package/dist/three-compat/postprocessing/index.js.map +1 -0
- package/dist/three-compat/render-targets/index.d.ts +17 -0
- package/dist/three-compat/render-targets/index.d.ts.map +1 -0
- package/dist/three-compat/render-targets/index.js +29 -0
- package/dist/three-compat/render-targets/index.js.map +1 -0
- package/dist/three-compat/shaders/index.d.ts +3 -0
- package/dist/three-compat/shaders/index.d.ts.map +1 -0
- package/dist/three-compat/shaders/index.js +3 -0
- package/dist/three-compat/shaders/index.js.map +1 -0
- package/dist/three-compat/textures/index.d.ts +19 -0
- package/dist/three-compat/textures/index.d.ts.map +1 -0
- package/dist/three-compat/textures/index.js +24 -0
- package/dist/three-compat/textures/index.js.map +1 -0
- package/dist/workflows/AnimationLabWorkflow.d.ts +3 -0
- package/dist/workflows/AnimationLabWorkflow.d.ts.map +1 -0
- package/dist/workflows/AnimationLabWorkflow.js +156 -0
- package/dist/workflows/AnimationLabWorkflow.js.map +1 -0
- package/dist/workflows/AssetViewerWorkflow.d.ts +3 -0
- package/dist/workflows/AssetViewerWorkflow.d.ts.map +1 -0
- package/dist/workflows/AssetViewerWorkflow.js +35 -0
- package/dist/workflows/AssetViewerWorkflow.js.map +1 -0
- package/dist/workflows/ComparisonWorkflow.d.ts +3 -0
- package/dist/workflows/ComparisonWorkflow.d.ts.map +1 -0
- package/dist/workflows/ComparisonWorkflow.js +67 -0
- package/dist/workflows/ComparisonWorkflow.js.map +1 -0
- package/dist/workflows/InteractiveSceneWorkflow.d.ts +3 -0
- package/dist/workflows/InteractiveSceneWorkflow.d.ts.map +1 -0
- package/dist/workflows/InteractiveSceneWorkflow.js +43 -0
- package/dist/workflows/InteractiveSceneWorkflow.js.map +1 -0
- package/dist/workflows/MaterialStudioWorkflow.d.ts +3 -0
- package/dist/workflows/MaterialStudioWorkflow.d.ts.map +1 -0
- package/dist/workflows/MaterialStudioWorkflow.js +47 -0
- package/dist/workflows/MaterialStudioWorkflow.js.map +1 -0
- package/dist/workflows/ProductConfiguratorWorkflow.d.ts +3 -0
- package/dist/workflows/ProductConfiguratorWorkflow.d.ts.map +1 -0
- package/dist/workflows/ProductConfiguratorWorkflow.js +25 -0
- package/dist/workflows/ProductConfiguratorWorkflow.js.map +1 -0
- package/dist/workflows/SceneShowcaseWorkflow.d.ts +3 -0
- package/dist/workflows/SceneShowcaseWorkflow.d.ts.map +1 -0
- package/dist/workflows/SceneShowcaseWorkflow.js +44 -0
- package/dist/workflows/SceneShowcaseWorkflow.js.map +1 -0
- package/dist/workflows/WorkflowDiagnostics.d.ts +11 -0
- package/dist/workflows/WorkflowDiagnostics.d.ts.map +1 -0
- package/dist/workflows/WorkflowDiagnostics.js +34 -0
- package/dist/workflows/WorkflowDiagnostics.js.map +1 -0
- package/dist/workflows/WorkflowTypes.d.ts +90 -0
- package/dist/workflows/WorkflowTypes.d.ts.map +1 -0
- package/dist/workflows/WorkflowTypes.js +2 -0
- package/dist/workflows/WorkflowTypes.js.map +1 -0
- package/dist/workflows/index.d.ts +13 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +11 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/production-runtime/ArchitectureWorkflow.d.ts +7 -0
- package/dist/workflows/production-runtime/ArchitectureWorkflow.d.ts.map +1 -0
- package/dist/workflows/production-runtime/ArchitectureWorkflow.js +2 -0
- package/dist/workflows/production-runtime/ArchitectureWorkflow.js.map +1 -0
- package/dist/workflows/production-runtime/AssetInspectionWorkflow.d.ts +7 -0
- package/dist/workflows/production-runtime/AssetInspectionWorkflow.d.ts.map +1 -0
- package/dist/workflows/production-runtime/AssetInspectionWorkflow.js +2 -0
- package/dist/workflows/production-runtime/AssetInspectionWorkflow.js.map +1 -0
- package/dist/workflows/production-runtime/CinematicWorkflow.d.ts +7 -0
- package/dist/workflows/production-runtime/CinematicWorkflow.d.ts.map +1 -0
- package/dist/workflows/production-runtime/CinematicWorkflow.js +2 -0
- package/dist/workflows/production-runtime/CinematicWorkflow.js.map +1 -0
- package/dist/workflows/production-runtime/MaterialAuthoringWorkflow.d.ts +7 -0
- package/dist/workflows/production-runtime/MaterialAuthoringWorkflow.d.ts.map +1 -0
- package/dist/workflows/production-runtime/MaterialAuthoringWorkflow.js +2 -0
- package/dist/workflows/production-runtime/MaterialAuthoringWorkflow.js.map +1 -0
- package/dist/workflows/production-runtime/ProductRenderWorkflow.d.ts +7 -0
- package/dist/workflows/production-runtime/ProductRenderWorkflow.d.ts.map +1 -0
- package/dist/workflows/production-runtime/ProductRenderWorkflow.js +2 -0
- package/dist/workflows/production-runtime/ProductRenderWorkflow.js.map +1 -0
- package/dist/workflows/production-runtime/ProductionExampleRuntime.d.ts +66 -0
- package/dist/workflows/production-runtime/ProductionExampleRuntime.d.ts.map +1 -0
- package/dist/workflows/production-runtime/ProductionExampleRuntime.js +189 -0
- package/dist/workflows/production-runtime/ProductionExampleRuntime.js.map +1 -0
- package/dist/workflows/production-runtime/ProductionWorkflows.d.ts +69 -0
- package/dist/workflows/production-runtime/ProductionWorkflows.d.ts.map +1 -0
- package/dist/workflows/production-runtime/ProductionWorkflows.js +128 -0
- package/dist/workflows/production-runtime/ProductionWorkflows.js.map +1 -0
- package/dist/workflows/production-runtime/WorkflowDiagnostics.d.ts +7 -0
- package/dist/workflows/production-runtime/WorkflowDiagnostics.d.ts.map +1 -0
- package/dist/workflows/production-runtime/WorkflowDiagnostics.js +2 -0
- package/dist/workflows/production-runtime/WorkflowDiagnostics.js.map +1 -0
- package/dist/workflows/production-runtime/index.d.ts +11 -0
- package/dist/workflows/production-runtime/index.d.ts.map +1 -0
- package/dist/workflows/production-runtime/index.js +9 -0
- package/dist/workflows/production-runtime/index.js.map +1 -0
- package/dist/workflows/workflow-foundation/index.d.ts +26 -0
- package/dist/workflows/workflow-foundation/index.d.ts.map +1 -0
- package/dist/workflows/workflow-foundation/index.js +25 -0
- package/dist/workflows/workflow-foundation/index.js.map +1 -0
- package/package.json +490 -0
- package/templates/cinematic-scene/README.md +11 -0
- package/templates/cinematic-scene/index.html +13 -0
- package/templates/cinematic-scene/package.json +21 -0
- package/templates/cinematic-scene/playwright.config.ts +14 -0
- package/templates/cinematic-scene/public/aura-assets/hero-fixture.glb +0 -0
- package/templates/cinematic-scene/public/aura-assets/hero.thumb.svg +1 -0
- package/templates/cinematic-scene/src/aura-assets.ts +17 -0
- package/templates/cinematic-scene/src/main.ts +27 -0
- package/templates/cinematic-scene/tests/route-health.spec.ts +16 -0
- package/templates/cinematic-scene/tests/screenshot.spec.ts +56 -0
- package/templates/cinematic-scene/tsconfig.json +15 -0
- package/templates/mini-game/README.md +10 -0
- package/templates/mini-game/index.html +13 -0
- package/templates/mini-game/package.json +21 -0
- package/templates/mini-game/playwright.config.ts +14 -0
- package/templates/mini-game/public/aura-assets/player-fixture.glb +0 -0
- package/templates/mini-game/public/aura-assets/player.thumb.svg +8 -0
- package/templates/mini-game/src/aura-assets.ts +17 -0
- package/templates/mini-game/src/main.ts +27 -0
- package/templates/mini-game/tests/route-health.spec.ts +16 -0
- package/templates/mini-game/tests/screenshot.spec.ts +63 -0
- package/templates/mini-game/tsconfig.json +15 -0
- package/templates/product-viewer/README.md +16 -0
- package/templates/product-viewer/index.html +16 -0
- package/templates/product-viewer/package.json +21 -0
- package/templates/product-viewer/playwright.config.ts +14 -0
- package/templates/product-viewer/public/aura-assets/product-fixture.glb +0 -0
- package/templates/product-viewer/public/aura-assets/product.thumb.svg +1 -0
- package/templates/product-viewer/src/aura-assets.ts +17 -0
- package/templates/product-viewer/src/main.ts +27 -0
- package/templates/product-viewer/tests/route-health.spec.ts +16 -0
- package/templates/product-viewer/tests/screenshot.spec.ts +60 -0
- package/templates/product-viewer/tsconfig.json +15 -0
|
@@ -0,0 +1,2735 @@
|
|
|
1
|
+
import { PointLight, composeMat4, decomposeMat4, invertMat4, multiplyMat4, Renderable, Scene, SpotLight } from "../scene/index.js";
|
|
2
|
+
import { AnimationClip, AnimationTrack, Skeleton } from "../animation/browser-index.js";
|
|
3
|
+
import { evaluateGLTFExtensionSupport } from "./GLTFExtensionSupport.js";
|
|
4
|
+
const DEFAULT_GLTF_MATERIAL_NAME = "default-material";
|
|
5
|
+
const RUNTIME_MATERIAL_KEY_MARKER = "#aura3d-runtime:";
|
|
6
|
+
const DISPOSE_GLTF_ASSET = Symbol("disposeGLTFAsset");
|
|
7
|
+
const MAX_RENDERABLE_SKIN_JOINTS = 64;
|
|
8
|
+
function createSpecularFromSpecularGlossiness(extension) {
|
|
9
|
+
if (!extension)
|
|
10
|
+
return undefined;
|
|
11
|
+
return {
|
|
12
|
+
factor: 1,
|
|
13
|
+
colorFactor: extension.specularFactor,
|
|
14
|
+
colorTexture: extension.specularGlossinessTexture
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export class GLTFLoader {
|
|
18
|
+
options;
|
|
19
|
+
type = "gltf";
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this.options = options;
|
|
22
|
+
}
|
|
23
|
+
canLoad(request) {
|
|
24
|
+
return /\.(?:gltf|glb)(?:\?.*)?$/i.test(request.url) || request.url.startsWith("data:model/gltf");
|
|
25
|
+
}
|
|
26
|
+
async load(request, context) {
|
|
27
|
+
context.throwIfAborted(request.url);
|
|
28
|
+
const document = await loadDocument(request);
|
|
29
|
+
let json = document.json;
|
|
30
|
+
if (json.asset?.version && !json.asset.version.startsWith("2.")) {
|
|
31
|
+
throw new Error(`Unsupported glTF version: ${json.asset.version}`);
|
|
32
|
+
}
|
|
33
|
+
const extensionSupport = evaluateGLTFExtensionSupport(json.extensionsUsed, json.extensionsRequired);
|
|
34
|
+
const unsupportedRequiredExtensions = extensionSupport.unsupportedRequired;
|
|
35
|
+
if (unsupportedRequiredExtensions.length > 0) {
|
|
36
|
+
throw new Error(`Unsupported required glTF extensions: ${unsupportedRequiredExtensions.join(", ")}`);
|
|
37
|
+
}
|
|
38
|
+
const rawBuffers = await Promise.all((json.buffers ?? []).map((buffer, index) => loadBuffer(buffer, index, document, request)));
|
|
39
|
+
const prepared = await prepareBufferViews(json, rawBuffers, this.options.meshoptDecoder);
|
|
40
|
+
const buffers = prepared.buffers;
|
|
41
|
+
json = prepared.json;
|
|
42
|
+
const accessorCache = createGLTFAccessorReadCache();
|
|
43
|
+
const meshQuantizationEnabled = usesGLTFExtension(json, "KHR_mesh_quantization");
|
|
44
|
+
const images = createImageAssets(json, buffers);
|
|
45
|
+
const textures = createTextureAssets(json);
|
|
46
|
+
const materials = createMaterialAssets(json, textures);
|
|
47
|
+
const materialVariants = createMaterialVariantAssets(json);
|
|
48
|
+
const scenes = createSceneAssets(json);
|
|
49
|
+
const defaultScene = resolveDefaultSceneIndex(json);
|
|
50
|
+
const cameras = createCameraAssets(json);
|
|
51
|
+
const lights = createLightAssets(json);
|
|
52
|
+
const skins = createSkinAssets(json, buffers, accessorCache);
|
|
53
|
+
const nodeInstanceTransforms = createNodeInstanceTransforms(json, buffers, accessorCache);
|
|
54
|
+
const meshes = await Promise.all((json.meshes ?? []).flatMap((mesh, meshIndex) => {
|
|
55
|
+
validateMeshDescriptor(mesh, meshIndex);
|
|
56
|
+
return mesh.primitives.map(async (primitive, primitiveIndex) => {
|
|
57
|
+
validatePrimitiveDescriptor(primitive, meshIndex, primitiveIndex);
|
|
58
|
+
validatePrimitiveAttributeAccessors(json, primitive, meshQuantizationEnabled, meshIndex, primitiveIndex);
|
|
59
|
+
const positionAccessorIndex = primitive.attributes.POSITION;
|
|
60
|
+
if (positionAccessorIndex === undefined) {
|
|
61
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} is missing POSITION`);
|
|
62
|
+
}
|
|
63
|
+
const dracoPrimitive = await decodeDracoPrimitive(json, buffers, primitive, meshIndex, primitiveIndex, this.options.dracoDecoder);
|
|
64
|
+
const positions = dracoPrimitive?.attributes.POSITION ?? readAccessor(json, buffers, positionAccessorIndex, accessorCache);
|
|
65
|
+
const normals = readPrimitiveAttribute(json, buffers, primitive, dracoPrimitive, "NORMAL", accessorCache);
|
|
66
|
+
const texcoordSets = readTexcoordSets(json, buffers, primitive, positions.length, meshIndex, primitiveIndex, dracoPrimitive, accessorCache);
|
|
67
|
+
const texcoords = texcoordSets[0] ?? [];
|
|
68
|
+
const tangents = readPrimitiveAttribute(json, buffers, primitive, dracoPrimitive, "TANGENT", accessorCache);
|
|
69
|
+
const colors = readPrimitiveAttribute(json, buffers, primitive, dracoPrimitive, "COLOR_0", accessorCache);
|
|
70
|
+
const joints = readPrimitiveAttribute(json, buffers, primitive, dracoPrimitive, "JOINTS_0", accessorCache);
|
|
71
|
+
const weights = readPrimitiveAttribute(json, buffers, primitive, dracoPrimitive, "WEIGHTS_0", accessorCache);
|
|
72
|
+
const indices = dracoPrimitive
|
|
73
|
+
? dracoPrimitive.indices?.map((index) => [index])
|
|
74
|
+
: primitive.indices === undefined ? undefined : readAccessor(json, buffers, primitive.indices, accessorCache);
|
|
75
|
+
validateAttributeCount("NORMAL", normals, positions.length, meshIndex, primitiveIndex);
|
|
76
|
+
validateAttributeCount("TANGENT", tangents, positions.length, meshIndex, primitiveIndex);
|
|
77
|
+
validateAttributeCount("COLOR_0", colors, positions.length, meshIndex, primitiveIndex);
|
|
78
|
+
validateAttributeCount("JOINTS_0", joints, positions.length, meshIndex, primitiveIndex);
|
|
79
|
+
validateAttributeCount("WEIGHTS_0", weights, positions.length, meshIndex, primitiveIndex);
|
|
80
|
+
const primitiveMaterialIndex = resolvePrimitiveMaterialIndex(primitive, materials, meshIndex, primitiveIndex);
|
|
81
|
+
const primitiveMaterial = primitiveMaterialIndex === undefined ? undefined : materials[primitiveMaterialIndex];
|
|
82
|
+
const primitiveMaterialVariants = resolvePrimitiveMaterialVariants(primitive, materialVariants, materials, meshIndex, primitiveIndex);
|
|
83
|
+
validateMaterialTexCoordSets(primitiveMaterial, texcoordSets, meshIndex, primitiveIndex);
|
|
84
|
+
const typedPositions = positions.map((position) => [position[0] ?? 0, position[1] ?? 0, position[2] ?? 0]);
|
|
85
|
+
const typedNormals = normals.map((normal) => [normal[0] ?? 0, normal[1] ?? 0, normal[2] ?? 0]);
|
|
86
|
+
const typedTangents = tangents.map((tangent) => [tangent[0] ?? 0, tangent[1] ?? 0, tangent[2] ?? 0, tangent[3] ?? 1]);
|
|
87
|
+
const typedColors = colors.map((color) => [color[0] ?? 1, color[1] ?? 1, color[2] ?? 1, color[3] ?? 1]);
|
|
88
|
+
const typedJoints = joints.map((joint) => [joint[0] ?? 0, joint[1] ?? 0, joint[2] ?? 0, joint[3] ?? 0]);
|
|
89
|
+
const typedWeights = weights.map((weight) => normalizeSkinWeights([
|
|
90
|
+
weight[0] ?? 0,
|
|
91
|
+
weight[1] ?? 0,
|
|
92
|
+
weight[2] ?? 0,
|
|
93
|
+
weight[3] ?? 0
|
|
94
|
+
], meshIndex, primitiveIndex));
|
|
95
|
+
const morphTargets = readMorphTargets(json, buffers, primitive, positions.length, meshIndex, primitiveIndex, accessorCache);
|
|
96
|
+
const resolvedPrimitive = resolvePrimitiveMode(primitive, indices?.map((index) => index[0] ?? 0), positions.length, meshIndex, primitiveIndex);
|
|
97
|
+
const geometry = createGeometryAsset(typedPositions, resolvedPrimitive.indices);
|
|
98
|
+
return {
|
|
99
|
+
name: meshPrimitiveName(mesh, meshIndex, primitiveIndex),
|
|
100
|
+
sourceMeshIndex: meshIndex,
|
|
101
|
+
primitiveIndex,
|
|
102
|
+
topology: resolvedPrimitive.topology,
|
|
103
|
+
geometry,
|
|
104
|
+
positions: typedPositions,
|
|
105
|
+
normals: typedNormals,
|
|
106
|
+
texcoords,
|
|
107
|
+
texcoordSets,
|
|
108
|
+
tangents: typedTangents,
|
|
109
|
+
colors: typedColors,
|
|
110
|
+
joints: typedJoints,
|
|
111
|
+
weights: typedWeights,
|
|
112
|
+
morphTargets,
|
|
113
|
+
morphWeights: resolveMorphWeights(mesh, meshIndex, primitiveIndex, morphTargets.length),
|
|
114
|
+
indices: resolvedPrimitive.indices,
|
|
115
|
+
material: materialName(primitiveMaterial, primitiveMaterialIndex),
|
|
116
|
+
materialIndex: primitiveMaterialIndex,
|
|
117
|
+
materialVariants: primitiveMaterialVariants,
|
|
118
|
+
skinIndex: findSkinForMesh(json, meshIndex)
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
}));
|
|
122
|
+
const animations = createAnimationClips(json, buffers, accessorCache);
|
|
123
|
+
const loadProfile = createGLTFLoaderLoadProfileDiagnostics(document, buffers, images, accessorCache);
|
|
124
|
+
const loaderDiagnostics = createGLTFLoaderDiagnostics(json, {
|
|
125
|
+
images,
|
|
126
|
+
textures,
|
|
127
|
+
materials,
|
|
128
|
+
meshes,
|
|
129
|
+
animations,
|
|
130
|
+
skins
|
|
131
|
+
}, loadProfile);
|
|
132
|
+
let disposed = false;
|
|
133
|
+
const assertAlive = () => {
|
|
134
|
+
if (disposed) {
|
|
135
|
+
throw new Error(`glTF asset ${request.url} has been disposed`);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const asset = {
|
|
139
|
+
url: request.url,
|
|
140
|
+
get disposed() {
|
|
141
|
+
return disposed;
|
|
142
|
+
},
|
|
143
|
+
loaderDiagnostics,
|
|
144
|
+
images,
|
|
145
|
+
textures,
|
|
146
|
+
materials,
|
|
147
|
+
materialVariants,
|
|
148
|
+
scenes,
|
|
149
|
+
defaultScene,
|
|
150
|
+
meshes,
|
|
151
|
+
cameras,
|
|
152
|
+
lights,
|
|
153
|
+
skins,
|
|
154
|
+
animations,
|
|
155
|
+
createScene: (options) => {
|
|
156
|
+
assertAlive();
|
|
157
|
+
return createScene(json, meshes, cameras, lights, skins, nodeInstanceTransforms, materialVariants, options);
|
|
158
|
+
},
|
|
159
|
+
toJSON: () => {
|
|
160
|
+
assertAlive();
|
|
161
|
+
return serializeGLTFAsset(request.url, loaderDiagnostics, images, textures, materials, materialVariants, scenes, defaultScene, meshes, cameras, lights, skins, animations);
|
|
162
|
+
},
|
|
163
|
+
[DISPOSE_GLTF_ASSET]: () => {
|
|
164
|
+
disposed = true;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
return asset;
|
|
168
|
+
}
|
|
169
|
+
dispose(asset) {
|
|
170
|
+
asset[DISPOSE_GLTF_ASSET]?.();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function createGLTFAccessorReadCache() {
|
|
174
|
+
return {
|
|
175
|
+
rowsByAccessor: new Map(),
|
|
176
|
+
dataViews: new Map(),
|
|
177
|
+
profile: {
|
|
178
|
+
accessorReadCount: 0,
|
|
179
|
+
uniqueAccessorReadCount: 0,
|
|
180
|
+
accessorCacheHitCount: 0,
|
|
181
|
+
accessorRowsRead: 0,
|
|
182
|
+
accessorValuesRead: 0,
|
|
183
|
+
accessorReadMs: 0,
|
|
184
|
+
dataViewCacheEntries: 0,
|
|
185
|
+
largestAccessors: []
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function createGLTFLoaderLoadProfileDiagnostics(document, buffers, images, accessorCache) {
|
|
190
|
+
const profile = accessorCache.profile;
|
|
191
|
+
const embeddedImageBytes = images.reduce((sum, image) => sum + (image.data?.byteLength ?? 0), 0);
|
|
192
|
+
return {
|
|
193
|
+
schemaVersion: "gltf-loader-load-profile",
|
|
194
|
+
documentBytes: document.byteLength,
|
|
195
|
+
binaryChunkBytes: document.binaryChunk?.byteLength ?? 0,
|
|
196
|
+
bufferBytes: buffers.reduce((sum, buffer) => sum + buffer.byteLength, 0),
|
|
197
|
+
imageBytes: embeddedImageBytes,
|
|
198
|
+
embeddedImageBytes,
|
|
199
|
+
externalImageCount: images.filter((image) => Boolean(image.uri) && !image.uri.startsWith("data:")).length,
|
|
200
|
+
bufferViewImageCount: images.filter((image) => image.data !== undefined).length,
|
|
201
|
+
accessorReadCount: profile.accessorReadCount,
|
|
202
|
+
uniqueAccessorReadCount: profile.uniqueAccessorReadCount,
|
|
203
|
+
accessorCacheHitCount: profile.accessorCacheHitCount,
|
|
204
|
+
accessorRowsRead: profile.accessorRowsRead,
|
|
205
|
+
accessorValuesRead: profile.accessorValuesRead,
|
|
206
|
+
accessorReadMs: roundDiagnosticMs(profile.accessorReadMs),
|
|
207
|
+
dataViewCacheEntries: profile.dataViewCacheEntries,
|
|
208
|
+
largestAccessors: [...profile.largestAccessors]
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function roundDiagnosticMs(value) {
|
|
212
|
+
return Math.round(value * 1000) / 1000;
|
|
213
|
+
}
|
|
214
|
+
function nowMs() {
|
|
215
|
+
const performance = globalThis.performance;
|
|
216
|
+
return performance && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
217
|
+
}
|
|
218
|
+
function createGeometryAsset(positions, indices) {
|
|
219
|
+
const min = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];
|
|
220
|
+
const max = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];
|
|
221
|
+
for (const position of positions) {
|
|
222
|
+
min[0] = Math.min(min[0], position[0]);
|
|
223
|
+
min[1] = Math.min(min[1], position[1]);
|
|
224
|
+
min[2] = Math.min(min[2], position[2]);
|
|
225
|
+
max[0] = Math.max(max[0], position[0]);
|
|
226
|
+
max[1] = Math.max(max[1], position[1]);
|
|
227
|
+
max[2] = Math.max(max[2], position[2]);
|
|
228
|
+
}
|
|
229
|
+
return { vertexCount: positions.length, indexCount: indices?.length ?? 0, bounds: { min, max } };
|
|
230
|
+
}
|
|
231
|
+
function createGLTFLoaderDiagnostics(json, asset, loadProfile) {
|
|
232
|
+
const extensionsUsed = [...new Set([...(json.extensionsUsed ?? []), ...(json.extensionsRequired ?? [])])].sort();
|
|
233
|
+
const extensionSupport = evaluateGLTFExtensionSupport(json.extensionsUsed, json.extensionsRequired);
|
|
234
|
+
const materialFeatures = [...new Set(asset.materials.flatMap(materialFeatureNames))].sort();
|
|
235
|
+
const textureSlots = [...new Set(asset.materials.flatMap(materialTextureSlotNames))].sort();
|
|
236
|
+
const unsupportedFeatures = collectUnsupportedFeatureDiagnostics(json);
|
|
237
|
+
const compression = {
|
|
238
|
+
draco: usesGLTFExtension(json, "KHR_draco_mesh_compression"),
|
|
239
|
+
meshopt: usesGLTFMeshoptExtension(json),
|
|
240
|
+
ktx2Basis: usesGLTFExtension(json, "KHR_texture_basisu") || asset.images.some((image) => /\.ktx2(?:[?#]|$)/i.test(image.uri ?? "") || image.mimeType === "image/ktx2")
|
|
241
|
+
};
|
|
242
|
+
const features = new Set([
|
|
243
|
+
"gltf",
|
|
244
|
+
...extensionsUsed.map((extension) => `extension:${extension}`),
|
|
245
|
+
...materialFeatures.map((feature) => `material:${feature}`),
|
|
246
|
+
...textureSlots.map((slot) => `texture-slot:${slot}`)
|
|
247
|
+
]);
|
|
248
|
+
if (asset.meshes.length > 0)
|
|
249
|
+
features.add("mesh");
|
|
250
|
+
if (asset.meshes.some((mesh) => mesh.geometry.indexCount > 0))
|
|
251
|
+
features.add("indexed-geometry");
|
|
252
|
+
if (asset.meshes.some((mesh) => mesh.normals.length > 0))
|
|
253
|
+
features.add("normals");
|
|
254
|
+
if (asset.meshes.some((mesh) => mesh.tangents.length > 0))
|
|
255
|
+
features.add("tangents");
|
|
256
|
+
if (asset.meshes.some((mesh) => mesh.colors.length > 0))
|
|
257
|
+
features.add("vertex-colors");
|
|
258
|
+
if (asset.meshes.some((mesh) => mesh.texcoordSets.some((set) => set.length > 0)))
|
|
259
|
+
features.add("texcoords");
|
|
260
|
+
if (asset.meshes.some((mesh) => mesh.texcoordSets.length > 1))
|
|
261
|
+
features.add("multi-uv");
|
|
262
|
+
if (asset.meshes.some((mesh) => mesh.morphTargets.length > 0))
|
|
263
|
+
features.add("morph-targets");
|
|
264
|
+
if (asset.meshes.some((mesh) => mesh.skinIndex !== undefined || mesh.joints.length > 0 || mesh.weights.length > 0))
|
|
265
|
+
features.add("skinning");
|
|
266
|
+
if (asset.skins.some((skin) => skin.joints.length > MAX_RENDERABLE_SKIN_JOINTS))
|
|
267
|
+
features.add("skinning-palette-limit-fallback");
|
|
268
|
+
if ((json.skins ?? []).some((skin) => skin.inverseBindMatrices === undefined))
|
|
269
|
+
features.add("skinning-default-inverse-bind-matrices");
|
|
270
|
+
for (const unsupportedFeature of unsupportedFeatures)
|
|
271
|
+
features.add(`unsupported:${unsupportedFeature}`);
|
|
272
|
+
if (asset.animations.length > 0)
|
|
273
|
+
features.add("animations");
|
|
274
|
+
if (asset.skins.length > 0)
|
|
275
|
+
features.add("skins");
|
|
276
|
+
if (asset.textures.length > 0)
|
|
277
|
+
features.add("textures");
|
|
278
|
+
if (compression.draco)
|
|
279
|
+
features.add("compression:draco");
|
|
280
|
+
if (compression.meshopt)
|
|
281
|
+
features.add("compression:meshopt");
|
|
282
|
+
if (compression.ktx2Basis)
|
|
283
|
+
features.add("compression:ktx2-basis");
|
|
284
|
+
return {
|
|
285
|
+
schemaVersion: "gltf-loader-diagnostics",
|
|
286
|
+
features: [...features].sort(),
|
|
287
|
+
extensionsUsed,
|
|
288
|
+
extensionsRequired: [...(json.extensionsRequired ?? [])].sort(),
|
|
289
|
+
unsupportedExtensions: extensionSupport.notAcceptedUsed,
|
|
290
|
+
extensionSupport,
|
|
291
|
+
unsupportedFeatures,
|
|
292
|
+
meshCount: asset.meshes.length,
|
|
293
|
+
primitiveCount: asset.meshes.length,
|
|
294
|
+
vertexCount: asset.meshes.reduce((sum, mesh) => sum + mesh.geometry.vertexCount, 0),
|
|
295
|
+
indexCount: asset.meshes.reduce((sum, mesh) => sum + mesh.geometry.indexCount, 0),
|
|
296
|
+
materialCount: asset.materials.length,
|
|
297
|
+
textureCount: asset.textures.length,
|
|
298
|
+
imageCount: asset.images.length,
|
|
299
|
+
animationCount: asset.animations.length,
|
|
300
|
+
skinCount: asset.skins.length,
|
|
301
|
+
morphTargetCount: asset.meshes.reduce((sum, mesh) => sum + mesh.morphTargets.length, 0),
|
|
302
|
+
materialFeatures,
|
|
303
|
+
textureSlots,
|
|
304
|
+
compression,
|
|
305
|
+
...(loadProfile ? { loadProfile } : {})
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function collectUnsupportedFeatureDiagnostics(json) {
|
|
309
|
+
const unsupported = new Set();
|
|
310
|
+
for (const mesh of json.meshes ?? []) {
|
|
311
|
+
for (const primitive of mesh.primitives) {
|
|
312
|
+
if (primitive.attributes.JOINTS_1 !== undefined || primitive.attributes.WEIGHTS_1 !== undefined) {
|
|
313
|
+
unsupported.add("skinning-extra-influences:JOINTS_1/WEIGHTS_1");
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return [...unsupported].sort();
|
|
318
|
+
}
|
|
319
|
+
function materialFeatureNames(material) {
|
|
320
|
+
return [
|
|
321
|
+
material.unlit ? "unlit" : undefined,
|
|
322
|
+
material.metallicFactor > 0 ? "metallic" : undefined,
|
|
323
|
+
material.roughnessFactor < 1 ? "roughness" : undefined,
|
|
324
|
+
material.emissiveFactor.some((value) => value > 0) || material.emissiveStrength !== 1 ? "emissive" : undefined,
|
|
325
|
+
material.alphaMode !== "OPAQUE" ? `alpha-${material.alphaMode.toLowerCase()}` : undefined,
|
|
326
|
+
material.doubleSided ? "double-sided" : undefined,
|
|
327
|
+
material.normalTexture ? "normal-texture" : undefined,
|
|
328
|
+
material.occlusionTexture ? "occlusion-texture" : undefined,
|
|
329
|
+
material.clearcoat ? "clearcoat" : undefined,
|
|
330
|
+
material.transmission ? "transmission" : undefined,
|
|
331
|
+
material.diffuseTransmission ? "diffuse-transmission" : undefined,
|
|
332
|
+
material.volume ? "volume" : undefined,
|
|
333
|
+
material.ior !== undefined ? "ior" : undefined,
|
|
334
|
+
material.specular ? "specular" : undefined,
|
|
335
|
+
material.sheen ? "sheen" : undefined,
|
|
336
|
+
material.anisotropy ? "anisotropy" : undefined,
|
|
337
|
+
material.iridescence ? "iridescence" : undefined,
|
|
338
|
+
material.dispersion !== undefined ? "dispersion" : undefined,
|
|
339
|
+
material.pbrSpecularGlossiness ? "pbr-specular-glossiness" : undefined
|
|
340
|
+
].filter((feature) => feature !== undefined);
|
|
341
|
+
}
|
|
342
|
+
function materialTextureSlotNames(material) {
|
|
343
|
+
return [
|
|
344
|
+
material.baseColorTexture ? "base-color" : undefined,
|
|
345
|
+
material.metallicRoughnessTexture ? "metallic-roughness" : undefined,
|
|
346
|
+
material.normalTexture ? "normal" : undefined,
|
|
347
|
+
material.occlusionTexture ? "occlusion" : undefined,
|
|
348
|
+
material.emissiveTexture ? "emissive" : undefined,
|
|
349
|
+
material.clearcoat?.texture ? "clearcoat" : undefined,
|
|
350
|
+
material.clearcoat?.roughnessTexture ? "clearcoat-roughness" : undefined,
|
|
351
|
+
material.clearcoat?.normalTexture ? "clearcoat-normal" : undefined,
|
|
352
|
+
material.transmission?.texture ? "transmission" : undefined,
|
|
353
|
+
material.diffuseTransmission?.texture ? "diffuse-transmission" : undefined,
|
|
354
|
+
material.diffuseTransmission?.colorTexture ? "diffuse-transmission-color" : undefined,
|
|
355
|
+
material.volume?.thicknessTexture ? "volume-thickness" : undefined,
|
|
356
|
+
material.specular?.texture ? "specular" : undefined,
|
|
357
|
+
material.specular?.colorTexture ? "specular-color" : undefined,
|
|
358
|
+
material.sheen?.colorTexture ? "sheen-color" : undefined,
|
|
359
|
+
material.sheen?.roughnessTexture ? "sheen-roughness" : undefined,
|
|
360
|
+
material.anisotropy?.texture ? "anisotropy" : undefined,
|
|
361
|
+
material.iridescence?.texture ? "iridescence" : undefined,
|
|
362
|
+
material.iridescence?.thicknessTexture ? "iridescence-thickness" : undefined
|
|
363
|
+
].filter((slot) => slot !== undefined);
|
|
364
|
+
}
|
|
365
|
+
function validateAttributeCount(semantic, values, vertexCount, meshIndex, primitiveIndex) {
|
|
366
|
+
if (values.length > 0 && values.length !== vertexCount) {
|
|
367
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} ${semantic} count mismatch`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
function validateMeshDescriptor(mesh, meshIndex) {
|
|
371
|
+
if (!Array.isArray(mesh.primitives) || mesh.primitives.length === 0) {
|
|
372
|
+
throw new Error(`glTF mesh ${meshIndex} primitives must be a non-empty array`);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function validatePrimitiveDescriptor(primitive, meshIndex, primitiveIndex) {
|
|
376
|
+
if (!isObjectRecord(primitive.attributes) || Array.isArray(primitive.attributes)) {
|
|
377
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} attributes must be an object`);
|
|
378
|
+
}
|
|
379
|
+
for (const [semantic, accessorIndex] of Object.entries(primitive.attributes)) {
|
|
380
|
+
if (!Number.isInteger(accessorIndex) || accessorIndex < 0) {
|
|
381
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} attribute ${semantic} accessor must be a non-negative integer`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (primitive.indices !== undefined && (!Number.isInteger(primitive.indices) || primitive.indices < 0)) {
|
|
385
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} indices accessor must be a non-negative integer`);
|
|
386
|
+
}
|
|
387
|
+
if (primitive.mode !== undefined && (!Number.isInteger(primitive.mode) || primitive.mode < 0)) {
|
|
388
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} mode must be a non-negative integer`);
|
|
389
|
+
}
|
|
390
|
+
const variantExtension = primitive.extensions?.KHR_materials_variants;
|
|
391
|
+
if (variantExtension !== undefined && (!Array.isArray(variantExtension.mappings) || variantExtension.mappings.length === 0)) {
|
|
392
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_materials_variants.mappings must be a non-empty array`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function readTexcoordSets(json, buffers, primitive, vertexCount, meshIndex, primitiveIndex, decodedPrimitive, accessorCache) {
|
|
396
|
+
const sets = [];
|
|
397
|
+
for (const [semantic, accessorIndex] of Object.entries(primitive.attributes)) {
|
|
398
|
+
const match = /^TEXCOORD_(\d+)$/.exec(semantic);
|
|
399
|
+
if (!match)
|
|
400
|
+
continue;
|
|
401
|
+
const setIndex = Number(match[1]);
|
|
402
|
+
if (!Number.isInteger(setIndex)) {
|
|
403
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} ${semantic} has invalid texture coordinate set index`);
|
|
404
|
+
}
|
|
405
|
+
const values = decodedPrimitive?.attributes[semantic] ?? readAccessor(json, buffers, accessorIndex, accessorCache);
|
|
406
|
+
validateAttributeCount(semantic, values, vertexCount, meshIndex, primitiveIndex);
|
|
407
|
+
sets[setIndex] = values.map((texcoord) => [texcoord[0] ?? 0, texcoord[1] ?? 0]);
|
|
408
|
+
}
|
|
409
|
+
const normalized = [];
|
|
410
|
+
for (let index = 0; index < sets.length; index += 1) {
|
|
411
|
+
normalized[index] = sets[index] ?? [];
|
|
412
|
+
}
|
|
413
|
+
return normalized;
|
|
414
|
+
}
|
|
415
|
+
function readPrimitiveAttribute(json, buffers, primitive, decodedPrimitive, semantic, accessorCache) {
|
|
416
|
+
const decoded = decodedPrimitive?.attributes[semantic];
|
|
417
|
+
if (decoded)
|
|
418
|
+
return normalizeDecodedPrimitiveAttribute(json, primitive, semantic, decoded);
|
|
419
|
+
return readOptionalAccessor(json, buffers, primitive.attributes[semantic], accessorCache);
|
|
420
|
+
}
|
|
421
|
+
function normalizeDecodedPrimitiveAttribute(json, primitive, semantic, rows) {
|
|
422
|
+
const copied = rows.map((row) => [...row]);
|
|
423
|
+
const accessorIndex = primitive.attributes[semantic];
|
|
424
|
+
const accessor = accessorIndex === undefined ? undefined : json.accessors?.[accessorIndex];
|
|
425
|
+
if (!accessor?.normalized || !semantic.startsWith("COLOR_")) {
|
|
426
|
+
return copied;
|
|
427
|
+
}
|
|
428
|
+
const normalizer = normalizedComponentScale(accessor.componentType);
|
|
429
|
+
if (!normalizer) {
|
|
430
|
+
return copied;
|
|
431
|
+
}
|
|
432
|
+
const needsNormalization = copied.some((row) => row.some((value) => Math.abs(value) > 1));
|
|
433
|
+
if (!needsNormalization) {
|
|
434
|
+
return copied.map((row) => row.map(clampColorChannel));
|
|
435
|
+
}
|
|
436
|
+
return copied.map((row) => row.map((value) => clampColorChannel(normalizer(value))));
|
|
437
|
+
}
|
|
438
|
+
function normalizedComponentScale(componentType) {
|
|
439
|
+
if (componentType === 5120)
|
|
440
|
+
return (value) => Math.max(value / 127, -1);
|
|
441
|
+
if (componentType === 5121)
|
|
442
|
+
return (value) => value / 255;
|
|
443
|
+
if (componentType === 5122)
|
|
444
|
+
return (value) => Math.max(value / 32767, -1);
|
|
445
|
+
if (componentType === 5123)
|
|
446
|
+
return (value) => value / 65535;
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
function clampColorChannel(value) {
|
|
450
|
+
return Math.max(0, Math.min(1, value));
|
|
451
|
+
}
|
|
452
|
+
async function decodeDracoPrimitive(json, buffers, primitive, meshIndex, primitiveIndex, dracoDecoder) {
|
|
453
|
+
const extension = primitive.extensions?.KHR_draco_mesh_compression;
|
|
454
|
+
if (!extension)
|
|
455
|
+
return undefined;
|
|
456
|
+
if (!usesGLTFExtension(json, "KHR_draco_mesh_compression")) {
|
|
457
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} uses KHR_draco_mesh_compression but the extension is not declared`);
|
|
458
|
+
}
|
|
459
|
+
if (!dracoDecoder) {
|
|
460
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression requires a dracoDecoder`);
|
|
461
|
+
}
|
|
462
|
+
validateDracoDescriptor(extension, meshIndex, primitiveIndex);
|
|
463
|
+
const { view, buffer } = getBufferView(json, buffers, extension.bufferView);
|
|
464
|
+
const start = view.byteOffset ?? 0;
|
|
465
|
+
const source = new Uint8Array(buffer, start, view.byteLength);
|
|
466
|
+
const decoded = await dracoDecoder(source, {
|
|
467
|
+
meshIndex,
|
|
468
|
+
primitiveIndex,
|
|
469
|
+
bufferViewIndex: extension.bufferView,
|
|
470
|
+
attributes: { ...extension.attributes }
|
|
471
|
+
});
|
|
472
|
+
validateDecodedDracoPrimitive(decoded, primitive, meshIndex, primitiveIndex);
|
|
473
|
+
return decoded;
|
|
474
|
+
}
|
|
475
|
+
function validateDracoDescriptor(extension, meshIndex, primitiveIndex) {
|
|
476
|
+
if (!Number.isInteger(extension.bufferView) || extension.bufferView < 0) {
|
|
477
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression bufferView must be a non-negative integer`);
|
|
478
|
+
}
|
|
479
|
+
if (!isObjectRecord(extension.attributes) || Array.isArray(extension.attributes)) {
|
|
480
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression attributes must be an object`);
|
|
481
|
+
}
|
|
482
|
+
if (!Number.isInteger(extension.attributes.POSITION) || extension.attributes.POSITION < 0) {
|
|
483
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression requires POSITION attribute mapping`);
|
|
484
|
+
}
|
|
485
|
+
for (const [semantic, attributeId] of Object.entries(extension.attributes)) {
|
|
486
|
+
if (!Number.isInteger(attributeId) || attributeId < 0) {
|
|
487
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression attribute ${semantic} id must be a non-negative integer`);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
function validateDecodedDracoPrimitive(decoded, primitive, meshIndex, primitiveIndex) {
|
|
492
|
+
if (!isObjectRecord(decoded.attributes) || Array.isArray(decoded.attributes)) {
|
|
493
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression decoder must return attributes`);
|
|
494
|
+
}
|
|
495
|
+
const positions = decoded.attributes.POSITION;
|
|
496
|
+
if (!Array.isArray(positions) || positions.length === 0) {
|
|
497
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression decoder must return POSITION rows`);
|
|
498
|
+
}
|
|
499
|
+
for (const [semantic, rows] of Object.entries(decoded.attributes)) {
|
|
500
|
+
if (primitive.attributes[semantic] === undefined) {
|
|
501
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression decoded unexpected attribute ${semantic}`);
|
|
502
|
+
}
|
|
503
|
+
if (!Array.isArray(rows) || rows.length !== positions.length) {
|
|
504
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression decoded ${semantic} count must match POSITION count`);
|
|
505
|
+
}
|
|
506
|
+
for (const [rowIndex, row] of rows.entries()) {
|
|
507
|
+
if (!Array.isArray(row) || row.some((value) => !Number.isFinite(value))) {
|
|
508
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression decoded ${semantic} row ${rowIndex} must contain finite values`);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (decoded.indices !== undefined) {
|
|
513
|
+
for (const index of decoded.indices) {
|
|
514
|
+
if (!Number.isInteger(index) || index < 0 || index >= positions.length) {
|
|
515
|
+
throw new RangeError(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_draco_mesh_compression decoded index ${index} is outside vertex count ${positions.length}`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
function validateMaterialTexCoordSets(material, texcoordSets, meshIndex, primitiveIndex) {
|
|
521
|
+
if (!material)
|
|
522
|
+
return;
|
|
523
|
+
for (const textureInfo of materialTextureInfos(material)) {
|
|
524
|
+
if (textureInfo.texCoord > 0 && (texcoordSets[textureInfo.texCoord]?.length ?? 0) === 0) {
|
|
525
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} material ${material.name} references missing TEXCOORD_${textureInfo.texCoord}`);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function materialTextureInfos(material) {
|
|
530
|
+
return [
|
|
531
|
+
material.baseColorTexture,
|
|
532
|
+
material.metallicRoughnessTexture,
|
|
533
|
+
material.normalTexture,
|
|
534
|
+
material.occlusionTexture,
|
|
535
|
+
material.emissiveTexture,
|
|
536
|
+
material.clearcoat?.texture,
|
|
537
|
+
material.clearcoat?.roughnessTexture,
|
|
538
|
+
material.clearcoat?.normalTexture,
|
|
539
|
+
material.transmission?.texture,
|
|
540
|
+
material.diffuseTransmission?.texture,
|
|
541
|
+
material.diffuseTransmission?.colorTexture,
|
|
542
|
+
material.volume?.thicknessTexture,
|
|
543
|
+
material.specular?.texture,
|
|
544
|
+
material.specular?.colorTexture,
|
|
545
|
+
material.sheen?.colorTexture,
|
|
546
|
+
material.sheen?.roughnessTexture,
|
|
547
|
+
material.anisotropy?.texture,
|
|
548
|
+
material.iridescence?.texture,
|
|
549
|
+
material.iridescence?.thicknessTexture
|
|
550
|
+
].filter((info) => info !== undefined);
|
|
551
|
+
}
|
|
552
|
+
function resolvePrimitiveMode(primitive, rawIndices, vertexCount, meshIndex, primitiveIndex) {
|
|
553
|
+
const mode = primitive.mode ?? 4;
|
|
554
|
+
const source = rawIndices ?? [...Array(vertexCount).keys()];
|
|
555
|
+
validatePrimitiveIndices(source, vertexCount, meshIndex, primitiveIndex);
|
|
556
|
+
switch (mode) {
|
|
557
|
+
case 1:
|
|
558
|
+
if (source.length % 2 !== 0)
|
|
559
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} LINES index count must be even`);
|
|
560
|
+
return { topology: "lines", indices: rawIndices };
|
|
561
|
+
case 2:
|
|
562
|
+
return { topology: "lines", indices: expandLineLoop(source) };
|
|
563
|
+
case 3:
|
|
564
|
+
return { topology: "lines", indices: expandLineStrip(source) };
|
|
565
|
+
case 4:
|
|
566
|
+
if (source.length % 3 !== 0)
|
|
567
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} TRIANGLES index count must be a multiple of 3`);
|
|
568
|
+
return { topology: "triangles", indices: rawIndices };
|
|
569
|
+
case 5:
|
|
570
|
+
return { topology: "triangles", indices: expandTriangleStrip(source) };
|
|
571
|
+
case 6:
|
|
572
|
+
return { topology: "triangles", indices: expandTriangleFan(source) };
|
|
573
|
+
case 0:
|
|
574
|
+
return { topology: "points", indices: rawIndices };
|
|
575
|
+
default:
|
|
576
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} has unsupported primitive mode ${mode}`);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
function validatePrimitiveIndices(indices, vertexCount, meshIndex, primitiveIndex) {
|
|
580
|
+
for (const index of indices) {
|
|
581
|
+
if (!Number.isInteger(index) || index < 0 || index >= vertexCount) {
|
|
582
|
+
throw new RangeError(`glTF mesh ${meshIndex} primitive ${primitiveIndex} index ${index} is outside vertex count ${vertexCount}`);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
function expandLineStrip(indices) {
|
|
587
|
+
const expanded = [];
|
|
588
|
+
for (let index = 0; index < indices.length - 1; index += 1) {
|
|
589
|
+
expanded.push(indices[index], indices[index + 1]);
|
|
590
|
+
}
|
|
591
|
+
return expanded;
|
|
592
|
+
}
|
|
593
|
+
function expandLineLoop(indices) {
|
|
594
|
+
if (indices.length < 2)
|
|
595
|
+
return [];
|
|
596
|
+
const expanded = [...expandLineStrip(indices)];
|
|
597
|
+
expanded.push(indices[indices.length - 1], indices[0]);
|
|
598
|
+
return expanded;
|
|
599
|
+
}
|
|
600
|
+
function expandTriangleStrip(indices) {
|
|
601
|
+
const expanded = [];
|
|
602
|
+
for (let index = 0; index < indices.length - 2; index += 1) {
|
|
603
|
+
if (index % 2 === 0) {
|
|
604
|
+
expanded.push(indices[index], indices[index + 1], indices[index + 2]);
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
expanded.push(indices[index + 1], indices[index], indices[index + 2]);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return expanded;
|
|
611
|
+
}
|
|
612
|
+
function expandTriangleFan(indices) {
|
|
613
|
+
const expanded = [];
|
|
614
|
+
for (let index = 1; index < indices.length - 1; index += 1) {
|
|
615
|
+
expanded.push(indices[0], indices[index], indices[index + 1]);
|
|
616
|
+
}
|
|
617
|
+
return expanded;
|
|
618
|
+
}
|
|
619
|
+
function readMorphTargets(json, buffers, primitive, vertexCount, meshIndex, primitiveIndex, accessorCache) {
|
|
620
|
+
if (primitive.targets === undefined) {
|
|
621
|
+
return [];
|
|
622
|
+
}
|
|
623
|
+
if (!Array.isArray(primitive.targets)) {
|
|
624
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} targets must be an array`);
|
|
625
|
+
}
|
|
626
|
+
return primitive.targets.map((target, targetIndex) => {
|
|
627
|
+
validateMorphTargetDescriptor(target, meshIndex, primitiveIndex, targetIndex);
|
|
628
|
+
const positions = readOptionalAccessor(json, buffers, target.POSITION, accessorCache);
|
|
629
|
+
const normals = readOptionalAccessor(json, buffers, target.NORMAL, accessorCache);
|
|
630
|
+
const tangents = readOptionalAccessor(json, buffers, target.TANGENT, accessorCache);
|
|
631
|
+
if (positions.length > 0 && positions.length !== vertexCount) {
|
|
632
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} morph target ${targetIndex} POSITION count mismatch`);
|
|
633
|
+
}
|
|
634
|
+
if (normals.length > 0 && normals.length !== vertexCount) {
|
|
635
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} morph target ${targetIndex} NORMAL count mismatch`);
|
|
636
|
+
}
|
|
637
|
+
if (tangents.length > 0 && tangents.length !== vertexCount) {
|
|
638
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} morph target ${targetIndex} TANGENT count mismatch`);
|
|
639
|
+
}
|
|
640
|
+
return {
|
|
641
|
+
positions: positions.map((position) => [position[0] ?? 0, position[1] ?? 0, position[2] ?? 0]),
|
|
642
|
+
normals: normals.map((normal) => [normal[0] ?? 0, normal[1] ?? 0, normal[2] ?? 0]),
|
|
643
|
+
tangents: tangents.map((tangent) => [tangent[0] ?? 0, tangent[1] ?? 0, tangent[2] ?? 0])
|
|
644
|
+
};
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
function validateMorphTargetDescriptor(target, meshIndex, primitiveIndex, targetIndex) {
|
|
648
|
+
if (!isObjectRecord(target) || Array.isArray(target)) {
|
|
649
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} morph target ${targetIndex} must be an object`);
|
|
650
|
+
}
|
|
651
|
+
for (const key of Object.keys(target)) {
|
|
652
|
+
if (key !== "POSITION" && key !== "NORMAL" && key !== "TANGENT") {
|
|
653
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} morph target ${targetIndex} attribute ${key} is unsupported`);
|
|
654
|
+
}
|
|
655
|
+
const accessorIndex = target[key];
|
|
656
|
+
if (!Number.isInteger(accessorIndex) || accessorIndex < 0) {
|
|
657
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} morph target ${targetIndex} ${key} accessor must be a non-negative integer`);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function resolveMorphWeights(mesh, meshIndex, primitiveIndex, targetCount) {
|
|
662
|
+
if (mesh.weights === undefined) {
|
|
663
|
+
return Array.from({ length: targetCount }, () => 0);
|
|
664
|
+
}
|
|
665
|
+
if (!Array.isArray(mesh.weights)) {
|
|
666
|
+
throw new Error(`glTF mesh ${meshIndex} weights must be an array`);
|
|
667
|
+
}
|
|
668
|
+
if (mesh.weights.length !== targetCount) {
|
|
669
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} weights count must match morph target count`);
|
|
670
|
+
}
|
|
671
|
+
if (mesh.weights.some((weight) => !Number.isFinite(weight))) {
|
|
672
|
+
throw new Error(`glTF mesh ${meshIndex} weights must contain finite numbers`);
|
|
673
|
+
}
|
|
674
|
+
return [...mesh.weights];
|
|
675
|
+
}
|
|
676
|
+
function createImageAssets(json, buffers) {
|
|
677
|
+
const avifEnabled = usesGLTFExtension(json, "EXT_texture_avif");
|
|
678
|
+
const webpEnabled = usesGLTFExtension(json, "EXT_texture_webp");
|
|
679
|
+
const basisuEnabled = usesGLTFExtension(json, "KHR_texture_basisu");
|
|
680
|
+
return (json.images ?? []).map((image, index) => {
|
|
681
|
+
if (image.uri && image.bufferView !== undefined) {
|
|
682
|
+
throw new Error(`glTF image ${index} cannot define both uri and bufferView`);
|
|
683
|
+
}
|
|
684
|
+
if (!image.uri && image.bufferView === undefined) {
|
|
685
|
+
throw new Error(`glTF image ${index} must define uri or bufferView`);
|
|
686
|
+
}
|
|
687
|
+
if (image.bufferView !== undefined && !image.mimeType) {
|
|
688
|
+
throw new Error(`glTF image ${index} with bufferView requires mimeType`);
|
|
689
|
+
}
|
|
690
|
+
validateImageMimeType(image, index, avifEnabled, webpEnabled, basisuEnabled);
|
|
691
|
+
return {
|
|
692
|
+
name: image.name ?? `image-${index}`,
|
|
693
|
+
uri: image.uri,
|
|
694
|
+
mimeType: image.mimeType,
|
|
695
|
+
data: image.bufferView === undefined ? undefined : readBufferViewBytes(json, buffers, image.bufferView)
|
|
696
|
+
};
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function validateImageMimeType(image, index, avifEnabled, webpEnabled, basisuEnabled) {
|
|
700
|
+
if (image.mimeType !== undefined && !isSupportedImageMimeType(image.mimeType, avifEnabled, webpEnabled, basisuEnabled)) {
|
|
701
|
+
throw new Error(`glTF image ${index} mimeType must be ${supportedImageMimeTypeMessage(avifEnabled, webpEnabled, basisuEnabled)}`);
|
|
702
|
+
}
|
|
703
|
+
if (image.uri?.startsWith("data:")) {
|
|
704
|
+
const separator = image.uri.indexOf(",");
|
|
705
|
+
if (separator < 0) {
|
|
706
|
+
throw new Error(`glTF image ${index} data uri must include a comma separator`);
|
|
707
|
+
}
|
|
708
|
+
const mediaType = image.uri.slice(5, separator).split(";")[0]?.toLowerCase();
|
|
709
|
+
if (!isSupportedImageMimeType(mediaType, avifEnabled, webpEnabled, basisuEnabled)) {
|
|
710
|
+
throw new Error(`glTF image ${index} data uri media type must be ${supportedImageMimeTypeMessage(avifEnabled, webpEnabled, basisuEnabled)}`);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
function isSupportedImageMimeType(mimeType, avifEnabled, webpEnabled, basisuEnabled) {
|
|
715
|
+
return mimeType === "image/png" || mimeType === "image/jpeg" || (avifEnabled && mimeType === "image/avif") || (webpEnabled && mimeType === "image/webp") || (basisuEnabled && mimeType === "image/ktx2");
|
|
716
|
+
}
|
|
717
|
+
function supportedImageMimeTypeMessage(avifEnabled, webpEnabled, basisuEnabled) {
|
|
718
|
+
return ["image/png", "image/jpeg", ...(avifEnabled ? ["image/avif"] : []), ...(webpEnabled ? ["image/webp"] : []), ...(basisuEnabled ? ["image/ktx2"] : [])].join(", or ");
|
|
719
|
+
}
|
|
720
|
+
function createTextureAssets(json) {
|
|
721
|
+
return (json.textures ?? []).map((texture, index) => {
|
|
722
|
+
const source = validateTextureDescriptor(json, texture, index);
|
|
723
|
+
const sampler = texture.sampler;
|
|
724
|
+
return {
|
|
725
|
+
name: texture.name ?? `texture-${index}`,
|
|
726
|
+
source,
|
|
727
|
+
sampler,
|
|
728
|
+
...(sampler === undefined ? {} : { samplerDescriptor: createSamplerAsset(json.samplers[sampler], sampler) })
|
|
729
|
+
};
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
function validateTextureDescriptor(json, texture, index) {
|
|
733
|
+
const avifSource = texture.extensions?.EXT_texture_avif?.source;
|
|
734
|
+
if (avifSource !== undefined && !usesGLTFExtension(json, "EXT_texture_avif")) {
|
|
735
|
+
throw new Error(`glTF texture ${index} uses EXT_texture_avif but the extension is not declared`);
|
|
736
|
+
}
|
|
737
|
+
const webpSource = texture.extensions?.EXT_texture_webp?.source;
|
|
738
|
+
if (webpSource !== undefined && !usesGLTFExtension(json, "EXT_texture_webp")) {
|
|
739
|
+
throw new Error(`glTF texture ${index} uses EXT_texture_webp but the extension is not declared`);
|
|
740
|
+
}
|
|
741
|
+
const basisuSource = texture.extensions?.KHR_texture_basisu?.source;
|
|
742
|
+
if (basisuSource !== undefined && !usesGLTFExtension(json, "KHR_texture_basisu")) {
|
|
743
|
+
throw new Error(`glTF texture ${index} uses KHR_texture_basisu but the extension is not declared`);
|
|
744
|
+
}
|
|
745
|
+
const source = basisuSource ?? avifSource ?? webpSource ?? texture.source;
|
|
746
|
+
if (source === undefined) {
|
|
747
|
+
throw new Error(`glTF texture ${index} references missing image source undefined`);
|
|
748
|
+
}
|
|
749
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
750
|
+
throw new Error(`glTF texture ${index} source must be a non-negative integer`);
|
|
751
|
+
}
|
|
752
|
+
if (!json.images?.[source]) {
|
|
753
|
+
throw new Error(`glTF texture ${index} references missing image source ${source}`);
|
|
754
|
+
}
|
|
755
|
+
if (texture.sampler !== undefined) {
|
|
756
|
+
if (!Number.isInteger(texture.sampler) || texture.sampler < 0) {
|
|
757
|
+
throw new Error(`glTF texture ${index} sampler must be a non-negative integer`);
|
|
758
|
+
}
|
|
759
|
+
if (!json.samplers?.[texture.sampler]) {
|
|
760
|
+
throw new Error(`glTF texture ${index} references missing sampler ${texture.sampler}`);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
return source;
|
|
764
|
+
}
|
|
765
|
+
function createSamplerAsset(sampler, samplerIndex) {
|
|
766
|
+
return {
|
|
767
|
+
minFilter: minFilterFromGLTF(sampler.minFilter, samplerIndex),
|
|
768
|
+
magFilter: magFilterFromGLTF(sampler.magFilter, samplerIndex),
|
|
769
|
+
addressU: addressModeFromGLTF(sampler.wrapS, samplerIndex, "wrapS"),
|
|
770
|
+
addressV: addressModeFromGLTF(sampler.wrapT, samplerIndex, "wrapT")
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
function minFilterFromGLTF(value, samplerIndex) {
|
|
774
|
+
if (value === undefined)
|
|
775
|
+
return "linear-mipmap-linear";
|
|
776
|
+
if (value === 9728)
|
|
777
|
+
return "nearest";
|
|
778
|
+
if (value === 9729)
|
|
779
|
+
return "linear";
|
|
780
|
+
if (value === 9984)
|
|
781
|
+
return "nearest-mipmap-nearest";
|
|
782
|
+
if (value === 9985)
|
|
783
|
+
return "linear-mipmap-nearest";
|
|
784
|
+
if (value === 9986)
|
|
785
|
+
return "nearest-mipmap-linear";
|
|
786
|
+
if (value === 9987)
|
|
787
|
+
return "linear-mipmap-linear";
|
|
788
|
+
throw new Error(`glTF sampler ${samplerIndex} minFilter has unsupported value ${value}`);
|
|
789
|
+
}
|
|
790
|
+
function magFilterFromGLTF(value, samplerIndex) {
|
|
791
|
+
if (value === undefined)
|
|
792
|
+
return "linear";
|
|
793
|
+
if (value === 9728)
|
|
794
|
+
return "nearest";
|
|
795
|
+
if (value === 9729)
|
|
796
|
+
return "linear";
|
|
797
|
+
throw new Error(`glTF sampler ${samplerIndex} magFilter has unsupported value ${value}`);
|
|
798
|
+
}
|
|
799
|
+
function addressModeFromGLTF(value, samplerIndex, field) {
|
|
800
|
+
if (value === undefined || value === 10497)
|
|
801
|
+
return "repeat";
|
|
802
|
+
if (value === 33071)
|
|
803
|
+
return "clamp-to-edge";
|
|
804
|
+
if (value === 33648)
|
|
805
|
+
return "mirror-repeat";
|
|
806
|
+
throw new Error(`glTF sampler ${samplerIndex} ${field} has unsupported value ${value}`);
|
|
807
|
+
}
|
|
808
|
+
function createSceneAssets(json) {
|
|
809
|
+
return (json.scenes ?? []).map((scene, index) => {
|
|
810
|
+
return {
|
|
811
|
+
name: scene.name ?? `scene-${index}`,
|
|
812
|
+
nodeIndices: [...(scene.nodes ?? [])]
|
|
813
|
+
};
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
function resolveDefaultSceneIndex(json) {
|
|
817
|
+
return json.scene ?? 0;
|
|
818
|
+
}
|
|
819
|
+
function createMaterialAssets(json, textures) {
|
|
820
|
+
return (json.materials ?? []).map((material, index) => {
|
|
821
|
+
const pbr = material.pbrMetallicRoughness;
|
|
822
|
+
const pbrSpecularGlossiness = resolvePBRSpecularGlossiness(material, textures, index).pbrSpecularGlossiness;
|
|
823
|
+
const specular = resolveSpecular(material, textures, index).specular ?? createSpecularFromSpecularGlossiness(pbrSpecularGlossiness);
|
|
824
|
+
return {
|
|
825
|
+
name: material.name ?? `material-${index}`,
|
|
826
|
+
unlit: material.extensions?.KHR_materials_unlit !== undefined,
|
|
827
|
+
baseColorFactor: pbrSpecularGlossiness?.diffuseFactor ?? resolveColor4(pbr?.baseColorFactor, [1, 1, 1, 1], `material ${index} baseColorFactor`),
|
|
828
|
+
baseColorTexture: pbrSpecularGlossiness?.diffuseTexture ?? resolveTextureInfo(textures, pbr?.baseColorTexture, `material ${index} baseColorTexture`),
|
|
829
|
+
metallicFactor: pbrSpecularGlossiness ? 0 : resolveUnit(pbr?.metallicFactor, 1, `material ${index} metallicFactor`),
|
|
830
|
+
roughnessFactor: pbrSpecularGlossiness ? 1 - pbrSpecularGlossiness.glossinessFactor : resolveUnit(pbr?.roughnessFactor, 1, `material ${index} roughnessFactor`),
|
|
831
|
+
metallicRoughnessTexture: pbrSpecularGlossiness
|
|
832
|
+
? undefined
|
|
833
|
+
: resolveTextureInfo(textures, pbr?.metallicRoughnessTexture, `material ${index} metallicRoughnessTexture`),
|
|
834
|
+
normalTexture: withDefaultScale(resolveTextureInfo(textures, material.normalTexture, `material ${index} normalTexture`), material.normalTexture?.scale),
|
|
835
|
+
occlusionTexture: withDefaultStrength(resolveTextureInfo(textures, material.occlusionTexture, `material ${index} occlusionTexture`), material.occlusionTexture?.strength),
|
|
836
|
+
emissiveTexture: resolveTextureInfo(textures, material.emissiveTexture, `material ${index} emissiveTexture`),
|
|
837
|
+
emissiveFactor: resolveColor3(material.emissiveFactor, [0, 0, 0], `material ${index} emissiveFactor`),
|
|
838
|
+
emissiveStrength: resolveEmissiveStrength(material, index),
|
|
839
|
+
...(resolveClearcoat(material, textures, index)),
|
|
840
|
+
...(resolveTransmission(material, textures, index)),
|
|
841
|
+
...(resolveDiffuseTransmission(material, textures, pbrSpecularGlossiness, index)),
|
|
842
|
+
...(resolveVolume(material, textures, index)),
|
|
843
|
+
...(resolveIOR(material, index)),
|
|
844
|
+
...(specular ? { specular } : {}),
|
|
845
|
+
...(pbrSpecularGlossiness ? { pbrSpecularGlossiness } : {}),
|
|
846
|
+
...(resolveSheen(material, textures, index)),
|
|
847
|
+
...(resolveAnisotropy(material, textures, index)),
|
|
848
|
+
...(resolveIridescence(material, textures, index)),
|
|
849
|
+
...(resolveDispersion(material, index)),
|
|
850
|
+
alphaMode: resolveAlphaMode(material.alphaMode, index),
|
|
851
|
+
alphaCutoff: resolveUnit(material.alphaCutoff, 0.5, `material ${index} alphaCutoff`),
|
|
852
|
+
doubleSided: material.doubleSided ?? false
|
|
853
|
+
};
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
function createMaterialVariantAssets(json) {
|
|
857
|
+
if (!usesGLTFExtension(json, "KHR_materials_variants"))
|
|
858
|
+
return [];
|
|
859
|
+
const variants = json.extensions?.KHR_materials_variants?.variants;
|
|
860
|
+
if (!Array.isArray(variants) || variants.length === 0) {
|
|
861
|
+
throw new Error("glTF KHR_materials_variants.variants must be a non-empty array when the extension is declared");
|
|
862
|
+
}
|
|
863
|
+
return variants.map((variant, index) => {
|
|
864
|
+
if (!isObjectRecord(variant)) {
|
|
865
|
+
throw new Error(`glTF KHR_materials_variants variant ${index} must be an object`);
|
|
866
|
+
}
|
|
867
|
+
return { name: typeof variant.name === "string" && variant.name.length > 0 ? variant.name : `variant-${index}` };
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
function resolvePrimitiveMaterialVariants(primitive, variants, materials, meshIndex, primitiveIndex) {
|
|
871
|
+
const mappings = primitive.extensions?.KHR_materials_variants?.mappings;
|
|
872
|
+
if (!mappings)
|
|
873
|
+
return [];
|
|
874
|
+
if (variants.length === 0) {
|
|
875
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} uses KHR_materials_variants but the extension is not declared`);
|
|
876
|
+
}
|
|
877
|
+
const resolved = [];
|
|
878
|
+
for (let mappingIndex = 0; mappingIndex < mappings.length; mappingIndex += 1) {
|
|
879
|
+
const mapping = mappings[mappingIndex];
|
|
880
|
+
if (!Number.isInteger(mapping.material) || mapping.material < 0) {
|
|
881
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_materials_variants mapping ${mappingIndex} material must be a non-negative integer`);
|
|
882
|
+
}
|
|
883
|
+
const material = materials[mapping.material];
|
|
884
|
+
if (!material) {
|
|
885
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_materials_variants mapping ${mappingIndex} references missing material ${mapping.material}`);
|
|
886
|
+
}
|
|
887
|
+
if (!Array.isArray(mapping.variants) || mapping.variants.length === 0) {
|
|
888
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_materials_variants mapping ${mappingIndex} variants must be a non-empty array`);
|
|
889
|
+
}
|
|
890
|
+
for (const variantIndex of mapping.variants) {
|
|
891
|
+
if (!Number.isInteger(variantIndex) || variantIndex < 0) {
|
|
892
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_materials_variants mapping ${mappingIndex} variant must be a non-negative integer`);
|
|
893
|
+
}
|
|
894
|
+
const variant = variants[variantIndex];
|
|
895
|
+
if (!variant) {
|
|
896
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} KHR_materials_variants mapping ${mappingIndex} references missing variant ${variantIndex}`);
|
|
897
|
+
}
|
|
898
|
+
resolved.push({
|
|
899
|
+
variantIndex,
|
|
900
|
+
variant: variant.name,
|
|
901
|
+
materialIndex: mapping.material,
|
|
902
|
+
material: material.name
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return resolved;
|
|
907
|
+
}
|
|
908
|
+
function resolveAlphaMode(value, materialIndex) {
|
|
909
|
+
if (value === undefined)
|
|
910
|
+
return "OPAQUE";
|
|
911
|
+
if (value === "OPAQUE" || value === "MASK" || value === "BLEND")
|
|
912
|
+
return value;
|
|
913
|
+
throw new Error(`glTF material ${materialIndex} alphaMode must be OPAQUE, MASK, or BLEND`);
|
|
914
|
+
}
|
|
915
|
+
function resolveTextureInfo(textures, info, label) {
|
|
916
|
+
if (!info)
|
|
917
|
+
return undefined;
|
|
918
|
+
if (!Number.isInteger(info.index) || info.index < 0) {
|
|
919
|
+
throw new Error(`glTF ${label} index must be a non-negative integer`);
|
|
920
|
+
}
|
|
921
|
+
const texture = textures[info.index];
|
|
922
|
+
if (!texture) {
|
|
923
|
+
throw new Error(`glTF ${label} references missing texture ${info.index}`);
|
|
924
|
+
}
|
|
925
|
+
const transform = info.extensions?.KHR_texture_transform;
|
|
926
|
+
const texCoord = transform?.texCoord ?? info.texCoord ?? 0;
|
|
927
|
+
if (!Number.isInteger(texCoord) || texCoord < 0) {
|
|
928
|
+
throw new RangeError(`glTF ${label} texCoord must be a non-negative integer`);
|
|
929
|
+
}
|
|
930
|
+
return {
|
|
931
|
+
texture: info.index,
|
|
932
|
+
image: texture.source,
|
|
933
|
+
texCoord,
|
|
934
|
+
...(transform ? { transform: resolveTextureTransform(transform) } : {})
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
function usesGLTFExtension(json, extension) {
|
|
938
|
+
return Boolean(json.extensionsRequired?.includes(extension) || json.extensionsUsed?.includes(extension));
|
|
939
|
+
}
|
|
940
|
+
function usesGLTFMeshoptExtension(json) {
|
|
941
|
+
return GLTF_MESHOPT_EXTENSION_NAMES.some((extension) => usesGLTFExtension(json, extension));
|
|
942
|
+
}
|
|
943
|
+
const GLTF_MESHOPT_EXTENSION_NAMES = ["EXT_meshopt_compression", "KHR_meshopt_compression"];
|
|
944
|
+
function validatePrimitiveAttributeAccessors(json, primitive, meshQuantizationEnabled, meshIndex, primitiveIndex) {
|
|
945
|
+
for (const [semantic, accessorIndex] of Object.entries(primitive.attributes)) {
|
|
946
|
+
if (semantic !== "POSITION" && semantic !== "NORMAL" && semantic !== "TANGENT") {
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
const accessor = json.accessors?.[accessorIndex];
|
|
950
|
+
if (!accessor) {
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
if (!isAccessorComponentType(accessor.componentType)) {
|
|
954
|
+
continue;
|
|
955
|
+
}
|
|
956
|
+
validateQuantizedAttributeComponentType(accessor.componentType, semantic, meshQuantizationEnabled, meshIndex, primitiveIndex);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
function validateQuantizedAttributeComponentType(componentType, semantic, meshQuantizationEnabled, meshIndex, primitiveIndex) {
|
|
960
|
+
if (componentType === 5126) {
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
if (!meshQuantizationEnabled) {
|
|
964
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} ${semantic} accessor uses non-FLOAT componentType ${componentType}; declare KHR_mesh_quantization to import quantized attributes`);
|
|
965
|
+
}
|
|
966
|
+
if (componentType === 5120 || componentType === 5121 || componentType === 5122 || componentType === 5123) {
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} ${semantic} accessor componentType ${componentType} is unsupported for KHR_mesh_quantization`);
|
|
970
|
+
}
|
|
971
|
+
function normalizeSkinWeights(weights, meshIndex, primitiveIndex) {
|
|
972
|
+
if (weights.some((weight) => !Number.isFinite(weight) || weight < 0)) {
|
|
973
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} WEIGHTS_0 must contain finite non-negative values`);
|
|
974
|
+
}
|
|
975
|
+
const sum = weights[0] + weights[1] + weights[2] + weights[3];
|
|
976
|
+
if (sum <= 0) {
|
|
977
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} WEIGHTS_0 must sum to a positive value`);
|
|
978
|
+
}
|
|
979
|
+
if (Math.abs(sum - 1) <= 1e-5)
|
|
980
|
+
return weights;
|
|
981
|
+
return [
|
|
982
|
+
weights[0] / sum,
|
|
983
|
+
weights[1] / sum,
|
|
984
|
+
weights[2] / sum,
|
|
985
|
+
weights[3] / sum
|
|
986
|
+
];
|
|
987
|
+
}
|
|
988
|
+
function createCameraAssets(json) {
|
|
989
|
+
return (json.cameras ?? []).map((camera, index) => {
|
|
990
|
+
if (camera.type === "perspective") {
|
|
991
|
+
if (!camera.perspective) {
|
|
992
|
+
throw new Error(`glTF camera ${index} perspective camera requires perspective data`);
|
|
993
|
+
}
|
|
994
|
+
const yfov = resolveCameraPositive(camera.perspective.yfov, `camera ${index} perspective.yfov`);
|
|
995
|
+
if (yfov >= Math.PI) {
|
|
996
|
+
throw new RangeError(`glTF camera ${index} perspective.yfov must be less than PI`);
|
|
997
|
+
}
|
|
998
|
+
const znear = resolveCameraPositive(camera.perspective.znear, `camera ${index} perspective.znear`);
|
|
999
|
+
const zfar = camera.perspective.zfar === undefined
|
|
1000
|
+
? 1000
|
|
1001
|
+
: resolveCameraPositive(camera.perspective.zfar, `camera ${index} perspective.zfar`);
|
|
1002
|
+
if (zfar <= znear) {
|
|
1003
|
+
throw new RangeError(`glTF camera ${index} perspective.zfar must be greater than znear`);
|
|
1004
|
+
}
|
|
1005
|
+
const aspectRatio = resolveCameraPositive(camera.perspective.aspectRatio ?? 1, `camera ${index} perspective.aspectRatio`);
|
|
1006
|
+
return {
|
|
1007
|
+
name: camera.name ?? `camera-${index}`,
|
|
1008
|
+
type: "perspective",
|
|
1009
|
+
perspective: { aspectRatio, yfov, znear, zfar }
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
if (camera.type === "orthographic") {
|
|
1013
|
+
if (!camera.orthographic) {
|
|
1014
|
+
throw new Error(`glTF camera ${index} orthographic camera requires orthographic data`);
|
|
1015
|
+
}
|
|
1016
|
+
const xmag = resolveCameraPositive(camera.orthographic.xmag, `camera ${index} orthographic.xmag`);
|
|
1017
|
+
const ymag = resolveCameraPositive(camera.orthographic.ymag, `camera ${index} orthographic.ymag`);
|
|
1018
|
+
const znear = resolveCameraPositive(camera.orthographic.znear, `camera ${index} orthographic.znear`);
|
|
1019
|
+
const zfar = resolveCameraPositive(camera.orthographic.zfar, `camera ${index} orthographic.zfar`);
|
|
1020
|
+
if (zfar <= znear) {
|
|
1021
|
+
throw new RangeError(`glTF camera ${index} orthographic.zfar must be greater than znear`);
|
|
1022
|
+
}
|
|
1023
|
+
return {
|
|
1024
|
+
name: camera.name ?? `camera-${index}`,
|
|
1025
|
+
type: "orthographic",
|
|
1026
|
+
orthographic: { xmag, ymag, znear, zfar }
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
throw new Error(`glTF camera ${index} has unsupported type ${String(camera.type)}`);
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
function resolveCameraPositive(value, label) {
|
|
1033
|
+
const resolved = value;
|
|
1034
|
+
if (resolved === undefined || !Number.isFinite(resolved) || resolved <= 0) {
|
|
1035
|
+
throw new RangeError(`glTF ${label} must be finite and positive`);
|
|
1036
|
+
}
|
|
1037
|
+
return resolved;
|
|
1038
|
+
}
|
|
1039
|
+
function createLightAssets(json) {
|
|
1040
|
+
return (json.extensions?.KHR_lights_punctual?.lights ?? []).map((light, index) => {
|
|
1041
|
+
const color = resolveColor3(light.color, [1, 1, 1], `light ${index} color`);
|
|
1042
|
+
const intensity = resolveNonNegative(light.intensity, 1, `light ${index} intensity`);
|
|
1043
|
+
if (light.type !== "directional" && light.type !== "point" && light.type !== "spot") {
|
|
1044
|
+
throw new Error(`glTF light ${index} has unsupported type ${String(light.type)}`);
|
|
1045
|
+
}
|
|
1046
|
+
if (light.type === "directional") {
|
|
1047
|
+
return { name: light.name ?? `light-${index}`, type: "directional", color, intensity };
|
|
1048
|
+
}
|
|
1049
|
+
const range = resolvePositive(light.range, 10, `light ${index} range`);
|
|
1050
|
+
if (light.type === "point") {
|
|
1051
|
+
return { name: light.name ?? `light-${index}`, type: "point", color, intensity, range };
|
|
1052
|
+
}
|
|
1053
|
+
const outerConeAngle = resolveConeAngle(light.spot?.outerConeAngle, Math.PI / 4, `light ${index} spot.outerConeAngle`, false);
|
|
1054
|
+
const innerConeAngle = resolveConeAngle(light.spot?.innerConeAngle, 0, `light ${index} spot.innerConeAngle`, true);
|
|
1055
|
+
if (innerConeAngle > outerConeAngle) {
|
|
1056
|
+
throw new RangeError(`glTF light ${index} spot.innerConeAngle must be less than or equal to outerConeAngle`);
|
|
1057
|
+
}
|
|
1058
|
+
return {
|
|
1059
|
+
name: light.name ?? `light-${index}`,
|
|
1060
|
+
type: "spot",
|
|
1061
|
+
color,
|
|
1062
|
+
intensity,
|
|
1063
|
+
range,
|
|
1064
|
+
spot: { innerConeAngle, outerConeAngle }
|
|
1065
|
+
};
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
function resolveConeAngle(value, fallback, label, allowZero) {
|
|
1069
|
+
const resolved = value ?? fallback;
|
|
1070
|
+
const valid = allowZero ? resolved >= 0 : resolved > 0;
|
|
1071
|
+
if (!Number.isFinite(resolved) || !valid || resolved >= Math.PI / 2) {
|
|
1072
|
+
const lower = allowZero ? "[0" : "(0";
|
|
1073
|
+
throw new RangeError(`glTF ${label} must be finite and within ${lower}, PI / 2)`);
|
|
1074
|
+
}
|
|
1075
|
+
return resolved;
|
|
1076
|
+
}
|
|
1077
|
+
function resolveEmissiveStrength(material, materialIndex) {
|
|
1078
|
+
const strength = material.extensions?.KHR_materials_emissive_strength?.emissiveStrength ?? 1;
|
|
1079
|
+
if (!Number.isFinite(strength) || strength < 0) {
|
|
1080
|
+
throw new RangeError(`glTF material ${materialIndex} KHR_materials_emissive_strength.emissiveStrength must be finite and non-negative`);
|
|
1081
|
+
}
|
|
1082
|
+
return strength;
|
|
1083
|
+
}
|
|
1084
|
+
function resolveClearcoat(material, textures, materialIndex) {
|
|
1085
|
+
const extension = material.extensions?.KHR_materials_clearcoat;
|
|
1086
|
+
if (!extension)
|
|
1087
|
+
return {};
|
|
1088
|
+
return {
|
|
1089
|
+
clearcoat: {
|
|
1090
|
+
factor: resolveUnit(extension.clearcoatFactor, 0, `material ${materialIndex} KHR_materials_clearcoat.clearcoatFactor`),
|
|
1091
|
+
texture: resolveTextureInfo(textures, extension.clearcoatTexture, `material ${materialIndex} KHR_materials_clearcoat.clearcoatTexture`),
|
|
1092
|
+
roughnessFactor: resolveUnit(extension.clearcoatRoughnessFactor, 0, `material ${materialIndex} KHR_materials_clearcoat.clearcoatRoughnessFactor`),
|
|
1093
|
+
roughnessTexture: resolveTextureInfo(textures, extension.clearcoatRoughnessTexture, `material ${materialIndex} KHR_materials_clearcoat.clearcoatRoughnessTexture`),
|
|
1094
|
+
normalTexture: withDefaultScale(resolveTextureInfo(textures, extension.clearcoatNormalTexture, `material ${materialIndex} KHR_materials_clearcoat.clearcoatNormalTexture`), extension.clearcoatNormalTexture?.scale)
|
|
1095
|
+
}
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
function resolveTransmission(material, textures, materialIndex) {
|
|
1099
|
+
const extension = material.extensions?.KHR_materials_transmission;
|
|
1100
|
+
if (!extension)
|
|
1101
|
+
return {};
|
|
1102
|
+
return {
|
|
1103
|
+
transmission: {
|
|
1104
|
+
factor: resolveUnit(extension.transmissionFactor, 0, `material ${materialIndex} KHR_materials_transmission.transmissionFactor`),
|
|
1105
|
+
texture: resolveTextureInfo(textures, extension.transmissionTexture, `material ${materialIndex} KHR_materials_transmission.transmissionTexture`)
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
function resolveDiffuseTransmission(material, textures, pbrSpecularGlossiness, materialIndex) {
|
|
1110
|
+
const extension = material.extensions?.KHR_materials_diffuse_transmission;
|
|
1111
|
+
if (!extension)
|
|
1112
|
+
return {};
|
|
1113
|
+
if (material.extensions?.KHR_materials_unlit !== undefined) {
|
|
1114
|
+
throw new Error(`glTF material ${materialIndex} KHR_materials_diffuse_transmission must not be combined with KHR_materials_unlit`);
|
|
1115
|
+
}
|
|
1116
|
+
if (pbrSpecularGlossiness) {
|
|
1117
|
+
throw new Error(`glTF material ${materialIndex} KHR_materials_diffuse_transmission must not be combined with KHR_materials_pbrSpecularGlossiness`);
|
|
1118
|
+
}
|
|
1119
|
+
return {
|
|
1120
|
+
diffuseTransmission: {
|
|
1121
|
+
factor: resolveUnit(extension.diffuseTransmissionFactor, 0, `material ${materialIndex} KHR_materials_diffuse_transmission.diffuseTransmissionFactor`),
|
|
1122
|
+
texture: resolveTextureInfo(textures, extension.diffuseTransmissionTexture, `material ${materialIndex} KHR_materials_diffuse_transmission.diffuseTransmissionTexture`),
|
|
1123
|
+
colorFactor: resolveColor3(extension.diffuseTransmissionColorFactor, [1, 1, 1], `material ${materialIndex} KHR_materials_diffuse_transmission.diffuseTransmissionColorFactor`),
|
|
1124
|
+
colorTexture: resolveTextureInfo(textures, extension.diffuseTransmissionColorTexture, `material ${materialIndex} KHR_materials_diffuse_transmission.diffuseTransmissionColorTexture`)
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
function resolveVolume(material, textures, materialIndex) {
|
|
1129
|
+
const extension = material.extensions?.KHR_materials_volume;
|
|
1130
|
+
if (!extension)
|
|
1131
|
+
return {};
|
|
1132
|
+
return {
|
|
1133
|
+
volume: {
|
|
1134
|
+
thicknessFactor: resolveNonNegative(extension.thicknessFactor, 0, `material ${materialIndex} KHR_materials_volume.thicknessFactor`),
|
|
1135
|
+
thicknessTexture: resolveTextureInfo(textures, extension.thicknessTexture, `material ${materialIndex} KHR_materials_volume.thicknessTexture`),
|
|
1136
|
+
attenuationDistance: resolvePositive(extension.attenuationDistance, Number.POSITIVE_INFINITY, `material ${materialIndex} KHR_materials_volume.attenuationDistance`),
|
|
1137
|
+
attenuationColor: resolveColor3(extension.attenuationColor, [1, 1, 1], `material ${materialIndex} KHR_materials_volume.attenuationColor`)
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
function resolveIOR(material, materialIndex) {
|
|
1142
|
+
const extension = material.extensions?.KHR_materials_ior;
|
|
1143
|
+
if (!extension)
|
|
1144
|
+
return {};
|
|
1145
|
+
const ior = extension.ior ?? 1.5;
|
|
1146
|
+
if (!Number.isFinite(ior) || ior < 1) {
|
|
1147
|
+
throw new RangeError(`glTF material ${materialIndex} KHR_materials_ior.ior must be finite and at least 1`);
|
|
1148
|
+
}
|
|
1149
|
+
return { ior };
|
|
1150
|
+
}
|
|
1151
|
+
function resolveSpecular(material, textures, materialIndex) {
|
|
1152
|
+
const extension = material.extensions?.KHR_materials_specular;
|
|
1153
|
+
if (!extension)
|
|
1154
|
+
return {};
|
|
1155
|
+
return {
|
|
1156
|
+
specular: {
|
|
1157
|
+
factor: resolveUnit(extension.specularFactor, 1, `material ${materialIndex} KHR_materials_specular.specularFactor`),
|
|
1158
|
+
texture: resolveTextureInfo(textures, extension.specularTexture, `material ${materialIndex} KHR_materials_specular.specularTexture`),
|
|
1159
|
+
colorFactor: resolveNonNegativeColor3(extension.specularColorFactor, [1, 1, 1], `material ${materialIndex} KHR_materials_specular.specularColorFactor`),
|
|
1160
|
+
colorTexture: resolveTextureInfo(textures, extension.specularColorTexture, `material ${materialIndex} KHR_materials_specular.specularColorTexture`)
|
|
1161
|
+
}
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
function resolvePBRSpecularGlossiness(material, textures, materialIndex) {
|
|
1165
|
+
const extension = material.extensions?.KHR_materials_pbrSpecularGlossiness;
|
|
1166
|
+
if (!extension)
|
|
1167
|
+
return {};
|
|
1168
|
+
return {
|
|
1169
|
+
pbrSpecularGlossiness: {
|
|
1170
|
+
diffuseFactor: resolveColor4(extension.diffuseFactor, [1, 1, 1, 1], `material ${materialIndex} KHR_materials_pbrSpecularGlossiness.diffuseFactor`),
|
|
1171
|
+
diffuseTexture: resolveTextureInfo(textures, extension.diffuseTexture, `material ${materialIndex} KHR_materials_pbrSpecularGlossiness.diffuseTexture`),
|
|
1172
|
+
specularFactor: resolveColor3(extension.specularFactor, [1, 1, 1], `material ${materialIndex} KHR_materials_pbrSpecularGlossiness.specularFactor`),
|
|
1173
|
+
glossinessFactor: resolveUnit(extension.glossinessFactor, 1, `material ${materialIndex} KHR_materials_pbrSpecularGlossiness.glossinessFactor`),
|
|
1174
|
+
specularGlossinessTexture: resolveTextureInfo(textures, extension.specularGlossinessTexture, `material ${materialIndex} KHR_materials_pbrSpecularGlossiness.specularGlossinessTexture`)
|
|
1175
|
+
}
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
function resolveSheen(material, textures, materialIndex) {
|
|
1179
|
+
const extension = material.extensions?.KHR_materials_sheen;
|
|
1180
|
+
if (!extension)
|
|
1181
|
+
return {};
|
|
1182
|
+
return {
|
|
1183
|
+
sheen: {
|
|
1184
|
+
colorFactor: resolveColor3(extension.sheenColorFactor, [0, 0, 0], `material ${materialIndex} KHR_materials_sheen.sheenColorFactor`),
|
|
1185
|
+
colorTexture: resolveTextureInfo(textures, extension.sheenColorTexture, `material ${materialIndex} KHR_materials_sheen.sheenColorTexture`),
|
|
1186
|
+
roughnessFactor: resolveUnit(extension.sheenRoughnessFactor, 0, `material ${materialIndex} KHR_materials_sheen.sheenRoughnessFactor`),
|
|
1187
|
+
roughnessTexture: resolveTextureInfo(textures, extension.sheenRoughnessTexture, `material ${materialIndex} KHR_materials_sheen.sheenRoughnessTexture`)
|
|
1188
|
+
}
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
function resolveAnisotropy(material, textures, materialIndex) {
|
|
1192
|
+
const extension = material.extensions?.KHR_materials_anisotropy;
|
|
1193
|
+
if (!extension)
|
|
1194
|
+
return {};
|
|
1195
|
+
return {
|
|
1196
|
+
anisotropy: {
|
|
1197
|
+
strength: resolveUnit(extension.anisotropyStrength, 0, `material ${materialIndex} KHR_materials_anisotropy.anisotropyStrength`),
|
|
1198
|
+
rotation: resolveFiniteNumber(extension.anisotropyRotation, 0, `material ${materialIndex} KHR_materials_anisotropy.anisotropyRotation`),
|
|
1199
|
+
texture: resolveTextureInfo(textures, extension.anisotropyTexture, `material ${materialIndex} KHR_materials_anisotropy.anisotropyTexture`)
|
|
1200
|
+
}
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
function resolveIridescence(material, textures, materialIndex) {
|
|
1204
|
+
const extension = material.extensions?.KHR_materials_iridescence;
|
|
1205
|
+
if (!extension)
|
|
1206
|
+
return {};
|
|
1207
|
+
const thicknessMinimum = resolveNonNegative(extension.iridescenceThicknessMinimum, 100, `material ${materialIndex} KHR_materials_iridescence.iridescenceThicknessMinimum`);
|
|
1208
|
+
const thicknessMaximum = resolveNonNegative(extension.iridescenceThicknessMaximum, 400, `material ${materialIndex} KHR_materials_iridescence.iridescenceThicknessMaximum`);
|
|
1209
|
+
if (thicknessMaximum < thicknessMinimum) {
|
|
1210
|
+
throw new RangeError(`glTF material ${materialIndex} KHR_materials_iridescence.iridescenceThicknessMaximum must be greater than or equal to iridescenceThicknessMinimum`);
|
|
1211
|
+
}
|
|
1212
|
+
return {
|
|
1213
|
+
iridescence: {
|
|
1214
|
+
factor: resolveUnit(extension.iridescenceFactor, 0, `material ${materialIndex} KHR_materials_iridescence.iridescenceFactor`),
|
|
1215
|
+
texture: resolveTextureInfo(textures, extension.iridescenceTexture, `material ${materialIndex} KHR_materials_iridescence.iridescenceTexture`),
|
|
1216
|
+
ior: resolveIridescenceIOR(extension.iridescenceIor, materialIndex),
|
|
1217
|
+
thicknessMinimum,
|
|
1218
|
+
thicknessMaximum,
|
|
1219
|
+
thicknessTexture: resolveTextureInfo(textures, extension.iridescenceThicknessTexture, `material ${materialIndex} KHR_materials_iridescence.iridescenceThicknessTexture`)
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
function resolveIridescenceIOR(value, materialIndex) {
|
|
1224
|
+
const ior = value ?? 1.3;
|
|
1225
|
+
if (!Number.isFinite(ior) || ior < 1 || ior > 3) {
|
|
1226
|
+
throw new RangeError(`glTF material ${materialIndex} KHR_materials_iridescence.iridescenceIor must be finite and within [1, 3]`);
|
|
1227
|
+
}
|
|
1228
|
+
return ior;
|
|
1229
|
+
}
|
|
1230
|
+
function resolveDispersion(material, materialIndex) {
|
|
1231
|
+
const extension = material.extensions?.KHR_materials_dispersion;
|
|
1232
|
+
if (!extension)
|
|
1233
|
+
return {};
|
|
1234
|
+
return {
|
|
1235
|
+
dispersion: resolveNonNegative(extension.dispersion, 0, `material ${materialIndex} KHR_materials_dispersion.dispersion`)
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
function resolveTextureTransform(transform) {
|
|
1239
|
+
return {
|
|
1240
|
+
offset: resolveFiniteVec2(transform.offset, [0, 0], "KHR_texture_transform.offset"),
|
|
1241
|
+
scale: resolveFiniteVec2(transform.scale, [1, 1], "KHR_texture_transform.scale"),
|
|
1242
|
+
rotation: resolveFiniteNumber(transform.rotation, 0, "KHR_texture_transform.rotation")
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
function withDefaultScale(info, scale) {
|
|
1246
|
+
return info ? { ...info, scale: resolveNonNegative(scale, 1, "normalTexture.scale") } : undefined;
|
|
1247
|
+
}
|
|
1248
|
+
function withDefaultStrength(info, strength) {
|
|
1249
|
+
return info ? { ...info, strength: resolveUnit(strength, 1, "occlusionTexture.strength") } : undefined;
|
|
1250
|
+
}
|
|
1251
|
+
function resolveColor4(value, fallback, label) {
|
|
1252
|
+
const channels = value ?? fallback;
|
|
1253
|
+
if (channels.length !== 4 || channels.some((channel) => !Number.isFinite(channel) || channel < 0 || channel > 1)) {
|
|
1254
|
+
throw new RangeError(`glTF ${label} must contain four finite values in [0, 1]`);
|
|
1255
|
+
}
|
|
1256
|
+
return [channels[0], channels[1], channels[2], channels[3]];
|
|
1257
|
+
}
|
|
1258
|
+
function resolveColor3(value, fallback, label) {
|
|
1259
|
+
const channels = value ?? fallback;
|
|
1260
|
+
if (channels.length !== 3 || channels.some((channel) => !Number.isFinite(channel) || channel < 0 || channel > 1)) {
|
|
1261
|
+
throw new RangeError(`glTF ${label} must contain three finite values in [0, 1]`);
|
|
1262
|
+
}
|
|
1263
|
+
return [channels[0], channels[1], channels[2]];
|
|
1264
|
+
}
|
|
1265
|
+
function resolveNonNegativeColor3(value, fallback, label) {
|
|
1266
|
+
const channels = value ?? fallback;
|
|
1267
|
+
if (channels.length !== 3 || channels.some((channel) => !Number.isFinite(channel) || channel < 0)) {
|
|
1268
|
+
throw new RangeError(`glTF ${label} must contain three finite non-negative values`);
|
|
1269
|
+
}
|
|
1270
|
+
return [channels[0], channels[1], channels[2]];
|
|
1271
|
+
}
|
|
1272
|
+
function resolveUnit(value, fallback, label) {
|
|
1273
|
+
const resolved = value ?? fallback;
|
|
1274
|
+
if (!Number.isFinite(resolved) || resolved < 0 || resolved > 1) {
|
|
1275
|
+
throw new RangeError(`glTF ${label} must be finite and within [0, 1]`);
|
|
1276
|
+
}
|
|
1277
|
+
return resolved;
|
|
1278
|
+
}
|
|
1279
|
+
function resolveNonNegative(value, fallback, label) {
|
|
1280
|
+
const resolved = value ?? fallback;
|
|
1281
|
+
if (!Number.isFinite(resolved) || resolved < 0) {
|
|
1282
|
+
throw new RangeError(`glTF ${label} must be finite and non-negative`);
|
|
1283
|
+
}
|
|
1284
|
+
return resolved;
|
|
1285
|
+
}
|
|
1286
|
+
function resolvePositive(value, fallback, label) {
|
|
1287
|
+
const resolved = value ?? fallback;
|
|
1288
|
+
if (resolved === Number.POSITIVE_INFINITY)
|
|
1289
|
+
return resolved;
|
|
1290
|
+
if (!Number.isFinite(resolved) || resolved <= 0) {
|
|
1291
|
+
throw new RangeError(`glTF ${label} must be finite and positive`);
|
|
1292
|
+
}
|
|
1293
|
+
return resolved;
|
|
1294
|
+
}
|
|
1295
|
+
function resolveFiniteNumber(value, fallback, label) {
|
|
1296
|
+
const resolved = value ?? fallback;
|
|
1297
|
+
if (!Number.isFinite(resolved)) {
|
|
1298
|
+
throw new RangeError(`glTF ${label} must be finite`);
|
|
1299
|
+
}
|
|
1300
|
+
return resolved;
|
|
1301
|
+
}
|
|
1302
|
+
function resolveFiniteVec2(value, fallback, label) {
|
|
1303
|
+
const resolved = value ?? fallback;
|
|
1304
|
+
if (resolved.length !== 2 || resolved.some((channel) => !Number.isFinite(channel))) {
|
|
1305
|
+
throw new RangeError(`glTF ${label} must contain two finite values`);
|
|
1306
|
+
}
|
|
1307
|
+
return [resolved[0], resolved[1]];
|
|
1308
|
+
}
|
|
1309
|
+
function createSkinAssets(json, buffers, accessorCache) {
|
|
1310
|
+
if (!json.skins || json.skins.length === 0)
|
|
1311
|
+
return [];
|
|
1312
|
+
const nodeWorldMatrices = computeGLTFNodeWorldMatrices(json);
|
|
1313
|
+
const nodeNameForIndex = createGLTFNodeNameResolver(json);
|
|
1314
|
+
return (json.skins ?? []).map((skin, skinIndex) => {
|
|
1315
|
+
if (skin.joints.length === 0) {
|
|
1316
|
+
throw new Error(`glTF skin ${skinIndex} requires at least one joint`);
|
|
1317
|
+
}
|
|
1318
|
+
validateSkinDescriptor(json, skin, skinIndex);
|
|
1319
|
+
const parentByNode = parentIndexByNode(json);
|
|
1320
|
+
const inverseBindMatrices = skin.inverseBindMatrices === undefined
|
|
1321
|
+
? []
|
|
1322
|
+
: readAccessor(json, buffers, skin.inverseBindMatrices, accessorCache).map(toMat4);
|
|
1323
|
+
if (inverseBindMatrices.length > 0 && inverseBindMatrices.length !== skin.joints.length) {
|
|
1324
|
+
throw new Error(`glTF skin ${skinIndex} inverseBindMatrices count must match joints count`);
|
|
1325
|
+
}
|
|
1326
|
+
const jointSet = new Set(skin.joints);
|
|
1327
|
+
const orderedJoints = orderSkinJoints(json, skin.joints);
|
|
1328
|
+
const boneIndexByNode = new Map();
|
|
1329
|
+
for (let index = 0; index < orderedJoints.length; index += 1) {
|
|
1330
|
+
boneIndexByNode.set(orderedJoints[index], index);
|
|
1331
|
+
}
|
|
1332
|
+
const skeleton = new Skeleton(orderedJoints.map((nodeIndex) => {
|
|
1333
|
+
const node = json.nodes?.[nodeIndex];
|
|
1334
|
+
if (!node) {
|
|
1335
|
+
throw new Error(`glTF skin ${skinIndex} references missing joint node ${nodeIndex}`);
|
|
1336
|
+
}
|
|
1337
|
+
const parentNode = parentByNode.get(nodeIndex);
|
|
1338
|
+
const parentIndex = parentNode !== undefined && jointSet.has(parentNode) ? boneIndexByNode.get(parentNode) ?? -1 : -1;
|
|
1339
|
+
const transform = resolveNodeTransform(node, nodeIndex);
|
|
1340
|
+
return {
|
|
1341
|
+
name: nodeNameForIndex(nodeIndex),
|
|
1342
|
+
parentIndex,
|
|
1343
|
+
translation: transform.translation,
|
|
1344
|
+
rotation: transform.rotation,
|
|
1345
|
+
scale: transform.scale,
|
|
1346
|
+
inverseBindMatrix: inverseBindMatrices[skin.joints.indexOf(nodeIndex)] ?? identityMat4()
|
|
1347
|
+
};
|
|
1348
|
+
}));
|
|
1349
|
+
return {
|
|
1350
|
+
name: skin.name ?? `skin-${skinIndex}`,
|
|
1351
|
+
joints: skin.joints,
|
|
1352
|
+
jointNames: skin.joints.map((nodeIndex) => nodeNameForIndex(nodeIndex)),
|
|
1353
|
+
inverseBindMatrices: skin.joints.map((nodeIndex) => inverseBindMatrices[skin.joints.indexOf(nodeIndex)] ?? identityMat4()),
|
|
1354
|
+
skeletonRoot: skin.skeleton,
|
|
1355
|
+
skeleton,
|
|
1356
|
+
jointBindMatrices: skin.joints.map((nodeIndex) => multiplyLoaderMat4(nodeWorldMatrices.get(nodeIndex) ?? identityMat4(), inverseBindMatrices[skin.joints.indexOf(nodeIndex)] ?? identityMat4())),
|
|
1357
|
+
...(skin.joints.length <= MAX_RENDERABLE_SKIN_JOINTS ? { skinningPalette: buildGLTFSkinningPalette(skeleton, orderedJoints, skin.joints) } : {})
|
|
1358
|
+
};
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
function computeGLTFNodeWorldMatrices(json) {
|
|
1362
|
+
const nodes = json.nodes ?? [];
|
|
1363
|
+
const parents = parentIndexByNode(json);
|
|
1364
|
+
const matrices = new Map();
|
|
1365
|
+
const visiting = new Set();
|
|
1366
|
+
const resolve = (nodeIndex) => {
|
|
1367
|
+
const existing = matrices.get(nodeIndex);
|
|
1368
|
+
if (existing)
|
|
1369
|
+
return existing;
|
|
1370
|
+
if (visiting.has(nodeIndex)) {
|
|
1371
|
+
throw new Error(`glTF node graph contains a cycle at node ${nodeIndex}`);
|
|
1372
|
+
}
|
|
1373
|
+
const node = nodes[nodeIndex];
|
|
1374
|
+
if (!node)
|
|
1375
|
+
return identityMat4();
|
|
1376
|
+
visiting.add(nodeIndex);
|
|
1377
|
+
const transform = resolveNodeTransform(node, nodeIndex);
|
|
1378
|
+
const local = composeLoaderMat4(transform.translation, transform.rotation, transform.scale);
|
|
1379
|
+
const parent = parents.get(nodeIndex);
|
|
1380
|
+
const world = parent === undefined ? local : multiplyLoaderMat4(resolve(parent), local);
|
|
1381
|
+
matrices.set(nodeIndex, world);
|
|
1382
|
+
visiting.delete(nodeIndex);
|
|
1383
|
+
return world;
|
|
1384
|
+
};
|
|
1385
|
+
for (let index = 0; index < nodes.length; index += 1) {
|
|
1386
|
+
resolve(index);
|
|
1387
|
+
}
|
|
1388
|
+
return matrices;
|
|
1389
|
+
}
|
|
1390
|
+
function buildGLTFSkinningPalette(skeleton, orderedJoints, gltfJoints) {
|
|
1391
|
+
const orderedPalette = skeleton.matrixPalette();
|
|
1392
|
+
const paletteByNode = new Map();
|
|
1393
|
+
for (let index = 0; index < orderedJoints.length; index += 1) {
|
|
1394
|
+
paletteByNode.set(orderedJoints[index], orderedPalette[index]);
|
|
1395
|
+
}
|
|
1396
|
+
const matrices = new Float32Array(gltfJoints.length * 16);
|
|
1397
|
+
for (let index = 0; index < gltfJoints.length; index += 1) {
|
|
1398
|
+
const matrix = paletteByNode.get(gltfJoints[index]);
|
|
1399
|
+
if (!matrix) {
|
|
1400
|
+
throw new Error(`glTF skin references missing ordered joint ${gltfJoints[index]}`);
|
|
1401
|
+
}
|
|
1402
|
+
matrices.set(matrix, index * 16);
|
|
1403
|
+
}
|
|
1404
|
+
return { jointCount: gltfJoints.length, matrices };
|
|
1405
|
+
}
|
|
1406
|
+
function validateSkinDescriptor(json, skin, skinIndex) {
|
|
1407
|
+
const seen = new Set();
|
|
1408
|
+
for (const joint of skin.joints) {
|
|
1409
|
+
if (!Number.isInteger(joint) || joint < 0) {
|
|
1410
|
+
throw new Error(`glTF skin ${skinIndex} joint indices must be non-negative integers`);
|
|
1411
|
+
}
|
|
1412
|
+
if (seen.has(joint)) {
|
|
1413
|
+
throw new Error(`glTF skin ${skinIndex} contains duplicate joint ${joint}`);
|
|
1414
|
+
}
|
|
1415
|
+
seen.add(joint);
|
|
1416
|
+
}
|
|
1417
|
+
if (skin.skeleton !== undefined && (!Number.isInteger(skin.skeleton) || skin.skeleton < 0 || !json.nodes?.[skin.skeleton])) {
|
|
1418
|
+
throw new Error(`glTF skin ${skinIndex} references missing skeleton node ${skin.skeleton}`);
|
|
1419
|
+
}
|
|
1420
|
+
if (skin.inverseBindMatrices !== undefined && (!Number.isInteger(skin.inverseBindMatrices) || skin.inverseBindMatrices < 0)) {
|
|
1421
|
+
throw new Error(`glTF skin ${skinIndex} inverseBindMatrices must reference a non-negative accessor index`);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
function createNodeInstanceTransforms(json, buffers, accessorCache) {
|
|
1425
|
+
const transforms = new Map();
|
|
1426
|
+
for (const [nodeIndex, node] of (json.nodes ?? []).entries()) {
|
|
1427
|
+
const extension = node.extensions?.EXT_mesh_gpu_instancing;
|
|
1428
|
+
if (!extension)
|
|
1429
|
+
continue;
|
|
1430
|
+
if (!isObjectRecord(extension.attributes) || Array.isArray(extension.attributes)) {
|
|
1431
|
+
throw new Error(`glTF node ${nodeIndex} EXT_mesh_gpu_instancing.attributes must be an object`);
|
|
1432
|
+
}
|
|
1433
|
+
const allowed = new Set(["TRANSLATION", "ROTATION", "SCALE"]);
|
|
1434
|
+
for (const semantic of Object.keys(extension.attributes)) {
|
|
1435
|
+
if (!allowed.has(semantic)) {
|
|
1436
|
+
throw new Error(`glTF node ${nodeIndex} EXT_mesh_gpu_instancing attribute ${semantic} is unsupported`);
|
|
1437
|
+
}
|
|
1438
|
+
const accessorIndex = extension.attributes[semantic];
|
|
1439
|
+
if (!Number.isInteger(accessorIndex) || accessorIndex < 0) {
|
|
1440
|
+
throw new Error(`glTF node ${nodeIndex} EXT_mesh_gpu_instancing ${semantic} accessor must be a non-negative integer`);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
const translations = readOptionalAccessor(json, buffers, extension.attributes.TRANSLATION, accessorCache);
|
|
1444
|
+
const rotations = readOptionalAccessor(json, buffers, extension.attributes.ROTATION, accessorCache);
|
|
1445
|
+
const scales = readOptionalAccessor(json, buffers, extension.attributes.SCALE, accessorCache);
|
|
1446
|
+
const instanceCount = firstPositiveLength([translations.length, rotations.length, scales.length]);
|
|
1447
|
+
if (instanceCount === 0) {
|
|
1448
|
+
throw new Error(`glTF node ${nodeIndex} EXT_mesh_gpu_instancing requires TRANSLATION, ROTATION, or SCALE attributes`);
|
|
1449
|
+
}
|
|
1450
|
+
validateInstanceAttributeCount("TRANSLATION", translations.length, instanceCount, nodeIndex);
|
|
1451
|
+
validateInstanceAttributeCount("ROTATION", rotations.length, instanceCount, nodeIndex);
|
|
1452
|
+
validateInstanceAttributeCount("SCALE", scales.length, instanceCount, nodeIndex);
|
|
1453
|
+
const packed = new Float32Array(instanceCount * 16);
|
|
1454
|
+
for (let instanceIndex = 0; instanceIndex < instanceCount; instanceIndex += 1) {
|
|
1455
|
+
const translation = toInstanceVec3(translations[instanceIndex], [0, 0, 0], `node ${nodeIndex} EXT_mesh_gpu_instancing TRANSLATION`);
|
|
1456
|
+
const rotation = toInstanceQuat(rotations[instanceIndex], [0, 0, 0, 1], `node ${nodeIndex} EXT_mesh_gpu_instancing ROTATION`);
|
|
1457
|
+
const scale = toInstanceVec3(scales[instanceIndex], [1, 1, 1], `node ${nodeIndex} EXT_mesh_gpu_instancing SCALE`);
|
|
1458
|
+
packed.set(composeMat4(translation, rotation, scale), instanceIndex * 16);
|
|
1459
|
+
}
|
|
1460
|
+
transforms.set(nodeIndex, packed);
|
|
1461
|
+
}
|
|
1462
|
+
return transforms;
|
|
1463
|
+
}
|
|
1464
|
+
function firstPositiveLength(lengths) {
|
|
1465
|
+
return lengths.find((length) => length > 0) ?? 0;
|
|
1466
|
+
}
|
|
1467
|
+
function validateInstanceAttributeCount(semantic, count, instanceCount, nodeIndex) {
|
|
1468
|
+
if (count > 0 && count !== instanceCount) {
|
|
1469
|
+
throw new Error(`glTF node ${nodeIndex} EXT_mesh_gpu_instancing ${semantic} count must match instance count`);
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
function toInstanceVec3(row, fallback, label) {
|
|
1473
|
+
if (!row)
|
|
1474
|
+
return fallback;
|
|
1475
|
+
if (row.length < 3 || row.slice(0, 3).some((value) => !Number.isFinite(value))) {
|
|
1476
|
+
throw new Error(`glTF ${label} must contain three finite values`);
|
|
1477
|
+
}
|
|
1478
|
+
return [row[0], row[1], row[2]];
|
|
1479
|
+
}
|
|
1480
|
+
function toInstanceQuat(row, fallback, label) {
|
|
1481
|
+
if (!row)
|
|
1482
|
+
return fallback;
|
|
1483
|
+
if (row.length < 4 || row.slice(0, 4).some((value) => !Number.isFinite(value))) {
|
|
1484
|
+
throw new Error(`glTF ${label} must contain four finite values`);
|
|
1485
|
+
}
|
|
1486
|
+
return [row[0], row[1], row[2], row[3]];
|
|
1487
|
+
}
|
|
1488
|
+
function createAnimationClips(json, buffers, accessorCache) {
|
|
1489
|
+
const nodeNameForIndex = createGLTFNodeNameResolver(json);
|
|
1490
|
+
return (json.animations ?? []).map((animation, animationIndex) => {
|
|
1491
|
+
const tracks = animation.channels.flatMap((channel, channelIndex) => {
|
|
1492
|
+
const sampler = animation.samplers[channel.sampler];
|
|
1493
|
+
if (!sampler) {
|
|
1494
|
+
throw new Error(`glTF animation ${animationIndex} channel ${channelIndex} references missing sampler ${channel.sampler}`);
|
|
1495
|
+
}
|
|
1496
|
+
if (isOptionalAnimationPointerChannel(json, channel)) {
|
|
1497
|
+
return [];
|
|
1498
|
+
}
|
|
1499
|
+
if (channel.target.node === undefined || !json.nodes?.[channel.target.node]) {
|
|
1500
|
+
throw new Error(`glTF animation ${animationIndex} channel ${channelIndex} references missing target node ${channel.target.node ?? "undefined"}`);
|
|
1501
|
+
}
|
|
1502
|
+
const interpolation = resolveAnimationInterpolation(sampler.interpolation, animationIndex, channelIndex);
|
|
1503
|
+
const path = resolveAnimationTargetPath(channel.target.path, animationIndex, channelIndex);
|
|
1504
|
+
const times = readAccessor(json, buffers, sampler.input, accessorCache).map((row) => row[0] ?? 0);
|
|
1505
|
+
const output = readAccessor(json, buffers, sampler.output, accessorCache);
|
|
1506
|
+
const values = animationKeyframesForSampler(path, times, output, interpolation, animationIndex, channelIndex, morphWeightCountForAnimationTarget(json, channel.target.node));
|
|
1507
|
+
const valueType = valueTypeForAnimationPath(path);
|
|
1508
|
+
return [new AnimationTrack({
|
|
1509
|
+
target: `${nodeNameForIndex(channel.target.node)}.${path}`,
|
|
1510
|
+
valueType,
|
|
1511
|
+
keyframes: values
|
|
1512
|
+
})];
|
|
1513
|
+
});
|
|
1514
|
+
return new AnimationClip({ name: animation.name ?? `animation-${animationIndex}`, tracks });
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
function isOptionalAnimationPointerChannel(json, channel) {
|
|
1518
|
+
return channel.target.path === "pointer" &&
|
|
1519
|
+
json.extensionsUsed?.includes("KHR_animation_pointer") === true &&
|
|
1520
|
+
json.extensionsRequired?.includes("KHR_animation_pointer") !== true &&
|
|
1521
|
+
typeof channel.target.extensions?.KHR_animation_pointer?.pointer === "string";
|
|
1522
|
+
}
|
|
1523
|
+
function resolveAnimationInterpolation(value, animationIndex, channelIndex) {
|
|
1524
|
+
if (value === undefined || value === "LINEAR" || value === "STEP" || value === "CUBICSPLINE") {
|
|
1525
|
+
return value ?? "LINEAR";
|
|
1526
|
+
}
|
|
1527
|
+
throw new Error(`glTF animation ${animationIndex} channel ${channelIndex} interpolation ${value} is unsupported`);
|
|
1528
|
+
}
|
|
1529
|
+
function resolveAnimationTargetPath(path, animationIndex, channelIndex) {
|
|
1530
|
+
if (path === "translation" || path === "rotation" || path === "scale" || path === "weights") {
|
|
1531
|
+
return path;
|
|
1532
|
+
}
|
|
1533
|
+
throw new Error(`glTF animation ${animationIndex} channel ${channelIndex} target path ${path} is unsupported`);
|
|
1534
|
+
}
|
|
1535
|
+
function animationKeyframesForSampler(path, times, output, interpolation, animationIndex, channelIndex, morphWeightCount) {
|
|
1536
|
+
const normalizedOutput = path === "weights" ? normalizeWeightAnimationOutput(times, output, interpolation, animationIndex, channelIndex, morphWeightCount) : output;
|
|
1537
|
+
if (interpolation !== "CUBICSPLINE") {
|
|
1538
|
+
if (times.length !== normalizedOutput.length) {
|
|
1539
|
+
throw new Error(`glTF animation ${animationIndex} channel ${channelIndex} input/output count mismatch`);
|
|
1540
|
+
}
|
|
1541
|
+
const samples = sanitizeAnimationSamples(times, normalizedOutput, 1);
|
|
1542
|
+
const mode = interpolation === "STEP" ? "step" : "linear";
|
|
1543
|
+
return samples.times.map((time, index) => ({
|
|
1544
|
+
time,
|
|
1545
|
+
value: animationValueForPath(path, samples.output[index]),
|
|
1546
|
+
interpolation: mode
|
|
1547
|
+
}));
|
|
1548
|
+
}
|
|
1549
|
+
if (normalizedOutput.length !== times.length * 3) {
|
|
1550
|
+
throw new Error(`glTF animation ${animationIndex} channel ${channelIndex} CUBICSPLINE output count must be three times input count`);
|
|
1551
|
+
}
|
|
1552
|
+
const samples = sanitizeAnimationSamples(times, normalizedOutput, 3);
|
|
1553
|
+
return samples.times.map((time, index) => {
|
|
1554
|
+
const offset = index * 3;
|
|
1555
|
+
return {
|
|
1556
|
+
time,
|
|
1557
|
+
inTangent: animationValueForPath(path, samples.output[offset]),
|
|
1558
|
+
value: animationValueForPath(path, samples.output[offset + 1]),
|
|
1559
|
+
outTangent: animationValueForPath(path, samples.output[offset + 2]),
|
|
1560
|
+
interpolation: "cubicspline"
|
|
1561
|
+
};
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
function sanitizeAnimationSamples(times, output, rowsPerSample) {
|
|
1565
|
+
const cleanTimes = [];
|
|
1566
|
+
const cleanOutput = [];
|
|
1567
|
+
let previous = -Number.MAX_VALUE;
|
|
1568
|
+
for (let index = 0; index < times.length; index += 1) {
|
|
1569
|
+
const time = times[index] ?? 0;
|
|
1570
|
+
if (!Number.isFinite(time) || time < 0 || time <= previous) {
|
|
1571
|
+
continue;
|
|
1572
|
+
}
|
|
1573
|
+
cleanTimes.push(time);
|
|
1574
|
+
for (let row = 0; row < rowsPerSample; row += 1) {
|
|
1575
|
+
const value = output[index * rowsPerSample + row];
|
|
1576
|
+
if (value !== undefined)
|
|
1577
|
+
cleanOutput.push(value);
|
|
1578
|
+
}
|
|
1579
|
+
previous = time;
|
|
1580
|
+
}
|
|
1581
|
+
return cleanTimes.length > 0 ? { times: cleanTimes, output: cleanOutput } : { times, output };
|
|
1582
|
+
}
|
|
1583
|
+
function morphWeightCountForAnimationTarget(json, nodeIndex) {
|
|
1584
|
+
const node = nodeIndex === undefined ? undefined : json.nodes?.[nodeIndex];
|
|
1585
|
+
const mesh = node?.mesh === undefined ? undefined : json.meshes?.[node.mesh];
|
|
1586
|
+
if (!mesh)
|
|
1587
|
+
return undefined;
|
|
1588
|
+
if (mesh.weights && mesh.weights.length > 0)
|
|
1589
|
+
return mesh.weights.length;
|
|
1590
|
+
return Math.max(0, ...mesh.primitives.map((primitive) => primitive.targets?.length ?? 0)) || undefined;
|
|
1591
|
+
}
|
|
1592
|
+
function normalizeWeightAnimationOutput(times, output, interpolation, animationIndex, channelIndex, morphWeightCount) {
|
|
1593
|
+
const samplesPerTime = interpolation === "CUBICSPLINE" ? 3 : 1;
|
|
1594
|
+
const expectedRows = times.length * samplesPerTime;
|
|
1595
|
+
if (output.length === expectedRows)
|
|
1596
|
+
return output;
|
|
1597
|
+
if (times.length === 0 || output.length % expectedRows !== 0) {
|
|
1598
|
+
return output;
|
|
1599
|
+
}
|
|
1600
|
+
const width = morphWeightCount ?? (output.length / expectedRows);
|
|
1601
|
+
if (!Number.isInteger(width) || width <= 0 || output.length !== expectedRows * width) {
|
|
1602
|
+
throw new Error(`glTF animation ${animationIndex} channel ${channelIndex} weights output count does not match morph target count`);
|
|
1603
|
+
}
|
|
1604
|
+
const grouped = [];
|
|
1605
|
+
for (let sampleIndex = 0; sampleIndex < expectedRows; sampleIndex += 1) {
|
|
1606
|
+
const values = [];
|
|
1607
|
+
for (let component = 0; component < width; component += 1) {
|
|
1608
|
+
values.push(output[sampleIndex * width + component]?.[0] ?? 0);
|
|
1609
|
+
}
|
|
1610
|
+
grouped.push(values);
|
|
1611
|
+
}
|
|
1612
|
+
return grouped;
|
|
1613
|
+
}
|
|
1614
|
+
async function loadDocument(request) {
|
|
1615
|
+
const binary = request.url.startsWith("data:model/gltf-binary") || /\.glb(?:\?.*)?$/i.test(request.url);
|
|
1616
|
+
if (request.url.startsWith("data:")) {
|
|
1617
|
+
const data = decodeDataUri(request.url);
|
|
1618
|
+
if (binary) {
|
|
1619
|
+
return parseGLB(data, request.url);
|
|
1620
|
+
}
|
|
1621
|
+
const text = new TextDecoder().decode(data);
|
|
1622
|
+
return { json: JSON.parse(text), url: request.url, byteLength: data.byteLength };
|
|
1623
|
+
}
|
|
1624
|
+
if (typeof fetch !== "function") {
|
|
1625
|
+
throw new Error("GLTFLoader requires fetch for non-data URLs");
|
|
1626
|
+
}
|
|
1627
|
+
const response = await fetch(request.url, { signal: request.signal });
|
|
1628
|
+
if (!response.ok) {
|
|
1629
|
+
throw new Error(`glTF request failed with ${response.status}`);
|
|
1630
|
+
}
|
|
1631
|
+
if (binary) {
|
|
1632
|
+
return parseGLB(await readResponseBytes(response, request.url, "document", request), request.url);
|
|
1633
|
+
}
|
|
1634
|
+
const bytes = await readResponseBytes(response, request.url, "document", request);
|
|
1635
|
+
return { json: JSON.parse(new TextDecoder().decode(bytes)), url: request.url, byteLength: bytes.byteLength };
|
|
1636
|
+
}
|
|
1637
|
+
async function loadBuffer(buffer, index, document, request) {
|
|
1638
|
+
validateBufferDescriptor(index, buffer);
|
|
1639
|
+
if (!buffer.uri) {
|
|
1640
|
+
if (index === 0 && document.binaryChunk) {
|
|
1641
|
+
if (buffer.byteLength > document.binaryChunk.byteLength) {
|
|
1642
|
+
throw new Error(`glTF buffer 0 declares ${buffer.byteLength} bytes but GLB BIN chunk has ${document.binaryChunk.byteLength}`);
|
|
1643
|
+
}
|
|
1644
|
+
return buffer.byteLength === document.binaryChunk.byteLength
|
|
1645
|
+
? document.binaryChunk
|
|
1646
|
+
: document.binaryChunk.slice(0, buffer.byteLength);
|
|
1647
|
+
}
|
|
1648
|
+
throw new Error(`glTF buffer ${index} is missing a uri and no GLB BIN chunk is available`);
|
|
1649
|
+
}
|
|
1650
|
+
if (buffer.uri.startsWith("data:")) {
|
|
1651
|
+
return validateLoadedBufferLength(index, buffer, decodeBufferDataUri(index, buffer.uri));
|
|
1652
|
+
}
|
|
1653
|
+
if (typeof fetch !== "function") {
|
|
1654
|
+
throw new Error("GLTFLoader requires fetch for external buffers");
|
|
1655
|
+
}
|
|
1656
|
+
const url = new URL(buffer.uri, document.url).toString();
|
|
1657
|
+
const response = await fetch(url, { signal: request.signal });
|
|
1658
|
+
if (!response.ok) {
|
|
1659
|
+
throw new Error(`glTF buffer request failed with ${response.status}`);
|
|
1660
|
+
}
|
|
1661
|
+
return validateLoadedBufferLength(index, buffer, await readResponseBytes(response, url, "buffer", request));
|
|
1662
|
+
}
|
|
1663
|
+
function validateBufferDescriptor(index, buffer) {
|
|
1664
|
+
if (!Number.isInteger(buffer.byteLength) || buffer.byteLength < 0) {
|
|
1665
|
+
throw new Error(`glTF buffer ${index} byteLength must be a non-negative integer`);
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
function decodeBufferDataUri(index, uri) {
|
|
1669
|
+
const separator = uri.indexOf(",");
|
|
1670
|
+
if (separator < 0) {
|
|
1671
|
+
throw new Error(`glTF buffer ${index} data uri must include a comma separator`);
|
|
1672
|
+
}
|
|
1673
|
+
const header = uri.slice(5, separator).toLowerCase();
|
|
1674
|
+
const mediaType = header.split(";")[0] ?? "";
|
|
1675
|
+
if (mediaType && mediaType !== "application/octet-stream" && mediaType !== "application/gltf-buffer") {
|
|
1676
|
+
throw new Error(`glTF buffer ${index} data uri media type must be application/octet-stream or application/gltf-buffer`);
|
|
1677
|
+
}
|
|
1678
|
+
const payload = uri.slice(separator + 1);
|
|
1679
|
+
if (header.endsWith(";base64")) {
|
|
1680
|
+
return decodeBufferBase64DataUri(index, payload);
|
|
1681
|
+
}
|
|
1682
|
+
try {
|
|
1683
|
+
return new TextEncoder().encode(decodeURIComponent(payload)).buffer;
|
|
1684
|
+
}
|
|
1685
|
+
catch (error) {
|
|
1686
|
+
throw new Error(`glTF buffer ${index} data uri payload must be valid URI encoding: ${error instanceof Error ? error.message : String(error)}`);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
function decodeBufferBase64DataUri(index, payload) {
|
|
1690
|
+
let decodedPayload;
|
|
1691
|
+
try {
|
|
1692
|
+
decodedPayload = decodeURIComponent(payload);
|
|
1693
|
+
}
|
|
1694
|
+
catch (error) {
|
|
1695
|
+
throw new Error(`glTF buffer ${index} data uri base64 payload must be valid URI encoding: ${error instanceof Error ? error.message : String(error)}`);
|
|
1696
|
+
}
|
|
1697
|
+
const compactPayload = decodedPayload.replace(/\s+/g, "");
|
|
1698
|
+
const paddingIndex = compactPayload.indexOf("=");
|
|
1699
|
+
const paddingIsTerminal = paddingIndex < 0 || /^={1,2}$/.test(compactPayload.slice(paddingIndex));
|
|
1700
|
+
if (compactPayload.length % 4 === 1 ||
|
|
1701
|
+
!paddingIsTerminal ||
|
|
1702
|
+
!/^[A-Za-z0-9+/]*={0,2}$/.test(compactPayload)) {
|
|
1703
|
+
throw new Error(`glTF buffer ${index} data uri base64 payload is malformed`);
|
|
1704
|
+
}
|
|
1705
|
+
let binary;
|
|
1706
|
+
try {
|
|
1707
|
+
binary = atob(compactPayload);
|
|
1708
|
+
}
|
|
1709
|
+
catch (error) {
|
|
1710
|
+
throw new Error(`glTF buffer ${index} data uri base64 payload is malformed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1711
|
+
}
|
|
1712
|
+
const bytes = new Uint8Array(binary.length);
|
|
1713
|
+
for (let i = 0; i < binary.length; i += 1) {
|
|
1714
|
+
bytes[i] = binary.charCodeAt(i);
|
|
1715
|
+
}
|
|
1716
|
+
return bytes.buffer;
|
|
1717
|
+
}
|
|
1718
|
+
function validateLoadedBufferLength(index, buffer, data) {
|
|
1719
|
+
if (data.byteLength !== buffer.byteLength) {
|
|
1720
|
+
throw new Error(`glTF buffer ${index} declares ${buffer.byteLength} bytes but loaded ${data.byteLength}`);
|
|
1721
|
+
}
|
|
1722
|
+
return data;
|
|
1723
|
+
}
|
|
1724
|
+
async function prepareBufferViews(json, buffers, meshoptDecoder) {
|
|
1725
|
+
const bufferViews = json.bufferViews ?? [];
|
|
1726
|
+
const compressedViewEntries = bufferViews
|
|
1727
|
+
.map((view, index) => ({ view, index, meshopt: resolveMeshoptCompressionExtension(view) }))
|
|
1728
|
+
.filter((entry) => entry.meshopt !== undefined);
|
|
1729
|
+
if (compressedViewEntries.length === 0) {
|
|
1730
|
+
return { json, buffers };
|
|
1731
|
+
}
|
|
1732
|
+
if (!usesGLTFMeshoptExtension(json)) {
|
|
1733
|
+
throw new Error("glTF uses meshopt-compressed bufferViews but meshopt extension is not declared");
|
|
1734
|
+
}
|
|
1735
|
+
if (!meshoptDecoder) {
|
|
1736
|
+
throw new Error("glTF meshopt compression requires a meshoptDecoder");
|
|
1737
|
+
}
|
|
1738
|
+
const preparedBuffers = [...buffers];
|
|
1739
|
+
const preparedBufferViews = [...bufferViews];
|
|
1740
|
+
for (const { index, meshopt } of compressedViewEntries) {
|
|
1741
|
+
const { name, extension } = meshopt;
|
|
1742
|
+
validateMeshoptDescriptor(json, buffers, index, name, extension);
|
|
1743
|
+
const sourceBuffer = buffers[extension.buffer];
|
|
1744
|
+
const byteOffset = extension.byteOffset ?? 0;
|
|
1745
|
+
const source = new Uint8Array(sourceBuffer, byteOffset, extension.byteLength);
|
|
1746
|
+
const descriptor = {
|
|
1747
|
+
bufferViewIndex: index,
|
|
1748
|
+
byteStride: extension.byteStride,
|
|
1749
|
+
count: extension.count,
|
|
1750
|
+
mode: extension.mode,
|
|
1751
|
+
filter: extension.filter ?? "NONE"
|
|
1752
|
+
};
|
|
1753
|
+
const decoded = toOwnedArrayBuffer(await meshoptDecoder(source, descriptor));
|
|
1754
|
+
const expectedByteLength = extension.count * extension.byteStride;
|
|
1755
|
+
if (decoded.byteLength !== expectedByteLength) {
|
|
1756
|
+
throw new Error(`glTF bufferView ${index} EXT_meshopt_compression decoded ${decoded.byteLength} bytes but expected ${expectedByteLength}`);
|
|
1757
|
+
}
|
|
1758
|
+
const decodedBufferIndex = preparedBuffers.length;
|
|
1759
|
+
preparedBuffers.push(decoded);
|
|
1760
|
+
preparedBufferViews[index] = {
|
|
1761
|
+
buffer: decodedBufferIndex,
|
|
1762
|
+
byteOffset: 0,
|
|
1763
|
+
byteLength: decoded.byteLength,
|
|
1764
|
+
...(extension.mode === "ATTRIBUTES" ? { byteStride: extension.byteStride } : {})
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
return {
|
|
1768
|
+
json: { ...json, bufferViews: preparedBufferViews },
|
|
1769
|
+
buffers: preparedBuffers
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
function resolveMeshoptCompressionExtension(view) {
|
|
1773
|
+
for (const name of GLTF_MESHOPT_EXTENSION_NAMES) {
|
|
1774
|
+
const extension = view.extensions?.[name];
|
|
1775
|
+
if (extension)
|
|
1776
|
+
return { name, extension };
|
|
1777
|
+
}
|
|
1778
|
+
return undefined;
|
|
1779
|
+
}
|
|
1780
|
+
function validateMeshoptDescriptor(json, buffers, bufferViewIndex, extensionName, extension) {
|
|
1781
|
+
if (!Number.isInteger(extension.buffer) || extension.buffer < 0 || !json.buffers?.[extension.buffer] || !buffers[extension.buffer]) {
|
|
1782
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} buffer must reference an existing buffer`);
|
|
1783
|
+
}
|
|
1784
|
+
if (extension.byteOffset !== undefined && (!Number.isInteger(extension.byteOffset) || extension.byteOffset < 0)) {
|
|
1785
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} byteOffset must be a non-negative integer`);
|
|
1786
|
+
}
|
|
1787
|
+
if (!Number.isInteger(extension.byteLength) || extension.byteLength < 0) {
|
|
1788
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} byteLength must be a non-negative integer`);
|
|
1789
|
+
}
|
|
1790
|
+
if (!Number.isInteger(extension.byteStride) || extension.byteStride <= 0) {
|
|
1791
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} byteStride must be a positive integer`);
|
|
1792
|
+
}
|
|
1793
|
+
if (!Number.isInteger(extension.count) || extension.count < 0) {
|
|
1794
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} count must be a non-negative integer`);
|
|
1795
|
+
}
|
|
1796
|
+
if (extension.mode !== "ATTRIBUTES" && extension.mode !== "TRIANGLES" && extension.mode !== "INDICES") {
|
|
1797
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} mode ${String(extension.mode)} is unsupported`);
|
|
1798
|
+
}
|
|
1799
|
+
if (extension.filter !== undefined &&
|
|
1800
|
+
extension.filter !== "NONE" &&
|
|
1801
|
+
extension.filter !== "OCTAHEDRAL" &&
|
|
1802
|
+
extension.filter !== "QUATERNION" &&
|
|
1803
|
+
extension.filter !== "EXPONENTIAL" &&
|
|
1804
|
+
extension.filter !== "COLOR") {
|
|
1805
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} filter ${String(extension.filter)} is unsupported`);
|
|
1806
|
+
}
|
|
1807
|
+
const sourceBuffer = buffers[extension.buffer];
|
|
1808
|
+
const sourceStart = extension.byteOffset ?? 0;
|
|
1809
|
+
const sourceEnd = sourceStart + extension.byteLength;
|
|
1810
|
+
if (sourceEnd > sourceBuffer.byteLength) {
|
|
1811
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} ${extensionName} source range exceeds buffer ${extension.buffer}`);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
function toOwnedArrayBuffer(value) {
|
|
1815
|
+
if (value instanceof ArrayBuffer) {
|
|
1816
|
+
return value.slice(0);
|
|
1817
|
+
}
|
|
1818
|
+
const copy = new Uint8Array(value.byteLength);
|
|
1819
|
+
copy.set(value);
|
|
1820
|
+
return copy.buffer;
|
|
1821
|
+
}
|
|
1822
|
+
async function readResponseBytes(response, url, phase, request) {
|
|
1823
|
+
const totalBytes = parseContentLength(response.headers?.get("content-length"));
|
|
1824
|
+
const reader = response.body?.getReader();
|
|
1825
|
+
if (!reader) {
|
|
1826
|
+
const buffer = await response.arrayBuffer();
|
|
1827
|
+
request.onProgress?.({ url, phase: "complete", loadedBytes: buffer.byteLength, ...(totalBytes === undefined ? {} : { totalBytes }) });
|
|
1828
|
+
return buffer;
|
|
1829
|
+
}
|
|
1830
|
+
const chunks = [];
|
|
1831
|
+
let loadedBytes = 0;
|
|
1832
|
+
while (true) {
|
|
1833
|
+
if (request.signal?.aborted) {
|
|
1834
|
+
throw request.signal.reason instanceof Error ? request.signal.reason : new Error(`glTF request aborted for ${url}`);
|
|
1835
|
+
}
|
|
1836
|
+
const { done, value } = await reader.read();
|
|
1837
|
+
if (done)
|
|
1838
|
+
break;
|
|
1839
|
+
chunks.push(value);
|
|
1840
|
+
loadedBytes += value.byteLength;
|
|
1841
|
+
request.onProgress?.({ url, phase, loadedBytes, ...(totalBytes === undefined ? {} : { totalBytes }) });
|
|
1842
|
+
}
|
|
1843
|
+
const buffer = new Uint8Array(loadedBytes);
|
|
1844
|
+
let offset = 0;
|
|
1845
|
+
for (const chunk of chunks) {
|
|
1846
|
+
buffer.set(chunk, offset);
|
|
1847
|
+
offset += chunk.byteLength;
|
|
1848
|
+
}
|
|
1849
|
+
request.onProgress?.({ url, phase: "complete", loadedBytes, ...(totalBytes === undefined ? {} : { totalBytes }) });
|
|
1850
|
+
return buffer.buffer;
|
|
1851
|
+
}
|
|
1852
|
+
function parseContentLength(value) {
|
|
1853
|
+
if (!value)
|
|
1854
|
+
return undefined;
|
|
1855
|
+
const parsed = Number(value);
|
|
1856
|
+
return Number.isFinite(parsed) && parsed >= 0 ? parsed : undefined;
|
|
1857
|
+
}
|
|
1858
|
+
function decodeDataUri(uri) {
|
|
1859
|
+
const [header = "", payload = ""] = uri.split(",", 2);
|
|
1860
|
+
if (header.endsWith(";base64")) {
|
|
1861
|
+
let binary;
|
|
1862
|
+
try {
|
|
1863
|
+
binary = atob(payload);
|
|
1864
|
+
}
|
|
1865
|
+
catch (error) {
|
|
1866
|
+
throw new Error(`Invalid base64 data URI payload: ${error instanceof Error ? error.message : String(error)}`);
|
|
1867
|
+
}
|
|
1868
|
+
const bytes = new Uint8Array(binary.length);
|
|
1869
|
+
for (let i = 0; i < binary.length; i += 1) {
|
|
1870
|
+
bytes[i] = binary.charCodeAt(i);
|
|
1871
|
+
}
|
|
1872
|
+
return bytes.buffer;
|
|
1873
|
+
}
|
|
1874
|
+
return new TextEncoder().encode(decodeURIComponent(payload)).buffer;
|
|
1875
|
+
}
|
|
1876
|
+
const GLB_MAGIC = 0x46546c67;
|
|
1877
|
+
const GLB_VERSION = 2;
|
|
1878
|
+
const GLB_CHUNK_JSON = 0x4e4f534a;
|
|
1879
|
+
const GLB_CHUNK_BIN = 0x004e4942;
|
|
1880
|
+
function parseGLB(data, url) {
|
|
1881
|
+
const view = new DataView(data);
|
|
1882
|
+
if (data.byteLength < 20) {
|
|
1883
|
+
throw new Error("GLB file is too small");
|
|
1884
|
+
}
|
|
1885
|
+
const magic = view.getUint32(0, true);
|
|
1886
|
+
const version = view.getUint32(4, true);
|
|
1887
|
+
const declaredLength = view.getUint32(8, true);
|
|
1888
|
+
if (magic !== GLB_MAGIC) {
|
|
1889
|
+
throw new Error("Invalid GLB magic");
|
|
1890
|
+
}
|
|
1891
|
+
if (version !== GLB_VERSION) {
|
|
1892
|
+
throw new Error(`Unsupported GLB version: ${version}`);
|
|
1893
|
+
}
|
|
1894
|
+
if (declaredLength !== data.byteLength) {
|
|
1895
|
+
throw new Error(`GLB length mismatch: header ${declaredLength}, actual ${data.byteLength}`);
|
|
1896
|
+
}
|
|
1897
|
+
let offset = 12;
|
|
1898
|
+
let json;
|
|
1899
|
+
let binaryChunk;
|
|
1900
|
+
while (offset < data.byteLength) {
|
|
1901
|
+
if (offset + 8 > data.byteLength) {
|
|
1902
|
+
throw new Error("Malformed GLB chunk header");
|
|
1903
|
+
}
|
|
1904
|
+
const chunkLength = view.getUint32(offset, true);
|
|
1905
|
+
const chunkType = view.getUint32(offset + 4, true);
|
|
1906
|
+
const chunkStart = offset + 8;
|
|
1907
|
+
const chunkEnd = chunkStart + chunkLength;
|
|
1908
|
+
if (chunkEnd > data.byteLength) {
|
|
1909
|
+
throw new Error("Malformed GLB chunk length");
|
|
1910
|
+
}
|
|
1911
|
+
const chunk = data.slice(chunkStart, chunkEnd);
|
|
1912
|
+
if (chunkType === GLB_CHUNK_JSON) {
|
|
1913
|
+
const text = new TextDecoder().decode(chunk).replace(/[\u0000\s]+$/u, "");
|
|
1914
|
+
json = JSON.parse(text);
|
|
1915
|
+
}
|
|
1916
|
+
else if (chunkType === GLB_CHUNK_BIN) {
|
|
1917
|
+
binaryChunk = chunk;
|
|
1918
|
+
}
|
|
1919
|
+
offset = chunkEnd;
|
|
1920
|
+
}
|
|
1921
|
+
if (!json) {
|
|
1922
|
+
throw new Error("GLB is missing a JSON chunk");
|
|
1923
|
+
}
|
|
1924
|
+
return { json, binaryChunk, url, byteLength: data.byteLength };
|
|
1925
|
+
}
|
|
1926
|
+
function readAccessor(json, buffers, accessorIndex, accessorCache) {
|
|
1927
|
+
if (accessorCache)
|
|
1928
|
+
accessorCache.profile.accessorReadCount += 1;
|
|
1929
|
+
const cached = accessorCache?.rowsByAccessor.get(accessorIndex);
|
|
1930
|
+
if (cached && accessorCache) {
|
|
1931
|
+
accessorCache.profile.accessorCacheHitCount++;
|
|
1932
|
+
return cached;
|
|
1933
|
+
}
|
|
1934
|
+
const startedAt = nowMs();
|
|
1935
|
+
const accessor = json.accessors?.[accessorIndex];
|
|
1936
|
+
if (!accessor) {
|
|
1937
|
+
throw new Error(`Missing glTF accessor ${accessorIndex}`);
|
|
1938
|
+
}
|
|
1939
|
+
validateAccessorShape(accessorIndex, accessor);
|
|
1940
|
+
const componentCount = componentCountForType(accessor.type);
|
|
1941
|
+
const componentBytes = componentByteSize(accessor.componentType);
|
|
1942
|
+
const rowByteLength = componentCount * componentBytes;
|
|
1943
|
+
validateAccessorDescriptor(accessorIndex, accessor, rowByteLength);
|
|
1944
|
+
const output = Array.from({ length: accessor.count }, () => new Array(componentCount).fill(0));
|
|
1945
|
+
if (accessor.bufferView !== undefined) {
|
|
1946
|
+
const { view, buffer } = getBufferView(json, buffers, accessor.bufferView);
|
|
1947
|
+
const dataView = dataViewForBuffer(buffer, accessorCache);
|
|
1948
|
+
const stride = view.byteStride ?? rowByteLength;
|
|
1949
|
+
if (stride < rowByteLength) {
|
|
1950
|
+
throw new Error(`glTF accessor ${accessorIndex} byteStride ${stride} is smaller than element size ${rowByteLength}`);
|
|
1951
|
+
}
|
|
1952
|
+
const offset = (view.byteOffset ?? 0) + (accessor.byteOffset ?? 0);
|
|
1953
|
+
validateAccessorBounds(accessorIndex, buffer, view, offset, accessor.count, stride, rowByteLength);
|
|
1954
|
+
for (let item = 0; item < accessor.count; item += 1) {
|
|
1955
|
+
const baseOffset = offset + item * stride;
|
|
1956
|
+
for (let component = 0; component < componentCount; component += 1) {
|
|
1957
|
+
output[item][component] = readComponent(dataView, baseOffset + component * componentBytes, accessor.componentType, accessor.normalized ?? false);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
if (accessor.sparse) {
|
|
1962
|
+
applySparseAccessor(json, buffers, accessorIndex, accessor, output, componentCount, componentBytes, accessorCache);
|
|
1963
|
+
}
|
|
1964
|
+
if (accessorCache) {
|
|
1965
|
+
recordAccessorRead(accessorCache, accessorIndex, accessor, componentCount, output.length, nowMs() - startedAt);
|
|
1966
|
+
accessorCache.rowsByAccessor.set(accessorIndex, output);
|
|
1967
|
+
}
|
|
1968
|
+
return output;
|
|
1969
|
+
}
|
|
1970
|
+
function dataViewForBuffer(buffer, accessorCache) {
|
|
1971
|
+
if (!accessorCache)
|
|
1972
|
+
return new DataView(buffer);
|
|
1973
|
+
const existing = accessorCache.dataViews.get(buffer);
|
|
1974
|
+
if (existing)
|
|
1975
|
+
return existing;
|
|
1976
|
+
const view = new DataView(buffer);
|
|
1977
|
+
accessorCache.dataViews.set(buffer, view);
|
|
1978
|
+
accessorCache.profile.dataViewCacheEntries = accessorCache.dataViews.size;
|
|
1979
|
+
return view;
|
|
1980
|
+
}
|
|
1981
|
+
function recordAccessorRead(accessorCache, accessorIndex, accessor, componentCount, rowCount, elapsedMs) {
|
|
1982
|
+
const profile = accessorCache.profile;
|
|
1983
|
+
const byteLength = rowCount * componentCount * componentByteSize(accessor.componentType);
|
|
1984
|
+
profile.uniqueAccessorReadCount++;
|
|
1985
|
+
profile.accessorRowsRead += rowCount;
|
|
1986
|
+
profile.accessorValuesRead += rowCount * componentCount;
|
|
1987
|
+
profile.accessorReadMs += elapsedMs;
|
|
1988
|
+
profile.largestAccessors.push({
|
|
1989
|
+
accessorIndex,
|
|
1990
|
+
count: accessor.count,
|
|
1991
|
+
type: accessor.type,
|
|
1992
|
+
componentType: accessor.componentType,
|
|
1993
|
+
componentCount,
|
|
1994
|
+
byteLength,
|
|
1995
|
+
...(accessor.bufferView !== undefined ? { bufferView: accessor.bufferView } : {})
|
|
1996
|
+
});
|
|
1997
|
+
profile.largestAccessors.sort((left, right) => right.byteLength - left.byteLength);
|
|
1998
|
+
if (profile.largestAccessors.length > 8) {
|
|
1999
|
+
profile.largestAccessors.length = 8;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
function validateAccessorShape(accessorIndex, accessor) {
|
|
2003
|
+
if (!isAccessorType(accessor.type)) {
|
|
2004
|
+
throw new Error(`glTF accessor ${accessorIndex} type ${String(accessor.type)} is unsupported`);
|
|
2005
|
+
}
|
|
2006
|
+
if (!isAccessorComponentType(accessor.componentType)) {
|
|
2007
|
+
throw new Error(`glTF accessor ${accessorIndex} componentType ${String(accessor.componentType)} is unsupported`);
|
|
2008
|
+
}
|
|
2009
|
+
if (accessor.bufferView !== undefined && (!Number.isInteger(accessor.bufferView) || accessor.bufferView < 0)) {
|
|
2010
|
+
throw new Error(`glTF accessor ${accessorIndex} bufferView must be a non-negative integer`);
|
|
2011
|
+
}
|
|
2012
|
+
if (accessor.sparse) {
|
|
2013
|
+
validateSparseAccessorShape(accessorIndex, accessor.sparse);
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
function validateAccessorDescriptor(accessorIndex, accessor, rowByteLength) {
|
|
2017
|
+
if (!Number.isInteger(accessor.count) || accessor.count < 0) {
|
|
2018
|
+
throw new Error(`glTF accessor ${accessorIndex} count must be a non-negative integer`);
|
|
2019
|
+
}
|
|
2020
|
+
if (accessor.byteOffset !== undefined && (!Number.isInteger(accessor.byteOffset) || accessor.byteOffset < 0)) {
|
|
2021
|
+
throw new Error(`glTF accessor ${accessorIndex} byteOffset must be a non-negative integer`);
|
|
2022
|
+
}
|
|
2023
|
+
if (accessor.sparse) {
|
|
2024
|
+
if (!Number.isInteger(accessor.sparse.count) || accessor.sparse.count < 0) {
|
|
2025
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse count must be a non-negative integer`);
|
|
2026
|
+
}
|
|
2027
|
+
if (accessor.sparse.count > accessor.count) {
|
|
2028
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse count exceeds accessor count`);
|
|
2029
|
+
}
|
|
2030
|
+
if (accessor.sparse.indices.byteOffset !== undefined && (!Number.isInteger(accessor.sparse.indices.byteOffset) || accessor.sparse.indices.byteOffset < 0)) {
|
|
2031
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse indices byteOffset must be a non-negative integer`);
|
|
2032
|
+
}
|
|
2033
|
+
if (accessor.sparse.values.byteOffset !== undefined && (!Number.isInteger(accessor.sparse.values.byteOffset) || accessor.sparse.values.byteOffset < 0)) {
|
|
2034
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse values byteOffset must be a non-negative integer`);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
if (rowByteLength <= 0) {
|
|
2038
|
+
throw new Error(`glTF accessor ${accessorIndex} has invalid element size`);
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
function validateSparseAccessorShape(accessorIndex, sparse) {
|
|
2042
|
+
const record = sparse;
|
|
2043
|
+
if (!isObjectRecord(record.indices)) {
|
|
2044
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse indices must be an object`);
|
|
2045
|
+
}
|
|
2046
|
+
if (!isObjectRecord(record.values)) {
|
|
2047
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse values must be an object`);
|
|
2048
|
+
}
|
|
2049
|
+
if (!isSparseIndexComponentType(sparse.indices.componentType)) {
|
|
2050
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse indices componentType ${String(sparse.indices.componentType)} is unsupported`);
|
|
2051
|
+
}
|
|
2052
|
+
if (!Number.isInteger(sparse.indices.bufferView) || sparse.indices.bufferView < 0) {
|
|
2053
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse indices bufferView must be a non-negative integer`);
|
|
2054
|
+
}
|
|
2055
|
+
if (!Number.isInteger(sparse.values.bufferView) || sparse.values.bufferView < 0) {
|
|
2056
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse values bufferView must be a non-negative integer`);
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
function isObjectRecord(value) {
|
|
2060
|
+
return typeof value === "object" && value !== null;
|
|
2061
|
+
}
|
|
2062
|
+
function applySparseAccessor(json, buffers, accessorIndex, accessor, output, componentCount, componentBytes, accessorCache) {
|
|
2063
|
+
const sparse = accessor.sparse;
|
|
2064
|
+
if (!sparse || sparse.count === 0) {
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
const { view: indexView, buffer: indexBuffer } = getBufferView(json, buffers, sparse.indices.bufferView);
|
|
2068
|
+
const indexDataView = dataViewForBuffer(indexBuffer, accessorCache);
|
|
2069
|
+
const indexComponentBytes = componentByteSize(sparse.indices.componentType);
|
|
2070
|
+
const indexStart = (indexView.byteOffset ?? 0) + (sparse.indices.byteOffset ?? 0);
|
|
2071
|
+
validateRawRange(`glTF accessor ${accessorIndex} sparse indices`, indexBuffer, indexView, indexStart, sparse.count * indexComponentBytes);
|
|
2072
|
+
const { view: valueView, buffer: valueBuffer } = getBufferView(json, buffers, sparse.values.bufferView);
|
|
2073
|
+
const valueDataView = dataViewForBuffer(valueBuffer, accessorCache);
|
|
2074
|
+
const valueStart = (valueView.byteOffset ?? 0) + (sparse.values.byteOffset ?? 0);
|
|
2075
|
+
const rowByteLength = componentCount * componentBytes;
|
|
2076
|
+
validateRawRange(`glTF accessor ${accessorIndex} sparse values`, valueBuffer, valueView, valueStart, sparse.count * rowByteLength);
|
|
2077
|
+
for (let item = 0; item < sparse.count; item += 1) {
|
|
2078
|
+
const targetIndex = readComponent(indexDataView, indexStart + item * indexComponentBytes, sparse.indices.componentType, false);
|
|
2079
|
+
if (!Number.isInteger(targetIndex) || targetIndex < 0 || targetIndex >= accessor.count) {
|
|
2080
|
+
throw new Error(`glTF accessor ${accessorIndex} sparse index ${targetIndex} is out of range`);
|
|
2081
|
+
}
|
|
2082
|
+
const valueOffset = valueStart + item * rowByteLength;
|
|
2083
|
+
for (let component = 0; component < componentCount; component += 1) {
|
|
2084
|
+
output[targetIndex][component] = readComponent(valueDataView, valueOffset + component * componentBytes, accessor.componentType, accessor.normalized ?? false);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
function getBufferView(json, buffers, bufferViewIndex) {
|
|
2089
|
+
if (!Number.isInteger(bufferViewIndex) || bufferViewIndex < 0) {
|
|
2090
|
+
throw new Error(`glTF bufferView ${String(bufferViewIndex)} must be a non-negative integer`);
|
|
2091
|
+
}
|
|
2092
|
+
const view = json.bufferViews?.[bufferViewIndex];
|
|
2093
|
+
if (!view) {
|
|
2094
|
+
throw new Error(`Missing glTF bufferView ${bufferViewIndex}`);
|
|
2095
|
+
}
|
|
2096
|
+
validateBufferViewDescriptor(bufferViewIndex, view);
|
|
2097
|
+
const buffer = buffers[view.buffer];
|
|
2098
|
+
if (!buffer) {
|
|
2099
|
+
throw new Error(`Missing glTF buffer ${view.buffer}`);
|
|
2100
|
+
}
|
|
2101
|
+
const start = view.byteOffset ?? 0;
|
|
2102
|
+
const end = start + view.byteLength;
|
|
2103
|
+
if (end > buffer.byteLength) {
|
|
2104
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} exceeds buffer ${view.buffer}`);
|
|
2105
|
+
}
|
|
2106
|
+
return { view, buffer };
|
|
2107
|
+
}
|
|
2108
|
+
function validateBufferViewDescriptor(bufferViewIndex, view) {
|
|
2109
|
+
if (!Number.isInteger(view.buffer) || view.buffer < 0) {
|
|
2110
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} buffer must be a non-negative integer`);
|
|
2111
|
+
}
|
|
2112
|
+
if (view.byteOffset !== undefined && (!Number.isInteger(view.byteOffset) || view.byteOffset < 0)) {
|
|
2113
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} byteOffset must be a non-negative integer`);
|
|
2114
|
+
}
|
|
2115
|
+
if (!Number.isInteger(view.byteLength) || view.byteLength < 0) {
|
|
2116
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} byteLength must be a non-negative integer`);
|
|
2117
|
+
}
|
|
2118
|
+
if (view.byteStride !== undefined &&
|
|
2119
|
+
(!Number.isInteger(view.byteStride) || view.byteStride < 4 || view.byteStride > 252 || view.byteStride % 4 !== 0)) {
|
|
2120
|
+
throw new Error(`glTF bufferView ${bufferViewIndex} byteStride must be a 4-byte aligned integer between 4 and 252`);
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
function validateAccessorBounds(accessorIndex, buffer, view, start, count, stride, rowByteLength) {
|
|
2124
|
+
const byteLength = count === 0 ? 0 : (count - 1) * stride + rowByteLength;
|
|
2125
|
+
validateRawRange(`glTF accessor ${accessorIndex}`, buffer, view, start, byteLength);
|
|
2126
|
+
}
|
|
2127
|
+
function validateRawRange(label, buffer, view, start, byteLength) {
|
|
2128
|
+
if (!Number.isInteger(start) || start < 0 || !Number.isInteger(byteLength) || byteLength < 0) {
|
|
2129
|
+
throw new Error(`${label} byte range must be non-negative integers`);
|
|
2130
|
+
}
|
|
2131
|
+
const viewStart = view.byteOffset ?? 0;
|
|
2132
|
+
const viewEnd = viewStart + view.byteLength;
|
|
2133
|
+
const end = start + byteLength;
|
|
2134
|
+
if (end > viewEnd || end > buffer.byteLength) {
|
|
2135
|
+
throw new Error(`${label} exceeds its glTF bufferView`);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
function readOptionalAccessor(json, buffers, accessorIndex, accessorCache) {
|
|
2139
|
+
return accessorIndex === undefined ? [] : readAccessor(json, buffers, accessorIndex, accessorCache);
|
|
2140
|
+
}
|
|
2141
|
+
function readBufferViewBytes(json, buffers, bufferViewIndex) {
|
|
2142
|
+
const { view, buffer } = getBufferView(json, buffers, bufferViewIndex);
|
|
2143
|
+
const start = view.byteOffset ?? 0;
|
|
2144
|
+
const end = start + view.byteLength;
|
|
2145
|
+
return buffer.slice(start, end);
|
|
2146
|
+
}
|
|
2147
|
+
function isAccessorType(type) {
|
|
2148
|
+
return type === "SCALAR" || type === "VEC2" || type === "VEC3" || type === "VEC4" || type === "MAT4";
|
|
2149
|
+
}
|
|
2150
|
+
function isAccessorComponentType(type) {
|
|
2151
|
+
return type === 5120 || type === 5121 || type === 5122 || type === 5123 || type === 5125 || type === 5126;
|
|
2152
|
+
}
|
|
2153
|
+
function isSparseIndexComponentType(type) {
|
|
2154
|
+
return type === 5121 || type === 5123 || type === 5125;
|
|
2155
|
+
}
|
|
2156
|
+
function componentCountForType(type) {
|
|
2157
|
+
return type === "SCALAR" ? 1 : type === "VEC2" ? 2 : type === "VEC3" ? 3 : type === "VEC4" ? 4 : 16;
|
|
2158
|
+
}
|
|
2159
|
+
function componentByteSize(type) {
|
|
2160
|
+
if (type === 5120 || type === 5121)
|
|
2161
|
+
return 1;
|
|
2162
|
+
if (type === 5122 || type === 5123)
|
|
2163
|
+
return 2;
|
|
2164
|
+
return 4;
|
|
2165
|
+
}
|
|
2166
|
+
function readComponent(view, byteOffset, type, normalized) {
|
|
2167
|
+
if (type === 5120) {
|
|
2168
|
+
const value = view.getInt8(byteOffset);
|
|
2169
|
+
return normalized ? Math.max(value / 127, -1) : value;
|
|
2170
|
+
}
|
|
2171
|
+
if (type === 5121) {
|
|
2172
|
+
const value = view.getUint8(byteOffset);
|
|
2173
|
+
return normalized ? value / 255 : value;
|
|
2174
|
+
}
|
|
2175
|
+
if (type === 5122) {
|
|
2176
|
+
const value = view.getInt16(byteOffset, true);
|
|
2177
|
+
return normalized ? Math.max(value / 32767, -1) : value;
|
|
2178
|
+
}
|
|
2179
|
+
if (type === 5126)
|
|
2180
|
+
return view.getFloat32(byteOffset, true);
|
|
2181
|
+
if (type === 5125)
|
|
2182
|
+
return view.getUint32(byteOffset, true);
|
|
2183
|
+
const value = view.getUint16(byteOffset, true);
|
|
2184
|
+
return normalized ? value / 65535 : value;
|
|
2185
|
+
}
|
|
2186
|
+
function resolvePrimitiveMaterialIndex(primitive, materials, meshIndex, primitiveIndex) {
|
|
2187
|
+
if (primitive.material === undefined) {
|
|
2188
|
+
return undefined;
|
|
2189
|
+
}
|
|
2190
|
+
if (!Number.isInteger(primitive.material) || primitive.material < 0) {
|
|
2191
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} material must be a non-negative integer`);
|
|
2192
|
+
}
|
|
2193
|
+
if (!materials[primitive.material]) {
|
|
2194
|
+
throw new Error(`glTF mesh ${meshIndex} primitive ${primitiveIndex} references missing material ${primitive.material}`);
|
|
2195
|
+
}
|
|
2196
|
+
return primitive.material;
|
|
2197
|
+
}
|
|
2198
|
+
function materialName(material, index) {
|
|
2199
|
+
return index === undefined ? DEFAULT_GLTF_MATERIAL_NAME : material?.name ?? `material-${index}`;
|
|
2200
|
+
}
|
|
2201
|
+
function meshPrimitiveName(mesh, meshIndex, primitiveIndex) {
|
|
2202
|
+
const base = mesh.name ?? `mesh-${meshIndex}`;
|
|
2203
|
+
return mesh.primitives.length === 1 ? base : `${base}-primitive-${primitiveIndex}`;
|
|
2204
|
+
}
|
|
2205
|
+
function resolveNodeTransform(node, nodeIndex) {
|
|
2206
|
+
if (node.matrix !== undefined) {
|
|
2207
|
+
if (node.translation !== undefined || node.rotation !== undefined || node.scale !== undefined) {
|
|
2208
|
+
throw new Error(`glTF node ${nodeIndex} cannot combine matrix with translation, rotation, or scale`);
|
|
2209
|
+
}
|
|
2210
|
+
const decomposed = decomposeMat4(resolveNodeMatrix(node.matrix, nodeIndex));
|
|
2211
|
+
return {
|
|
2212
|
+
translation: decomposed.position,
|
|
2213
|
+
rotation: decomposed.rotation,
|
|
2214
|
+
scale: decomposed.scale
|
|
2215
|
+
};
|
|
2216
|
+
}
|
|
2217
|
+
return {
|
|
2218
|
+
translation: resolveVec3(node.translation, [0, 0, 0], `node ${nodeIndex} translation`),
|
|
2219
|
+
rotation: resolveQuat(node.rotation, [0, 0, 0, 1], `node ${nodeIndex} rotation`),
|
|
2220
|
+
scale: resolveVec3(node.scale, [1, 1, 1], `node ${nodeIndex} scale`)
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
function resolveNodeMatrix(matrix, nodeIndex) {
|
|
2224
|
+
if (matrix.length !== 16 || matrix.some((value) => !Number.isFinite(value))) {
|
|
2225
|
+
throw new RangeError(`glTF node ${nodeIndex} matrix must contain 16 finite values`);
|
|
2226
|
+
}
|
|
2227
|
+
return [
|
|
2228
|
+
matrix[0], matrix[1], matrix[2], matrix[3],
|
|
2229
|
+
matrix[4], matrix[5], matrix[6], matrix[7],
|
|
2230
|
+
matrix[8], matrix[9], matrix[10], matrix[11],
|
|
2231
|
+
matrix[12], matrix[13], matrix[14], matrix[15]
|
|
2232
|
+
];
|
|
2233
|
+
}
|
|
2234
|
+
function resolveVec3(value, fallback, label) {
|
|
2235
|
+
const resolved = value ?? fallback;
|
|
2236
|
+
if (resolved.length !== 3 || resolved.some((component) => !Number.isFinite(component))) {
|
|
2237
|
+
throw new RangeError(`glTF ${label} must contain three finite values`);
|
|
2238
|
+
}
|
|
2239
|
+
return [resolved[0], resolved[1], resolved[2]];
|
|
2240
|
+
}
|
|
2241
|
+
function resolveQuat(value, fallback, label) {
|
|
2242
|
+
const resolved = value ?? fallback;
|
|
2243
|
+
if (resolved.length !== 4 || resolved.some((component) => !Number.isFinite(component))) {
|
|
2244
|
+
throw new RangeError(`glTF ${label} must contain four finite values`);
|
|
2245
|
+
}
|
|
2246
|
+
return [resolved[0], resolved[1], resolved[2], resolved[3]];
|
|
2247
|
+
}
|
|
2248
|
+
function createScene(json, meshes, cameras, lights, skins, nodeInstanceTransforms, materialVariants, options = {}) {
|
|
2249
|
+
const sceneIndex = resolveSelectedSceneIndex(json, options);
|
|
2250
|
+
validateSceneGraph(json, sceneIndex);
|
|
2251
|
+
validateSceneMaterialVariant(materialVariants, options.materialVariant);
|
|
2252
|
+
const materialKeyForRenderable = createRuntimeMaterialKeyResolver(json, sceneIndex, meshes, skins, nodeInstanceTransforms, options.materialVariant);
|
|
2253
|
+
const nodeWorldMatrices = computeGLTFNodeWorldMatrices(json);
|
|
2254
|
+
const nodeNameForIndex = createGLTFNodeNameResolver(json);
|
|
2255
|
+
const scene = new Scene();
|
|
2256
|
+
const nodes = new Map();
|
|
2257
|
+
const createNode = (index) => {
|
|
2258
|
+
const source = json.nodes?.[index];
|
|
2259
|
+
if (!source) {
|
|
2260
|
+
throw new Error(`Missing glTF node ${index}`);
|
|
2261
|
+
}
|
|
2262
|
+
const existing = nodes.get(index);
|
|
2263
|
+
if (existing) {
|
|
2264
|
+
return existing;
|
|
2265
|
+
}
|
|
2266
|
+
const node = createSceneNodeForGLTFNode(scene, source, index, nodeNameForIndex(index), cameras, lights);
|
|
2267
|
+
const transform = resolveNodeTransform(source, index);
|
|
2268
|
+
node.transform.setPosition(transform.translation[0], transform.translation[1], transform.translation[2]);
|
|
2269
|
+
node.transform.setRotation(transform.rotation[0], transform.rotation[1], transform.rotation[2], transform.rotation[3]);
|
|
2270
|
+
node.transform.setScale(transform.scale[0], transform.scale[1], transform.scale[2]);
|
|
2271
|
+
if (source.mesh !== undefined) {
|
|
2272
|
+
attachMeshPrimitives(scene, node, source.mesh, index, meshes, skins, source.skin, nodeWorldMatrices.get(index), nodeInstanceTransforms.get(index), materialKeyForRenderable);
|
|
2273
|
+
}
|
|
2274
|
+
nodes.set(index, node);
|
|
2275
|
+
for (const childIndex of source.children ?? []) {
|
|
2276
|
+
node.addChild(createNode(childIndex));
|
|
2277
|
+
}
|
|
2278
|
+
return node;
|
|
2279
|
+
};
|
|
2280
|
+
const sceneDefinition = json.scenes?.[sceneIndex];
|
|
2281
|
+
for (const nodeIndex of sceneDefinition?.nodes ?? []) {
|
|
2282
|
+
scene.root.addChild(createNode(nodeIndex));
|
|
2283
|
+
}
|
|
2284
|
+
return scene;
|
|
2285
|
+
}
|
|
2286
|
+
function resolveSelectedSceneIndex(json, options) {
|
|
2287
|
+
if (options.sceneIndex !== undefined && options.sceneName !== undefined) {
|
|
2288
|
+
throw new Error("glTF scene selection cannot specify both sceneIndex and sceneName");
|
|
2289
|
+
}
|
|
2290
|
+
if (options.sceneName !== undefined) {
|
|
2291
|
+
const sceneIndex = (json.scenes ?? []).findIndex((scene, index) => (scene.name ?? `scene-${index}`) === options.sceneName);
|
|
2292
|
+
if (sceneIndex < 0) {
|
|
2293
|
+
throw new Error(`glTF scene named ${options.sceneName} is not defined`);
|
|
2294
|
+
}
|
|
2295
|
+
return sceneIndex;
|
|
2296
|
+
}
|
|
2297
|
+
if (options.sceneIndex !== undefined) {
|
|
2298
|
+
if (!Number.isInteger(options.sceneIndex) || options.sceneIndex < 0 || !json.scenes?.[options.sceneIndex]) {
|
|
2299
|
+
throw new Error(`glTF scene ${options.sceneIndex} is missing`);
|
|
2300
|
+
}
|
|
2301
|
+
return options.sceneIndex;
|
|
2302
|
+
}
|
|
2303
|
+
return resolveDefaultSceneIndex(json);
|
|
2304
|
+
}
|
|
2305
|
+
function validateSceneMaterialVariant(materialVariants, selectedVariant) {
|
|
2306
|
+
if (selectedVariant === undefined)
|
|
2307
|
+
return;
|
|
2308
|
+
if (!materialVariants.some((variant) => variant.name === selectedVariant)) {
|
|
2309
|
+
throw new Error(`glTF material variant ${selectedVariant} is not defined`);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
function validateSceneGraph(json, sceneIndex = resolveDefaultSceneIndex(json)) {
|
|
2313
|
+
const nodeDefinitions = json.nodes ?? [];
|
|
2314
|
+
if (json.scenes && (!Number.isInteger(sceneIndex) || sceneIndex < 0 || !json.scenes[sceneIndex]))
|
|
2315
|
+
throw new Error(`glTF scene ${sceneIndex} is missing`);
|
|
2316
|
+
const parentByNode = new Map();
|
|
2317
|
+
for (const [nodeIndex, node] of nodeDefinitions.entries()) {
|
|
2318
|
+
for (const childIndex of node.children ?? []) {
|
|
2319
|
+
if (!Number.isInteger(childIndex) || childIndex < 0 || !nodeDefinitions[childIndex]) {
|
|
2320
|
+
throw new Error(`glTF node ${nodeIndex} references missing child node ${childIndex}`);
|
|
2321
|
+
}
|
|
2322
|
+
const existingParent = parentByNode.get(childIndex);
|
|
2323
|
+
if (existingParent !== undefined) {
|
|
2324
|
+
throw new Error(`glTF node ${childIndex} has multiple parents: ${existingParent} and ${nodeIndex}`);
|
|
2325
|
+
}
|
|
2326
|
+
parentByNode.set(childIndex, nodeIndex);
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
const visiting = new Set();
|
|
2330
|
+
const visited = new Set();
|
|
2331
|
+
const visit = (nodeIndex) => {
|
|
2332
|
+
if (visiting.has(nodeIndex)) {
|
|
2333
|
+
throw new Error(`glTF node graph contains a cycle at node ${nodeIndex}`);
|
|
2334
|
+
}
|
|
2335
|
+
if (visited.has(nodeIndex)) {
|
|
2336
|
+
return;
|
|
2337
|
+
}
|
|
2338
|
+
visiting.add(nodeIndex);
|
|
2339
|
+
for (const childIndex of nodeDefinitions[nodeIndex]?.children ?? []) {
|
|
2340
|
+
visit(childIndex);
|
|
2341
|
+
}
|
|
2342
|
+
visiting.delete(nodeIndex);
|
|
2343
|
+
visited.add(nodeIndex);
|
|
2344
|
+
};
|
|
2345
|
+
for (let nodeIndex = 0; nodeIndex < nodeDefinitions.length; nodeIndex += 1) {
|
|
2346
|
+
visit(nodeIndex);
|
|
2347
|
+
}
|
|
2348
|
+
for (const [rootListIndex, rootNodeIndex] of (json.scenes?.[sceneIndex]?.nodes ?? []).entries()) {
|
|
2349
|
+
if (!Number.isInteger(rootNodeIndex) || rootNodeIndex < 0 || !nodeDefinitions[rootNodeIndex]) {
|
|
2350
|
+
throw new Error(`glTF scene ${sceneIndex} root ${rootListIndex} references missing node ${rootNodeIndex}`);
|
|
2351
|
+
}
|
|
2352
|
+
if (parentByNode.has(rootNodeIndex)) {
|
|
2353
|
+
throw new Error(`glTF scene ${sceneIndex} root ${rootNodeIndex} is also a child node`);
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
function attachMeshPrimitives(scene, node, meshIndex, nodeIndex, meshes, skins, nodeSkinIndex, nodeWorldMatrix, instanceTransforms, materialKeyForRenderable) {
|
|
2358
|
+
if (!Number.isInteger(meshIndex) || meshIndex < 0) {
|
|
2359
|
+
throw new RangeError(`glTF node ${nodeIndex} mesh must be a non-negative integer`);
|
|
2360
|
+
}
|
|
2361
|
+
const primitives = meshes.filter((mesh) => mesh.sourceMeshIndex === meshIndex);
|
|
2362
|
+
if (primitives.length === 0) {
|
|
2363
|
+
throw new Error(`glTF node ${nodeIndex} references missing mesh ${meshIndex}`);
|
|
2364
|
+
}
|
|
2365
|
+
if (primitives.length === 1) {
|
|
2366
|
+
const mesh = primitives[0];
|
|
2367
|
+
const skinning = skinningForMesh(mesh, skins, nodeSkinIndex, nodeWorldMatrix);
|
|
2368
|
+
scene.addRenderable(node, new Renderable({
|
|
2369
|
+
geometry: mesh.name,
|
|
2370
|
+
material: materialKeyForRenderable?.(mesh, runtimeMaterialContract(skinning, instanceTransforms)) ?? mesh.material,
|
|
2371
|
+
...(skinning ? { skinning } : {}),
|
|
2372
|
+
morphWeights: mesh.morphWeights,
|
|
2373
|
+
...(instanceTransforms ? { instanceTransforms } : {})
|
|
2374
|
+
}));
|
|
2375
|
+
return;
|
|
2376
|
+
}
|
|
2377
|
+
for (const mesh of primitives) {
|
|
2378
|
+
const skinning = skinningForMesh(mesh, skins, nodeSkinIndex, nodeWorldMatrix);
|
|
2379
|
+
const primitiveNode = scene.createNode(mesh.name);
|
|
2380
|
+
primitiveNode.transform.setPosition(0, 0, 0);
|
|
2381
|
+
primitiveNode.transform.setRotation(0, 0, 0, 1);
|
|
2382
|
+
primitiveNode.transform.setScale(1, 1, 1);
|
|
2383
|
+
scene.addRenderable(primitiveNode, new Renderable({
|
|
2384
|
+
geometry: mesh.name,
|
|
2385
|
+
material: materialKeyForRenderable?.(mesh, runtimeMaterialContract(skinning, instanceTransforms)) ?? mesh.material,
|
|
2386
|
+
...(skinning ? { skinning } : {}),
|
|
2387
|
+
morphWeights: mesh.morphWeights,
|
|
2388
|
+
...(instanceTransforms ? { instanceTransforms } : {})
|
|
2389
|
+
}));
|
|
2390
|
+
node.addChild(primitiveNode);
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
function skinningForMesh(mesh, skins, nodeSkinIndex, nodeWorldMatrix) {
|
|
2394
|
+
const skinIndex = nodeSkinIndex;
|
|
2395
|
+
if (skinIndex === undefined)
|
|
2396
|
+
return undefined;
|
|
2397
|
+
if (mesh.joints.length === 0 || mesh.weights.length === 0) {
|
|
2398
|
+
throw new Error(`glTF mesh ${mesh.name} references skin ${skinIndex} but is missing JOINTS_0 or WEIGHTS_0 attributes`);
|
|
2399
|
+
}
|
|
2400
|
+
const skin = skins[skinIndex];
|
|
2401
|
+
if (!skin) {
|
|
2402
|
+
throw new Error(`glTF mesh ${mesh.name} references missing skin ${skinIndex}`);
|
|
2403
|
+
}
|
|
2404
|
+
if (skin.joints.length > MAX_RENDERABLE_SKIN_JOINTS) {
|
|
2405
|
+
return undefined;
|
|
2406
|
+
}
|
|
2407
|
+
if (!nodeWorldMatrix)
|
|
2408
|
+
return skin.skinningPalette;
|
|
2409
|
+
const inverseMeshWorld = invertLoaderMat4(nodeWorldMatrix);
|
|
2410
|
+
const matrices = new Float32Array(skin.jointBindMatrices.length * 16);
|
|
2411
|
+
for (let index = 0; index < skin.jointBindMatrices.length; index += 1) {
|
|
2412
|
+
matrices.set(multiplyLoaderMat4(inverseMeshWorld, skin.jointBindMatrices[index]), index * 16);
|
|
2413
|
+
}
|
|
2414
|
+
return { jointCount: skin.jointBindMatrices.length, matrices };
|
|
2415
|
+
}
|
|
2416
|
+
function composeLoaderMat4(translation, rotation, scale) {
|
|
2417
|
+
return composeMat4([...translation], [...rotation], [...scale]);
|
|
2418
|
+
}
|
|
2419
|
+
function multiplyLoaderMat4(left, right) {
|
|
2420
|
+
return multiplyMat4([...left], [...right]);
|
|
2421
|
+
}
|
|
2422
|
+
function invertLoaderMat4(matrix) {
|
|
2423
|
+
return invertMat4([...matrix]);
|
|
2424
|
+
}
|
|
2425
|
+
export function gltfRuntimeMaterialKey(material, contract) {
|
|
2426
|
+
const signature = runtimeMaterialSignature(contract);
|
|
2427
|
+
return signature === "base" ? material : `${material}${RUNTIME_MATERIAL_KEY_MARKER}${signature}`;
|
|
2428
|
+
}
|
|
2429
|
+
export function parseGLTFRuntimeMaterialKey(key) {
|
|
2430
|
+
const markerIndex = key.lastIndexOf(RUNTIME_MATERIAL_KEY_MARKER);
|
|
2431
|
+
if (markerIndex < 0)
|
|
2432
|
+
return { material: key, contract: {} };
|
|
2433
|
+
const signature = key.slice(markerIndex + RUNTIME_MATERIAL_KEY_MARKER.length);
|
|
2434
|
+
const contract = runtimeMaterialContractFromSignature(signature);
|
|
2435
|
+
if (!contract)
|
|
2436
|
+
return { material: key, contract: {} };
|
|
2437
|
+
return {
|
|
2438
|
+
material: key.slice(0, markerIndex),
|
|
2439
|
+
contract
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
function createRuntimeMaterialKeyResolver(json, sceneIndex, meshes, skins, nodeInstanceTransforms, materialVariant) {
|
|
2443
|
+
const signaturesByMaterial = new Map();
|
|
2444
|
+
const register = (material, contract) => {
|
|
2445
|
+
const signatures = signaturesByMaterial.get(material) ?? new Set();
|
|
2446
|
+
signatures.add(runtimeMaterialSignature(contract));
|
|
2447
|
+
signaturesByMaterial.set(material, signatures);
|
|
2448
|
+
};
|
|
2449
|
+
const visit = (nodeIndex) => {
|
|
2450
|
+
const node = json.nodes?.[nodeIndex];
|
|
2451
|
+
if (!node)
|
|
2452
|
+
return;
|
|
2453
|
+
if (node.mesh !== undefined) {
|
|
2454
|
+
const instanceTransforms = nodeInstanceTransforms.get(nodeIndex);
|
|
2455
|
+
for (const mesh of meshes.filter((entry) => entry.sourceMeshIndex === node.mesh)) {
|
|
2456
|
+
const skinning = skinningForMesh(mesh, skins, node.skin);
|
|
2457
|
+
register(materialForVariant(mesh, materialVariant), runtimeMaterialContract(skinning, instanceTransforms));
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
for (const childIndex of node.children ?? [])
|
|
2461
|
+
visit(childIndex);
|
|
2462
|
+
};
|
|
2463
|
+
for (const nodeIndex of json.scenes?.[sceneIndex]?.nodes ?? [])
|
|
2464
|
+
visit(nodeIndex);
|
|
2465
|
+
return (mesh, contract) => {
|
|
2466
|
+
const material = materialForVariant(mesh, materialVariant);
|
|
2467
|
+
const signatures = signaturesByMaterial.get(material);
|
|
2468
|
+
return signatures && signatures.size > 1 ? gltfRuntimeMaterialKey(material, contract) : material;
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
function runtimeMaterialContract(skinning, instanceTransforms) {
|
|
2472
|
+
return {
|
|
2473
|
+
...(skinning ? { skinned: true } : {}),
|
|
2474
|
+
...(instanceTransforms ? { instanced: true } : {})
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
function runtimeMaterialSignature(contract) {
|
|
2478
|
+
if (contract.skinned && contract.instanced)
|
|
2479
|
+
return "skinned+instanced";
|
|
2480
|
+
if (contract.skinned)
|
|
2481
|
+
return "skinned";
|
|
2482
|
+
if (contract.instanced)
|
|
2483
|
+
return "instanced";
|
|
2484
|
+
return "base";
|
|
2485
|
+
}
|
|
2486
|
+
function runtimeMaterialContractFromSignature(signature) {
|
|
2487
|
+
if (signature === "skinned+instanced")
|
|
2488
|
+
return { skinned: true, instanced: true };
|
|
2489
|
+
if (signature === "skinned")
|
|
2490
|
+
return { skinned: true };
|
|
2491
|
+
if (signature === "instanced")
|
|
2492
|
+
return { instanced: true };
|
|
2493
|
+
if (signature === "base")
|
|
2494
|
+
return {};
|
|
2495
|
+
return undefined;
|
|
2496
|
+
}
|
|
2497
|
+
function materialForVariant(mesh, materialVariant) {
|
|
2498
|
+
if (materialVariant === undefined)
|
|
2499
|
+
return mesh.material;
|
|
2500
|
+
return mesh.materialVariants.find((mapping) => mapping.variant === materialVariant)?.material ?? mesh.material;
|
|
2501
|
+
}
|
|
2502
|
+
function createSceneNodeForGLTFNode(scene, source, nodeIndex, nodeName, cameras, lights) {
|
|
2503
|
+
if (source.camera !== undefined && source.extensions?.KHR_lights_punctual?.light !== undefined) {
|
|
2504
|
+
throw new Error(`glTF node ${nodeIndex} cannot combine camera and KHR_lights_punctual light`);
|
|
2505
|
+
}
|
|
2506
|
+
let node;
|
|
2507
|
+
if (source.camera !== undefined) {
|
|
2508
|
+
node = createCameraNodeForGLTFNode(scene, source, nodeIndex, nodeName, cameras);
|
|
2509
|
+
applyGLTFNodeMetadata(node, source, nodeIndex);
|
|
2510
|
+
return node;
|
|
2511
|
+
}
|
|
2512
|
+
const lightIndex = source.extensions?.KHR_lights_punctual?.light;
|
|
2513
|
+
if (lightIndex === undefined) {
|
|
2514
|
+
node = scene.createNode(nodeName);
|
|
2515
|
+
applyGLTFNodeMetadata(node, source, nodeIndex);
|
|
2516
|
+
return node;
|
|
2517
|
+
}
|
|
2518
|
+
if (!Number.isInteger(lightIndex) || lightIndex < 0) {
|
|
2519
|
+
throw new RangeError(`glTF node ${nodeIndex} KHR_lights_punctual.light must be a non-negative integer`);
|
|
2520
|
+
}
|
|
2521
|
+
const light = lights[lightIndex];
|
|
2522
|
+
if (!light) {
|
|
2523
|
+
throw new Error(`glTF node ${nodeIndex} references missing punctual light ${lightIndex}`);
|
|
2524
|
+
}
|
|
2525
|
+
const lightNode = scene.createLight(light.type, nodeName);
|
|
2526
|
+
lightNode.color = [...light.color];
|
|
2527
|
+
lightNode.intensity = light.intensity;
|
|
2528
|
+
if (lightNode instanceof PointLight) {
|
|
2529
|
+
lightNode.range = light.range ?? 10;
|
|
2530
|
+
}
|
|
2531
|
+
else if (lightNode instanceof SpotLight) {
|
|
2532
|
+
lightNode.range = light.range ?? 10;
|
|
2533
|
+
lightNode.angle = light.spot?.outerConeAngle ?? Math.PI / 4;
|
|
2534
|
+
lightNode.penumbra = spotPenumbra(light.spot?.innerConeAngle ?? 0, lightNode.angle);
|
|
2535
|
+
}
|
|
2536
|
+
applyGLTFNodeMetadata(lightNode, source, nodeIndex);
|
|
2537
|
+
return lightNode;
|
|
2538
|
+
}
|
|
2539
|
+
function applyGLTFNodeMetadata(node, source, nodeIndex) {
|
|
2540
|
+
node.userData.gltfNodeIndex = nodeIndex;
|
|
2541
|
+
if (!source.extras)
|
|
2542
|
+
return;
|
|
2543
|
+
node.userData.gltfExtras = { ...source.extras };
|
|
2544
|
+
for (const [key, value] of Object.entries(source.extras)) {
|
|
2545
|
+
if (key.startsWith("a3d_"))
|
|
2546
|
+
node.userData[key] = value;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
function createCameraNodeForGLTFNode(scene, source, nodeIndex, nodeName, cameras) {
|
|
2550
|
+
const cameraIndex = source.camera;
|
|
2551
|
+
if (!Number.isInteger(cameraIndex) || cameraIndex === undefined || cameraIndex < 0) {
|
|
2552
|
+
throw new RangeError(`glTF node ${nodeIndex} camera must be a non-negative integer`);
|
|
2553
|
+
}
|
|
2554
|
+
const camera = cameras[cameraIndex];
|
|
2555
|
+
if (!camera) {
|
|
2556
|
+
throw new Error(`glTF node ${nodeIndex} references missing camera ${cameraIndex}`);
|
|
2557
|
+
}
|
|
2558
|
+
if (camera.type === "perspective") {
|
|
2559
|
+
const perspective = camera.perspective;
|
|
2560
|
+
return scene.createPerspectiveCamera({
|
|
2561
|
+
name: nodeName,
|
|
2562
|
+
fovYRadians: perspective.yfov,
|
|
2563
|
+
aspect: perspective.aspectRatio,
|
|
2564
|
+
near: perspective.znear,
|
|
2565
|
+
far: perspective.zfar
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
const orthographic = camera.orthographic;
|
|
2569
|
+
return scene.createOrthographicCamera({
|
|
2570
|
+
name: nodeName,
|
|
2571
|
+
left: -orthographic.xmag / 2,
|
|
2572
|
+
right: orthographic.xmag / 2,
|
|
2573
|
+
bottom: -orthographic.ymag / 2,
|
|
2574
|
+
top: orthographic.ymag / 2,
|
|
2575
|
+
near: orthographic.znear,
|
|
2576
|
+
far: orthographic.zfar
|
|
2577
|
+
});
|
|
2578
|
+
}
|
|
2579
|
+
function spotPenumbra(innerConeAngle, outerConeAngle) {
|
|
2580
|
+
if (outerConeAngle <= 0)
|
|
2581
|
+
return 0;
|
|
2582
|
+
return Math.max(0, Math.min(1, 1 - innerConeAngle / outerConeAngle));
|
|
2583
|
+
}
|
|
2584
|
+
function createGLTFNodeNameResolver(json) {
|
|
2585
|
+
const bases = (json.nodes ?? []).map((node, index) => typeof node.name === "string" && node.name.trim().length > 0 ? node.name : `node-${index}`);
|
|
2586
|
+
const totals = new Map();
|
|
2587
|
+
for (const base of bases) {
|
|
2588
|
+
totals.set(base, (totals.get(base) ?? 0) + 1);
|
|
2589
|
+
}
|
|
2590
|
+
const seen = new Map();
|
|
2591
|
+
const names = bases.map((base) => {
|
|
2592
|
+
const count = seen.get(base) ?? 0;
|
|
2593
|
+
seen.set(base, count + 1);
|
|
2594
|
+
return (totals.get(base) ?? 0) > 1 && count > 0 ? `${base}_${count}` : base;
|
|
2595
|
+
});
|
|
2596
|
+
return (nodeIndex) => {
|
|
2597
|
+
const name = names[nodeIndex];
|
|
2598
|
+
if (name === undefined) {
|
|
2599
|
+
throw new Error(`glTF node ${nodeIndex} is missing`);
|
|
2600
|
+
}
|
|
2601
|
+
return name;
|
|
2602
|
+
};
|
|
2603
|
+
}
|
|
2604
|
+
function findSkinForMesh(json, meshIndex) {
|
|
2605
|
+
const nodeIndex = (json.nodes ?? []).findIndex((node) => node.mesh === meshIndex && node.skin !== undefined);
|
|
2606
|
+
if (nodeIndex < 0)
|
|
2607
|
+
return undefined;
|
|
2608
|
+
return json.nodes?.[nodeIndex]?.skin;
|
|
2609
|
+
}
|
|
2610
|
+
function parentIndexByNode(json) {
|
|
2611
|
+
const parents = new Map();
|
|
2612
|
+
for (const [parentIndex, node] of (json.nodes ?? []).entries()) {
|
|
2613
|
+
for (const childIndex of node.children ?? []) {
|
|
2614
|
+
parents.set(childIndex, parentIndex);
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
return parents;
|
|
2618
|
+
}
|
|
2619
|
+
function orderSkinJoints(json, joints) {
|
|
2620
|
+
const jointSet = new Set(joints);
|
|
2621
|
+
const ordered = [];
|
|
2622
|
+
const visited = new Set();
|
|
2623
|
+
const parents = parentIndexByNode(json);
|
|
2624
|
+
const visit = (joint) => {
|
|
2625
|
+
if (visited.has(joint))
|
|
2626
|
+
return;
|
|
2627
|
+
const parent = parents.get(joint);
|
|
2628
|
+
if (parent !== undefined && jointSet.has(parent))
|
|
2629
|
+
visit(parent);
|
|
2630
|
+
if (!json.nodes?.[joint]) {
|
|
2631
|
+
throw new Error(`glTF skin references missing joint node ${joint}`);
|
|
2632
|
+
}
|
|
2633
|
+
visited.add(joint);
|
|
2634
|
+
ordered.push(joint);
|
|
2635
|
+
};
|
|
2636
|
+
for (const joint of joints)
|
|
2637
|
+
visit(joint);
|
|
2638
|
+
return ordered;
|
|
2639
|
+
}
|
|
2640
|
+
function valueTypeForAnimationPath(path) {
|
|
2641
|
+
if (path === "rotation")
|
|
2642
|
+
return "quaternion";
|
|
2643
|
+
if (path === "translation" || path === "scale")
|
|
2644
|
+
return "vector3";
|
|
2645
|
+
return "number-array";
|
|
2646
|
+
}
|
|
2647
|
+
function animationValueForPath(path, row) {
|
|
2648
|
+
if (path === "rotation")
|
|
2649
|
+
return toQuat(row);
|
|
2650
|
+
if (path === "translation" || path === "scale")
|
|
2651
|
+
return toVec3(row);
|
|
2652
|
+
return [...row];
|
|
2653
|
+
}
|
|
2654
|
+
function toVec3(row) {
|
|
2655
|
+
return [row[0] ?? 0, row[1] ?? 0, row[2] ?? 0];
|
|
2656
|
+
}
|
|
2657
|
+
function toQuat(row) {
|
|
2658
|
+
return [row[0] ?? 0, row[1] ?? 0, row[2] ?? 0, row[3] ?? 1];
|
|
2659
|
+
}
|
|
2660
|
+
function toMat4(row) {
|
|
2661
|
+
if (row.length !== 16) {
|
|
2662
|
+
throw new Error(`glTF MAT4 accessor row has ${row.length} components`);
|
|
2663
|
+
}
|
|
2664
|
+
return [
|
|
2665
|
+
row[0], row[1], row[2], row[3],
|
|
2666
|
+
row[4], row[5], row[6], row[7],
|
|
2667
|
+
row[8], row[9], row[10], row[11],
|
|
2668
|
+
row[12], row[13], row[14], row[15]
|
|
2669
|
+
];
|
|
2670
|
+
}
|
|
2671
|
+
function identityMat4() {
|
|
2672
|
+
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
2673
|
+
}
|
|
2674
|
+
function serializeGLTFAsset(url, loaderDiagnostics, images, textures, materials, materialVariants, scenes, defaultScene, meshes, cameras, lights, skins, animations) {
|
|
2675
|
+
return {
|
|
2676
|
+
url,
|
|
2677
|
+
loaderDiagnostics,
|
|
2678
|
+
images: images.map((image) => ({
|
|
2679
|
+
name: image.name,
|
|
2680
|
+
...(image.uri ? { uri: image.uri } : {}),
|
|
2681
|
+
...(image.mimeType ? { mimeType: image.mimeType } : {}),
|
|
2682
|
+
...(image.data ? { byteLength: image.data.byteLength } : {})
|
|
2683
|
+
})),
|
|
2684
|
+
textures: textures.map((texture) => ({ ...texture })),
|
|
2685
|
+
materials: materials.map((material) => ({ ...material })),
|
|
2686
|
+
materialVariants: materialVariants.map((variant) => ({ ...variant })),
|
|
2687
|
+
scenes: scenes.map((scene) => ({ name: scene.name, nodeIndices: [...scene.nodeIndices] })),
|
|
2688
|
+
defaultScene,
|
|
2689
|
+
meshes: meshes.map((mesh) => ({
|
|
2690
|
+
...mesh,
|
|
2691
|
+
positions: mesh.positions.map((position) => [...position]),
|
|
2692
|
+
normals: mesh.normals.map((normal) => [...normal]),
|
|
2693
|
+
texcoords: mesh.texcoords.map((texcoord) => [...texcoord]),
|
|
2694
|
+
texcoordSets: mesh.texcoordSets.map((set) => set.map((texcoord) => [...texcoord])),
|
|
2695
|
+
tangents: mesh.tangents.map((tangent) => [...tangent]),
|
|
2696
|
+
colors: mesh.colors.map((color) => [...color]),
|
|
2697
|
+
joints: mesh.joints.map((joint) => [...joint]),
|
|
2698
|
+
weights: mesh.weights.map((weight) => [...weight]),
|
|
2699
|
+
morphTargets: mesh.morphTargets.map((target) => ({
|
|
2700
|
+
positions: target.positions.map((position) => [...position]),
|
|
2701
|
+
normals: target.normals.map((normal) => [...normal]),
|
|
2702
|
+
tangents: target.tangents.map((tangent) => [...tangent])
|
|
2703
|
+
})),
|
|
2704
|
+
morphWeights: [...mesh.morphWeights],
|
|
2705
|
+
indices: mesh.indices ? [...mesh.indices] : undefined
|
|
2706
|
+
})),
|
|
2707
|
+
cameras: cameras.map((camera) => ({
|
|
2708
|
+
...camera,
|
|
2709
|
+
...(camera.perspective ? { perspective: { ...camera.perspective } } : {}),
|
|
2710
|
+
...(camera.orthographic ? { orthographic: { ...camera.orthographic } } : {})
|
|
2711
|
+
})),
|
|
2712
|
+
lights: lights.map((light) => ({
|
|
2713
|
+
...light,
|
|
2714
|
+
color: [...light.color],
|
|
2715
|
+
...(light.spot ? { spot: { ...light.spot } } : {})
|
|
2716
|
+
})),
|
|
2717
|
+
skins: skins.map((skin) => ({
|
|
2718
|
+
name: skin.name,
|
|
2719
|
+
joints: [...skin.joints],
|
|
2720
|
+
jointNames: [...skin.jointNames],
|
|
2721
|
+
inverseBindMatrices: skin.inverseBindMatrices.map((matrix) => [...matrix]),
|
|
2722
|
+
...(skin.skeletonRoot !== undefined ? { skeletonRoot: skin.skeletonRoot } : {}),
|
|
2723
|
+
bones: skin.skeleton.bones.map((bone) => ({
|
|
2724
|
+
name: bone.name,
|
|
2725
|
+
parentIndex: bone.parentIndex,
|
|
2726
|
+
translation: [...bone.translation],
|
|
2727
|
+
rotation: [...bone.rotation],
|
|
2728
|
+
scale: [...bone.scale],
|
|
2729
|
+
inverseBindMatrix: [...bone.inverseBindMatrix]
|
|
2730
|
+
}))
|
|
2731
|
+
})),
|
|
2732
|
+
animations: animations.map((animation) => animation.toJSON())
|
|
2733
|
+
};
|
|
2734
|
+
}
|
|
2735
|
+
//# sourceMappingURL=GLTFLoader.js.map
|