@babylonjs/core 7.51.3 → 7.52.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.
Files changed (163) hide show
  1. package/Audio/Interfaces/IAudioEngineOptions.d.ts +2 -0
  2. package/Audio/Interfaces/IAudioEngineOptions.js.map +1 -1
  3. package/AudioV2/abstractAudio/abstractAudioBus.d.ts +22 -0
  4. package/AudioV2/abstractAudio/abstractAudioBus.js +35 -0
  5. package/AudioV2/abstractAudio/abstractAudioBus.js.map +1 -0
  6. package/AudioV2/abstractAudio/abstractAudioNode.d.ts +99 -0
  7. package/AudioV2/abstractAudio/abstractAudioNode.js +149 -0
  8. package/AudioV2/abstractAudio/abstractAudioNode.js.map +1 -0
  9. package/AudioV2/abstractAudio/abstractSound.d.ts +152 -0
  10. package/AudioV2/abstractAudio/abstractSound.js +202 -0
  11. package/AudioV2/abstractAudio/abstractSound.js.map +1 -0
  12. package/AudioV2/abstractAudio/abstractSoundInstance.d.ts +34 -0
  13. package/AudioV2/abstractAudio/abstractSoundInstance.js +35 -0
  14. package/AudioV2/abstractAudio/abstractSoundInstance.js.map +1 -0
  15. package/AudioV2/abstractAudio/audioBus.d.ts +48 -0
  16. package/AudioV2/abstractAudio/audioBus.js +53 -0
  17. package/AudioV2/abstractAudio/audioBus.js.map +1 -0
  18. package/AudioV2/abstractAudio/audioEngineV2.d.ts +193 -0
  19. package/AudioV2/abstractAudio/audioEngineV2.js +155 -0
  20. package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -0
  21. package/AudioV2/abstractAudio/index.d.ts +10 -0
  22. package/AudioV2/abstractAudio/index.js +12 -0
  23. package/AudioV2/abstractAudio/index.js.map +1 -0
  24. package/AudioV2/abstractAudio/mainAudioBus.d.ts +22 -0
  25. package/AudioV2/abstractAudio/mainAudioBus.js +18 -0
  26. package/AudioV2/abstractAudio/mainAudioBus.js.map +1 -0
  27. package/AudioV2/abstractAudio/mainAudioOut.d.ts +13 -0
  28. package/AudioV2/abstractAudio/mainAudioOut.js +15 -0
  29. package/AudioV2/abstractAudio/mainAudioOut.js.map +1 -0
  30. package/AudioV2/abstractAudio/staticSound.d.ts +134 -0
  31. package/AudioV2/abstractAudio/staticSound.js +113 -0
  32. package/AudioV2/abstractAudio/staticSound.js.map +1 -0
  33. package/AudioV2/abstractAudio/staticSoundBuffer.d.ts +46 -0
  34. package/AudioV2/abstractAudio/staticSoundBuffer.js +17 -0
  35. package/AudioV2/abstractAudio/staticSoundBuffer.js.map +1 -0
  36. package/AudioV2/abstractAudio/staticSoundInstance.d.ts +15 -0
  37. package/AudioV2/abstractAudio/staticSoundInstance.js +5 -0
  38. package/AudioV2/abstractAudio/staticSoundInstance.js.map +1 -0
  39. package/AudioV2/abstractAudio/streamingSound.d.ts +77 -0
  40. package/AudioV2/abstractAudio/streamingSound.js +109 -0
  41. package/AudioV2/abstractAudio/streamingSound.js.map +1 -0
  42. package/AudioV2/abstractAudio/streamingSoundInstance.d.ts +25 -0
  43. package/AudioV2/abstractAudio/streamingSoundInstance.js +29 -0
  44. package/AudioV2/abstractAudio/streamingSoundInstance.js.map +1 -0
  45. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +53 -0
  46. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +97 -0
  47. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -0
  48. package/AudioV2/abstractAudio/subNodes/abstractAudioSubNode.d.ts +13 -0
  49. package/AudioV2/abstractAudio/subNodes/abstractAudioSubNode.js +33 -0
  50. package/AudioV2/abstractAudio/subNodes/abstractAudioSubNode.js.map +1 -0
  51. package/AudioV2/abstractAudio/subNodes/audioSubNode.d.ts +6 -0
  52. package/AudioV2/abstractAudio/subNodes/audioSubNode.js +8 -0
  53. package/AudioV2/abstractAudio/subNodes/audioSubNode.js.map +1 -0
  54. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +31 -0
  55. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +46 -0
  56. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -0
  57. package/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.d.ts +19 -0
  58. package/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.js +27 -0
  59. package/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.js.map +1 -0
  60. package/AudioV2/abstractAudio/subNodes/volumeAudioSubNode.d.ts +28 -0
  61. package/AudioV2/abstractAudio/subNodes/volumeAudioSubNode.js +24 -0
  62. package/AudioV2/abstractAudio/subNodes/volumeAudioSubNode.js.map +1 -0
  63. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +187 -0
  64. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +41 -0
  65. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -0
  66. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.d.ts +59 -0
  67. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js +21 -0
  68. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js.map +1 -0
  69. package/AudioV2/abstractAudio/subProperties/abstractStereoAudio.d.ts +38 -0
  70. package/AudioV2/abstractAudio/subProperties/abstractStereoAudio.js +18 -0
  71. package/AudioV2/abstractAudio/subProperties/abstractStereoAudio.js.map +1 -0
  72. package/AudioV2/abstractAudio/subProperties/index.d.ts +3 -0
  73. package/AudioV2/abstractAudio/subProperties/index.js +4 -0
  74. package/AudioV2/abstractAudio/subProperties/index.js.map +1 -0
  75. package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +49 -0
  76. package/AudioV2/abstractAudio/subProperties/spatialAudio.js +129 -0
  77. package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -0
  78. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.d.ts +9 -0
  79. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js +22 -0
  80. package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js.map +1 -0
  81. package/AudioV2/abstractAudio/subProperties/stereoAudio.d.ts +11 -0
  82. package/AudioV2/abstractAudio/subProperties/stereoAudio.js +18 -0
  83. package/AudioV2/abstractAudio/subProperties/stereoAudio.js.map +1 -0
  84. package/AudioV2/audioUtils.d.ts +3 -0
  85. package/AudioV2/audioUtils.js +6 -0
  86. package/AudioV2/audioUtils.js.map +1 -0
  87. package/AudioV2/index.d.ts +3 -0
  88. package/AudioV2/index.js +5 -0
  89. package/AudioV2/index.js.map +1 -0
  90. package/AudioV2/soundState.d.ts +29 -0
  91. package/AudioV2/soundState.js +31 -0
  92. package/AudioV2/soundState.js.map +1 -0
  93. package/AudioV2/webAudio/index.d.ts +5 -0
  94. package/AudioV2/webAudio/index.js +6 -0
  95. package/AudioV2/webAudio/index.js.map +1 -0
  96. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +59 -0
  97. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +156 -0
  98. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -0
  99. package/AudioV2/webAudio/subNodes/stereoWebAudioSubNode.d.ts +24 -0
  100. package/AudioV2/webAudio/subNodes/stereoWebAudioSubNode.js +55 -0
  101. package/AudioV2/webAudio/subNodes/stereoWebAudioSubNode.js.map +1 -0
  102. package/AudioV2/webAudio/subNodes/volumeWebAudioSubNode.d.ts +24 -0
  103. package/AudioV2/webAudio/subNodes/volumeWebAudioSubNode.js +55 -0
  104. package/AudioV2/webAudio/subNodes/volumeWebAudioSubNode.js.map +1 -0
  105. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.d.ts +26 -0
  106. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js +54 -0
  107. package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js.map +1 -0
  108. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.d.ts +21 -0
  109. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +112 -0
  110. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -0
  111. package/AudioV2/webAudio/subProperties/spatialWebAudio.d.ts +10 -0
  112. package/AudioV2/webAudio/subProperties/spatialWebAudio.js +26 -0
  113. package/AudioV2/webAudio/subProperties/spatialWebAudio.js.map +1 -0
  114. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.d.ts +4 -0
  115. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js +108 -0
  116. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js.map +1 -0
  117. package/AudioV2/webAudio/webAudioBus.d.ts +35 -0
  118. package/AudioV2/webAudio/webAudioBus.js +63 -0
  119. package/AudioV2/webAudio/webAudioBus.js.map +1 -0
  120. package/AudioV2/webAudio/webAudioEngine.d.ts +110 -0
  121. package/AudioV2/webAudio/webAudioEngine.js +227 -0
  122. package/AudioV2/webAudio/webAudioEngine.js.map +1 -0
  123. package/AudioV2/webAudio/webAudioMainBus.d.ts +29 -0
  124. package/AudioV2/webAudio/webAudioMainBus.js +64 -0
  125. package/AudioV2/webAudio/webAudioMainBus.js.map +1 -0
  126. package/AudioV2/webAudio/webAudioMainOut.d.ts +20 -0
  127. package/AudioV2/webAudio/webAudioMainOut.js +35 -0
  128. package/AudioV2/webAudio/webAudioMainOut.js.map +1 -0
  129. package/AudioV2/webAudio/webAudioNode.d.ts +24 -0
  130. package/AudioV2/webAudio/webAudioNode.js +2 -0
  131. package/AudioV2/webAudio/webAudioNode.js.map +1 -0
  132. package/AudioV2/webAudio/webAudioStaticSound.d.ts +106 -0
  133. package/AudioV2/webAudio/webAudioStaticSound.js +368 -0
  134. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -0
  135. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +94 -0
  136. package/AudioV2/webAudio/webAudioStreamingSound.js +358 -0
  137. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -0
  138. package/Engines/abstractEngine.d.ts +4 -0
  139. package/Engines/abstractEngine.js +4 -2
  140. package/Engines/abstractEngine.js.map +1 -1
  141. package/Engines/engine.common.js +0 -4
  142. package/Engines/engine.common.js.map +1 -1
  143. package/Engines/engine.d.ts +0 -1
  144. package/Engines/engine.js +0 -1
  145. package/Engines/engine.js.map +1 -1
  146. package/Lights/Shadows/cascadedShadowGenerator.js +33 -20
  147. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  148. package/Materials/Textures/hdrCubeTexture.js +4 -1
  149. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  150. package/Meshes/geometry.js +7 -15
  151. package/Meshes/geometry.js.map +1 -1
  152. package/Shaders/ShadersInclude/shadowMapFragment.js +1 -0
  153. package/Shaders/ShadersInclude/shadowMapFragment.js.map +1 -1
  154. package/Shaders/iblCdfDebug.fragment.js +2 -2
  155. package/Shaders/iblCdfDebug.fragment.js.map +1 -1
  156. package/ShadersWGSL/ShadersInclude/shadowMapFragment.js +1 -0
  157. package/ShadersWGSL/ShadersInclude/shadowMapFragment.js.map +1 -1
  158. package/ShadersWGSL/iblCdfDebug.fragment.js +2 -2
  159. package/ShadersWGSL/iblCdfDebug.fragment.js.map +1 -1
  160. package/index.d.ts +1 -0
  161. package/index.js +1 -0
  162. package/index.js.map +1 -1
  163. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import type { Nullable } from "../../../types";
