@babylonjs/core 8.48.0 → 8.48.1

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.
Files changed (80) hide show
  1. package/Audio/analyser.js.map +1 -1
  2. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
  3. package/Buffers/buffer.align.js +3 -3
  4. package/Buffers/buffer.align.js.map +1 -1
  5. package/Buffers/bufferUtils.d.ts +7 -0
  6. package/Buffers/bufferUtils.js +31 -13
  7. package/Buffers/bufferUtils.js.map +1 -1
  8. package/Engines/Extensions/engine.dynamicBuffer.js +3 -3
  9. package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
  10. package/Engines/Native/nativeDataStream.d.ts +1 -1
  11. package/Engines/Native/nativeDataStream.js.map +1 -1
  12. package/Engines/Native/nativeInterfaces.d.ts +4 -4
  13. package/Engines/Native/nativeInterfaces.js.map +1 -1
  14. package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +13 -1
  15. package/Engines/WebGPU/Extensions/engine.rawTexture.js +26 -8
  16. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  17. package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -1
  18. package/Engines/WebGPU/webgpuTextureManager.js +19 -6
  19. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  20. package/Engines/abstractEngine.d.ts +4 -2
  21. package/Engines/abstractEngine.functions.d.ts +1 -1
  22. package/Engines/abstractEngine.functions.js +8 -8
  23. package/Engines/abstractEngine.functions.js.map +1 -1
  24. package/Engines/abstractEngine.js +6 -4
  25. package/Engines/abstractEngine.js.map +1 -1
  26. package/Engines/engine.d.ts +12 -0
  27. package/Engines/thinNativeEngine.js +1 -1
  28. package/Engines/thinNativeEngine.js.map +1 -1
  29. package/Engines/thinWebGPUEngine.js +3 -0
  30. package/Engines/thinWebGPUEngine.js.map +1 -1
  31. package/Engines/webgpuEngine.js +18 -18
  32. package/Engines/webgpuEngine.js.map +1 -1
  33. package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
  34. package/Materials/Background/backgroundMaterial.d.ts +16 -8
  35. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +14 -1
  36. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  37. package/Materials/Node/nodeMaterial.d.ts +16 -8
  38. package/Materials/PBR/openpbrMaterial.d.ts +16 -8
  39. package/Materials/PBR/pbrBaseMaterial.d.ts +16 -8
  40. package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.d.ts +1 -1
  41. package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.js.map +1 -1
  42. package/Materials/Textures/Loaders/EXR/exrLoader.core.d.ts +1 -1
  43. package/Materials/Textures/Loaders/EXR/exrLoader.core.js.map +1 -1
  44. package/Materials/Textures/internalTexture.d.ts +6 -0
  45. package/Materials/Textures/internalTexture.js +24 -2
  46. package/Materials/Textures/internalTexture.js.map +1 -1
  47. package/Materials/Textures/rawTexture.d.ts +8 -1
  48. package/Materials/Textures/rawTexture.js +12 -3
  49. package/Materials/Textures/rawTexture.js.map +1 -1
  50. package/Materials/Textures/rawTexture2DArray.d.ts +8 -1
  51. package/Materials/Textures/rawTexture2DArray.js +14 -3
  52. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  53. package/Materials/imageProcessing.d.ts +47 -8
  54. package/Materials/standardMaterial.d.ts +16 -8
  55. package/Meshes/Builders/shapeBuilder.d.ts +4 -0
  56. package/Meshes/Builders/shapeBuilder.js +12 -9
  57. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  58. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +68 -4
  59. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +343 -26
  60. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  61. package/Misc/dds.js.map +1 -1
  62. package/Misc/environmentTextureTools.js +3 -1
  63. package/Misc/environmentTextureTools.js.map +1 -1
  64. package/Misc/fileTools.js +9 -1
  65. package/Misc/fileTools.js.map +1 -1
  66. package/Physics/v1/physicsImpostor.d.ts +2 -2
  67. package/Physics/v1/physicsImpostor.js.map +1 -1
  68. package/Shaders/ShadersInclude/gaussianSplatting.js +16 -3
  69. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  70. package/Shaders/gaussianSplatting.vertex.js +17 -4
  71. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  72. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +11 -1
  73. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  74. package/ShadersWGSL/gaussianSplatting.vertex.js +17 -4
  75. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  76. package/XR/native/nativeXRFrame.d.ts +1 -1
  77. package/XR/native/nativeXRFrame.js.map +1 -1
  78. package/package.json +1 -1
  79. package/types.d.ts +1 -1
  80. package/types.js.map +1 -1
