@types/three 0.157.1 → 0.158.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 (246) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +290 -0
  3. three/examples/jsm/animation/CCDIKSolver.d.ts +30 -0
  4. three/examples/jsm/animation/MMDAnimationHelper.d.ts +105 -0
  5. three/examples/jsm/animation/MMDPhysics.d.ts +124 -0
  6. three/examples/jsm/cameras/CinematicCamera.d.ts +41 -0
  7. three/examples/jsm/capabilities/WebGL.d.ts +9 -0
  8. three/examples/jsm/controls/OrbitControls.d.ts +304 -0
  9. three/examples/jsm/controls/TrackballControls.d.ts +58 -0
  10. three/examples/jsm/effects/OutlineEffect.d.ts +36 -0
  11. three/examples/jsm/environments/RoomEnvironment.d.ts +6 -0
  12. three/examples/jsm/exporters/PLYExporter.d.ts +30 -0
  13. three/examples/jsm/exporters/STLExporter.d.ts +21 -0
  14. three/examples/jsm/helpers/RectAreaLightHelper.d.ts +10 -0
  15. three/examples/jsm/helpers/ViewHelper.d.ts +15 -0
  16. three/examples/jsm/libs/fflate.module.d.ts +1 -0
  17. three/examples/jsm/libs/lil-gui.module.min.d.ts +609 -0
  18. three/examples/jsm/libs/tween.module.d.ts +219 -0
  19. three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +3 -0
  20. three/examples/jsm/lines/Line2.d.ts +11 -0
  21. three/examples/jsm/lines/LineGeometry.d.ts +10 -0
  22. three/examples/jsm/lines/LineMaterial.d.ts +31 -0
  23. three/examples/jsm/lines/LineSegments2.d.ts +14 -0
  24. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +23 -0
  25. three/examples/jsm/loaders/DDSLoader.d.ts +16 -0
  26. three/examples/jsm/loaders/DRACOLoader.d.ts +19 -0
  27. three/examples/jsm/loaders/GLTFLoader.d.ts +147 -0
  28. three/examples/jsm/loaders/KTX2Loader.d.ts +17 -0
  29. three/examples/jsm/loaders/LDrawLoader.d.ts +19 -0
  30. three/examples/jsm/loaders/LogLuvLoader.d.ts +1 -1
  31. three/examples/jsm/loaders/MMDLoader.d.ts +56 -0
  32. three/examples/jsm/loaders/MTLLoader.d.ts +104 -0
  33. three/examples/jsm/loaders/OBJLoader.d.ts +10 -0
  34. three/examples/jsm/loaders/PCDLoader.d.ts +8 -0
  35. three/examples/jsm/loaders/RGBELoader.d.ts +19 -0
  36. three/examples/jsm/loaders/SVGLoader.d.ts +68 -0
  37. three/examples/jsm/loaders/TGALoader.d.ts +7 -0
  38. three/examples/jsm/loaders/TTFLoader.d.ts +8 -0
  39. three/examples/jsm/loaders/USDZLoader.d.ts +11 -0
  40. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +17 -0
  41. three/examples/jsm/math/Capsule.d.ts +0 -1
  42. three/examples/jsm/misc/MD2CharacterComplex.d.ts +9 -1
  43. three/examples/jsm/nodes/Nodes.d.ts +149 -0
  44. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
  45. three/examples/jsm/nodes/accessors/BufferNode.d.ts +11 -0
  46. three/examples/jsm/nodes/accessors/CameraNode.d.ts +12 -0
  47. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +13 -0
  48. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +9 -0
  49. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +23 -0
  50. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +6 -0
  51. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -0
  52. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +6 -0
  53. three/examples/jsm/nodes/accessors/NormalNode.d.ts +12 -0
  54. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +22 -0
  55. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +7 -0
  56. three/examples/jsm/nodes/accessors/PositionNode.d.ts +21 -0
  57. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +13 -0
  58. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +8 -0
  59. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +13 -0
  60. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +6 -0
  61. three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
  62. three/examples/jsm/nodes/accessors/TextureNode.d.ts +14 -0
  63. three/examples/jsm/nodes/accessors/UVNode.d.ts +8 -0
  64. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  65. three/examples/jsm/nodes/code/CodeNode.d.ts +15 -0
  66. three/examples/jsm/nodes/code/ExpressionNode.d.ts +7 -0
  67. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -0
  68. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  69. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +8 -0
  70. three/examples/jsm/nodes/core/AttributeNode.d.ts +9 -0
  71. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  72. three/examples/jsm/nodes/core/CacheNode.d.ts +10 -0
  73. three/examples/jsm/nodes/core/ConstNode.d.ts +10 -0
  74. three/examples/jsm/nodes/core/ContextNode.d.ts +10 -0
  75. three/examples/jsm/nodes/core/InputNode.d.ts +16 -0
  76. three/examples/jsm/nodes/core/Node.d.ts +31 -0
  77. three/examples/jsm/nodes/core/NodeAttribute.d.ts +6 -0
  78. three/examples/jsm/nodes/core/NodeBuilder.d.ts +138 -0
  79. three/examples/jsm/nodes/core/NodeCache.d.ts +9 -0
  80. three/examples/jsm/nodes/core/NodeCode.d.ts +4 -0
  81. three/examples/jsm/nodes/core/NodeFrame.d.ts +19 -0
  82. three/examples/jsm/nodes/core/NodeFunction.d.ts +13 -0
  83. three/examples/jsm/nodes/core/NodeFunctionInput.d.ts +7 -0
  84. three/examples/jsm/nodes/core/NodeKeywords.d.ts +14 -0
  85. three/examples/jsm/nodes/core/NodeParser.d.ts +5 -0
  86. three/examples/jsm/nodes/core/NodeUniform.d.ts +13 -0
  87. three/examples/jsm/nodes/core/NodeUtils.d.ts +13 -0
  88. three/examples/jsm/nodes/core/NodeVar.d.ts +6 -0
  89. three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
  90. three/examples/jsm/nodes/core/PropertyNode.d.ts +6 -0
  91. three/examples/jsm/nodes/core/StackNode.d.ts +11 -0
  92. three/examples/jsm/nodes/core/TempNode.d.ts +11 -0
  93. three/examples/jsm/nodes/core/UniformNode.d.ts +10 -0
  94. three/examples/jsm/nodes/core/VarNode.d.ts +16 -0
  95. three/examples/jsm/nodes/core/VaryingNode.d.ts +8 -0
  96. three/examples/jsm/nodes/core/constants.d.ts +78 -0
  97. three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
  98. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +20 -0
  99. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +18 -0
  100. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +6 -0
  101. three/examples/jsm/nodes/display/NormalMapNode.d.ts +12 -0
  102. three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
  103. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +14 -0
  104. three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
  105. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
  106. three/examples/jsm/nodes/fog/FogNode.d.ts +10 -0
  107. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +10 -0
  108. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +6 -0
  109. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +6 -0
  110. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +10 -0
  111. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +9 -0
  112. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +6 -0
  113. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +6 -0
  114. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +11 -0
  115. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +5 -0
  116. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +6 -0
  117. three/examples/jsm/nodes/geometry/RangeNode.d.ts +13 -0
  118. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +11 -0
  119. three/examples/jsm/nodes/lighting/AONode.d.ts +8 -0
  120. three/examples/jsm/nodes/lighting/AnalyticLightNode.d.ts +10 -0
  121. three/examples/jsm/nodes/lighting/EnvironmentNode.d.ts +8 -0
  122. three/examples/jsm/nodes/lighting/HemisphereLightNode.d.ts +13 -0
  123. three/examples/jsm/nodes/lighting/LightUtils.d.ts +4 -0
  124. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +15 -0
  125. three/examples/jsm/nodes/lighting/LightingNode.d.ts +5 -0
  126. three/examples/jsm/nodes/lighting/LightsNode.d.ts +19 -0
  127. three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
  128. three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
  129. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +14 -0
  130. three/examples/jsm/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
  131. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +9 -0
  132. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +9 -0
  133. three/examples/jsm/nodes/materials/Materials.d.ts +17 -0
  134. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +10 -0
  135. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +22 -0
  136. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +18 -0
  137. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +38 -0
  138. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +15 -0
  139. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +23 -0
  140. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
  141. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +4 -0
  142. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +6 -0
  143. three/examples/jsm/nodes/math/CondNode.d.ts +9 -0
  144. three/examples/jsm/nodes/math/MathNode.d.ts +115 -0
  145. three/examples/jsm/nodes/math/OperatorNode.d.ts +31 -0
  146. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
  147. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +156 -0
  148. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +310 -0
  149. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +166 -0
  150. three/examples/jsm/nodes/utils/ArrayElementNode.d.ts +9 -0
  151. three/examples/jsm/nodes/utils/ConvertNode.d.ts +8 -0
  152. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
  153. three/examples/jsm/nodes/utils/JoinNode.d.ts +10 -0
  154. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +5 -0
  155. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +11 -0
  156. three/examples/jsm/nodes/utils/OscNode.d.ts +19 -0
  157. three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
  158. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +10 -0
  159. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +8 -0
  160. three/examples/jsm/nodes/utils/SplitNode.d.ts +16 -0
  161. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +9 -0
  162. three/examples/jsm/nodes/utils/TimerNode.d.ts +19 -0
  163. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
  164. three/examples/jsm/objects/Reflector.d.ts +29 -0
  165. three/examples/jsm/objects/ReflectorForSSRPass.d.ts +1 -0
  166. three/examples/jsm/objects/Refractor.d.ts +2 -1
  167. three/examples/jsm/physics/AmmoPhysics.d.ts +2 -1
  168. three/examples/jsm/physics/RapierPhysics.d.ts +2 -1
  169. three/examples/jsm/postprocessing/EffectComposer.d.ts +31 -0
  170. three/examples/jsm/postprocessing/Pass.d.ts +31 -0
  171. three/examples/jsm/postprocessing/SavePass.d.ts +12 -0
  172. three/examples/jsm/postprocessing/ShaderPass.d.ts +11 -0
  173. three/examples/jsm/renderers/CSS3DRenderer.d.ts +26 -0
  174. three/examples/jsm/renderers/SVGRenderer.d.ts +2 -1
  175. three/examples/jsm/renderers/common/Backend.d.ts +15 -0
  176. three/examples/jsm/renderers/common/Info.d.ts +15 -0
  177. three/examples/jsm/renderers/common/Renderer.d.ts +42 -0
  178. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +17 -0
  179. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +37 -0
  180. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +3 -0
  181. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +9 -0
  182. three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +11 -0
  183. three/examples/jsm/shaders/AfterimageShader.d.ts +1 -0
  184. three/examples/jsm/shaders/BasicShader.d.ts +1 -0
  185. three/examples/jsm/shaders/BlendShader.d.ts +1 -0
  186. three/examples/jsm/shaders/BokehShader.d.ts +1 -0
  187. three/examples/jsm/shaders/BokehShader2.d.ts +44 -0
  188. three/examples/jsm/shaders/BrightnessContrastShader.d.ts +1 -0
  189. three/examples/jsm/shaders/ColorCorrectionShader.d.ts +1 -0
  190. three/examples/jsm/shaders/DOFMipMapShader.d.ts +1 -0
  191. three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts +1 -0
  192. three/examples/jsm/shaders/FXAAShader.d.ts +1 -0
  193. three/examples/jsm/shaders/FocusShader.d.ts +1 -0
  194. three/examples/jsm/shaders/FreiChenShader.d.ts +1 -0
  195. three/examples/jsm/shaders/GodRaysShader.d.ts +4 -0
  196. three/examples/jsm/shaders/HalftoneShader.d.ts +1 -0
  197. three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts +1 -0
  198. three/examples/jsm/shaders/HueSaturationShader.d.ts +1 -0
  199. three/examples/jsm/shaders/KaleidoShader.d.ts +1 -0
  200. three/examples/jsm/shaders/LuminosityHighPassShader.d.ts +1 -0
  201. three/examples/jsm/shaders/LuminosityShader.d.ts +1 -0
  202. three/examples/jsm/shaders/MirrorShader.d.ts +1 -0
  203. three/examples/jsm/shaders/NormalMapShader.d.ts +1 -0
  204. three/examples/jsm/shaders/OutputShader.d.ts +1 -0
  205. three/examples/jsm/shaders/SAOShader.d.ts +1 -0
  206. three/examples/jsm/shaders/SMAAShader.d.ts +3 -0
  207. three/examples/jsm/shaders/SSAOShader.d.ts +3 -0
  208. three/examples/jsm/shaders/SSRShader.d.ts +3 -0
  209. three/examples/jsm/shaders/SobelOperatorShader.d.ts +1 -0
  210. three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts +1 -0
  211. three/examples/jsm/shaders/TechnicolorShader.d.ts +1 -0
  212. three/examples/jsm/shaders/TriangleBlurShader.d.ts +1 -0
  213. three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts +1 -0
  214. three/examples/jsm/shaders/VelocityShader.d.ts +14 -0
  215. three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts +1 -0
  216. three/examples/jsm/shaders/WaterRefractionShader.d.ts +1 -0
  217. three/examples/jsm/utils/GPUStatsPanel.d.ts +12 -0
  218. three/examples/jsm/utils/GeometryUtils.d.ts +25 -0
  219. three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
  220. three/examples/jsm/webxr/VRButton.d.ts +5 -0
  221. three/examples/jsm/webxr/XRButton.d.ts +6 -0
  222. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +21 -0
  223. three/examples/jsm/webxr/XREstimatedLight.d.ts +32 -0
  224. three/examples/jsm/webxr/XRHandMeshModel.d.ts +11 -0
  225. three/examples/jsm/webxr/XRHandModelFactory.d.ts +25 -0
  226. three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts +24 -0
  227. three/package.json +3 -2
  228. three/src/cameras/CubeCamera.d.ts +1 -2
  229. three/src/constants.d.ts +21 -10
  230. three/src/core/Object3D.d.ts +4 -4
  231. three/src/core/Raycaster.d.ts +1 -0
  232. three/src/extras/Earcut.d.ts +15 -0
  233. three/src/extras/core/Curve.d.ts +1 -1
  234. three/src/geometries/CapsuleGeometry.d.ts +1 -1
  235. three/src/helpers/AxesHelper.d.ts +2 -2
  236. three/src/helpers/Box3Helper.d.ts +2 -2
  237. three/src/lights/Light.d.ts +1 -2
  238. three/src/materials/Material.d.ts +20 -2
  239. three/src/materials/MeshPhysicalMaterial.d.ts +8 -6
  240. three/src/math/ColorManagement.d.ts +1 -1
  241. three/src/math/Matrix4.d.ts +2 -1
  242. three/src/objects/SkinnedMesh.d.ts +9 -8
  243. three/src/renderers/WebGLRenderer.d.ts +12 -2
  244. three/src/scenes/Scene.d.ts +2 -2
  245. three/src/textures/DepthTexture.d.ts +3 -3
  246. three/src/textures/Texture.d.ts +2 -2
