@types/three 0.173.0 → 0.175.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 (136) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +1 -1
  3. three/examples/jsm/animation/CCDIKSolver.d.ts +3 -2
  4. three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
  5. three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
  6. three/examples/jsm/interactive/HTMLMesh.d.ts +9 -2
  7. three/examples/jsm/loaders/LUTImageLoader.d.ts +2 -2
  8. three/examples/jsm/loaders/MTLLoader.d.ts +2 -1
  9. three/examples/jsm/misc/Timer.d.ts +13 -2
  10. three/examples/jsm/objects/Reflector.d.ts +1 -0
  11. three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
  12. three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
  13. three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
  14. three/examples/jsm/transpiler/AST.d.ts +218 -1
  15. three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
  16. three/examples/jsm/tsl/math/Bayer.d.ts +4 -0
  17. three/examples/jsm/tsl/utils/Raymarching.d.ts +9 -0
  18. three/examples/jsm/webxr/VRButton.d.ts +4 -2
  19. three/package.json +2 -2
  20. three/src/Three.TSL.d.ts +7 -1
  21. three/src/Three.d.ts +6 -1
  22. three/src/animation/AnimationAction.d.ts +219 -19
  23. three/src/animation/AnimationClip.d.ts +140 -28
  24. three/src/animation/AnimationMixer.d.ts +100 -8
  25. three/src/animation/AnimationObjectGroup.d.ts +55 -14
  26. three/src/animation/AnimationUtils.d.ts +154 -43
  27. three/src/animation/KeyframeTrack.d.ts +134 -25
  28. three/src/animation/PropertyBinding.d.ts +89 -31
  29. three/src/animation/PropertyMixer.d.ts +62 -5
  30. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
  31. three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
  32. three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
  33. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
  34. three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
  35. three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
  36. three/src/constants.d.ts +2 -2
  37. three/src/core/BufferAttribute.d.ts +11 -0
  38. three/src/core/BufferGeometry.d.ts +1 -3
  39. three/src/core/Raycaster.d.ts +4 -0
  40. three/src/extras/Controls.d.ts +1 -1
  41. three/src/extras/Earcut.d.ts +5 -3
  42. three/src/extras/ImageUtils.d.ts +1 -0
  43. three/src/extras/PMREMGenerator.d.ts +15 -2
  44. three/src/geometries/TorusGeometry.d.ts +5 -6
  45. three/src/lights/PointLight.d.ts +1 -1
  46. three/src/loaders/FileLoader.d.ts +2 -2
  47. three/src/loaders/LoaderUtils.d.ts +0 -5
  48. three/src/materials/Material.d.ts +3 -0
  49. three/src/materials/nodes/NodeMaterial.d.ts +2 -1
  50. three/src/materials/nodes/VolumeNodeMaterial.d.ts +14 -2
  51. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +4 -4
  52. three/src/nodes/Nodes.d.ts +2 -2
  53. three/src/nodes/TSL.d.ts +1 -0
  54. three/src/nodes/accessors/BufferAttributeNode.d.ts +36 -26
  55. three/src/nodes/accessors/Lights.d.ts +1 -1
  56. three/src/nodes/accessors/MaterialProperties.d.ts +5 -0
  57. three/src/nodes/accessors/ModelNode.d.ts +1 -0
  58. three/src/nodes/accessors/Object3DNode.d.ts +7 -5
  59. three/src/nodes/accessors/SkinningNode.d.ts +4 -3
  60. three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
  61. three/src/nodes/accessors/Texture3DNode.d.ts +2 -2
  62. three/src/nodes/accessors/TextureNode.d.ts +3 -1
  63. three/src/nodes/code/ExpressionNode.d.ts +3 -2
  64. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  65. three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
  66. three/src/nodes/core/LightingModel.d.ts +13 -28
  67. three/src/nodes/core/Node.d.ts +24 -24
  68. three/src/nodes/core/NodeAttribute.d.ts +3 -3
  69. three/src/nodes/core/NodeCache.d.ts +2 -2
  70. three/src/nodes/core/NodeParser.d.ts +1 -1
  71. three/src/nodes/core/NodeUniform.d.ts +4 -4
  72. three/src/nodes/core/NodeVar.d.ts +4 -4
  73. three/src/nodes/core/NodeVarying.d.ts +2 -2
  74. three/src/nodes/core/StructTypeNode.d.ts +3 -3
  75. three/src/nodes/core/UniformNode.d.ts +7 -7
  76. three/src/nodes/core/constants.d.ts +0 -1
  77. three/src/nodes/display/PassNode.d.ts +10 -1
  78. three/src/nodes/functions/BSDF/LTC.d.ts +5 -1
  79. three/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
  80. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +1 -12
  81. three/src/nodes/lighting/AnalyticLightNode.d.ts +13 -1
  82. three/src/nodes/lighting/LightingContextNode.d.ts +18 -4
  83. three/src/nodes/lighting/LightsNode.d.ts +24 -0
  84. three/src/nodes/lighting/PointLightNode.d.ts +8 -7
  85. three/src/nodes/lighting/ShadowBaseNode.d.ts +3 -0
  86. three/src/nodes/math/ConditionalNode.d.ts +4 -4
  87. three/src/nodes/math/MathNode.d.ts +20 -12
  88. three/src/nodes/math/OperatorNode.d.ts +57 -26
  89. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  90. three/src/nodes/tsl/TSLCore.d.ts +3 -0
  91. three/src/nodes/utils/DebugNode.d.ts +20 -0
  92. three/src/nodes/utils/ReflectorNode.d.ts +1 -0
  93. three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
  94. three/src/objects/LOD.d.ts +4 -3
  95. three/src/renderers/common/Animation.d.ts +6 -6
  96. three/src/renderers/common/Attributes.d.ts +2 -2
  97. three/src/renderers/common/BindGroup.d.ts +2 -2
  98. three/src/renderers/common/Binding.d.ts +2 -2
  99. three/src/renderers/common/Buffer.d.ts +3 -3
  100. three/src/renderers/common/BufferUtils.d.ts +7 -8
  101. three/src/renderers/common/BundleGroup.d.ts +2 -2
  102. three/src/renderers/common/ChainMap.d.ts +3 -3
  103. three/src/renderers/common/ClippingContext.d.ts +3 -3
  104. three/src/renderers/common/Color4.d.ts +8 -8
  105. three/src/renderers/common/ComputePipeline.d.ts +1 -1
  106. three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
  107. three/src/renderers/common/DataMap.d.ts +2 -2
  108. three/src/renderers/common/Geometries.d.ts +4 -4
  109. three/src/renderers/common/Info.d.ts +2 -2
  110. three/src/renderers/common/Pipeline.d.ts +1 -1
  111. three/src/renderers/common/Pipelines.d.ts +9 -9
  112. three/src/renderers/common/ProgrammableStage.d.ts +4 -4
  113. three/src/renderers/common/RenderContext.d.ts +2 -2
  114. three/src/renderers/common/RenderContexts.d.ts +3 -3
  115. three/src/renderers/common/RenderList.d.ts +11 -11
  116. three/src/renderers/common/RenderObject.d.ts +13 -13
  117. three/src/renderers/common/RenderObjects.d.ts +3 -3
  118. three/src/renderers/common/RenderPipeline.d.ts +1 -1
  119. three/src/renderers/common/Renderer.d.ts +143 -108
  120. three/src/renderers/common/Textures.d.ts +6 -6
  121. three/src/renderers/common/TimestampQueryPool.d.ts +13 -1
  122. three/src/renderers/common/Uniform.d.ts +13 -13
  123. three/src/renderers/common/UniformBuffer.d.ts +1 -1
  124. three/src/renderers/common/UniformsGroup.d.ts +13 -13
  125. three/src/renderers/common/XRManager.d.ts +79 -15
  126. three/src/renderers/common/XRRenderTarget.d.ts +4 -4
  127. three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -2
  128. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
  129. three/src/renderers/common/nodes/NodeLibrary.d.ts +11 -11
  130. three/src/renderers/common/nodes/NodeUniform.d.ts +9 -9
  131. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -1
  132. three/src/renderers/common/nodes/Nodes.d.ts +11 -11
  133. three/src/renderers/webgl/WebGLState.d.ts +7 -6
  134. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
  135. three/src/textures/CanvasTexture.d.ts +1 -1
  136. three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