@@ -17,7 +17,11 @@ const shader = `#include<sceneUboDeclaration>
17
17
  #include<clipPlaneVertexDeclaration>
18
18
  #include<fogVertexDeclaration>
19
19
  #include<logDepthDeclaration>
20
- attribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;
20
+ attribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;
21
+ #if IS_COMPOUND
22
+ uniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;
23
+ #endif
24
+ var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;
21
25
  #if SH_DEGREE>0
22
26
  var shTexture0: texture_2d<u32>;
23
27
  #endif
@@ -27,16 +31,25 @@ var shTexture1: texture_2d<u32>;
27
31
  #if SH_DEGREE>2
28
32
  var shTexture2: texture_2d<u32>;
29
33
  #endif
34
+ #if IS_COMPOUND
35
+ var partIndicesTexture: texture_2d<f32>;
36
+ #endif
30
37
  varying vColor: vec4f;varying vPosition: vec2f;
31
38
  #include<gaussianSplatting>
32
39
  @vertex
33
- fn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy;
40
+ fn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);
41
+ #if IS_COMPOUND
42
+ let splatWorld: mat4x4f=getPartWorld(splat.partIndex);
43
+ #else
44
+ let splatWorld: mat4x4f=mesh.world;
45
+ #endif
46
+ let worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy;
34
47
  #if SH_DEGREE>0
35
- let worldRot: mat3x3f= mat3x3f(mesh.world[0].xyz,mesh.world[1].xyz,mesh.world[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);
48
+ let worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);
36
49
  #else
37
50
  vertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);
38
51
  #endif
39
- vertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);
52
+ vertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);
40
53
  #include<clipPlaneVertex>
41
54
  #include<fogVertex>
42
55
  #include<logDepthVertex>
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Bd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/meshUboDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if SH_DEGREE>0\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2\nvar shTexture2: texture_2d<u32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy;\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(mesh.world[0].xyz,mesh.world[1].xyz,mesh.world[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\nvertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Cd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/meshUboDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;\n#endif\nvar covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if SH_DEGREE>0\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2\nvar shTexture2: texture_2d<u32>;\n#endif\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy;\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\nvertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
@@ -1,6 +1,6 @@
1
1
  /** @internal */
2
2
  interface INativeXRFrame extends XRFrame {
3
- getPoseData: (space: XRSpace, baseSpace: XRReferenceSpace, vectorBuffer: ArrayBuffer, matrixBuffer: ArrayBuffer) => XRPose;
3
+ getPoseData: (space: XRSpace, baseSpace: XRReferenceSpace, vectorBuffer: ArrayBufferLike, matrixBuffer: ArrayBufferLike) => XRPose;
4
4
  _imageTrackingResults?: XRImageTrackingResult[];
5
5
  }
6
6
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"nativeXRFrame.js","sourceRoot":"","sources":["../../../../../dev/core/src/XR/native/nativeXRFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AASzE,gBAAgB;AAChB,MAAM,OAAO,aAAa;IAStB,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,YAAoB,WAA2B;QAA3B,gBAAW,GAAX,WAAW,CAAgB;QAZ9B,iBAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACtC,YAAO,GAAW;YAC/B,SAAS,EAAE,IAAI,CAAC,YAAY;YAC5B,gBAAgB,EAAE,KAAK;SAC1B,CAAC;QACF,yCAAyC;QACxB,sBAAiB,GAAG,IAAI,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QA0B7C,cAAS,GAAG,IAAI,CAAC,WAAW,CAAC,SAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE/D,kBAAa,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEtE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iBAAiB,CAAC,CAAC,CAAC,CAAC;QACvC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAEvC,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,WAAuB,CAAC;QAC9D,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC1C,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC1C,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC1C,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAYD,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;IAC3C,CAAC;IAID,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC7C,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;IAC3C,CAAC;IAUD,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC;IAC9C,CAAC;IAMM,mBAAmB,CAAC,IAAY;QACnC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACpE,qDAAqD;IACzD,CAAC;CACJ;AAED,mEAAmE;AACnE,uBAAuB,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { RegisterNativeTypeAsync } from \"../../Engines/thinNativeEngine\";\r\n\r\n/** @internal */\r\ninterface INativeXRFrame extends XRFrame {\r\n // Native-only helper functions\r\n getPoseData: (space: XRSpace, baseSpace: XRReferenceSpace, vectorBuffer: ArrayBuffer, matrixBuffer: ArrayBuffer) => XRPose;\r\n _imageTrackingResults?: XRImageTrackingResult[];\r\n}\r\n\r\n/** @internal */\r\nexport class NativeXRFrame implements XRFrame {\r\n private readonly _xrTransform = new XRRigidTransform();\r\n private readonly _xrPose: XRPose = {\r\n transform: this._xrTransform,\r\n emulatedPosition: false,\r\n };\r\n // Enough space for position, orientation\r\n private readonly _xrPoseVectorData = new Float32Array(4 + 4);\r\n\r\n public get session(): XRSession {\r\n return this._nativeImpl.session;\r\n }\r\n\r\n constructor(private _nativeImpl: INativeXRFrame) {}\r\n\r\n public getPose(space: XRSpace, baseSpace: XRReferenceSpace): XRPose | undefined {\r\n if (!this._nativeImpl.getPoseData(space, baseSpace, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer)) {\r\n return undefined;\r\n }\r\n const position = this._xrTransform.position as DOMPoint;\r\n position.x = this._xrPoseVectorData[0];\r\n position.y = this._xrPoseVectorData[1];\r\n position.z = this._xrPoseVectorData[2];\r\n position.w = this._xrPoseVectorData[3];\r\n\r\n const orientation = this._xrTransform.orientation as DOMPoint;\r\n orientation.x = this._xrPoseVectorData[4];\r\n orientation.y = this._xrPoseVectorData[5];\r\n orientation.z = this._xrPoseVectorData[6];\r\n orientation.w = this._xrPoseVectorData[7];\r\n return this._xrPose;\r\n }\r\n\r\n public readonly fillPoses = this._nativeImpl.fillPoses!.bind(this._nativeImpl);\r\n\r\n public readonly getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl);\r\n\r\n public readonly getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl);\r\n\r\n public readonly getHitTestResultsForTransientInput = () => {\r\n throw new Error(\"XRFrame.getHitTestResultsForTransientInput not supported on native.\");\r\n };\r\n\r\n public get trackedAnchors(): XRAnchorSet | undefined {\r\n return this._nativeImpl.trackedAnchors;\r\n }\r\n\r\n public readonly createAnchor = this._nativeImpl.createAnchor!.bind(this._nativeImpl);\r\n\r\n public get worldInformation(): XRWorldInformation | undefined {\r\n return this._nativeImpl.worldInformation;\r\n }\r\n\r\n public get detectedPlanes(): XRPlaneSet | undefined {\r\n return this._nativeImpl.detectedPlanes;\r\n }\r\n\r\n public readonly getJointPose = this._nativeImpl.getJointPose!.bind(this._nativeImpl);\r\n\r\n public readonly fillJointRadii = this._nativeImpl.fillJointRadii!.bind(this._nativeImpl);\r\n\r\n public readonly getLightEstimate = () => {\r\n throw new Error(\"XRFrame.getLightEstimate not supported on native.\");\r\n };\r\n\r\n public get featurePointCloud(): number[] | undefined {\r\n return this._nativeImpl.featurePointCloud;\r\n }\r\n\r\n public readonly getImageTrackingResults = (): XRImageTrackingResult[] => {\r\n return this._nativeImpl._imageTrackingResults ?? [];\r\n };\r\n\r\n public getDepthInformation(view: XRView): XRCPUDepthInformation | undefined {\r\n throw new Error(\"This function is not available in Babylon Native\");\r\n // return this._nativeImpl.getDepthInformation(view);\r\n }\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\r\nRegisterNativeTypeAsync(\"NativeXRFrame\", NativeXRFrame);\r\n"]}
1
+ {"version":3,"file":"nativeXRFrame.js","sourceRoot":"","sources":["../../../../../dev/core/src/XR/native/nativeXRFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AASzE,gBAAgB;AAChB,MAAM,OAAO,aAAa;IAStB,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,YAAoB,WAA2B;QAA3B,gBAAW,GAAX,WAAW,CAAgB;QAZ9B,iBAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACtC,YAAO,GAAW;YAC/B,SAAS,EAAE,IAAI,CAAC,YAAY;YAC5B,gBAAgB,EAAE,KAAK;SAC1B,CAAC;QACF,yCAAyC;QACxB,sBAAiB,GAAG,IAAI,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QA0B7C,cAAS,GAAG,IAAI,CAAC,WAAW,CAAC,SAAU,CAAC,IAAI,CAAC,I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INativeXRFrame extends XRFrame {\r\n // Native-only helper functions\r\n getPoseData: (space: XRSpace, baseSpace: XRReferenceSpace, vectorBuffer: ArrayBufferLike, matrixBuffer: ArrayBufferLike) => XRPose;\r\n _imageTrackingResults?: XRImageTrackingResult[];\r\n}\r\n\r\n/** @internal */\r\nexport class NativeXRFrame implements XRFrame {\r\n private readonly _xrTransform = new XRRigidTransform();\r\n private readonly _xrPose: XRPose = {\r\n transform: this._xrTransform,\r\n emulatedPosition: false,\r\n };\r\n // Enough space for position, orientation\r\n private readonly _xrPoseVectorData = new Float32Array(4 + 4);\r\n\r\n public get session(): XRSession {\r\n return this._nativeImpl.session;\r\n }\r\n\r\n constructor(private _nativeImpl: INativeXRFrame) {}\r\n\r\n public getPose(space: XRSpace, baseSpace: XRReferenceSpace): XRPose | undefined {\r\n if (!this._nativeImpl.getPoseData(space, baseSpace, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer)) {\r\n return undefined;\r\n }\r\n const position = this._xrTransform.position as DOMPoint;\r\n position.x = this._xrPoseVectorData[0];\r\n position.y = this._xrPoseVectorData[1];\r\n position.z = this._xrPoseVectorData[2];\r\n position.w = this._xrPoseVectorData[3];\r\n\r\n const orientation = this._xrTransform.orientation as DOMPoint;\r\n orientation.x = this._xrPoseVectorData[4];\r\n orientation.y = this._xrPoseVectorData[5];\r\n orientation.z = this._xrPoseVectorData[6];\r\n orientation.w = this._xrPoseVectorData[7];\r\n return this._xrPose;\r\n }\r\n\r\n public readonly fillPoses = this._nativeImpl.fillPoses!.bind(this._nativeImpl);\r\n\r\n public readonly getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl);\r\n\r\n public readonly getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl);\r\n\r\n public readonly getHitTestResultsForTransientInput = () => {\r\n throw new Error(\"XRFrame.getHitTestResultsForTransientInput not supported on native.\");\r\n };\r\n\r\n public get trackedAnchors(): XRAnchorSet | undefined {\r\n return this._nativeImpl.trackedAnchors;\r\n }\r\n\r\n public readonly createAnchor = this._nativeImpl.createAnchor!.bind(this._nativeImpl);\r\n\r\n public get worldInformation(): XRWorldInformation | undefined {\r\n return this._nativeImpl.worldInformation;\r\n }\r\n\r\n public get detectedPlanes(): XRPlaneSet | undefined {\r\n return this._nativeImpl.detectedPlanes;\r\n }\r\n\r\n public readonly getJointPose = this._nativeImpl.getJointPose!.bind(this._nativeImpl);\r\n\r\n public readonly fillJointRadii = this._nativeImpl.fillJointRadii!.bind(this._nativeImpl);\r\n\r\n public readonly getLightEstimate = () => {\r\n throw new Error(\"XRFrame.getLightEstimate not supported on native.\");\r\n };\r\n\r\n public get featurePointCloud(): number[] | undefined {\r\n return this._nativeImpl.featurePointCloud;\r\n }\r\n\r\n public readonly getImageTrackingResults = (): XRImageTrackingResult[] => {\r\n return this._nativeImpl._imageTrackingResults ?? [];\r\n };\r\n\r\n public getDepthInformation(view: XRView): XRCPUDepthInformation | undefined {\r\n throw new Error(\"This function is not available in Babylon Native\");\r\n // return this._nativeImpl.getDepthInformation(view);\r\n }\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\r\nRegisterNativeTypeAsync(\"NativeXRFrame\", NativeXRFrame);\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/core",
3
- "version": "8.48.0",
3
+ "version": "8.48.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
package/types.d.ts CHANGED
@@ -125,7 +125,7 @@ export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array
125
125
  /**
126
126
  * Alias for types that can be used by a Buffer or VertexBuffer.
127
127
  */
128
- export type DataArray = number[] | ArrayBuffer | ArrayBufferView;
128
+ export type DataArray = number[] | ArrayBufferLike | ArrayBufferView;
129
129
  /**
130
130
  * Alias type for primitive types
131
131
  */
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../dev/core/src/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\n/** Alias type for value that can be null */\r\nexport type Nullable<T> = T | null;\r\n/**\r\n * Alias type for number that are floats\r\n */\r\nexport type float = number;\r\n/**\r\n * Alias type for number that are doubles.\r\n */\r\nexport type double = number;\r\n/**\r\n * Alias type for number that are integer\r\n */\r\nexport type int = number;\r\n\r\n// Tuple manipulation\r\n/**\r\n * Empty\r\n */\r\nexport type Empty = [];\r\n\r\n/**\r\n * Removes the first element of T and shifts\r\n */\r\nexport type Shift<T> = T extends unknown[] ? (((...x: T) => void) extends (h: any, ...t: infer I) => void ? I : []) : unknown;\r\n\r\n/**\r\n * Gets the first element of T\r\n */\r\nexport type First<T> = T extends unknown[] ? (((...x: T) => void) extends (h: infer I, ...t: any) => void ? I : []) : never;\r\n\r\n/**\r\n * Inserts A into T at the start of T\r\n */\r\nexport type Unshift<T, A> = T extends unknown[] ? (((h: A, ...t: T) => void) extends (...i: infer I) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Removes the last element of T\r\n */\r\nexport type Pop<T> = T extends unknown[] ? (((...x: T) => void) extends (...i: [...infer I, any]) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Gets the last element of T\r\n */\r\nexport type Last<T> = T extends unknown[] ? (((...x: T) => void) extends (...i: [...infer H, infer I]) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Appends A to T\r\n */\r\nexport type Push<T, A> = T extends unknown[] ? (((...a: [...T, A]) => void) extends (...i: infer I) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Concats A and B\r\n */\r\nexport type Concat<A, B> = { 0: A; 1: Concat<Unshift<A, 0>, Shift<B>> }[Empty extends B ? 0 : 1];\r\n\r\n/**\r\n * Extracts from A what is not B\r\n *\r\n * @remarks\r\n * It does not remove duplicates (so Remove\\<[0, 0, 0], [0, 0]\\> yields [0]). This is intended and necessary behavior.\r\n */\r\nexport type Remove<A, B> = { 0: A; 1: Remove<Shift<A>, Shift<B>> }[Empty extends B ? 0 : 1];\r\n\r\n/**\r\n * The length of T\r\n */\r\nexport type Length<T> = T extends { length: number } ? T[\"length\"] : never;\r\n\r\ntype _FromLength<N extends number, R = Empty> = { 0: R; 1: _FromLength<N, Unshift<R, 0>> }[Length<R> extends N ? 0 : 1];\r\n\r\n/**\r\n * Creates a tuple of length N\r\n */\r\nexport type FromLength<N extends number> = _FromLength<N>;\r\n\r\n// compile-time math\r\n\r\n/**\r\n * Increments N\r\n */\r\nexport type Increment<N extends number> = Length<Unshift<_FromLength<N>, 0>>;\r\n\r\n/**\r\n * Decrements N\r\n */\r\nexport type Decrement<N extends number> = Length<Shift<_FromLength<N>>>;\r\n\r\n/**\r\n * Gets the sum of A and B\r\n */\r\nexport type Add<A extends number, B extends number> = Length<Concat<_FromLength<A>, _FromLength<B>>>;\r\n\r\n/**\r\n * Subtracts B from A\r\n */\r\nexport type Subtract<A extends number, B extends number> = Length<Remove<_FromLength<A>, _FromLength<B>>>;\r\n\r\n/**\r\n * Gets the type of an array's members\r\n */\r\nexport type Member<T, D = null> = D extends 0 ? T : T extends (infer U)[] ? Member<U, D extends number ? Decrement<D> : null> : T;\r\n\r\n/**\r\n * Flattens an array\r\n */\r\nexport type FlattenArray<A extends unknown[], D = null> = A extends (infer U)[] ? Member<Exclude<U, A>, D>[] : A extends unknown[] ? { [K in keyof A]: Member<A[K], D> } : A;\r\n\r\n/**\r\n * Whether T is a tuple\r\n */\r\nexport type IsTuple<T> = T extends [] ? false : T extends [infer Head, ...infer Rest] ? true : false;\r\n\r\n/**\r\n * Flattens a tuple\r\n */\r\nexport type FlattenTuple<A extends unknown[]> = A extends [infer U, ...infer Rest] ? (U extends unknown[] ? [...U, ...FlattenTuple<Rest>] : [U, ...FlattenTuple<Rest>]) : [];\r\n\r\n/**\r\n * Flattens an array or tuple\r\n */\r\nexport type Flatten<A extends unknown[]> = IsTuple<A> extends true ? FlattenTuple<A> : FlattenArray<A>;\r\n\r\ntype _Tuple<T, N extends number, R extends unknown[] = Empty> = R[\"length\"] extends N ? R : _Tuple<T, N, [T, ...R]>;\r\n\r\n/**\r\n * Creates a tuple of T with length N\r\n */\r\nexport type Tuple<T, N extends number> = _Tuple<T, N>;\r\n\r\n/** Alias type for number array or Float32Array */\r\nexport type FloatArray = number[] | Float32Array;\r\n/** Alias type for number array or Float32Array or Int32Array or Uint32Array or Uint16Array */\r\nexport type IndicesArray = number[] | Int32Array | Uint32Array | Uint16Array;\r\n\r\n/**\r\n * Alias type for all TypedArrays\r\n */\r\nexport type TypedArray =\r\n | Int8Array\r\n | Uint8Array\r\n | Uint8ClampedArray\r\n | Int16Array\r\n | Uint16Array\r\n | Int32Array\r\n | Uint32Array\r\n | Float32Array\r\n | Float64Array\r\n | BigInt64Array\r\n | BigUint64Array;\r\n\r\n/**\r\n * Alias for types that can be used by a Buffer or VertexBuffer.\r\n */\r\nexport type DataArray = number[] | ArrayBuffer | ArrayBufferView;\r\n\r\n/**\r\n * Alias type for primitive types\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\r\ntype Primitive = undefined | null | boolean | string | number | Function | Element;\r\n\r\n/**\r\n * Type modifier to make all the properties of an object Readonly\r\n */\r\nexport type Immutable<T> = T extends Primitive\r\n ? T\r\n : T extends Array<infer U>\r\n ? ReadonlyArray<U>\r\n : /* T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : // es2015+ only */\r\n DeepImmutable<T>;\r\n\r\n/**\r\n * Type modifier to make all the properties of an object Readonly recursively\r\n */\r\nexport type DeepImmutable<T> = T extends Primitive\r\n ? T\r\n : T extends Array<infer U>\r\n ? DeepImmutableArray<U>\r\n : /* T extends Map<infer K, infer V> ? DeepImmutableMap<K, V> : // es2015+ only */\r\n DeepImmutableObject<T>;\r\n\r\n/**\r\n * Type modifier to make all the properties of an object NonNullable\r\n */\r\nexport type NonNullableFields<T> = { [P in keyof T]: NonNullable<T[P]> };\r\n\r\n/**\r\n * Type modifier to make all the properties of an object Writable (remove \"readonly\")\r\n */\r\nexport type WritableObject<T> = { -readonly [P in keyof T]: T[P] };\r\n\r\n/**\r\n * Type modifier to make object properties readonly.\r\n */\r\nexport type DeepImmutableObject<T> = { readonly [K in keyof T]: DeepImmutable<T[K]> };\r\n\r\n/** @internal */\r\ninterface DeepImmutableArray<T> extends ReadonlyArray<DeepImmutable<T>> {}\r\n/** @internal */\r\n/* interface DeepImmutableMap<K, V> extends ReadonlyMap<DeepImmutable<K>, DeepImmutable<V>> {} // es2015+ only */\r\n\r\nexport type Constructor<C extends new (...args: any[]) => any, I extends InstanceType<C> = InstanceType<C>> = {\r\n new (...args: ConstructorParameters<C>): I;\r\n};\r\n\r\n/**\r\n * Alias type for image sources\r\n */\r\nexport type ImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas;\r\n\r\n/**\r\n * Type for typed array like objects\r\n */\r\nexport interface TypedArrayLike extends ArrayBufferView {\r\n /**\r\n * The size in bytes of the array.\r\n */\r\n readonly length: number;\r\n [n: number]: number;\r\n}\r\n\r\n/**\r\n * Interface for a constructor of a TypedArray.\r\n */\r\nexport interface TypedArrayConstructor<T extends TypedArray = TypedArray> {\r\n new (length: number): T;\r\n new (elements: Iterable<number>): T;\r\n new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): T;\r\n /**\r\n * The size in bytes of each element in the array.\r\n */\r\n readonly BYTES_PER_ELEMENT: number;\r\n}\r\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../dev/core/src/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\n/** Alias type for value that can be null */\r\nexport type Nullable<T> = T | null;\r\n/**\r\n * Alias type for number that are floats\r\n */\r\nexport type float = number;\r\n/**\r\n * Alias type for number that are doubles.\r\n */\r\nexport type double = number;\r\n/**\r\n * Alias type for number that are integer\r\n */\r\nexport type int = number;\r\n\r\n// Tuple manipulation\r\n/**\r\n * Empty\r\n */\r\nexport type Empty = [];\r\n\r\n/**\r\n * Removes the first element of T and shifts\r\n */\r\nexport type Shift<T> = T extends unknown[] ? (((...x: T) => void) extends (h: any, ...t: infer I) => void ? I : []) : unknown;\r\n\r\n/**\r\n * Gets the first element of T\r\n */\r\nexport type First<T> = T extends unknown[] ? (((...x: T) => void) extends (h: infer I, ...t: any) => void ? I : []) : never;\r\n\r\n/**\r\n * Inserts A into T at the start of T\r\n */\r\nexport type Unshift<T, A> = T extends unknown[] ? (((h: A, ...t: T) => void) extends (...i: infer I) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Removes the last element of T\r\n */\r\nexport type Pop<T> = T extends unknown[] ? (((...x: T) => void) extends (...i: [...infer I, any]) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Gets the last element of T\r\n */\r\nexport type Last<T> = T extends unknown[] ? (((...x: T) => void) extends (...i: [...infer H, infer I]) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Appends A to T\r\n */\r\nexport type Push<T, A> = T extends unknown[] ? (((...a: [...T, A]) => void) extends (...i: infer I) => void ? I : unknown) : never;\r\n\r\n/**\r\n * Concats A and B\r\n */\r\nexport type Concat<A, B> = { 0: A; 1: Concat<Unshift<A, 0>, Shift<B>> }[Empty extends B ? 0 : 1];\r\n\r\n/**\r\n * Extracts from A what is not B\r\n *\r\n * @remarks\r\n * It does not remove duplicates (so Remove\\<[0, 0, 0], [0, 0]\\> yields [0]). This is intended and necessary behavior.\r\n */\r\nexport type Remove<A, B> = { 0: A; 1: Remove<Shift<A>, Shift<B>> }[Empty extends B ? 0 : 1];\r\n\r\n/**\r\n * The length of T\r\n */\r\nexport type Length<T> = T extends { length: number } ? T[\"length\"] : never;\r\n\r\ntype _FromLength<N extends number, R = Empty> = { 0: R; 1: _FromLength<N, Unshift<R, 0>> }[Length<R> extends N ? 0 : 1];\r\n\r\n/**\r\n * Creates a tuple of length N\r\n */\r\nexport type FromLength<N extends number> = _FromLength<N>;\r\n\r\n// compile-time math\r\n\r\n/**\r\n * Increments N\r\n */\r\nexport type Increment<N extends number> = Length<Unshift<_FromLength<N>, 0>>;\r\n\r\n/**\r\n * Decrements N\r\n */\r\nexport type Decrement<N extends number> = Length<Shift<_FromLength<N>>>;\r\n\r\n/**\r\n * Gets the sum of A and B\r\n */\r\nexport type Add<A extends number, B extends number> = Length<Concat<_FromLength<A>, _FromLength<B>>>;\r\n\r\n/**\r\n * Subtracts B from A\r\n */\r\nexport type Subtract<A extends number, B extends number> = Length<Remove<_FromLength<A>, _FromLength<B>>>;\r\n\r\n/**\r\n * Gets the type of an array's members\r\n */\r\nexport type Member<T, D = null> = D extends 0 ? T : T extends (infer U)[] ? Member<U, D extends number ? Decrement<D> : null> : T;\r\n\r\n/**\r\n * Flattens an array\r\n */\r\nexport type FlattenArray<A extends unknown[], D = null> = A extends (infer U)[] ? Member<Exclude<U, A>, D>[] : A extends unknown[] ? { [K in keyof A]: Member<A[K], D> } : A;\r\n\r\n/**\r\n * Whether T is a tuple\r\n */\r\nexport type IsTuple<T> = T extends [] ? false : T extends [infer Head, ...infer Rest] ? true : false;\r\n\r\n/**\r\n * Flattens a tuple\r\n */\r\nexport type FlattenTuple<A extends unknown[]> = A extends [infer U, ...infer Rest] ? (U extends unknown[] ? [...U, ...FlattenTuple<Rest>] : [U, ...FlattenTuple<Rest>]) : [];\r\n\r\n/**\r\n * Flattens an array or tuple\r\n */\r\nexport type Flatten<A extends unknown[]> = IsTuple<A> extends true ? FlattenTuple<A> : FlattenArray<A>;\r\n\r\ntype _Tuple<T, N extends number, R extends unknown[] = Empty> = R[\"length\"] extends N ? R : _Tuple<T, N, [T, ...R]>;\r\n\r\n/**\r\n * Creates a tuple of T with length N\r\n */\r\nexport type Tuple<T, N extends number> = _Tuple<T, N>;\r\n\r\n/** Alias type for number array or Float32Array */\r\nexport type FloatArray = number[] | Float32Array;\r\n/** Alias type for number array or Float32Array or Int32Array or Uint32Array or Uint16Array */\r\nexport type IndicesArray = number[] | Int32Array | Uint32Array | Uint16Array;\r\n\r\n/**\r\n * Alias type for all TypedArrays\r\n */\r\nexport type TypedArray =\r\n | Int8Array\r\n | Uint8Array\r\n | Uint8ClampedArray\r\n | Int16Array\r\n | Uint16Array\r\n | Int32Array\r\n | Uint32Array\r\n | Float32Array\r\n | Float64Array\r\n | BigInt64Array\r\n | BigUint64Array;\r\n\r\n/**\r\n * Alias for types that can be used by a Buffer or VertexBuffer.\r\n */\r\nexport type DataArray = number[] | ArrayBufferLike | ArrayBufferView;\r\n\r\n/**\r\n * Alias type for primitive types\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\r\ntype Primitive = undefined | null | boolean | string | number | Function | Element;\r\n\r\n/**\r\n * Type modifier to make all the properties of an object Readonly\r\n */\r\nexport type Immutable<T> = T extends Primitive\r\n ? T\r\n : T extends Array<infer U>\r\n ? ReadonlyArray<U>\r\n : /* T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : // es2015+ only */\r\n DeepImmutable<T>;\r\n\r\n/**\r\n * Type modifier to make all the properties of an object Readonly recursively\r\n */\r\nexport type DeepImmutable<T> = T extends Primitive\r\n ? T\r\n : T extends Array<infer U>\r\n ? DeepImmutableArray<U>\r\n : /* T extends Map<infer K, infer V> ? DeepImmutableMap<K, V> : // es2015+ only */\r\n DeepImmutableObject<T>;\r\n\r\n/**\r\n * Type modifier to make all the properties of an object NonNullable\r\n */\r\nexport type NonNullableFields<T> = { [P in keyof T]: NonNullable<T[P]> };\r\n\r\n/**\r\n * Type modifier to make all the properties of an object Writable (remove \"readonly\")\r\n */\r\nexport type WritableObject<T> = { -readonly [P in keyof T]: T[P] };\r\n\r\n/**\r\n * Type modifier to make object properties readonly.\r\n */\r\nexport type DeepImmutableObject<T> = { readonly [K in keyof T]: DeepImmutable<T[K]> };\r\n\r\n/** @internal */\r\ninterface DeepImmutableArray<T> extends ReadonlyArray<DeepImmutable<T>> {}\r\n/** @internal */\r\n/* interface DeepImmutableMap<K, V> extends ReadonlyMap<DeepImmutable<K>, DeepImmutable<V>> {} // es2015+ only */\r\n\r\nexport type Constructor<C extends new (...args: any[]) => any, I extends InstanceType<C> = InstanceType<C>> = {\r\n new (...args: ConstructorParameters<C>): I;\r\n};\r\n\r\n/**\r\n * Alias type for image sources\r\n */\r\nexport type ImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas;\r\n\r\n/**\r\n * Type for typed array like objects\r\n */\r\nexport interface TypedArrayLike extends ArrayBufferView {\r\n /**\r\n * The size in bytes of the array.\r\n */\r\n readonly length: number;\r\n [n: number]: number;\r\n}\r\n\r\n/**\r\n * Interface for a constructor of a TypedArray.\r\n */\r\nexport interface TypedArrayConstructor<T extends TypedArray = TypedArray> {\r\n new (length: number): T;\r\n new (elements: Iterable<number>): T;\r\n new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): T;\r\n /**\r\n * The size in bytes of each element in the array.\r\n */\r\n readonly BYTES_PER_ELEMENT: number;\r\n}\r\n"]}