@@ -0,0 +1,104 @@
1
+ import {
2
+ Material,
3
+ LoadingManager,
4
+ Mapping,
5
+ Loader,
6
+ BufferGeometry,
7
+ Side,
8
+ Texture,
9
+ Vector2,
10
+ Wrapping,
11
+ } from '../../../src/Three.js';
12
+
13
+ export interface MaterialCreatorOptions {
14
+ /**
15
+ * side: Which side to apply the material
16
+ * THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide
17
+ */
18
+ side?: Side | undefined;
19
+ /*
20
+ * wrap: What type of wrapping to apply for textures
21
+ * THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping
22
+ */
23
+ wrap?: Wrapping | undefined;
24
+ /*
25
+ * normalizeRGB: RGBs need to be normalized to 0-1 from 0-255
26
+ * Default: false, assumed to be already normalized
27
+ */
28
+ normalizeRGB?: boolean | undefined;
29
+ /*
30
+ * ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's
31
+ * Default: false
32
+ */
33
+ ignoreZeroRGBs?: boolean | undefined;
34
+ /*
35
+ * invertTrProperty: Use values 1 of Tr field for fully opaque. This option is useful for obj
36
+ * exported from 3ds MAX, vcglib or meshlab.
37
+ * Default: false
38
+ */
39
+ invertTrProperty?: boolean | undefined;
40
+ }
41
+
42
+ export class MTLLoader extends Loader<MTLLoader.MaterialCreator> {
43
+ constructor(manager?: LoadingManager);
44
+ materialOptions: MaterialCreatorOptions;
45
+
46
+ parse(text: string, path: string): MTLLoader.MaterialCreator;
47
+ setMaterialOptions(value: MaterialCreatorOptions): void;
48
+ }
49
+
50
+ export interface MaterialInfo {
51
+ ks?: number[] | undefined;
52
+ kd?: number[] | undefined;
53
+ ke?: number[] | undefined;
54
+ map_kd?: string | undefined;
55
+ map_ks?: string | undefined;
56
+ map_ke?: string | undefined;
57
+ norm?: string | undefined;
58
+ map_bump?: string | undefined;
59
+ bump?: string | undefined;
60
+ map_d?: string | undefined;
61
+ ns?: number | undefined;
62
+ d?: number | undefined;
63
+ tr?: number | undefined;
64
+ }
65
+
66
+ export interface TexParams {
67
+ scale: Vector2;
68
+ offset: Vector2;
69
+ url: string;
70
+ }
71
+
72
+ export namespace MTLLoader {
73
+ class MaterialCreator {
74
+ constructor(baseUrl?: string, options?: MaterialCreatorOptions);
75
+
76
+ baseUrl: string;
77
+ options: MaterialCreatorOptions;
78
+ materialsInfo: { [key: string]: MaterialInfo };
79
+ materials: { [key: string]: Material };
80
+ private materialsArray: Material[];
81
+ nameLookup: { [key: string]: number };
82
+ side: Side;
83
+ wrap: Wrapping;
84
+ crossOrigin: string;
85
+
86
+ setCrossOrigin(value: string): this;
87
+ setManager(value: LoadingManager): void;
88
+ setMaterials(materialsInfo: { [key: string]: MaterialInfo }): void;
89
+ convert(materialsInfo: { [key: string]: MaterialInfo }): { [key: string]: MaterialInfo };
90
+ preload(): void;
91
+ getIndex(materialName: string): number;
92
+ getAsArray(): Material[];
93
+ create(materialName: string): Material;
94
+ createMaterial_(materialName: string): Material;
95
+ getTextureParams(value: string, matParams: any): TexParams;
96
+ loadTexture(
97
+ url: string,
98
+ mapping?: Mapping,
99
+ onLoad?: (bufferGeometry: BufferGeometry) => void,
100
+ onProgress?: (event: ProgressEvent) => void,
101
+ onError?: (event: ErrorEvent) => void,
102
+ ): Texture;
103
+ }
104
+ }
@@ -0,0 +1,10 @@
1
+ import { Loader, LoadingManager, Group } from '../../../src/Three.js';
2
+ import { MTLLoader } from './MTLLoader.js';
3
+
4
+ export class OBJLoader extends Loader<Group> {
5
+ constructor(manager?: LoadingManager);
6
+ materials: MTLLoader.MaterialCreator;
7
+
8
+ parse(data: string): Group;
9
+ setMaterials(materials: MTLLoader.MaterialCreator): this;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { BufferGeometry, Loader, LoadingManager, Points, PointsMaterial } from '../../../src/Three.js';
2
+
3
+ export class PCDLoader extends Loader<Points<BufferGeometry, PointsMaterial>> {
4
+ constructor(manager?: LoadingManager);
5
+ littleEndian: boolean;
6
+
7
+ parse(data: ArrayBuffer | string): Points<BufferGeometry, PointsMaterial>;
8
+ }
@@ -0,0 +1,19 @@
1
+ import { LoadingManager, DataTextureLoader, TextureDataType, PixelFormat } from '../../../src/Three.js';
2
+
3
+ export interface RGBE {
4
+ width: number;
5
+ height: number;
6
+ data: Float32Array | Uint8Array;
7
+ header: string;
8
+ gamma: number;
9
+ exposure: number;
10
+ type: TextureDataType;
11
+ }
12
+
13
+ export class RGBELoader extends DataTextureLoader {
14
+ constructor(manager?: LoadingManager);
15
+ type: TextureDataType;
16
+
17
+ parse(buffer: ArrayBuffer): RGBE;
18
+ setDataType(type: TextureDataType): this;
19
+ }
@@ -0,0 +1,68 @@
1
+ import { Loader, LoadingManager, ShapePath, BufferGeometry, Vector3, Shape, Vector2 } from '../../../src/Three.js';
2
+
3
+ export interface SVGResultPaths extends ShapePath {
4
+ userData?:
5
+ | {
6
+ [key: string]: any;
7
+ }
8
+ | undefined;
9
+ }
10
+
11
+ export interface SVGResult {
12
+ paths: SVGResultPaths[];
13
+ xml: XMLDocument;
14
+ }
15
+
16
+ export interface StrokeStyle {
17
+ strokeColor: string;
18
+ strokeWidth: number;
19
+ strokeLineJoin: string;
20
+ strokeLineCap: string;
21
+ strokeMiterLimit: number;
22
+ }
23
+
24
+ export class SVGLoader extends Loader<SVGResult> {
25
+ constructor(manager?: LoadingManager);
26
+
27
+ defaultDPI: number;
28
+ defaultUnit: string;
29
+
30
+ parse(text: string): SVGResult;
31
+
32
+ static getStrokeStyle(
33
+ width?: number,
34
+ color?: string,
35
+ lineJoin?: string,
36
+ lineCap?: string,
37
+ miterLimit?: number,
38
+ ): StrokeStyle;
39
+
40
+ /**
41
+ * Generates a stroke with some witdh around the given path.
42
+ * @remarks The path can be open or closed (last point equals to first point)
43
+ * @param points Array of Vector2D (the path). Minimum 2 points.
44
+ * @param style Object with SVG properties as returned by SVGLoader.getStrokeStyle(), or SVGLoader.parse() in the path.userData.style object
45
+ * @param arcDivisions Arc divisions for round joins and endcaps. (Optional)
46
+ * @param minDistance Points closer to this distance will be merged. (Optional)
47
+ * @returns BufferGeometry with stroke triangles (In plane z = 0). UV coordinates are generated ('u' along path. 'v' across it, from left to right)
48
+ */
49
+ static pointsToStroke(
50
+ points: Vector2[],
51
+ style: StrokeStyle,
52
+ arcDivisions?: number,
53
+ minDistance?: number,
54
+ ): BufferGeometry;
55
+
56
+ static pointsToStrokeWithBuffers(
57
+ points: Vector2[],
58
+ style: StrokeStyle,
59
+ arcDivisions?: number,
60
+ minDistance?: number,
61
+ vertices?: number[],
62
+ normals?: number[],
63
+ uvs?: number[],
64
+ vertexOffset?: number,
65
+ ): number;
66
+
67
+ static createShapes(shapePath: ShapePath): Shape[];
68
+ }
@@ -0,0 +1,7 @@
1
+ import { DataTexture, DataTextureLoader, LoadingManager } from '../../../src/Three.js';
2
+
3
+ export class TGALoader extends DataTextureLoader {
4
+ constructor(manager?: LoadingManager);
5
+
6
+ parse(data: ArrayBuffer): DataTexture;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { Loader, LoadingManager } from '../../../src/Three.js';
2
+
3
+ export class TTFLoader extends Loader<object> {
4
+ constructor(manager?: LoadingManager);
5
+ reversed: boolean;
6
+
7
+ parse(arraybuffer: ArrayBuffer): object;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { Loader, LoadingManager, Mesh } from '../../../src/Three.js';
2
+
3
+ export class USDAParser {
4
+ parse(text: string): object;
5
+ }
6
+
7
+ export class USDZLoader extends Loader<Mesh> {
8
+ constructor(manager?: LoadingManager);
9
+
10
+ parse(buffer: ArrayBuffer | string): THREE.Group;
11
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * MeshGouraudMaterial
3
+ *
4
+ * Lambert illumination model with Gouraud (per-vertex) shading
5
+ *
6
+ */
7
+
8
+ import { ShaderMaterial, ShaderMaterialParameters } from '../../../src/Three.js';
9
+
10
+ export class MeshGouraudMaterial extends ShaderMaterial {
11
+ isMeshGouraudMaterial: true;
12
+ type: 'MeshGouraudMaterial';
13
+
14
+ constructor(parameters?: ShaderMaterialParameters);
15
+
16
+ copy(source: MeshGouraudMaterial): this;
17
+ }
@@ -23,5 +23,4 @@ export class Capsule {
23
23
  radius: number,
24
24
  ): boolean;
25
25
  intersectsBox(box: Box3): boolean;
26
- lineLineMinimumPoints(line1: Line3, line2: Line3): Vector3[];
27
26
  }
@@ -14,7 +14,15 @@ export class MD2CharacterComplex {
14
14
  root: Object3D;
15
15
  meshBody: Mesh | null;
16
16
  meshWeapon: Mesh | null;
17
- controls: null;
17
+ controls: {
18
+ crouch?: boolean | undefined;
19
+ jump?: boolean | undefined;
20
+ attack?: boolean | undefined;
21
+ moveForward?: boolean | undefined;
22
+ moveBackward?: boolean | undefined;
23
+ moveLeft?: boolean | undefined;
24
+ moveRight?: boolean | undefined;
25
+ } | null;
18
26
  skinsBody: Texture[];
19
27
  skinsWeapon: Texture[];
20
28
  weapons: Mesh[];
@@ -0,0 +1,149 @@
1
+ // constants
2
+ export * from './core/constants.js';
3
+
4
+ // core
5
+ export { default as ArrayUniformNode } from './core/ArrayUniformNode.js';
6
+ export { default as AttributeNode } from './core/AttributeNode.js';
7
+ export { default as BypassNode } from './core/BypassNode.js';
8
+ export { default as CacheNode } from './core/CacheNode.js';
9
+ export { default as ConstNode } from './core/ConstNode.js';
10
+ export { default as ContextNode } from './core/ContextNode.js';
11
+ export { default as Node } from './core/Node.js';
12
+ export { default as NodeAttribute } from './core/NodeAttribute.js';
13
+ export { default as NodeBuilder } from './core/NodeBuilder.js';
14
+ export { default as NodeCache } from './core/NodeCache.js';
15
+ export { default as NodeCode } from './core/NodeCode.js';
16
+ export { default as NodeFrame } from './core/NodeFrame.js';
17
+ export { default as NodeFunctionInput } from './core/NodeFunctionInput.js';
18
+ export { default as NodeKeywords } from './core/NodeKeywords.js';
19
+ export { default as NodeUniform } from './core/NodeUniform.js';
20
+ export { default as NodeVar } from './core/NodeVar.js';
21
+ export { default as NodeVarying } from './core/NodeVarying.js';
22
+ export { default as PropertyNode } from './core/PropertyNode.js';
23
+ export { default as StackNode } from './core/StackNode.js';
24
+ export { default as TempNode } from './core/TempNode.js';
25
+ export { default as UniformNode } from './core/UniformNode.js';
26
+ export { default as VarNode } from './core/VarNode.js';
27
+ export { default as VaryingNode } from './core/VaryingNode.js';
28
+
29
+ import * as NodeUtils from './core/NodeUtils.js';
30
+ export { NodeUtils };
31
+
32
+ // math
33
+ export {
34
+ default as MathNode,
35
+ MathNodeMethod1,
36
+ MathNodeMethod2,
37
+ MathNodeMethod3,
38
+ MathNodeMethod,
39
+ } from './math/MathNode.js';
40
+ export { default as OperatorNode, OperatorNodeOp } from './math/OperatorNode.js';
41
+ export { default as CondNode } from './math/CondNode.js';
42
+
43
+ // utils
44
+ export { default as ArrayElementNode } from './utils/ArrayElementNode.js';
45
+ export { default as ConvertNode } from './utils/ConvertNode.js';
46
+ export { default as EquirectUVNode } from './utils/EquirectUVNode.js';
47
+ export { default as JoinNode } from './utils/JoinNode.js';
48
+ export { default as MatcapUVNode } from './utils/MatcapUVNode.js';
49
+ export { default as MaxMipLevelNode } from './utils/MaxMipLevelNode.js';
50
+ export { default as OscNode, OscNodeMethod } from './utils/OscNode.js';
51
+ export { default as RemapNode } from './utils/RemapNode.js';
52
+ export { default as RotateUVNode } from './utils/RotateUVNode.js';
53
+ export { default as SpecularMIPLevelNode } from './utils/SpecularMIPLevelNode.js';
54
+ export { default as SplitNode } from './utils/SplitNode.js';
55
+ export { default as SpriteSheetUVNode } from './utils/SpriteSheetUVNode.js';
56
+ export { default as TimerNode, TimerNodeScope } from './utils/TimerNode.js';
57
+ export { default as TriplanarTexturesNode } from './utils/TriplanarTexturesNode.js';
58
+
59
+ // shader node
60
+ export * from './shadernode/ShaderNodeElements.js';
61
+
62
+ // accessors
63
+ export { default as BitangentNode, BitangentNodeScope } from './accessors/BitangentNode.js';
64
+ export { default as BufferNode } from './accessors/BufferNode.js';
65
+ export { default as CameraNode, CameraNodeScope } from './accessors/CameraNode.js';
66
+ export { default as CubeTextureNode } from './accessors/CubeTextureNode.js';
67
+ export { default as InstanceNode } from './accessors/InstanceNode.js';
68
+ export { default as MaterialNode, MaterialNodeScope } from './accessors/MaterialNode.js';
69
+ export { default as MaterialReferenceNode } from './accessors/MaterialReferenceNode.js';
70
+ export { default as ModelNode } from './accessors/ModelNode.js';
71
+ export { default as ModelViewProjectionNode } from './accessors/ModelViewProjectionNode.js';
72
+ export { default as NormalNode, NormalNodeScope } from './accessors/NormalNode.js';
73
+ export { default as Object3DNode, Object3DNodeScope as OObject3DNodeScope } from './accessors/Object3DNode.js';
74
+ export { default as PointUVNode } from './accessors/PointUVNode.js';
75
+ export { default as PositionNode, PositionNodeScope } from './accessors/PositionNode.js';
76
+ export { default as ReferenceNode } from './accessors/ReferenceNode.js';
77
+ export { default as ReflectVectorNode } from './accessors/ReflectVectorNode.js';
78
+ export { default as SkinningNode } from './accessors/SkinningNode.js';
79
+ export { default as TangentNode, TangentNodeScope } from './accessors/TangentNode.js';
80
+ export { default as TextureNode } from './accessors/TextureNode.js';
81
+ export { default as UVNode } from './accessors/UVNode.js';
82
+ export { default as UserDataNode } from './accessors/UserDataNode.js';
83
+
84
+ // display
85
+ export { default as BlendModeNode, BlendMode } from './display/BlendModeNode.js';
86
+ export { default as ColorAdjustmentNode, ColorAdjustmentMethod } from './display/ColorAdjustmentNode.js';
87
+ export { default as ColorSpaceNode, ColorSpaceNodeMethod } from './display/ColorSpaceNode.js';
88
+ export { default as FrontFacingNode } from './display/FrontFacingNode.js';
89
+ export { default as NormalMapNode } from './display/NormalMapNode.js';
90
+ export { default as PosterizeNode } from './display/PosterizeNode.js';
91
+ export { default as ToneMappingNode } from './display/ToneMappingNode.js';
92
+ export { default as ViewportNode } from './display/ViewportNode.js';
93
+
94
+ // code
95
+ export { default as ExpressionNode } from './code/ExpressionNode.js';
96
+ export { default as CodeNode, CodeNodeInclude } from './code/CodeNode.js';
97
+ export { default as FunctionCallNode } from './code/FunctionCallNode.js';
98
+ export { default as FunctionNode, FunctionNodeArguments } from './code/FunctionNode.js';
99
+
100
+ // fog
101
+ export { default as FogNode } from './fog/FogNode.js';
102
+ export { default as FogRangeNode } from './fog/FogRangeNode.js';
103
+ export { default as FogExp2Node } from './fog/FogExp2Node.js';
104
+
105
+ // geometry
106
+ export { default as RangeNode, RangeModeBound } from './geometry/RangeNode.js';
107
+
108
+ // gpgpu
109
+ export { default as ComputeNode } from './gpgpu/ComputeNode.js';
110
+
111
+ // lighting
112
+ export { default as PointLightNode } from './lighting/PointLightNode.js';
113
+ export { default as SpotLightNode } from './lighting/SpotLightNode.js';
114
+ export { default as LightsNode } from './lighting/LightsNode.js';
115
+ export { default as LightingNode } from './lighting/LightingNode.js';
116
+ export { default as LightingContextNode, LightingModelNode } from './lighting/LightingContextNode.js';
117
+ export { default as HemisphereLightNode } from './lighting/HemisphereLightNode.js';
118
+ export { default as EnvironmentNode } from './lighting/EnvironmentNode.js';
119
+ export { default as AONode } from './lighting/AONode.js';
120
+ export { default as AnalyticLightNode } from './lighting/AnalyticLightNode.js';
121
+
122
+ // procedural
123
+ export { default as CheckerNode } from './procedural/CheckerNode.js';
124
+
125
+ // loaders
126
+ export { default as NodeLoader } from './loaders/NodeLoader.js';
127
+ export { default as NodeObjectLoader } from './loaders/NodeObjectLoader.js';
128
+ export { default as NodeMaterialLoader } from './loaders/NodeMaterialLoader.js';
129
+
130
+ // materials
131
+ export * from './materials/Materials.js';
132
+
133
+ // materialX
134
+ export * from './materialx/MaterialXNodes.js';
135
+
136
+ // functions
137
+ export { default as BRDF_GGX } from './functions/BSDF/BRDF_GGX.js';
138
+ export { default as BRDF_Lambert } from './functions/BSDF/BRDF_Lambert.js';
139
+ export { default as D_GGX } from './functions/BSDF/D_GGX.js';
140
+ export { default as DFGApprox } from './functions/BSDF/DFGApprox.js';
141
+ export { default as F_Schlick } from './functions/BSDF/F_Schlick.js';
142
+ export { default as V_GGX_SmithCorrelated } from './functions/BSDF/V_GGX_SmithCorrelated.js';
143
+
144
+ export { getDistanceAttenuation } from './lighting/LightUtils.js';
145
+
146
+ export { default as getGeometryRoughness } from './functions/material/getGeometryRoughness.js';
147
+ export { default as getRoughness } from './functions/material/getRoughness.js';
148
+
149
+ export { default as physicalLightingModel } from './functions/PhysicalLightingModel.js';
@@ -0,0 +1,18 @@
1
+ import Node from '../core/Node.js';
2
+
3
+ export type BitangentNodeScope =
4
+ | typeof BitangentNode.LOCAL
5
+ | typeof BitangentNode.VIEW
6
+ | typeof BitangentNode.WORLD
7
+ | typeof BitangentNode.GEOMETRY;
8
+
9
+ export default class BitangentNode extends Node {
10
+ static GEOMETRY: 'geometry';
11
+ static LOCAL: 'local';
12
+ static VIEW: 'view';
13
+ static WORLD: 'world';
14
+
15
+ scope: BitangentNodeScope;
16
+
17
+ constructor(scope?: BitangentNodeScope);
18
+ }
@@ -0,0 +1,11 @@
1
+ import { NodeTypeOption } from '../core/constants.js';
2
+ import UniformNode from '../core/UniformNode.js';
3
+
4
+ export default class BufferNode extends UniformNode {
5
+ isBufferNode: true;
6
+
7
+ bufferType: string;
8
+ bufferCount: number;
9
+
10
+ constructor(value: ArrayLike<number>, bufferType: NodeTypeOption, bufferCount?: number);
11
+ }
@@ -0,0 +1,12 @@
1
+ import Object3DNode, { Object3DNodeScope } from './Object3DNode.js';
2
+
3
+ export type CameraNodeScope = Object3DNodeScope | typeof CameraNode.PROJECTION_MATRIX;
4
+
5
+ export default class CameraNode extends Object3DNode {
6
+ static PROJECTION_MATRIX: 'projectionMatrix';
7
+
8
+ // @ts-expect-error
9
+ scope: CameraNodeScope;
10
+
11
+ constructor(scope?: CameraNodeScope);
12
+ }
@@ -0,0 +1,13 @@
1
+ import TextureNode from './TextureNode.js';
2
+ import { Node } from '../Nodes.js';
3
+ import { CubeTexture } from '../../../../src/Three.js';
4
+
5
+ export default class CubeTextureNode extends TextureNode {
6
+ isCubeTextureNode: boolean;
7
+ uvNode: Node | null;
8
+ levelNode: Node | null;
9
+
10
+ constructor(value: CubeTexture, uvNode?: Node | null, levelNode?: Node | null);
11
+
12
+ getDefaultUV(): Node;
13
+ }
@@ -0,0 +1,9 @@
1
+ import { InstancedMesh } from '../../../../src/Three.js';
2
+ import Node from '../core/Node.js';
3
+
4
+ export default class InstanceNode extends Node {
5
+ instanceMesh: InstancedMesh;
6
+ instanceMatrixNode: Node;
7
+
8
+ constructor(instanceMesh: InstancedMesh);
9
+ }
@@ -0,0 +1,23 @@
1
+ import Node from '../core/Node.js';
2
+
3
+ export type MaterialNodeScope =
4
+ | typeof MaterialNode.ALPHA_TEST
5
+ | typeof MaterialNode.COLOR
6
+ | typeof MaterialNode.OPACITY
7
+ | typeof MaterialNode.ROUGHNESS
8
+ | typeof MaterialNode.METALNESS
9
+ | typeof MaterialNode.EMISSIVE
10
+ | typeof MaterialNode.ROTATION;
11
+
12
+ export default class MaterialNode extends Node {
13
+ static ALPHA_TEST: 'alphaTest';
14
+ static COLOR: 'color';
15
+ static OPACITY: 'opacity';
16
+ static ROUGHNESS: 'roughness';
17
+ static METALNESS: 'metalness';
18
+ static EMISSIVE: 'emissive';
19
+ static ROTATION: 'rotation';
20
+
21
+ scope: MaterialNodeScope;
22
+ constructor(scope?: MaterialNodeScope);
23
+ }
@@ -0,0 +1,6 @@
1
+ import { Material } from '../../../../src/Three.js';
2
+ import ReferenceNode from './ReferenceNode.js';
3
+
4
+ export default class MaterialReferenceNode extends ReferenceNode<Material | null> {
5
+ constructor(property: string, inputType: string, material?: Material | null);
6
+ }
@@ -0,0 +1,9 @@
1
+ import { NodeFrame } from '../Nodes.js';
2
+ import Object3DNode, { Object3DNodeScope } from './Object3DNode.js';
3
+
4
+ /**
5
+ * Similar to {@link Object3DNode} but the object comes from {@link NodeFrame}
6
+ */
7
+ export default class ModelNode extends Object3DNode {
8
+ constructor(scope?: Object3DNodeScope);
9
+ }
@@ -0,0 +1,6 @@
1
+ import Node from '../core/Node.js';
2
+ import PositionNode from './PositionNode.js';
3
+
4
+ export default class ModelViewProjectionNode extends Node {
5
+ constructor(positionNode?: PositionNode);
6
+ }
@@ -0,0 +1,12 @@
1
+ import Node from '../core/Node.js';
2
+
3
+ export type NormalNodeScope = typeof NormalNode.GEOMETRY | typeof NormalNode.LOCAL | typeof NormalNode.VIEW;
4
+
5
+ export default class NormalNode extends Node {
6
+ static GEOMETRY: 'geometry';
7
+ static LOCAL: 'local';
8
+ static VIEW: 'view';
9
+ scope: NormalNodeScope;
10
+
11
+ constructor(scope?: NormalNodeScope);
12
+ }
@@ -0,0 +1,22 @@
1
+ import { Object3D } from '../../../../src/Three.js';
2
+ import Node from '../core/Node.js';
3
+
4
+ export type Object3DNodeScope =
5
+ | typeof Object3DNode.VIEW_MATRIX
6
+ | typeof Object3DNode.NORMAL_MATRIX
7
+ | typeof Object3DNode.WORLD_MATRIX
8
+ | typeof Object3DNode.POSITION
9
+ | typeof Object3DNode.VIEW_POSITION;
10
+
11
+ export default class Object3DNode extends Node {
12
+ static VIEW_MATRIX: 'viewMatrix';
13
+ static NORMAL_MATRIX: 'normalMatrix';
14
+ static WORLD_MATRIX: 'worldMatrix';
15
+ static POSITION: 'position';
16
+ static VIEW_POSITION: 'viewPosition';
17
+
18
+ scope: Object3DNodeScope;
19
+ object3d: Object3D | null;
20
+
21
+ constructor(scope?: Object3DNodeScope, object3d?: Object3D | null);
22
+ }
@@ -0,0 +1,7 @@
1
+ import Node from '../core/Node.js';
2
+
3
+ export default class PointUVNode extends Node {
4
+ isPointUVNode: true;
5
+
6
+ constructor();
7
+ }
@@ -0,0 +1,21 @@
1
+ import Node from '../core/Node.js';
2
+
3
+ export type PositionNodeScope =
4
+ | typeof PositionNode.GEOMETRY
5
+ | typeof PositionNode.LOCAL
6
+ | typeof PositionNode.WORLD
7
+ | typeof PositionNode.WORLD_DIRECTION
8
+ | typeof PositionNode.VIEW
9
+ | typeof PositionNode.VIEW_DIRECTION;
10
+
11
+ export default class PositionNode extends Node {
12
+ static GEOMETRY: 'geometry';
13
+ static LOCAL: 'local';
14
+ static WORLD: 'world';
15
+ static WORLD_DIRECTION: 'worldDirection';
16
+ static VIEW: 'view';
17
+ static VIEW_DIRECTION: 'viewDirection';
18
+ scope: PositionNodeScope;
19
+
20
+ constructor(scope?: PositionNodeScope);
21
+ }
@@ -0,0 +1,13 @@
1
+ import Node from '../core/Node.js';
2
+ import { NodeTypeOption } from '../Nodes.js';
3
+
4
+ export default class ReferenceNode<T> extends Node {
5
+ object: T;
6
+ property: string;
7
+ uniformType: string;
8
+ node: Node | null;
9
+
10
+ constructor(property: string, uniformType: NodeTypeOption, object?: T | null);
11
+
12
+ setNodeType(uniformType: NodeTypeOption): void;
13
+ }
@@ -0,0 +1,8 @@
1
+ import Node from '../core/Node.js';
2
+
3
+ export default class ReflectVectorNode extends Node {
4
+ constructor();
5
+
6
+ getHash(): 'reflectVector';
7
+ setup(): Node;
8
+ }