2
+ import type { AudioEngineV2 } from "../../abstractAudio/audioEngineV2";
3
+ import { _AbstractAudioSubNode } from "../../abstractAudio/subNodes/abstractAudioSubNode";
4
+ import type { IStereoAudioOptions } from "../../abstractAudio/subProperties/abstractStereoAudio";
5
+ import { _StereoAudioDefaults } from "../../abstractAudio/subProperties/abstractStereoAudio";
6
+ import type { _AbstractAudioSubGraph } from "./abstractAudioSubGraph";
7
+ /** @internal */
8
+ export declare abstract class _StereoAudioSubNode extends _AbstractAudioSubNode {
9
+ protected constructor(engine: AudioEngineV2);
10
+ abstract pan: number;
11
+ /** @internal */
12
+ setOptions(options: Partial<IStereoAudioOptions>): void;
13
+ }
14
+ /** @internal */
15
+ export declare function _GetStereoAudioSubNode(subGraph: _AbstractAudioSubGraph): Nullable<_StereoAudioSubNode>;
16
+ /** @internal */
17
+ export declare function _GetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K): (typeof _StereoAudioDefaults)[K];
18
+ /** @internal */
19
+ export declare function _SetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K, value: _StereoAudioSubNode[K]): void;
@@ -0,0 +1,27 @@
1
+ import { _AbstractAudioSubNode } from "../../abstractAudio/subNodes/abstractAudioSubNode.js";
2
+ import { _StereoAudioDefaults } from "../../abstractAudio/subProperties/abstractStereoAudio.js";
3
+ /** @internal */
4
+ export class _StereoAudioSubNode extends _AbstractAudioSubNode {
5
+ constructor(engine) {
6
+ super("Stereo" /* AudioSubNode.STEREO */, engine);
7
+ }
8
+ /** @internal */
9
+ setOptions(options) {
10
+ this.pan = options.stereoPan ?? _StereoAudioDefaults.pan;
11
+ }
12
+ }
13
+ /** @internal */
14
+ export function _GetStereoAudioSubNode(subGraph) {
15
+ return subGraph.getSubNode("Stereo" /* AudioSubNode.STEREO */);
16
+ }
17
+ /** @internal */
18
+ export function _GetStereoAudioProperty(subGraph, property) {
19
+ return _GetStereoAudioSubNode(subGraph)?.[property] ?? _StereoAudioDefaults[property];
20
+ }
21
+ /** @internal */
22
+ export function _SetStereoAudioProperty(subGraph, property, value) {
23
+ subGraph.callOnSubNode("Stereo" /* AudioSubNode.STEREO */, (node) => {
24
+ node[property] = value;
25
+ });
26
+ }
27
+ //# sourceMappingURL=stereoAudioSubNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stereoAudioSubNode.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAG1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAG7F,gBAAgB;AAChB,MAAM,OAAgB,mBAAoB,SAAQ,qBAAqB;IACnE,YAAsB,MAAqB;QACvC,KAAK,qCAAsB,MAAM,CAAC,CAAC;IACvC,CAAC;IAID,gBAAgB;IACT,UAAU,CAAC,OAAqC;QACnD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,oBAAoB,CAAC,GAAG,CAAC;IAC7D,CAAC;CACJ;AAED,gBAAgB;AAChB,MAAM,UAAU,sBAAsB,CAAC,QAAgC;IACnE,OAAO,QAAQ,CAAC,UAAU,oCAA0C,CAAC;AACzE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAA8C,QAAgC,EAAE,QAAW;IAC9H,OAAO,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAC1F,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAA8C,QAAgC,EAAE,QAAW,EAAE,KAA6B;IAC7J,QAAQ,CAAC,aAAa,qCAA2C,CAAC,IAAI,EAAE,EAAE;QACtE,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Nullable } from \"../../../types\";\nimport type { AudioEngineV2 } from \"../../abstractAudio/audioEngineV2\";\nimport { _AbstractAudioSubNode } from \"../../abstractAudio/subNodes/abstractAudioSubNode\";\nimport { AudioSubNode } from \"../../abstractAudio/subNodes/audioSubNode\";\nimport type { IStereoAudioOptions } from \"../../abstractAudio/subProperties/abstractStereoAudio\";\nimport { _StereoAudioDefaults } from \"../../abstractAudio/subProperties/abstractStereoAudio\";\nimport type { _AbstractAudioSubGraph } from \"./abstractAudioSubGraph\";\n\n/** @internal */\nexport abstract class _StereoAudioSubNode extends _AbstractAudioSubNode {\n protected constructor(engine: AudioEngineV2) {\n super(AudioSubNode.STEREO, engine);\n }\n\n abstract pan: number;\n\n /** @internal */\n public setOptions(options: Partial<IStereoAudioOptions>): void {\n this.pan = options.stereoPan ?? _StereoAudioDefaults.pan;\n }\n}\n\n/** @internal */\nexport function _GetStereoAudioSubNode(subGraph: _AbstractAudioSubGraph): Nullable<_StereoAudioSubNode> {\n return subGraph.getSubNode<_StereoAudioSubNode>(AudioSubNode.STEREO);\n}\n\n/** @internal */\nexport function _GetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K): (typeof _StereoAudioDefaults)[K] {\n return _GetStereoAudioSubNode(subGraph)?.[property] ?? _StereoAudioDefaults[property];\n}\n\n/** @internal */\nexport function _SetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K, value: _StereoAudioSubNode[K]): void {\n subGraph.callOnSubNode<_StereoAudioSubNode>(AudioSubNode.STEREO, (node) => {\n node[property] = value;\n });\n}\n"]}
@@ -0,0 +1,28 @@
1
+ import type { Nullable } from "../../../types";
2
+ import type { AudioEngineV2 } from "../audioEngineV2";
3
+ import { _AbstractAudioSubNode } from "../subNodes/abstractAudioSubNode";
4
+ import type { _AbstractAudioSubGraph } from "./abstractAudioSubGraph";
5
+ /** @internal */
6
+ export declare const _VolumeAudioDefaults: {
7
+ readonly volume: number;
8
+ };
9
+ /**
10
+ * Volume options.
11
+ */
12
+ export interface IVolumeAudioOptions {
13
+ /**
14
+ * The volume/gain. Defaults to 1.
15
+ */
16
+ volume: number;
17
+ }
18
+ /** @internal */
19
+ export declare abstract class _VolumeAudioSubNode extends _AbstractAudioSubNode {
20
+ protected constructor(engine: AudioEngineV2);
21
+ abstract volume: number;
22
+ /** @internal */
23
+ setOptions(options: Partial<IVolumeAudioOptions>): void;
24
+ }
25
+ /** @internal */
26
+ export declare function _GetVolumeAudioSubNode(subGraph: _AbstractAudioSubGraph): Nullable<_VolumeAudioSubNode>;
27
+ /** @internal */
28
+ export declare function _GetVolumeAudioProperty<K extends keyof typeof _VolumeAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K): (typeof _VolumeAudioDefaults)[K];
@@ -0,0 +1,24 @@
1
+ import { _AbstractAudioSubNode } from "../subNodes/abstractAudioSubNode.js";
2
+ /** @internal */
3
+ export const _VolumeAudioDefaults = {
4
+ volume: 1,
5
+ };
6
+ /** @internal */
7
+ export class _VolumeAudioSubNode extends _AbstractAudioSubNode {
8
+ constructor(engine) {
9
+ super("Volume" /* AudioSubNode.VOLUME */, engine);
10
+ }
11
+ /** @internal */
12
+ setOptions(options) {
13
+ this.volume = options.volume ?? _VolumeAudioDefaults.volume;
14
+ }
15
+ }
16
+ /** @internal */
17
+ export function _GetVolumeAudioSubNode(subGraph) {
18
+ return subGraph.getSubNode("Volume" /* AudioSubNode.VOLUME */);
19
+ }
20
+ /** @internal */
21
+ export function _GetVolumeAudioProperty(subGraph, property) {
22
+ return _GetVolumeAudioSubNode(subGraph)?.[property] ?? _VolumeAudioDefaults[property];
23
+ }
24
+ //# sourceMappingURL=volumeAudioSubNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volumeAudioSubNode.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subNodes/volumeAudioSubNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAIzE,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,MAAM,EAAE,CAAW;CACb,CAAC;AAYX,gBAAgB;AAChB,MAAM,OAAgB,mBAAoB,SAAQ,qBAAqB;IACnE,YAAsB,MAAqB;QACvC,KAAK,qCAAsB,MAAM,CAAC,CAAC;IACvC,CAAC;IAID,gBAAgB;IACT,UAAU,CAAC,OAAqC;QACnD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,oBAAoB,CAAC,MAAM,CAAC;IAChE,CAAC;CACJ;AAED,gBAAgB;AAChB,MAAM,UAAU,sBAAsB,CAAC,QAAgC;IACnE,OAAO,QAAQ,CAAC,UAAU,oCAA0C,CAAC;AACzE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAA8C,QAAgC,EAAE,QAAW;IAC9H,OAAO,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["import type { Nullable } from \"../../../types\";\nimport type { AudioEngineV2 } from \"../audioEngineV2\";\nimport { _AbstractAudioSubNode } from \"../subNodes/abstractAudioSubNode\";\nimport { AudioSubNode } from \"../subNodes/audioSubNode\";\nimport type { _AbstractAudioSubGraph } from \"./abstractAudioSubGraph\";\n\n/** @internal */\nexport const _VolumeAudioDefaults = {\n volume: 1 as number,\n} as const;\n\n/**\n * Volume options.\n */\nexport interface IVolumeAudioOptions {\n /**\n * The volume/gain. Defaults to 1.\n */\n volume: number;\n}\n\n/** @internal */\nexport abstract class _VolumeAudioSubNode extends _AbstractAudioSubNode {\n protected constructor(engine: AudioEngineV2) {\n super(AudioSubNode.VOLUME, engine);\n }\n\n public abstract volume: number;\n\n /** @internal */\n public setOptions(options: Partial<IVolumeAudioOptions>): void {\n this.volume = options.volume ?? _VolumeAudioDefaults.volume;\n }\n}\n\n/** @internal */\nexport function _GetVolumeAudioSubNode(subGraph: _AbstractAudioSubGraph): Nullable<_VolumeAudioSubNode> {\n return subGraph.getSubNode<_VolumeAudioSubNode>(AudioSubNode.VOLUME);\n}\n\n/** @internal */\nexport function _GetVolumeAudioProperty<K extends keyof typeof _VolumeAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K): (typeof _VolumeAudioDefaults)[K] {\n return _GetVolumeAudioSubNode(subGraph)?.[property] ?? _VolumeAudioDefaults[property];\n}\n"]}
@@ -0,0 +1,187 @@
1
+ import { Quaternion, Vector3 } from "../../../Maths/math.vector";
2
+ export declare const _SpatialAudioDefaults: {
3
+ readonly coneInnerAngle: number;
4
+ readonly coneOuterAngle: number;
5
+ readonly coneOuterVolume: number;
6
+ readonly distanceModel: DistanceModelType;
7
+ readonly maxDistance: number;
8
+ readonly panningModel: PanningModelType;
9
+ readonly position: Vector3;
10
+ readonly referenceDistance: number;
11
+ readonly rolloffFactor: number;
12
+ readonly rotation: Vector3;
13
+ readonly rotationQuaternion: Quaternion;
14
+ };
15
+ /**
16
+ * Options for spatial audio.
17
+ */
18
+ export interface ISpatialAudioOptions {
19
+ /**
20
+ * Whether to automatically update the spatial properties of the audio node. Defaults to `true`.
21
+ */
22
+ spatialAutoUpdate: boolean;
23
+ /**
24
+ * The spatial cone inner angle, in radians. Defaults to 2π.
25
+ * - When the listener is inside the cone inner angle, the volume is at its maximum.
26
+ */
27
+ spatialConeInnerAngle: number;
28
+ /**
29
+ * The spatial cone outer angle, in radians. Defaults to 2π.
30
+ * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.
31
+ * - When the listener is outside the cone outer angle, the volume is at its minimum.
32
+ */
33
+ spatialConeOuterAngle: number;
34
+ /**
35
+ * The amount of volume reduction outside the {@link spatialConeOuterAngle}. Defaults to 0.
36
+ */
37
+ spatialConeOuterVolume: number;
38
+ /**
39
+ * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to "inverse".
40
+ *
41
+ * Possible values are:
42
+ * - `"linear"`: The volume is reduced linearly as the source moves away from the listener.
43
+ * - `"inverse"`: The volume is reduced inversely as the source moves away from the listener.
44
+ * - `"exponential"`: The volume is reduced exponentially as the source moves away from the listener.
45
+ *
46
+ * @see {@link spatialMaxDistance}
47
+ * @see {@link spatialReferenceDistance}
48
+ * @see {@link spatialRolloffFactor}
49
+ */
50
+ spatialDistanceModel: "linear" | "inverse" | "exponential";
51
+ /**
52
+ * Enable spatial audio. Defaults to false.
53
+ *
54
+ * When set to `true`, the audio node's spatial properties will be initialized on creation and there will be no
55
+ * delay when setting the first spatial value.
56
+ *
57
+ * When not specified, or set to `false`, the audio node's spatial properties will not be initialized on creation
58
+ * and there will be a small delay when setting the first spatial value.
59
+ *
60
+ * - This option is ignored if any other spatial options are set.
61
+ */
62
+ spatialEnabled: boolean;
63
+ /**
64
+ * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.
65
+ * - This value is used only when the {@link spatialDistanceModel} is set to `"linear"`.
66
+ * @see {@link spatialDistanceModel}
67
+ */
68
+ spatialMaxDistance: number;
69
+ /**
70
+ * The spatial panning model. Defaults to "equalpower".
71
+ * - "equalpower" requires less CPU than "HRTF" but is less realistic for listeners with headphones or speakers close to the ears.
72
+ * - "HRTF" requires more CPU but is more realistic for listeners with headphones or speakers close to the ears.
73
+ *
74
+ * Possible values are:
75
+ * - `"equalpower"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.
76
+ * - `"HRTF"`:Renders a stereo output of higher quality than `"equalpower"` — it uses a convolution with measured impulse responses from human subjects.
77
+ */
78
+ spatialPanningModel: "equalpower" | "HRTF";
79
+ /**
80
+ * The spatial position. Defaults to (0, 0, 0).
81
+ */
82
+ spatialPosition: Vector3;
83
+ /**
84
+ * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.
85
+ * - This value is used by all distance models.
86
+ * @see {@link spatialDistanceModel}
87
+ */
88
+ spatialReferenceDistance: number;
89
+ /**
90
+ * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.
91
+ * - This value is used by all distance models.
92
+ * @see {@link spatialDistanceModel}
93
+ */
94
+ spatialRolloffFactor: number;
95
+ /**
96
+ * The spatial rotation, as Euler angles. Defaults to (0, 0, 0).
97
+ */
98
+ spatialRotation: Vector3;
99
+ /**
100
+ * The spatial rotation, as a quaternion. Defaults to (0, 0, 0, 1).
101
+ */
102
+ spatialRotationQuaternion: Quaternion;
103
+ }
104
+ /**
105
+ * @param options The spatial audio options to check.
106
+ * @returns `true` if spatial audio options are defined, otherwise `false`.
107
+ */
108
+ export declare function _HasSpatialAudioOptions(options: Partial<ISpatialAudioOptions>): boolean;
109
+ /**
110
+ * Abstract class representing the `spatial` audio property on a sound or audio bus.
111
+ *
112
+ * @see {@link AudioEngineV2.listener}
113
+ */
114
+ export declare abstract class AbstractSpatialAudio {
115
+ /**
116
+ * The spatial cone inner angle, in radians. Defaults to 2π.
117
+ * - When the listener is inside the cone inner angle, the volume is at its maximum.
118
+ */
119
+ abstract coneInnerAngle: number;
120
+ /**
121
+ * The spatial cone outer angle, in radians. Defaults to 2π.
122
+ * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.
123
+ * - When the listener is outside the cone outer angle, the volume is at its minimum.
124
+ */
125
+ abstract coneOuterAngle: number;
126
+ /**
127
+ * The amount of volume reduction outside the {@link coneOuterAngle}. Defaults to 0.
128
+ */
129
+ abstract coneOuterVolume: number;
130
+ /**
131
+ * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to "inverse".
132
+ *
133
+ * Possible values are:
134
+ * - `"linear"`: The volume is reduced linearly as the source moves away from the listener.
135
+ * - `"inverse"`: The volume is reduced inversely as the source moves away from the listener.
136
+ * - `"exponential"`: The volume is reduced exponentially as the source moves away from the listener.
137
+ *
138
+ * @see {@link spatialMaxDistance}
139
+ * @see {@link spatialReferenceDistance}
140
+ * @see {@link spatialRolloffFactor}
141
+ */
142
+ abstract distanceModel: "linear" | "inverse" | "exponential";
143
+ /**
144
+ * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.
145
+ * - This value is used only when the {@link distanceModel} is set to `"linear"`.
146
+ * @see {@link distanceModel}
147
+ */
148
+ abstract maxDistance: number;
149
+ /**
150
+ * The spatial panning model. Defaults to "equalpower".
151
+ * - "equalpower" requires less CPU than "HRTF" but is less realistic for listeners with headphones or speakers close to the ears.
152
+ * - "HRTF" requires more CPU but is more realistic for listeners with headphones or speakers close to the ears.
153
+ *
154
+ * Possible values are:
155
+ * - `"equalpower"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.
156
+ * - `"HRTF"`:Renders a stereo output of higher quality than `"equalpower"` — it uses a convolution with measured impulse responses from human subjects.
157
+ */
158
+ abstract panningModel: "equalpower" | "HRTF";
159
+ /**
160
+ * The spatial position. Defaults to (0, 0, 0).
161
+ */
162
+ abstract position: Vector3;
163
+ /**
164
+ * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.
165
+ * - This value is used by all distance models.
166
+ * @see {@link distanceModel}
167
+ */
168
+ abstract referenceDistance: number;
169
+ /**
170
+ * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.
171
+ * - This value is used by all distance models.
172
+ * @see {@link distanceModel}
173
+ */
174
+ abstract rolloffFactor: number;
175
+ /**
176
+ * The spatial rotation. Defaults to (0, 0, 0).
177
+ */
178
+ abstract rotation: Vector3;
179
+ /**
180
+ * The spatial rotation quaternion. Defaults to (0, 0, 0, 1).
181
+ */
182
+ abstract rotationQuaternion: Quaternion;
183
+ /**
184
+ * Updates the position and rotation properties.
185
+ */
186
+ abstract update(): void;
187
+ }
@@ -0,0 +1,41 @@
1
+ import { Quaternion, Vector3 } from "../../../Maths/math.vector.js";
2
+ export const _SpatialAudioDefaults = {
3
+ coneInnerAngle: 6.28318530718,
4
+ coneOuterAngle: 6.28318530718,
5
+ coneOuterVolume: 0,
6
+ distanceModel: "inverse",
7
+ maxDistance: 10000,
8
+ panningModel: "equalpower",
9
+ position: Vector3.Zero(),
10
+ referenceDistance: 1,
11
+ rolloffFactor: 1,
12
+ rotation: Vector3.Zero(),
13
+ rotationQuaternion: new Quaternion(),
14
+ };
15
+ /**
16
+ * @param options The spatial audio options to check.
17
+ * @returns `true` if spatial audio options are defined, otherwise `false`.
18
+ */
19
+ export function _HasSpatialAudioOptions(options) {
20
+ return (options.spatialEnabled ||
21
+ options.spatialAutoUpdate !== undefined ||
22
+ options.spatialConeInnerAngle !== undefined ||
23
+ options.spatialConeOuterAngle !== undefined ||
24
+ options.spatialConeOuterVolume !== undefined ||
25
+ options.spatialDistanceModel !== undefined ||
26
+ options.spatialMaxDistance !== undefined ||
27
+ options.spatialPanningModel !== undefined ||
28
+ options.spatialPosition !== undefined ||
29
+ options.spatialReferenceDistance !== undefined ||
30
+ options.spatialRolloffFactor !== undefined ||
31
+ options.spatialRotation !== undefined ||
32
+ options.spatialRotationQuaternion !== undefined);
33
+ }
34
+ /**
35
+ * Abstract class representing the `spatial` audio property on a sound or audio bus.
36
+ *
37
+ * @see {@link AudioEngineV2.listener}
38
+ */
39
+ export class AbstractSpatialAudio {
40
+ }
41
+ //# sourceMappingURL=abstractSpatialAudio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractSpatialAudio.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,cAAc,EAAE,aAAuB;IACvC,cAAc,EAAE,aAAuB;IACvC,eAAe,EAAE,CAAW;IAC5B,aAAa,EAAE,SAA8B;IAC7C,WAAW,EAAE,KAAe;IAC5B,YAAY,EAAE,YAAgC;IAC9C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,iBAAiB,EAAE,CAAW;IAC9B,aAAa,EAAE,CAAW;IAC1B,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,kBAAkB,EAAE,IAAI,UAAU,EAAE;CAC9B,CAAC;AA4FX;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAsC;IAC1E,OAAO,CACH,OAAO,CAAC,cAAc;QACtB,OAAO,CAAC,iBAAiB,KAAK,SAAS;QACvC,OAAO,CAAC,qBAAqB,KAAK,SAAS;QAC3C,OAAO,CAAC,qBAAqB,KAAK,SAAS;QAC3C,OAAO,CAAC,sBAAsB,KAAK,SAAS;QAC5C,OAAO,CAAC,oBAAoB,KAAK,SAAS;QAC1C,OAAO,CAAC,kBAAkB,KAAK,SAAS;QACxC,OAAO,CAAC,mBAAmB,KAAK,SAAS;QACzC,OAAO,CAAC,eAAe,KAAK,SAAS;QACrC,OAAO,CAAC,wBAAwB,KAAK,SAAS;QAC9C,OAAO,CAAC,oBAAoB,KAAK,SAAS;QAC1C,OAAO,CAAC,eAAe,KAAK,SAAS;QACrC,OAAO,CAAC,yBAAyB,KAAK,SAAS,CAClD,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,oBAAoB;CAoFzC","sourcesContent":["import { Quaternion, Vector3 } from \"../../../Maths/math.vector\";\n\nexport const _SpatialAudioDefaults = {\n coneInnerAngle: 6.28318530718 as number,\n coneOuterAngle: 6.28318530718 as number,\n coneOuterVolume: 0 as number,\n distanceModel: \"inverse\" as DistanceModelType,\n maxDistance: 10000 as number,\n panningModel: \"equalpower\" as PanningModelType,\n position: Vector3.Zero(),\n referenceDistance: 1 as number,\n rolloffFactor: 1 as number,\n rotation: Vector3.Zero(),\n rotationQuaternion: new Quaternion(),\n} as const;\n\n/**\n * Options for spatial audio.\n */\nexport interface ISpatialAudioOptions {\n /**\n * Whether to automatically update the spatial properties of the audio node. Defaults to `true`.\n */\n spatialAutoUpdate: boolean;\n /**\n * The spatial cone inner angle, in radians. Defaults to 2π.\n * - When the listener is inside the cone inner angle, the volume is at its maximum.\n */\n spatialConeInnerAngle: number;\n /**\n * The spatial cone outer angle, in radians. Defaults to 2π.\n * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.\n * - When the listener is outside the cone outer angle, the volume is at its minimum.\n */\n spatialConeOuterAngle: number;\n /**\n * The amount of volume reduction outside the {@link spatialConeOuterAngle}. Defaults to 0.\n */\n spatialConeOuterVolume: number;\n /**\n * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to \"inverse\".\n *\n * Possible values are:\n * - `\"linear\"`: The volume is reduced linearly as the source moves away from the listener.\n * - `\"inverse\"`: The volume is reduced inversely as the source moves away from the listener.\n * - `\"exponential\"`: The volume is reduced exponentially as the source moves away from the listener.\n *\n * @see {@link spatialMaxDistance}\n * @see {@link spatialReferenceDistance}\n * @see {@link spatialRolloffFactor}\n */\n spatialDistanceModel: \"linear\" | \"inverse\" | \"exponential\";\n /**\n * Enable spatial audio. Defaults to false.\n *\n * When set to `true`, the audio node's spatial properties will be initialized on creation and there will be no\n * delay when setting the first spatial value.\n *\n * When not specified, or set to `false`, the audio node's spatial properties will not be initialized on creation\n * and there will be a small delay when setting the first spatial value.\n *\n * - This option is ignored if any other spatial options are set.\n */\n spatialEnabled: boolean;\n /**\n * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.\n * - This value is used only when the {@link spatialDistanceModel} is set to `\"linear\"`.\n * @see {@link spatialDistanceModel}\n */\n spatialMaxDistance: number;\n /**\n * The spatial panning model. Defaults to \"equalpower\".\n * - \"equalpower\" requires less CPU than \"HRTF\" but is less realistic for listeners with headphones or speakers close to the ears.\n * - \"HRTF\" requires more CPU but is more realistic for listeners with headphones or speakers close to the ears.\n *\n * Possible values are:\n * - `\"equalpower\"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.\n * - `\"HRTF\"`:Renders a stereo output of higher quality than `\"equalpower\"` — it uses a convolution with measured impulse responses from human subjects.\n */\n spatialPanningModel: \"equalpower\" | \"HRTF\";\n /**\n * The spatial position. Defaults to (0, 0, 0).\n */\n spatialPosition: Vector3;\n /**\n * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link spatialDistanceModel}\n */\n spatialReferenceDistance: number;\n /**\n * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link spatialDistanceModel}\n */\n spatialRolloffFactor: number;\n /**\n * The spatial rotation, as Euler angles. Defaults to (0, 0, 0).\n */\n spatialRotation: Vector3;\n /**\n * The spatial rotation, as a quaternion. Defaults to (0, 0, 0, 1).\n */\n spatialRotationQuaternion: Quaternion;\n}\n\n/**\n * @param options The spatial audio options to check.\n * @returns `true` if spatial audio options are defined, otherwise `false`.\n */\nexport function _HasSpatialAudioOptions(options: Partial<ISpatialAudioOptions>): boolean {\n return (\n options.spatialEnabled ||\n options.spatialAutoUpdate !== undefined ||\n options.spatialConeInnerAngle !== undefined ||\n options.spatialConeOuterAngle !== undefined ||\n options.spatialConeOuterVolume !== undefined ||\n options.spatialDistanceModel !== undefined ||\n options.spatialMaxDistance !== undefined ||\n options.spatialPanningModel !== undefined ||\n options.spatialPosition !== undefined ||\n options.spatialReferenceDistance !== undefined ||\n options.spatialRolloffFactor !== undefined ||\n options.spatialRotation !== undefined ||\n options.spatialRotationQuaternion !== undefined\n );\n}\n\n/**\n * Abstract class representing the `spatial` audio property on a sound or audio bus.\n *\n * @see {@link AudioEngineV2.listener}\n */\nexport abstract class AbstractSpatialAudio {\n /**\n * The spatial cone inner angle, in radians. Defaults to 2π.\n * - When the listener is inside the cone inner angle, the volume is at its maximum.\n */\n public abstract coneInnerAngle: number;\n\n /**\n * The spatial cone outer angle, in radians. Defaults to 2π.\n * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.\n * - When the listener is outside the cone outer angle, the volume is at its minimum.\n */\n public abstract coneOuterAngle: number;\n\n /**\n * The amount of volume reduction outside the {@link coneOuterAngle}. Defaults to 0.\n */\n public abstract coneOuterVolume: number;\n\n /**\n * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to \"inverse\".\n *\n * Possible values are:\n * - `\"linear\"`: The volume is reduced linearly as the source moves away from the listener.\n * - `\"inverse\"`: The volume is reduced inversely as the source moves away from the listener.\n * - `\"exponential\"`: The volume is reduced exponentially as the source moves away from the listener.\n *\n * @see {@link spatialMaxDistance}\n * @see {@link spatialReferenceDistance}\n * @see {@link spatialRolloffFactor}\n */\n public abstract distanceModel: \"linear\" | \"inverse\" | \"exponential\";\n\n /**\n * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.\n * - This value is used only when the {@link distanceModel} is set to `\"linear\"`.\n * @see {@link distanceModel}\n */\n public abstract maxDistance: number;\n\n /**\n * The spatial panning model. Defaults to \"equalpower\".\n * - \"equalpower\" requires less CPU than \"HRTF\" but is less realistic for listeners with headphones or speakers close to the ears.\n * - \"HRTF\" requires more CPU but is more realistic for listeners with headphones or speakers close to the ears.\n *\n * Possible values are:\n * - `\"equalpower\"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.\n * - `\"HRTF\"`:Renders a stereo output of higher quality than `\"equalpower\"` — it uses a convolution with measured impulse responses from human subjects.\n */\n public abstract panningModel: \"equalpower\" | \"HRTF\";\n\n /**\n * The spatial position. Defaults to (0, 0, 0).\n */\n public abstract position: Vector3;\n\n /**\n * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link distanceModel}\n */\n public abstract referenceDistance: number;\n\n /**\n * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link distanceModel}\n */\n public abstract rolloffFactor: number;\n\n /**\n * The spatial rotation. Defaults to (0, 0, 0).\n */\n public abstract rotation: Vector3;\n\n /**\n * The spatial rotation quaternion. Defaults to (0, 0, 0, 1).\n */\n public abstract rotationQuaternion: Quaternion;\n\n /**\n * Updates the position and rotation properties.\n */\n public abstract update(): void;\n}\n"]}
@@ -0,0 +1,59 @@
1
+ import { Quaternion, Vector3 } from "../../../Maths/math.vector";
2
+ export declare const _SpatialAudioListenerDefaults: {
3
+ readonly position: Vector3;
4
+ readonly rotation: Vector3;
5
+ readonly rotationQuaternion: Quaternion;
6
+ };
7
+ /**
8
+ * Options for spatial audio.
9
+ */
10
+ export interface ISpatialAudioListenerOptions {
11
+ /**
12
+ * Whether to automatically update the position and rotation of the listener. Defaults to `true`.
13
+ */
14
+ listenerAutoUpdate: boolean;
15
+ /**
16
+ * Set to `true` to enable the listener. Defaults to `false`.
17
+ */
18
+ listenerEnabled: boolean;
19
+ /**
20
+ * The listener position. Defaults to (0, 0, 0).
21
+ */
22
+ listenerPosition: Vector3;
23
+ /**
24
+ * The listener rotation, as Euler angles. Defaults to (0, 0, 0).
25
+ */
26
+ listenerRotation: Vector3;
27
+ /**
28
+ * The listener rotation, as a quaternion. Defaults to (0, 0, 0, 1).
29
+ */
30
+ listenerRotationQuaternion: Quaternion;
31
+ }
32
+ /**
33
+ * @param options The spatial audio listener options to check.
34
+ * @returns `true` if spatial audio listener options are defined, otherwise `false`.
35
+ */
36
+ export declare function _HasSpatialAudioListenerOptions(options: Partial<ISpatialAudioListenerOptions>): boolean;
37
+ /**
38
+ * Abstract class representing the spatial audio `listener` property on an audio engine.
39
+ *
40
+ * @see {@link AudioEngineV2.listener}
41
+ */
42
+ export declare abstract class AbstractSpatialAudioListener {
43
+ /**
44
+ * The listener position. Defaults to (0, 0, 0).
45
+ */
46
+ abstract position: Vector3;
47
+ /**
48
+ * The listener rotation, as Euler angles. Defaults to (0, 0, 0).
49
+ */
50
+ abstract rotation: Vector3;
51
+ /**
52
+ * The listener rotation, as a quaternion. Defaults to (0, 0, 0, 1).
53
+ */
54
+ abstract rotationQuaternion: Quaternion;
55
+ /**
56
+ * Updates the position and rotation properties.
57
+ */
58
+ abstract update(): void;
59
+ }
@@ -0,0 +1,21 @@
1
+ import { Quaternion, Vector3 } from "../../../Maths/math.vector.js";
2
+ export const _SpatialAudioListenerDefaults = {
3
+ position: Vector3.Zero(),
4
+ rotation: Vector3.Zero(),
5
+ rotationQuaternion: new Quaternion(),
6
+ };
7
+ /**
8
+ * @param options The spatial audio listener options to check.
9
+ * @returns `true` if spatial audio listener options are defined, otherwise `false`.
10
+ */
11
+ export function _HasSpatialAudioListenerOptions(options) {
12
+ return options.listenerPosition !== undefined || options.listenerRotation !== undefined || options.listenerRotationQuaternion !== undefined;
13
+ }
14
+ /**
15
+ * Abstract class representing the spatial audio `listener` property on an audio engine.
16
+ *
17
+ * @see {@link AudioEngineV2.listener}
18
+ */
19
+ export class AbstractSpatialAudioListener {
20
+ }
21
+ //# sourceMappingURL=abstractSpatialAudioListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractSpatialAudioListener.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,6BAA6B,GAAG;IACzC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,kBAAkB,EAAE,IAAI,UAAU,EAAE;CAC9B,CAAC;AA4BX;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAA8C;IAC1F,OAAO,OAAO,CAAC,gBAAgB,KAAK,SAAS,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS,IAAI,OAAO,CAAC,0BAA0B,KAAK,SAAS,CAAC;AAChJ,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,4BAA4B;CAoBjD","sourcesContent":["import { Quaternion, Vector3 } from \"../../../Maths/math.vector\";\n\nexport const _SpatialAudioListenerDefaults = {\n position: Vector3.Zero(),\n rotation: Vector3.Zero(),\n rotationQuaternion: new Quaternion(),\n} as const;\n\n/**\n * Options for spatial audio.\n */\nexport interface ISpatialAudioListenerOptions {\n /**\n * Whether to automatically update the position and rotation of the listener. Defaults to `true`.\n */\n listenerAutoUpdate: boolean;\n /**\n * Set to `true` to enable the listener. Defaults to `false`.\n */\n listenerEnabled: boolean;\n /**\n * The listener position. Defaults to (0, 0, 0).\n */\n listenerPosition: Vector3;\n /**\n * The listener rotation, as Euler angles. Defaults to (0, 0, 0).\n */\n listenerRotation: Vector3;\n /**\n * The listener rotation, as a quaternion. Defaults to (0, 0, 0, 1).\n */\n listenerRotationQuaternion: Quaternion;\n}\n\n/**\n * @param options The spatial audio listener options to check.\n * @returns `true` if spatial audio listener options are defined, otherwise `false`.\n */\nexport function _HasSpatialAudioListenerOptions(options: Partial<ISpatialAudioListenerOptions>): boolean {\n return options.listenerPosition !== undefined || options.listenerRotation !== undefined || options.listenerRotationQuaternion !== undefined;\n}\n\n/**\n * Abstract class representing the spatial audio `listener` property on an audio engine.\n *\n * @see {@link AudioEngineV2.listener}\n */\nexport abstract class AbstractSpatialAudioListener {\n /**\n * The listener position. Defaults to (0, 0, 0).\n */\n public abstract position: Vector3;\n\n /**\n * The listener rotation, as Euler angles. Defaults to (0, 0, 0).\n */\n public abstract rotation: Vector3;\n\n /**\n * The listener rotation, as a quaternion. Defaults to (0, 0, 0, 1).\n */\n public abstract rotationQuaternion: Quaternion;\n\n /**\n * Updates the position and rotation properties.\n */\n public abstract update(): void;\n}\n"]}
@@ -0,0 +1,38 @@
1
+ export declare const _StereoAudioDefaults: {
2
+ readonly pan: number;
3
+ };
4
+ /** */
5
+ export interface IStereoAudioOptions {
6
+ /**
7
+ * Enable stereo. Defaults to false.
8
+ *
9
+ * When set to `true`, the audio node's stereo properties will be initialized on creation and there will be no
10
+ * delay when setting the first stereo value.
11
+ *
12
+ * When not specified, or set to `false`, the audio node's stereo properties will not be initialized on creation
13
+ * and there will be a small delay when setting the first stereo value.
14
+ *
15
+ * - This option is ignored if any other stereo options are set.
16
+ */
17
+ stereoEnabled: boolean;
18
+ /**
19
+ * The stereo pan from -1 (left) to 1 (right). Defaults to 0.
20
+ */
21
+ stereoPan: number;
22
+ }
23
+ /**
24
+ * @param options The stereo audio options to check.
25
+ * @returns `true` if stereo audio options are defined, otherwise `false`.
26
+ */
27
+ export declare function _HasStereoAudioOptions(options: Partial<IStereoAudioOptions>): boolean;
28
+ /**
29
+ * Abstract class representing the `stereo` audio property on a sound or audio bus.
30
+ *
31
+ * @see {@link AudioEngineV2.listener}
32
+ */
33
+ export declare abstract class AbstractStereoAudio {
34
+ /**
35
+ * The stereo pan from -1 (left) to 1 (right). Defaults to 0.
36
+ */
37
+ abstract pan: number;
38
+ }
@@ -0,0 +1,18 @@
1
+ export const _StereoAudioDefaults = {
2
+ pan: 0,
3
+ };
4
+ /**
5
+ * @param options The stereo audio options to check.
6
+ * @returns `true` if stereo audio options are defined, otherwise `false`.
7
+ */
8
+ export function _HasStereoAudioOptions(options) {
9
+ return options.stereoEnabled || options.stereoPan !== undefined;
10
+ }
11
+ /**
12
+ * Abstract class representing the `stereo` audio property on a sound or audio bus.
13
+ *
14
+ * @see {@link AudioEngineV2.listener}
15
+ */
16
+ export class AbstractStereoAudio {
17
+ }
18
+ //# sourceMappingURL=abstractStereoAudio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractStereoAudio.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractStereoAudio.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,GAAG,EAAE,CAAW;CACV,CAAC;AAsBX;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAqC;IACxE,OAAO,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,mBAAmB;CAKxC","sourcesContent":["export const _StereoAudioDefaults = {\n pan: 0 as number,\n} as const;\n\n/** */\nexport interface IStereoAudioOptions {\n /**\n * Enable stereo. Defaults to false.\n *\n * When set to `true`, the audio node's stereo properties will be initialized on creation and there will be no\n * delay when setting the first stereo value.\n *\n * When not specified, or set to `false`, the audio node's stereo properties will not be initialized on creation\n * and there will be a small delay when setting the first stereo value.\n *\n * - This option is ignored if any other stereo options are set.\n */\n stereoEnabled: boolean;\n /**\n * The stereo pan from -1 (left) to 1 (right). Defaults to 0.\n */\n stereoPan: number;\n}\n\n/**\n * @param options The stereo audio options to check.\n * @returns `true` if stereo audio options are defined, otherwise `false`.\n */\nexport function _HasStereoAudioOptions(options: Partial<IStereoAudioOptions>): boolean {\n return options.stereoEnabled || options.stereoPan !== undefined;\n}\n\n/**\n * Abstract class representing the `stereo` audio property on a sound or audio bus.\n *\n * @see {@link AudioEngineV2.listener}\n */\nexport abstract class AbstractStereoAudio {\n /**\n * The stereo pan from -1 (left) to 1 (right). Defaults to 0.\n */\n public abstract pan: number;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export * from "./abstractSpatialAudio";
2
+ export * from "./abstractSpatialAudioListener";
3
+ export * from "./abstractStereoAudio";
@@ -0,0 +1,4 @@
1
+ export * from "./abstractSpatialAudio.js";
2
+ export * from "./abstractSpatialAudioListener.js";
3
+ export * from "./abstractStereoAudio.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./abstractSpatialAudio\";\nexport * from \"./abstractSpatialAudioListener\";\nexport * from \"./abstractStereoAudio\";\n"]}
@@ -0,0 +1,49 @@
1
+ import type { Quaternion, Vector3 } from "../../../Maths/math.vector";
2
+ import type { _AbstractAudioSubGraph } from "../subNodes/abstractAudioSubGraph";
3
+ import { AbstractSpatialAudio } from "./abstractSpatialAudio";
4
+ /** @internal */
5
+ export declare class _SpatialAudio extends AbstractSpatialAudio {
6
+ private _position;
7
+ private _rotation;
8
+ private _rotationQuaternion;
9
+ private _subGraph;
10
+ /** @internal */
11
+ constructor(subGraph: _AbstractAudioSubGraph);
12
+ /** @internal */
13
+ get coneInnerAngle(): number;
14
+ set coneInnerAngle(value: number);
15
+ /** @internal */
16
+ get coneOuterAngle(): number;
17
+ set coneOuterAngle(value: number);
18
+ /** @internal */
19
+ get coneOuterVolume(): number;
20
+ set coneOuterVolume(value: number);
21
+ /** @internal */
22
+ get distanceModel(): DistanceModelType;
23
+ set distanceModel(value: DistanceModelType);
24
+ /** @internal */
25
+ get maxDistance(): number;
26
+ set maxDistance(value: number);
27
+ /** @internal */
28
+ get panningModel(): PanningModelType;
29
+ set panningModel(value: PanningModelType);
30
+ /** @internal */
31
+ get position(): Vector3;
32
+ set position(value: Vector3);
33
+ /** @internal */
34
+ get referenceDistance(): number;
35
+ set referenceDistance(value: number);
36
+ /** @internal */
37
+ get rolloffFactor(): number;
38
+ set rolloffFactor(value: number);
39
+ /** @internal */
40
+ get rotation(): Vector3;
41
+ set rotation(value: Vector3);
42
+ /** @internal */
43
+ get rotationQuaternion(): Quaternion;
44
+ set rotationQuaternion(value: Quaternion);
45
+ /** @internal */
46
+ update(): void;
47
+ private _updatePosition;
48
+ private _updateRotation;
49
+ }