@@ -75,7 +75,7 @@ declare class Textures extends DataMap<{
75
75
  * it updates the texture states representing the attachments of the framebuffer.
76
76
  *
77
77
  * @param {RenderTarget} renderTarget - The render target to update.
78
- * @param {Number} [activeMipmapLevel=0] - The active mipmap level.
78
+ * @param {number} [activeMipmapLevel=0] - The active mipmap level.
79
79
  */
80
80
  updateRenderTarget(renderTarget: RenderTarget, activeMipmapLevel?: number): void;
81
81
  /**
@@ -104,23 +104,23 @@ declare class Textures extends DataMap<{
104
104
  * Computes the number of mipmap levels for the given texture.
105
105
  *
106
106
  * @param {Texture} texture - The texture.
107
- * @param {Number} width - The texture's width.
108
- * @param {Number} height - The texture's height.
109
- * @return {Number} The number of mipmap levels.
107
+ * @param {number} width - The texture's width.
108
+ * @param {number} height - The texture's height.
109
+ * @return {number} The number of mipmap levels.
110
110
  */
111
111
  getMipLevels(texture: Texture, width: number, height: number): number;
112
112
  /**
113
113
  * Returns `true` if the given texture requires mipmaps.
114
114
  *
115
115
  * @param {Texture} texture - The texture.
116
- * @return {Boolean} Whether mipmaps are required or not.
116
+ * @return {boolean} Whether mipmaps are required or not.
117
117
  */
118
118
  needsMipmaps(texture: Texture): boolean;
119
119
  /**
120
120
  * Returns `true` if the given texture is an environment map.
121
121
  *
122
122
  * @param {Texture} texture - The texture.
123
- * @return {Boolean} Whether the given texture is an environment map or not.
123
+ * @return {boolean} Whether the given texture is an environment map or not.
124
124
  */
125
125
  isEnvironmentTexture(texture: Texture): boolean;
126
126
  /**
@@ -1,4 +1,9 @@
1
1
  import RenderContext from "./RenderContext.js";
2
+ /**
3
+ * Abstract base class of a timestamp query pool.
4
+ *
5
+ * @abstract
6
+ */
2
7
  declare abstract class TimestampQueryPool {
3
8
  trackTimestamp: boolean;
4
9
  maxQueries: number;
@@ -7,18 +12,25 @@ declare abstract class TimestampQueryPool {
7
12
  isDisposed: boolean;
8
13
  lastValue: number;
9
14
  pendingResolve: boolean;
15
+ /**
16
+ * Creates a new timestamp query pool.
17
+ *
18
+ * @param {number} [maxQueries=256] - Maximum number of queries this pool can hold.
19
+ */
10
20
  constructor(maxQueries?: number);
11
21
  /**
12
22
  * Allocate queries for a specific renderContext.
13
23
  *
14
24
  * @abstract
25
+ * @param {Object} renderContext - The render context to allocate queries for.
15
26
  */
16
27
  abstract allocateQueriesForContext(renderContext: RenderContext): number | null;
17
28
  /**
18
29
  * Resolve all timestamps and return data (or process them).
19
30
  *
20
31
  * @abstract
21
- * @returns {Promise<Number>|Number} The resolved timestamp value.
32
+ * @async
33
+ * @returns {Promise<number>|number} The resolved timestamp value.
22
34
  */
23
35
  abstract resolveQueriesAsync(): Promise<number>;
24
36
  /**
@@ -20,20 +20,20 @@ declare class Uniform<TValue> {
20
20
  /**
21
21
  * Constructs a new uniform.
22
22
  *
23
- * @param {String} name - The uniform's name.
24
- * @param {Any} value - The uniform's value.
23
+ * @param {string} name - The uniform's name.
24
+ * @param {any} value - The uniform's value.
25
25
  */
26
26
  constructor(name: string, value: TValue);
27
27
  /**
28
28
  * Sets the uniform's value.
29
29
  *
30
- * @param {Any} value - The value to set.
30
+ * @param {any} value - The value to set.
31
31
  */
32
32
  setValue(value: TValue): void;
33
33
  /**
34
34
  * Returns the uniform's value.
35
35
  *
36
- * @return {Any} The value.
36
+ * @return {any} The value.
37
37
  */
38
38
  getValue(): TValue;
39
39
  }
@@ -48,8 +48,8 @@ declare class NumberUniform extends Uniform<number> {
48
48
  /**
49
49
  * Constructs a new Number uniform.
50
50
  *
51
- * @param {String} name - The uniform's name.
52
- * @param {Number} value - The uniform's value.
51
+ * @param {string} name - The uniform's name.
52
+ * @param {number} value - The uniform's value.
53
53
  */
54
54
  constructor(name: string, value?: number);
55
55
  }
@@ -64,7 +64,7 @@ declare class Vector2Uniform extends Uniform<Vector2> {
64
64
  /**
65
65
  * Constructs a new Number uniform.
66
66
  *
67
- * @param {String} name - The uniform's name.
67
+ * @param {string} name - The uniform's name.
68
68
  * @param {Vector2} value - The uniform's value.
69
69
  */
70
70
  constructor(name: string, value?: Vector2);
@@ -80,7 +80,7 @@ declare class Vector3Uniform extends Uniform<Vector3> {
80
80
  /**
81
81
  * Constructs a new Number uniform.
82
82
  *
83
- * @param {String} name - The uniform's name.
83
+ * @param {string} name - The uniform's name.
84
84
  * @param {Vector3} value - The uniform's value.
85
85
  */
86
86
  constructor(name: string, value?: Vector3);
@@ -96,7 +96,7 @@ declare class Vector4Uniform extends Uniform<Vector4> {
96
96
  /**
97
97
  * Constructs a new Number uniform.
98
98
  *
99
- * @param {String} name - The uniform's name.
99
+ * @param {string} name - The uniform's name.
100
100
  * @param {Vector4} value - The uniform's value.
101
101
  */
102
102
  constructor(name: string, value?: Vector4);
@@ -112,7 +112,7 @@ declare class ColorUniform extends Uniform<Color> {
112
112
  /**
113
113
  * Constructs a new Number uniform.
114
114
  *
115
- * @param {String} name - The uniform's name.
115
+ * @param {string} name - The uniform's name.
116
116
  * @param {Color} value - The uniform's value.
117
117
  */
118
118
  constructor(name: string, value?: Color);
@@ -128,7 +128,7 @@ declare class Matrix2Uniform extends Uniform<Matrix2> {
128
128
  /**
129
129
  * Constructs a new Number uniform.
130
130
  *
131
- * @param {String} name - The uniform's name.
131
+ * @param {string} name - The uniform's name.
132
132
  * @param {Matrix2} value - The uniform's value.
133
133
  */
134
134
  constructor(name: string, value?: Matrix2);
@@ -144,7 +144,7 @@ declare class Matrix3Uniform extends Uniform<Matrix3> {
144
144
  /**
145
145
  * Constructs a new Number uniform.
146
146
  *
147
- * @param {String} name - The uniform's name.
147
+ * @param {string} name - The uniform's name.
148
148
  * @param {Matrix3} value - The uniform's value.
149
149
  */
150
150
  constructor(name: string, value?: Matrix3);
@@ -160,7 +160,7 @@ declare class Matrix4Uniform extends Uniform<Matrix4> {
160
160
  /**
161
161
  * Constructs a new Number uniform.
162
162
  *
163
- * @param {String} name - The uniform's name.
163
+ * @param {string} name - The uniform's name.
164
164
  * @param {Matrix4} value - The uniform's value.
165
165
  */
166
166
  constructor(name: string, value?: Matrix4);
@@ -10,7 +10,7 @@ declare class UniformBuffer extends Buffer {
10
10
  /**
11
11
  * Constructs a new uniform buffer.
12
12
  *
13
- * @param {String} name - The buffer's name.
13
+ * @param {string} name - The buffer's name.
14
14
  * @param {TypedArray} [buffer=null] - The buffer.
15
15
  */
16
16
  constructor(name?: string, buffer?: null);
@@ -23,7 +23,7 @@ declare class UniformsGroup extends UniformBuffer {
23
23
  /**
24
24
  * Constructs a new uniforms group.
25
25
  *
26
- * @param {String} name - The group's name.
26
+ * @param {string} name - The group's name.
27
27
  */
28
28
  constructor(name?: string);
29
29
  /**
@@ -43,7 +43,7 @@ declare class UniformsGroup extends UniformBuffer {
43
43
  /**
44
44
  * An array with the raw uniform values.
45
45
  *
46
- * @type {Array<Number>}
46
+ * @type {Array<number>}
47
47
  */
48
48
  get values(): number[];
49
49
  /**
@@ -55,7 +55,7 @@ declare class UniformsGroup extends UniformBuffer {
55
55
  /**
56
56
  * The byte length of the buffer with correct buffer alignment.
57
57
  *
58
- * @type {Number}
58
+ * @type {number}
59
59
  */
60
60
  get byteLength(): number;
61
61
  /**
@@ -64,7 +64,7 @@ declare class UniformsGroup extends UniformBuffer {
64
64
  * values has actually changed so this method only returns
65
65
  * `true` if there is a real value change.
66
66
  *
67
- * @return {Boolean} Whether the uniforms have been updated and
67
+ * @return {boolean} Whether the uniforms have been updated and
68
68
  * must be uploaded to the GPU.
69
69
  */
70
70
  update(): boolean;
@@ -73,62 +73,62 @@ declare class UniformsGroup extends UniformBuffer {
73
73
  * the uniforms type.
74
74
  *
75
75
  * @param {Uniform} uniform - The uniform to update.
76
- * @return {Boolean} Whether the uniform has been updated or not.
76
+ * @return {boolean} Whether the uniform has been updated or not.
77
77
  */
78
78
  updateByType(uniform: NodeUniformGPU): boolean | undefined;
79
79
  /**
80
80
  * Updates a given Number uniform.
81
81
  *
82
82
  * @param {NumberUniform} uniform - The Number uniform.
83
- * @return {Boolean} Whether the uniform has been updated or not.
83
+ * @return {boolean} Whether the uniform has been updated or not.
84
84
  */
85
85
  updateNumber(uniform: NumberNodeUniform): boolean;
86
86
  /**
87
87
  * Updates a given Vector2 uniform.
88
88
  *
89
89
  * @param {Vector2Uniform} uniform - The Vector2 uniform.
90
- * @return {Boolean} Whether the uniform has been updated or not.
90
+ * @return {boolean} Whether the uniform has been updated or not.
91
91
  */
92
92
  updateVector2(uniform: Vector2NodeUniform): boolean;
93
93
  /**
94
94
  * Updates a given Vector3 uniform.
95
95
  *
96
96
  * @param {Vector3Uniform} uniform - The Vector3 uniform.
97
- * @return {Boolean} Whether the uniform has been updated or not.
97
+ * @return {boolean} Whether the uniform has been updated or not.
98
98
  */
99
99
  updateVector3(uniform: Vector3NodeUniform): boolean;
100
100
  /**
101
101
  * Updates a given Vector4 uniform.
102
102
  *
103
103
  * @param {Vector4Uniform} uniform - The Vector4 uniform.
104
- * @return {Boolean} Whether the uniform has been updated or not.
104
+ * @return {boolean} Whether the uniform has been updated or not.
105
105
  */
106
106
  updateVector4(uniform: Vector4NodeUniform): boolean;
107
107
  /**
108
108
  * Updates a given Color uniform.
109
109
  *
110
110
  * @param {ColorUniform} uniform - The Color uniform.
111
- * @return {Boolean} Whether the uniform has been updated or not.
111
+ * @return {boolean} Whether the uniform has been updated or not.
112
112
  */
113
113
  updateColor(uniform: ColorNodeUniform): boolean;
114
114
  /**
115
115
  * Updates a given Matrix3 uniform.
116
116
  *
117
117
  * @param {Matrix3Uniform} uniform - The Matrix3 uniform.
118
- * @return {Boolean} Whether the uniform has been updated or not.
118
+ * @return {boolean} Whether the uniform has been updated or not.
119
119
  */
120
120
  updateMatrix3(uniform: Matrix3NodeUniform): boolean;
121
121
  /**
122
122
  * Updates a given Matrix4 uniform.
123
123
  *
124
124
  * @param {Matrix4Uniform} uniform - The Matrix4 uniform.
125
- * @return {Boolean} Whether the uniform has been updated or not.
125
+ * @return {boolean} Whether the uniform has been updated or not.
126
126
  */
127
127
  updateMatrix4(uniform: Matrix4NodeUniform): boolean;
128
128
  /**
129
129
  * Returns a typed array that matches the given data type.
130
130
  *
131
- * @param {String} type - The data type.
131
+ * @param {string} type - The data type.
132
132
  * @return {TypedArray} The typed array.
133
133
  */
134
134
  _getBufferForType(type: string | null): Int32Array | Uint32Array | Float32Array;
@@ -1,8 +1,14 @@
1
1
  import { ArrayCamera } from "../../cameras/ArrayCamera.js";
2
2
  import { PerspectiveCamera } from "../../cameras/PerspectiveCamera.js";
3
3
  import { EventDispatcher } from "../../core/EventDispatcher.js";
4
- import { RenderTarget } from "../../core/RenderTarget.js";
4
+ import { CylinderGeometry } from "../../geometries/CylinderGeometry.js";
5
+ import { PlaneGeometry } from "../../geometries/PlaneGeometry.js";
6
+ import { Material } from "../../materials/Material.js";
7
+ import { MeshBasicMaterial } from "../../materials/MeshBasicMaterial.js";
8
+ import { Quaternion } from "../../math/Quaternion.js";
5
9
  import { Vector2 } from "../../math/Vector2.js";
10
+ import { Vector3 } from "../../math/Vector3.js";
11
+ import { Mesh } from "../../objects/Mesh.js";
6
12
  import { WebXRController } from "../webxr/WebXRController.js";
7
13
  import { AnimationContext } from "./Animation.js";
8
14
  import Renderer from "./Renderer.js";
@@ -14,6 +20,39 @@ export interface XRManagerEventMap {
14
20
  data: XRFrame;
15
21
  };
16
22
  }
23
+ export interface XRQuadLayerObject {
24
+ type: "quad";
25
+ width: number;
26
+ height: number;
27
+ translation: Vector3;
28
+ quaternion: Quaternion;
29
+ pixelwidth: number;
30
+ pixelheight: number;
31
+ plane: Mesh;
32
+ material: Material;
33
+ rendercall: () => void;
34
+ renderTarget: XRRenderTarget;
35
+ xrlayer?: XRLayer;
36
+ }
37
+ export interface XRCylinderLayerObject {
38
+ type: "cylinder";
39
+ radius: number;
40
+ centralAngle: number;
41
+ aspectratio: number;
42
+ translation: Vector3;
43
+ quaternion: Quaternion;
44
+ pixelwidth: number;
45
+ pixelheight: number;
46
+ plane: Mesh;
47
+ material: Material;
48
+ rendercall: () => void;
49
+ renderTarget: XRRenderTarget;
50
+ xrlayer?: XRLayer;
51
+ }
52
+ export type XRLayerObject = XRQuadLayerObject | XRCylinderLayerObject;
53
+ export interface LayerAttributes {
54
+ stencil?: boolean | undefined;
55
+ }
17
56
  /**
18
57
  * The XR manager is built on top of the WebXR Device API to
19
58
  * manage XR sessions with `WebGPURenderer`.
@@ -35,8 +74,11 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
35
74
  _currentDepthFar: number | null;
36
75
  _controllers: WebXRController[];
37
76
  _controllerInputSources: (XRInputSource | null)[];
38
- _currentRenderTarget: RenderTarget | null;
39
77
  _xrRenderTarget: XRRenderTarget | null;
78
+ _layers: XRLayerObject[];
79
+ _supportsLayers: boolean;
80
+ _createXRLayer: (layer: XRLayerObject) => XRLayer;
81
+ _gl: WebGL2RenderingContext | null;
40
82
  _currentAnimationContext: AnimationContext | null;
41
83
  _currentAnimationLoop: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null;
42
84
  _currentPixelRatio: number | null;
@@ -67,7 +109,7 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
67
109
  * of a XR controller in target ray space. The requested controller is defined
68
110
  * by the given index.
69
111
  *
70
- * @param {Number} index - The index of the XR controller.
112
+ * @param {number} index - The index of the XR controller.
71
113
  * @return {Group} A group that represents the controller's transformation.
72
114
  */
73
115
  getController(index: number): import("../webxr/WebXRController.js").XRTargetRaySpace;
@@ -76,7 +118,7 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
76
118
  * of a XR controller in grip space. The requested controller is defined
77
119
  * by the given index.
78
120
  *
79
- * @param {Number} index - The index of the XR controller.
121
+ * @param {number} index - The index of the XR controller.
80
122
  * @return {Group} A group that represents the controller's transformation.
81
123
  */
82
124
  getControllerGrip(index: number): import("../webxr/WebXRController.js").XRGripSpace;
@@ -85,27 +127,27 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
85
127
  * of a XR controller in hand space. The requested controller is defined
86
128
  * by the given index.
87
129
  *
88
- * @param {Number} index - The index of the XR controller.
130
+ * @param {number} index - The index of the XR controller.
89
131
  * @return {Group} A group that represents the controller's transformation.
90
132
  */
91
133
  getHand(index: number): import("../webxr/WebXRController.js").XRHandSpace;
92
134
  /**
93
135
  * Returns the foveation value.
94
136
  *
95
- * @return {Number|undefined} The foveation value. Returns `undefined` if no base or projection layer is defined.
137
+ * @return {number|undefined} The foveation value. Returns `undefined` if no base or projection layer is defined.
96
138
  */
97
139
  getFoveation(): number | undefined;
98
140
  /**
99
141
  * Sets the foveation value.
100
142
  *
101
- * @param {Number} foveation - A number in the range `[0,1]` where `0` means no foveation (full resolution)
143
+ * @param {number} foveation - A number in the range `[0,1]` where `0` means no foveation (full resolution)
102
144
  * and `1` means maximum foveation (the edges render at lower resolution).
103
145
  */
104
146
  setFoveation(foveation: number): void;
105
147
  /**
106
148
  * Returns the framebuffer scale factor.
107
149
  *
108
- * @return {Number} The framebuffer scale factor.
150
+ * @return {number} The framebuffer scale factor.
109
151
  */
110
152
  getFramebufferScaleFactor(): number;
111
153
  /**
@@ -113,13 +155,13 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
113
155
  *
114
156
  * This method can not be used during a XR session.
115
157
  *
116
- * @param {Number} factor - The framebuffer scale factor.
158
+ * @param {number} factor - The framebuffer scale factor.
117
159
  */
118
160
  setFramebufferScaleFactor(factor: number): void;
119
161
  /**
120
162
  * Returns the reference space type.
121
163
  *
122
- * @return {String} The reference space type.
164
+ * @return {XRReferenceSpaceType} The reference space type.
123
165
  */
124
166
  getReferenceSpaceType(): XRReferenceSpaceType;
125
167
  /**
@@ -127,7 +169,7 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
127
169
  *
128
170
  * This method can not be used during a XR session.
129
171
  *
130
- * @param {String} type - The reference space type.
172
+ * @param {XRReferenceSpaceType} type - The reference space type.
131
173
  */
132
174
  setReferenceSpaceType(type: XRReferenceSpaceType): void;
133
175
  /**
@@ -151,19 +193,41 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
151
193
  /**
152
194
  * Returns the environment blend mode from the current XR session.
153
195
  *
154
- * @return {('opaque'|'additive'|'alpha-blend')?} The environment blend mode. Returns `null` when used outside of a XR session.
196
+ * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session.
155
197
  */
156
198
  getEnvironmentBlendMode(): XREnvironmentBlendMode | undefined;
157
199
  /**
158
200
  * Returns the current XR frame.
159
201
  *
160
- * @return {XRFrame?} The XR frame. Returns `null` when used outside a XR session.
202
+ * @return {?XRFrame} The XR frame. Returns `null` when used outside a XR session.
161
203
  */
162
204
  getFrame(): XRFrame | null;
205
+ createQuadLayer(
206
+ width: number,
207
+ height: number,
208
+ translation: Vector3,
209
+ quaternion: Quaternion,
210
+ pixelwidth: number,
211
+ pixelheight: number,
212
+ rendercall: () => void,
213
+ attributes?: LayerAttributes,
214
+ ): Mesh<PlaneGeometry, MeshBasicMaterial, import("../../core/Object3D.js").Object3DEventMap>;
215
+ createCylinderLayer(
216
+ radius: number,
217
+ centralAngle: number,
218
+ aspectratio: number,
219
+ translation: Vector3,
220
+ quaternion: Quaternion,
221
+ pixelwidth: number,
222
+ pixelheight: number,
223
+ rendercall: () => void,
224
+ attributes?: LayerAttributes,
225
+ ): Mesh<CylinderGeometry, MeshBasicMaterial, import("../../core/Object3D.js").Object3DEventMap>;
226
+ renderLayers(): void;
163
227
  /**
164
228
  * Returns the current XR session.
165
229
  *
166
- * @return {XRSession?} The XR session. Returns `null` when used outside a XR session.
230
+ * @return {?XRSession} The XR session. Returns `null` when used outside a XR session.
167
231
  */
168
232
  getSession(): XRSession | null;
169
233
  /**
@@ -188,7 +252,7 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
188
252
  * Returns a WebXR controller for the given controller index.
189
253
  *
190
254
  * @private
191
- * @param {Number} index - The controller index.
255
+ * @param {number} index - The controller index.
192
256
  * @return {WebXRController} The XR controller.
193
257
  */
194
258
  _getController(index: number): WebXRController;
@@ -1,4 +1,4 @@
1
- import { RenderTarget } from "../../core/RenderTarget.js";
1
+ import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
2
2
  /**
3
3
  * A special type of render target that is used when rendering
4
4
  * with the WebXR Device API.
@@ -13,11 +13,11 @@ declare class XRRenderTarget extends RenderTarget {
13
13
  /**
14
14
  * Constructs a new XR render target.
15
15
  *
16
- * @param {Number} [width=1] - The width of the render target.
17
- * @param {Number} [height=1] - The height of the render target.
16
+ * @param {number} [width=1] - The width of the render target.
17
+ * @param {number} [height=1] - The height of the render target.
18
18
  * @param {Object} [options={}] - The configuration options.
19
19
  */
20
- constructor(width?: number, height?: number, options?: {});
20
+ constructor(width?: number, height?: number, options?: RenderTargetOptions);
21
21
  copy(source: XRRenderTarget): this;
22
22
  }
23
23
  export { XRRenderTarget };
@@ -1,7 +1,14 @@
1
1
  import { RenderTarget } from "../../../core/RenderTarget.js";
2
+ import { Vector3 } from "../../../math/Vector3.js";
2
3
  import { Scene } from "../../../scenes/Scene.js";
3
4
  import Renderer from "../Renderer.js";
4
5
 
6
+ export interface PMREMGeneratorOptions {
7
+ size?: number | undefined;
8
+ position?: Vector3 | undefined;
9
+ renderTarget?: RenderTarget | null | undefined;
10
+ }
11
+
5
12
  declare class PMREMGenerator {
6
13
  constructor(renderer: Renderer);
7
14
 
@@ -10,7 +17,7 @@ declare class PMREMGenerator {
10
17
  sigma?: number,
11
18
  near?: number,
12
19
  far?: number,
13
- renderTarget?: RenderTarget | null,
20
+ options?: PMREMGeneratorOptions,
14
21
  ): RenderTarget;
15
22
 
16
23
  fromSceneAsync(
@@ -18,7 +25,7 @@ declare class PMREMGenerator {
18
25
  sigma?: number,
19
26
  near?: number,
20
27
  far?: number,
21
- renderTarget?: RenderTarget | null,
28
+ options?: PMREMGeneratorOptions,
22
29
  ): Promise<RenderTarget>;
23
30
 
24
31
  dispose(): void;
@@ -26,9 +26,9 @@ declare class NodeBuilderState {
26
26
  /**
27
27
  * Constructs a new node builder state.
28
28
  *
29
- * @param {String?} vertexShader - The native vertex shader code.
30
- * @param {String?} fragmentShader - The native fragment shader code.
31
- * @param {String?} computeShader - The native compute shader code.
29
+ * @param {string} vertexShader - The native vertex shader code.
30
+ * @param {string} fragmentShader - The native fragment shader code.
31
+ * @param {string} computeShader - The native compute shader code.
32
32
  * @param {Array<NodeAttribute>} nodeAttributes - An array of node attributes.
33
33
  * @param {Array<BindGroup>} bindings - An array of bind groups.
34
34
  * @param {Array<Node>} updateNodes - An array of nodes that implement their `update()` method.
@@ -45,7 +45,7 @@ declare class NodeLibrary {
45
45
  * Adds a tone mapping node function for a tone mapping technique (constant).
46
46
  *
47
47
  * @param {Function} toneMappingNode - The tone mapping node function.
48
- * @param {Number} toneMapping - The tone mapping.
48
+ * @param {number} toneMapping - The tone mapping.
49
49
  */
50
50
  addToneMapping(
51
51
  toneMappingNode: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>,
@@ -54,8 +54,8 @@ declare class NodeLibrary {
54
54
  /**
55
55
  * Returns a tone mapping node function for a tone mapping technique (constant).
56
56
  *
57
- * @param {Number} toneMapping - The tone mapping.
58
- * @return {Function?} The tone mapping node function. Returns `null` if no node function is found.
57
+ * @param {number} toneMapping - The tone mapping.
58
+ * @return {?Function} The tone mapping node function. Returns `null` if no node function is found.
59
59
  */
60
60
  getToneMappingFunction(
61
61
  toneMapping: ToneMapping,
@@ -63,15 +63,15 @@ declare class NodeLibrary {
63
63
  /**
64
64
  * Returns a node material class definition for a material type.
65
65
  *
66
- * @param {String} materialType - The material type.
67
- * @return {NodeMaterial.constructor?} The node material class definition. Returns `null` if no node material is found.
66
+ * @param {string} materialType - The material type.
67
+ * @return {?NodeMaterial.constructor} The node material class definition. Returns `null` if no node material is found.
68
68
  */
69
69
  getMaterialNodeClass(materialType: string): (new() => NodeMaterial) | null;
70
70
  /**
71
71
  * Adds a node material class definition for a given material type.
72
72
  *
73
73
  * @param {NodeMaterial.constructor} materialNodeClass - The node material class definition.
74
- * @param {String} materialClassType - The material type.
74
+ * @param {string} materialClassType - The material type.
75
75
  */
76
76
  addMaterial(materialNodeClass: {
77
77
  new(): NodeMaterial;
@@ -80,7 +80,7 @@ declare class NodeLibrary {
80
80
  * Returns a light node class definition for a light class definition.
81
81
  *
82
82
  * @param {Light.constructor} light - The light class definition.
83
- * @return {AnalyticLightNode.constructor?} The light node class definition. Returns `null` if no light node is found.
83
+ * @return {?AnalyticLightNode.constructor} The light node class definition. Returns `null` if no light node is found.
84
84
  */
85
85
  getLightNodeClass(light: Light): (new(light: Light) => AnalyticLightNode<Light>) | null;
86
86
  /**
@@ -97,16 +97,16 @@ declare class NodeLibrary {
97
97
  /**
98
98
  * Adds a node class definition for the given type to the provided type library.
99
99
  *
100
- * @param {Any} nodeClass - The node class definition.
101
- * @param {Number|String} type - The object type.
100
+ * @param {any} nodeClass - The node class definition.
101
+ * @param {number|string} type - The object type.
102
102
  * @param {Map} library - The type library.
103
103
  */
104
104
  addType<TNodeClass, TType>(nodeClass: TNodeClass, type: TType, library: Map<TType, TNodeClass>): void;
105
105
  /**
106
106
  * Adds a node class definition for the given class definition to the provided type library.
107
107
  *
108
- * @param {Any} nodeClass - The node class definition.
109
- * @param {Any} baseClass - The class definition.
108
+ * @param {any} nodeClass - The node class definition.
109
+ * @param {any} baseClass - The class definition.
110
110
  * @param {WeakMap} library - The type library.
111
111
  */
112
112
  addClass<TNodeClass, TBaseClass extends object>(