@types/three 0.159.0 → 0.161.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.
- three/README.md +1 -1
- three/examples/jsm/Addons.d.ts +5 -1
- three/examples/jsm/capabilities/WebGPU.d.ts +2 -0
- three/examples/jsm/curves/NURBSUtils.d.ts +136 -10
- three/examples/jsm/curves/NURBSVolume.d.ts +23 -0
- three/examples/jsm/exporters/USDZExporter.d.ts +1 -0
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -0
- three/examples/jsm/loaders/KTX2Loader.d.ts +45 -11
- three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
- three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
- three/examples/jsm/loaders/MaterialXLoader.d.ts +6 -0
- three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
- three/examples/jsm/misc/Timer.d.ts +80 -0
- three/examples/jsm/nodes/Nodes.d.ts +304 -61
- three/examples/jsm/nodes/accessors/BitangentNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/BufferNode.d.ts +4 -1
- three/examples/jsm/nodes/accessors/CameraNode.d.ts +24 -6
- three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +17 -4
- three/examples/jsm/nodes/accessors/InstanceNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/MaterialNode.d.ts +12 -0
- three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +7 -0
- three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -1
- three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/NormalNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
- three/examples/jsm/nodes/accessors/PointUVNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/PositionNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +4 -1
- three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/SkinningNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +8 -1
- three/examples/jsm/nodes/accessors/TangentNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
- three/examples/jsm/nodes/accessors/TextureNode.d.ts +21 -5
- three/examples/jsm/nodes/accessors/UVNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
- three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
- three/examples/jsm/nodes/code/CodeNode.d.ts +4 -0
- three/examples/jsm/nodes/code/ExpressionNode.d.ts +3 -0
- three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -1
- three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
- three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +1 -1
- three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
- three/examples/jsm/nodes/core/AttributeNode.d.ts +3 -0
- three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
- three/examples/jsm/nodes/core/CacheNode.d.ts +11 -0
- three/examples/jsm/nodes/core/ConstNode.d.ts +3 -3
- three/examples/jsm/nodes/core/ContextNode.d.ts +11 -0
- three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
- three/examples/jsm/nodes/core/InputNode.d.ts +4 -4
- three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
- three/examples/jsm/nodes/core/Node.d.ts +32 -8
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +27 -23
- three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
- three/examples/jsm/nodes/core/NodeUniform.d.ts +12 -8
- three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -3
- three/examples/jsm/nodes/core/PropertyNode.d.ts +27 -1
- three/examples/jsm/nodes/core/UniformNode.d.ts +12 -4
- three/examples/jsm/nodes/core/VarNode.d.ts +10 -0
- three/examples/jsm/nodes/core/VaryingNode.d.ts +9 -0
- three/examples/jsm/nodes/core/constants.d.ts +31 -28
- three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
- three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
- three/examples/jsm/nodes/display/BlendModeNode.d.ts +21 -6
- three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +29 -1
- three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +17 -0
- three/examples/jsm/nodes/display/FrontFacingNode.d.ts +4 -0
- three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
- three/examples/jsm/nodes/display/NormalMapNode.d.ts +13 -1
- three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
- three/examples/jsm/nodes/display/PosterizeNode.d.ts +12 -0
- three/examples/jsm/nodes/display/ToneMappingNode.d.ts +8 -1
- three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
- three/examples/jsm/nodes/display/ViewportNode.d.ts +8 -0
- three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
- three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
- three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
- three/examples/jsm/nodes/fog/FogNode.d.ts +9 -0
- three/examples/jsm/nodes/fog/FogRangeNode.d.ts +9 -0
- three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
- three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
- three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
- three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
- three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
- three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
- three/examples/jsm/nodes/functions/material/getRoughness.d.ts +1 -1
- three/examples/jsm/nodes/geometry/RangeNode.d.ts +3 -0
- three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +13 -0
- three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -8
- three/examples/jsm/nodes/lighting/LightsNode.d.ts +3 -0
- three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
- three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
- three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
- three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
- three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +16 -7
- three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -5
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +55 -16
- three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
- three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
- three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +43 -34
- three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +5 -3
- three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +7 -5
- three/examples/jsm/nodes/math/CondNode.d.ts +13 -0
- three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +140 -1
- three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
- three/examples/jsm/nodes/math/OperatorNode.d.ts +53 -1
- three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
- three/examples/jsm/nodes/procedural/CheckerNode.d.ts +9 -0
- three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +124 -31
- three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
- three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +4 -2
- three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +3 -0
- three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +6 -3
- three/examples/jsm/nodes/utils/OscNode.d.ts +6 -0
- three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
- three/examples/jsm/nodes/utils/RemapNode.d.ts +24 -1
- three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
- three/examples/jsm/nodes/utils/RotateUVNode.d.ts +9 -0
- three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +5 -1
- three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +7 -0
- three/examples/jsm/nodes/utils/TimerNode.d.ts +7 -1
- three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +28 -7
- three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
- three/examples/jsm/objects/QuadMesh.d.ts +15 -0
- three/examples/jsm/postprocessing/{HBAOPass.d.ts → GTAOPass.d.ts} +25 -10
- three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
- three/examples/jsm/renderers/common/Backend.d.ts +6 -2
- three/examples/jsm/renderers/common/Color4.d.ts +9 -0
- three/examples/jsm/renderers/common/Info.d.ts +7 -1
- three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
- three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
- three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
- three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
- three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +3 -0
- three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
- three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
- three/examples/jsm/shaders/{HBAOShader.d.ts → GTAOShader.d.ts} +23 -8
- three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +1 -1
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
- three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
- three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
- three/package.json +2 -2
- three/src/Three.d.ts +1 -0
- three/src/cameras/PerspectiveCamera.d.ts +13 -0
- three/src/constants.d.ts +4 -3
- three/src/core/InterleavedBufferAttribute.d.ts +12 -2
- three/src/core/Object3D.d.ts +13 -13
- three/src/core/UniformsGroup.d.ts +3 -3
- three/src/extras/core/Curve.d.ts +9 -9
- three/src/extras/core/CurvePath.d.ts +8 -7
- three/src/geometries/RingGeometry.d.ts +1 -1
- three/src/lights/PointLight.d.ts +7 -0
- three/src/loaders/MaterialLoader.d.ts +6 -3
- three/src/materials/LineBasicMaterial.d.ts +7 -0
- three/src/materials/LineDashedMaterial.d.ts +7 -1
- three/src/materials/Material.d.ts +17 -15
- three/src/materials/MeshBasicMaterial.d.ts +7 -0
- three/src/materials/MeshDepthMaterial.d.ts +6 -0
- three/src/materials/MeshDistanceMaterial.d.ts +7 -0
- three/src/materials/MeshLambertMaterial.d.ts +7 -0
- three/src/materials/MeshMatcapMaterial.d.ts +7 -0
- three/src/materials/MeshNormalMaterial.d.ts +7 -0
- three/src/materials/MeshPhongMaterial.d.ts +7 -0
- three/src/materials/MeshPhysicalMaterial.d.ts +6 -1
- three/src/materials/MeshStandardMaterial.d.ts +7 -2
- three/src/materials/MeshToonMaterial.d.ts +7 -0
- three/src/materials/PointsMaterial.d.ts +7 -0
- three/src/materials/RawShaderMaterial.d.ts +9 -0
- three/src/materials/ShaderMaterial.d.ts +17 -3
- three/src/materials/ShadowMaterial.d.ts +7 -0
- three/src/materials/SpriteMaterial.d.ts +7 -2
- three/src/math/Color.d.ts +1 -1
- three/src/math/Matrix4.d.ts +30 -30
- three/src/math/Quaternion.d.ts +27 -30
- three/src/math/Sphere.d.ts +5 -0
- three/src/math/Triangle.d.ts +8 -25
- three/src/math/Vector2.d.ts +24 -159
- three/src/math/Vector3.d.ts +46 -54
- three/src/math/Vector4.d.ts +25 -20
- three/src/objects/BatchedMesh.d.ts +2 -2
- three/src/objects/Bone.d.ts +2 -2
- three/src/objects/InstancedMesh.d.ts +2 -1
- three/src/objects/LOD.d.ts +2 -2
- three/src/objects/Line.d.ts +3 -2
- three/src/objects/LineLoop.d.ts +3 -1
- three/src/objects/LineSegments.d.ts +3 -1
- three/src/objects/Points.d.ts +3 -2
- three/src/objects/SkinnedMesh.d.ts +4 -8
- three/src/objects/Sprite.d.ts +2 -2
- three/src/renderers/shaders/ShaderLib.d.ts +18 -18
- three/src/renderers/shaders/UniformsUtils.d.ts +3 -2
- three/src/renderers/webgl/WebGLLights.d.ts +39 -37
- three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
- three/src/renderers/webgl/WebGLPrograms.d.ts +226 -9
- three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
- three/src/renderers/webxr/WebXRManager.d.ts +2 -1
- three/src/textures/CompressedCubeTexture.d.ts +13 -0
- three/src/textures/DataArrayTexture.d.ts +1 -1
- three/src/textures/Source.d.ts +11 -1
- three/build/three.d.ts +0 -2
- three/build/three.min.d.ts +0 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +0 -310
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -166
- three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 31 Jan 2024 17:07:12 GMT
|
|
12
12
|
* Dependencies: [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
|
|
13
13
|
|
|
14
14
|
# Credits
|
three/examples/jsm/Addons.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './csm/CSMShader.js';
|
|
|
25
25
|
export * as Curves from './curves/CurveExtras.js';
|
|
26
26
|
export * from './curves/NURBSCurve.js';
|
|
27
27
|
export * from './curves/NURBSSurface.js';
|
|
28
|
+
export * from './curves/NURBSVolume.js';
|
|
28
29
|
export * as NURBSUtils from './curves/NURBSUtils.js';
|
|
29
30
|
|
|
30
31
|
export * from './effects/AnaglyphEffect.js';
|
|
@@ -151,6 +152,7 @@ export * from './misc/MorphAnimMesh.js';
|
|
|
151
152
|
export * from './misc/MorphBlendMesh.js';
|
|
152
153
|
export * from './misc/ProgressiveLightMap.js';
|
|
153
154
|
export * from './misc/RollerCoaster.js';
|
|
155
|
+
export * from './misc/Timer.js';
|
|
154
156
|
export * from './misc/TubePainter.js';
|
|
155
157
|
export * from './misc/Volume.js';
|
|
156
158
|
export * from './misc/VolumeSlice.js';
|
|
@@ -160,7 +162,7 @@ export * from './modifiers/EdgeSplitModifier.js';
|
|
|
160
162
|
export * from './modifiers/SimplifyModifier.js';
|
|
161
163
|
export * from './modifiers/TessellateModifier.js';
|
|
162
164
|
|
|
163
|
-
export * from './objects/
|
|
165
|
+
export * from './objects/GroundedSkybox.js';
|
|
164
166
|
export * from './objects/Lensflare.js';
|
|
165
167
|
export * from './objects/MarchingCubes.js';
|
|
166
168
|
export * from './objects/Reflector.js';
|
|
@@ -183,6 +185,7 @@ export * from './postprocessing/DotScreenPass.js';
|
|
|
183
185
|
export * from './postprocessing/EffectComposer.js';
|
|
184
186
|
export * from './postprocessing/FilmPass.js';
|
|
185
187
|
export * from './postprocessing/GlitchPass.js';
|
|
188
|
+
export * from './postprocessing/GTAOPass.js';
|
|
186
189
|
export * from './postprocessing/HalftonePass.js';
|
|
187
190
|
export * from './postprocessing/LUTPass.js';
|
|
188
191
|
export * from './postprocessing/MaskPass.js';
|
|
@@ -230,6 +233,7 @@ export * from './shaders/FocusShader.js';
|
|
|
230
233
|
export * from './shaders/FreiChenShader.js';
|
|
231
234
|
export * from './shaders/GammaCorrectionShader.js';
|
|
232
235
|
export * from './shaders/GodRaysShader.js';
|
|
236
|
+
export * from './shaders/GTAOShader.js';
|
|
233
237
|
export * from './shaders/HalftoneShader.js';
|
|
234
238
|
export * from './shaders/HorizontalBlurShader.js';
|
|
235
239
|
export * from './shaders/HorizontalTiltShiftShader.js';
|
|
@@ -1,20 +1,146 @@
|
|
|
1
1
|
import { Vector3, Vector4 } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Finds knot vector span.
|
|
5
|
+
* @param p degree
|
|
6
|
+
* @param u parametric value
|
|
7
|
+
* @param U knot vector
|
|
8
|
+
* @returns the span
|
|
9
|
+
*/
|
|
10
|
+
export function findSpan(p: number, u: number, U: readonly number[]): number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Calculate basis functions. See The NURBS Book, page 70, algorithm A2.2
|
|
14
|
+
* @param span span in which u lies
|
|
15
|
+
* @param u parametric point
|
|
16
|
+
* @param p degrees
|
|
17
|
+
* @param U knot vector
|
|
18
|
+
* @returns array[p+1] with basis function values
|
|
19
|
+
*/
|
|
20
|
+
export function calcBasisFunctions(span: number, u: number, p: number, U: readonly number[]): number[];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Calculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.
|
|
24
|
+
* @param p degree of B-Spline
|
|
25
|
+
* @param U knot vector
|
|
26
|
+
* @param P control points (x, y, z, w)
|
|
27
|
+
* @param u parametric point
|
|
28
|
+
* @returns point for given u
|
|
29
|
+
*/
|
|
30
|
+
export function calcBSplinePoint(p: number, U: readonly number[], P: readonly Vector4[], u: number): Vector4;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Calculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.
|
|
34
|
+
* @param span span in which u lies
|
|
35
|
+
* @param u parametric point
|
|
36
|
+
* @param p degree
|
|
37
|
+
* @param n number of derivatives to calculate
|
|
38
|
+
* @param U knot vector
|
|
39
|
+
* @returns array[n+1][p+1] with basis functions derivatives
|
|
40
|
+
*/
|
|
41
|
+
export function calcBasisFunctionDerivatives(
|
|
42
|
+
span: number,
|
|
43
|
+
u: number,
|
|
44
|
+
p: number,
|
|
45
|
+
n: number,
|
|
46
|
+
U: readonly number[],
|
|
47
|
+
): number[][];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Calculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.
|
|
51
|
+
* @param p degree
|
|
52
|
+
* @param U knot vector
|
|
53
|
+
* @param P control points
|
|
54
|
+
* @param u Parametric points
|
|
55
|
+
* @param nd number of derivatives
|
|
56
|
+
* @returns array[d+1] with derivatives
|
|
57
|
+
*/
|
|
58
|
+
export function calcBSplineDerivatives(
|
|
59
|
+
p: number,
|
|
60
|
+
U: readonly number[],
|
|
61
|
+
P: readonly Vector4[],
|
|
62
|
+
u: number,
|
|
63
|
+
nd: number,
|
|
64
|
+
): Vector4[];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Calculate "K over I"
|
|
68
|
+
* @returns k!/(i!(k-i)!
|
|
69
|
+
*/
|
|
8
70
|
export function calcKoverI(k: number, i: number): number;
|
|
9
|
-
|
|
10
|
-
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Calculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.
|
|
74
|
+
* @param Pders result of function calcBSplineDerivatives
|
|
75
|
+
* @returns array with derivatives for rational curve.
|
|
76
|
+
*/
|
|
77
|
+
export function calcRationalCurveDerivatives(Pders: readonly Vector4[]): Vector3[];
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Calculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.
|
|
81
|
+
* @param p degree
|
|
82
|
+
* @param U knot vector
|
|
83
|
+
* @param P control points in homogeneous space
|
|
84
|
+
* @param u parametric points
|
|
85
|
+
* @param nd number of derivatives
|
|
86
|
+
* @returns array with derivatives
|
|
87
|
+
*/
|
|
88
|
+
export function calcNURBSDerivatives(
|
|
89
|
+
p: number,
|
|
90
|
+
U: readonly number[],
|
|
91
|
+
P: readonly Vector4[],
|
|
92
|
+
u: number,
|
|
93
|
+
nd: number,
|
|
94
|
+
): Vector3[];
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Calculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.
|
|
98
|
+
* @param p degree of B-Spline surface
|
|
99
|
+
* @param q degree of B-Spline surface
|
|
100
|
+
* @param U knot vector
|
|
101
|
+
* @param V knot vector
|
|
102
|
+
* @param P control points (x, y, z, w)
|
|
103
|
+
* @param u parametric value
|
|
104
|
+
* @param v parametric value
|
|
105
|
+
* @param target
|
|
106
|
+
* @returns point for given (u, v)
|
|
107
|
+
*/
|
|
11
108
|
export function calcSurfacePoint(
|
|
12
109
|
p: number,
|
|
13
110
|
q: number,
|
|
14
|
-
U: number[],
|
|
15
|
-
V: number[],
|
|
16
|
-
P: Vector4[],
|
|
111
|
+
U: readonly number[],
|
|
112
|
+
V: readonly number[],
|
|
113
|
+
P: readonly (readonly Vector4[])[],
|
|
114
|
+
u: number,
|
|
115
|
+
v: number,
|
|
116
|
+
target: Vector3,
|
|
117
|
+
): Vector3;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Calculate rational B-Spline volume point. See The NURBS Book, page 134, algorithm A4.3.
|
|
121
|
+
* @param p degree of B-Spline volume
|
|
122
|
+
* @param q degree of B-Spline volume
|
|
123
|
+
* @param r degree of B-Spline volume
|
|
124
|
+
* @param U knot vector
|
|
125
|
+
* @param V knot vector
|
|
126
|
+
* @param W knot vector
|
|
127
|
+
* @param P control points (x, y, z, w)
|
|
128
|
+
* @param u parametric value
|
|
129
|
+
* @param v parametric value
|
|
130
|
+
* @param w parametric value
|
|
131
|
+
* @param target
|
|
132
|
+
* @returns point for given (u, v, w)
|
|
133
|
+
*/
|
|
134
|
+
export function calcVolumePoint(
|
|
135
|
+
p: number,
|
|
136
|
+
q: number,
|
|
137
|
+
r: number,
|
|
138
|
+
U: readonly number[],
|
|
139
|
+
V: readonly number[],
|
|
140
|
+
W: readonly number[],
|
|
141
|
+
P: readonly (readonly (readonly Vector4[])[])[],
|
|
17
142
|
u: number,
|
|
18
143
|
v: number,
|
|
144
|
+
w: number,
|
|
19
145
|
target: Vector3,
|
|
20
146
|
): Vector3;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Vector3, Vector4 } from '../../../src/Three.js';
|
|
2
|
+
|
|
3
|
+
export class NURBSVolume {
|
|
4
|
+
degree1: number;
|
|
5
|
+
degree2: number;
|
|
6
|
+
degree3: number;
|
|
7
|
+
knots1: readonly number[];
|
|
8
|
+
knots2: readonly number[];
|
|
9
|
+
knots3: readonly number[];
|
|
10
|
+
controlPoints: Vector4[][][];
|
|
11
|
+
|
|
12
|
+
constructor(
|
|
13
|
+
degree1: number,
|
|
14
|
+
degree2: number,
|
|
15
|
+
degree3: number,
|
|
16
|
+
knots1: readonly number[],
|
|
17
|
+
knots2: readonly number[],
|
|
18
|
+
knots3: readonly number[],
|
|
19
|
+
controlPoints: Vector4[][][],
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
getPoint(t1: number, t2: number, t3: number, target: Vector3): void;
|
|
23
|
+
}
|
|
@@ -131,6 +131,7 @@ export class GLTFParser {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
export interface GLTFLoaderPlugin {
|
|
134
|
+
readonly name: string;
|
|
134
135
|
beforeRoot?: (() => Promise<void> | null) | undefined;
|
|
135
136
|
afterRoot?: ((result: GLTF) => Promise<void> | null) | undefined;
|
|
136
137
|
loadNode?: ((nodeIndex: number) => Promise<Object3D> | null) | undefined;
|
|
@@ -1,17 +1,51 @@
|
|
|
1
|
-
import { LoadingManager,
|
|
1
|
+
import { LoadingManager, Loader, CompressedTexture, WebGLRenderer } from '../../../src/Three.js';
|
|
2
2
|
import WebGPURenderer from '../renderers/webgpu/WebGPURenderer.js';
|
|
3
|
+
import Renderer from '../renderers/common/Renderer.js';
|
|
4
|
+
import { WorkerPool } from '../utils/WorkerPool.js';
|
|
5
|
+
|
|
6
|
+
export interface KTX2LoaderWorkerConfig {
|
|
7
|
+
astcSupported: boolean;
|
|
8
|
+
etc1Supported: boolean;
|
|
9
|
+
etc2Supported: boolean;
|
|
10
|
+
dxtSupported: boolean;
|
|
11
|
+
bptcSupported: boolean;
|
|
12
|
+
pvrtcSupported: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class KTX2Loader extends Loader<CompressedTexture> {
|
|
16
|
+
transcoderPath: string;
|
|
17
|
+
transcoderBinary: ArrayBuffer | null;
|
|
18
|
+
transcoderPending: Promise<void> | null;
|
|
19
|
+
|
|
20
|
+
workerPool: WorkerPool;
|
|
21
|
+
workerSourceURL: string;
|
|
22
|
+
workerConfig: KTX2LoaderWorkerConfig;
|
|
3
23
|
|
|
4
|
-
export class KTX2Loader extends CompressedTextureLoader {
|
|
5
24
|
constructor(manager?: LoadingManager);
|
|
6
25
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The WASM transcoder and JS wrapper are available from the examples/jsm/libs/basis directory.
|
|
28
|
+
* @param path Path to folder containing the WASM transcoder and JS wrapper.
|
|
29
|
+
*/
|
|
30
|
+
setTranscoderPath(path: string): this;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Sets the maximum number of web workers to be allocated by this instance.
|
|
34
|
+
* @param limit Maximum number of workers. Default is '4'.
|
|
35
|
+
*/
|
|
36
|
+
setWorkerLimit(limit: number): this;
|
|
37
|
+
|
|
38
|
+
detectSupportAsync(renderer: Renderer): Promise<this>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Detects hardware support for available compressed texture formats, to determine the output format for the
|
|
42
|
+
* transcoder. Must be called before loading a texture.
|
|
43
|
+
* @param renderer A renderer instance.
|
|
44
|
+
*/
|
|
45
|
+
detectSupport(renderer: WebGLRenderer | WebGPURenderer): this;
|
|
11
46
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
): KTX2Loader;
|
|
47
|
+
/**
|
|
48
|
+
* Disposes the loader object, de-allocating any Web Workers created.
|
|
49
|
+
*/
|
|
50
|
+
dispose(): this;
|
|
17
51
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Loader, LoadingManager, DataTexture, Data3DTexture } from '../../../src/Three.js';
|
|
1
|
+
import { Loader, LoadingManager, DataTexture, Data3DTexture, UnsignedByteType, FloatType } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
3
|
export interface LUT3dlResult {
|
|
4
4
|
size: number;
|
|
@@ -6,8 +6,35 @@ export interface LUT3dlResult {
|
|
|
6
6
|
texture3D: Data3DTexture;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* A 3D LUT loader that supports the .3dl file format.
|
|
11
|
+
*
|
|
12
|
+
* Based on the following references:
|
|
13
|
+
*
|
|
14
|
+
* http://download.autodesk.com/us/systemdocs/help/2011/lustre/index.html?url=./files/WSc4e151a45a3b785a24c3d9a411df9298473-7ffd.htm,topicNumber=d0e9492
|
|
15
|
+
* https://community.foundry.com/discuss/topic/103636/format-spec-for-3dl?mode=Post&postID=895258
|
|
16
|
+
*/
|
|
9
17
|
export class LUT3dlLoader extends Loader<LUT3dlResult> {
|
|
18
|
+
type: typeof UnsignedByteType | typeof FloatType;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new {@link LUT3dlLoader}.
|
|
22
|
+
* @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager}
|
|
23
|
+
*/
|
|
10
24
|
constructor(manager?: LoadingManager);
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The
|
|
28
|
+
* default is {@link THREE.UnsignedByteType}.
|
|
29
|
+
* @param type The texture type. See the Textures texture constants page for details.
|
|
30
|
+
*/
|
|
31
|
+
setType(type: typeof UnsignedByteType | typeof FloatType): this;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Parse a 3dl data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be an
|
|
35
|
+
* object containing the following LUT data: {@link LUT3dlResult.size}, {@link LUT3dlResult.texture} and
|
|
36
|
+
* {@link LUT3dlResult.texture3D}.
|
|
37
|
+
* @param input The 3dl data string.
|
|
38
|
+
*/
|
|
39
|
+
parse(input: string): LUT3dlResult;
|
|
13
40
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Loader,
|
|
3
|
+
LoadingManager,
|
|
4
|
+
Vector3,
|
|
5
|
+
DataTexture,
|
|
6
|
+
Data3DTexture,
|
|
7
|
+
UnsignedByteType,
|
|
8
|
+
FloatType,
|
|
9
|
+
} from '../../../src/Three.js';
|
|
2
10
|
|
|
3
11
|
export interface LUTCubeResult {
|
|
4
12
|
title: string;
|
|
@@ -9,8 +17,35 @@ export interface LUTCubeResult {
|
|
|
9
17
|
texture3D: Data3DTexture;
|
|
10
18
|
}
|
|
11
19
|
|
|
20
|
+
/**
|
|
21
|
+
* A 3D LUT loader that supports the .cube file format.
|
|
22
|
+
*
|
|
23
|
+
* Based on the following reference:
|
|
24
|
+
*
|
|
25
|
+
* https://wwwimages2.adobe.com/content/dam/acom/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf
|
|
26
|
+
*/
|
|
12
27
|
export class LUTCubeLoader extends Loader<LUTCubeResult> {
|
|
28
|
+
type: typeof UnsignedByteType | typeof FloatType;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new {@link LUTCubeLoader}.
|
|
32
|
+
* @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager}
|
|
33
|
+
*/
|
|
13
34
|
constructor(manager?: LoadingManager);
|
|
14
35
|
|
|
15
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The
|
|
38
|
+
* default is {@link THREE.UnsignedByteType}.
|
|
39
|
+
* @param type The texture type. See the Textures texture constants page for details.
|
|
40
|
+
*/
|
|
41
|
+
setType(type: typeof UnsignedByteType | typeof FloatType): this;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Parse a cube data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be
|
|
45
|
+
* an object containing the following LUT data: {@link LUTCubeResult.title}, {@link LUTCubeResult.size},
|
|
46
|
+
* {@link LUTCubeResult.domainMin}, {@link LUTCubeResult.domainMax}, {@link LUTCubeResult.texture} and
|
|
47
|
+
* {@link LUTCubeResult.texture3D}.
|
|
48
|
+
* @param input The cube data string.
|
|
49
|
+
*/
|
|
50
|
+
parse(input: string): LUTCubeResult;
|
|
16
51
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Loader, LoadingManager } from '../../../src/Three.js';
|
|
2
|
+
import { MeshPhysicalNodeMaterial } from '../nodes/Nodes.js';
|
|
3
|
+
|
|
4
|
+
export class MaterialXLoader extends Loader<{ materials: Record<string, MeshPhysicalNodeMaterial> }> {
|
|
5
|
+
constructor(manager?: LoadingManager);
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MeshPhysicalMaterial, MeshPhysicalMaterialParameters, Texture } from '../../../src/Three.js';
|
|
2
|
+
|
|
3
|
+
export interface MeshPostProcessingMaterialParameters extends MeshPhysicalMaterialParameters {
|
|
4
|
+
aoPassMap?: Texture | null | undefined;
|
|
5
|
+
aoPassMapScale?: number | undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class MeshPostProcessingMaterial extends MeshPhysicalMaterial {
|
|
9
|
+
constructor(parameters: MeshPostProcessingMaterialParameters);
|
|
10
|
+
|
|
11
|
+
get aoPassMap(): Texture | null | undefined;
|
|
12
|
+
set aoPassMap(aoPassMap: Texture | null | undefined);
|
|
13
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class is an alternative to {@link THREE.Clock} with a different API design and behavior
|
|
3
|
+
* The goal is to avoid the conceptual flaws that became apparent in {@link THREE.Clock} over time.
|
|
4
|
+
*
|
|
5
|
+
* - {@link Timer} has an {@link .update()} method that updates its internal state. That makes it possible to call
|
|
6
|
+
* {@link .getDelta()} and {@link .getElapsed()} multiple times per simulation step without getting different values.
|
|
7
|
+
* - The class uses the Page Visibility API to avoid large time delta values when the app is inactive (e.g. tab switched
|
|
8
|
+
* or browser hidden).
|
|
9
|
+
* - It's possible to configure a fixed time delta and a time scale value (similar to Unity's Time interface).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const timer = new Timer();
|
|
13
|
+
*
|
|
14
|
+
* function animate() {
|
|
15
|
+
* requestAnimationFrame(animate);
|
|
16
|
+
* timer.update();
|
|
17
|
+
* const delta = timer.getDelta();
|
|
18
|
+
* // do something with delta
|
|
19
|
+
* renderer.render(scene, camera);
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* @see https://threejs.org/examples/#webgl_morphtargets_sphere
|
|
23
|
+
*/
|
|
24
|
+
export class Timer {
|
|
25
|
+
constructor();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Disables the usage of a fixed delta time.
|
|
29
|
+
*/
|
|
30
|
+
disableFixedDelta(): this;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Can be used to free all internal resources. Usually called when the timer instance isn't required anymore.
|
|
34
|
+
*/
|
|
35
|
+
dispose(): this;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enables the usage of a fixed delta time.
|
|
39
|
+
*/
|
|
40
|
+
enableFixedDelta(): this;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns the time delta in seconds.
|
|
44
|
+
*/
|
|
45
|
+
getDelta(): number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns the elapsed time in seconds.
|
|
49
|
+
*/
|
|
50
|
+
getElapsed(): number;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Returns the fixed time delta that has been previously configured via {@link .setFixedDelta()}.
|
|
54
|
+
*/
|
|
55
|
+
getFixedDelta(): number;
|
|
56
|
+
|
|
57
|
+
getTimescale(): number;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resets the time computation for the current simulation step.
|
|
61
|
+
*/
|
|
62
|
+
reset(): this;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Defines a fixed time delta value which is used to update the timer per simulation step.
|
|
66
|
+
*/
|
|
67
|
+
setFixedDelta(fixedDelta: number): this;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Sets a time scale that scales the time delta in {@link .update()}.
|
|
71
|
+
* @param timescale
|
|
72
|
+
*/
|
|
73
|
+
setTimescale(timescale: number): this;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Updates the internal state of the timer. This method should be called once per simulation step and before you
|
|
77
|
+
* perform queries against the timer (e.g. via {@link .getDelta()}).
|
|
78
|
+
*/
|
|
79
|
+
update(): this;
|
|
80
|
+
}
|