three-base 2.0.130 → 2.0.137

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 (125) hide show
  1. package/ApngTexture.d.ts +13 -13
  2. package/ApngTexture.js +61 -61
  3. package/ApngTextureManage.d.ts +18 -18
  4. package/ApngTextureManage.js +87 -87
  5. package/DirectionalLight.d.ts +6 -0
  6. package/DirectionalLight.js +68 -0
  7. package/EventMesh.d.ts +18 -18
  8. package/EventMesh.js +59 -59
  9. package/ExtrudeMesh.d.ts +112 -112
  10. package/ExtrudeMesh.js +366 -366
  11. package/FPScontrol.d.ts +78 -50
  12. package/FPScontrol.js +617 -232
  13. package/Fire/Fire.d.ts +28 -28
  14. package/Fire/Fire.js +79 -79
  15. package/Fire/FireGromtry.d.ts +9 -9
  16. package/Fire/FireGromtry.js +40 -40
  17. package/Fire/FireMaterial.d.ts +28 -28
  18. package/Fire/FireMaterial.js +32 -32
  19. package/Fire/index.d.ts +1 -1
  20. package/Fire/index.js +1 -1
  21. package/Grass/Grass.d.ts +8 -8
  22. package/Grass/Grass.js +38 -38
  23. package/Grass/index.d.ts +1 -1
  24. package/Grass/index.js +1 -1
  25. package/Ground1/Ground1.d.ts +11 -11
  26. package/Ground1/Ground1.js +54 -54
  27. package/Ground1/index.d.ts +1 -1
  28. package/Ground1/index.js +1 -1
  29. package/InstancedMeshBase.d.ts +39 -39
  30. package/InstancedMeshBase.js +293 -293
  31. package/KeyFrameAnimation.d.ts +25 -25
  32. package/KeyFrameAnimation.js +78 -78
  33. package/MeshBase.d.ts +35 -35
  34. package/MeshBase.js +223 -223
  35. package/Mirror.d.ts +25 -25
  36. package/Mirror.js +139 -139
  37. package/PipeMesh/PathGeometry.d.ts +44 -44
  38. package/PipeMesh/PathGeometry.js +300 -300
  39. package/PipeMesh/PathPoint.d.ts +17 -17
  40. package/PipeMesh/PathPoint.js +31 -31
  41. package/PipeMesh/PathPointList.d.ts +31 -31
  42. package/PipeMesh/PathPointList.js +208 -208
  43. package/PipeMesh/PathTubeGeometry.d.ts +25 -25
  44. package/PipeMesh/PathTubeGeometry.js +130 -130
  45. package/PipeMesh/PipeMesh.d.ts +25 -25
  46. package/PipeMesh/PipeMesh.js +63 -63
  47. package/PipeMesh/index.d.ts +1 -1
  48. package/PipeMesh/index.js +1 -1
  49. package/PlaneModal1/PlaneModal1.d.ts +31 -31
  50. package/PlaneModal1/PlaneModal1.js +105 -105
  51. package/PlaneModal1/index.d.ts +1 -1
  52. package/PlaneModal1/index.js +1 -1
  53. package/PlaneText.d.ts +39 -39
  54. package/PlaneText.js +30 -30
  55. package/PlaneWithHtml.d.ts +11 -11
  56. package/PlaneWithHtml.js +63 -68
  57. package/PointLight/PointLight.d.ts +14 -13
  58. package/PointLight/PointLight.js +70 -64
  59. package/PointLight/index.d.ts +1 -1
  60. package/PointLight/index.js +1 -1
  61. package/Sky/Sky.d.ts +9 -9
  62. package/Sky/Sky.js +22 -22
  63. package/Sky/index.d.ts +1 -1
  64. package/Sky/index.js +1 -1
  65. package/SpotLight.d.ts +6 -0
  66. package/SpotLight.js +72 -0
  67. package/SpriteModal1/SpriteModal1.d.ts +30 -30
  68. package/SpriteModal1/SpriteModal1.js +110 -110
  69. package/SpriteModal1/index.d.ts +1 -1
  70. package/SpriteModal1/index.js +1 -1
  71. package/SpriteText.d.ts +45 -45
  72. package/SpriteText.js +163 -163
  73. package/SpriteText2.d.ts +47 -47
  74. package/SpriteText2.js +198 -198
  75. package/SpriteWithHtml.d.ts +7 -7
  76. package/SpriteWithHtml.js +44 -49
  77. package/Text3D/Text3D.d.ts +20 -20
  78. package/Text3D/Text3D.js +62 -62
  79. package/Text3D/fontController.d.ts +59 -59
  80. package/Text3D/fontController.js +199 -199
  81. package/Text3D/index.d.ts +1 -1
  82. package/Text3D/index.js +1 -1
  83. package/ThreeBase.d.ts +111 -81
  84. package/ThreeBase.js +656 -560
  85. package/ThreeMouse.d.ts +40 -40
  86. package/ThreeMouse.js +407 -407
  87. package/Transition.d.ts +40 -40
  88. package/Transition.js +210 -210
  89. package/Water/Water.d.ts +5 -0
  90. package/Water/Water.js +26 -0
  91. package/Water/waternormals.jpg +0 -0
  92. package/declare.d.ts +167 -0
  93. package/index.d.ts +1 -1
  94. package/index.js +2 -2
  95. package/keyContorls.d.ts +25 -25
  96. package/keyContorls.js +98 -98
  97. package/package.json +3 -2
  98. package/pass/bloom_pass.d.ts +2 -2
  99. package/pass/bloom_pass.js +99 -99
  100. package/pass/cover_pass.d.ts +2 -2
  101. package/pass/cover_pass.js +95 -95
  102. package/pass/emissive_ao_pass.d.ts +13 -0
  103. package/pass/emissive_ao_pass.js +370 -0
  104. package/pass/frosted_glass_pass.d.ts +2 -0
  105. package/pass/frosted_glass_pass.js +275 -0
  106. package/pass/fsQuad.d.ts +9 -9
  107. package/pass/fsQuad.js +28 -28
  108. package/pass/glow_pass.d.ts +2 -2
  109. package/pass/glow_pass.js +310 -254
  110. package/pass/ssao_pass.d.ts +13 -0
  111. package/pass/ssao_pass.js +372 -0
  112. package/pass/stroke_pass.d.ts +2 -2
  113. package/pass/stroke_pass.js +199 -199
  114. package/shaders/FXAAShaderMaterial.d.ts +3 -3
  115. package/shaders/FXAAShaderMaterial.js +21 -21
  116. package/shaders/baseTextureToRenderShader.d.ts +2 -2
  117. package/shaders/baseTextureToRenderShader.js +14 -14
  118. package/shaders/copyShader.d.ts +3 -3
  119. package/shaders/copyShader.js +14 -14
  120. package/shaders.d.ts +5 -5
  121. package/shaders.js +42 -42
  122. package/threeLoader.d.ts +34 -34
  123. package/threeLoader.js +527 -527
  124. package/threeUtils.d.ts +52 -52
  125. package/threeUtils.js +330 -330
package/Mirror.js CHANGED
@@ -1,51 +1,51 @@
1
- /*
2
- * @Author: xiaosihan
3
- * @Date: 2023-08-04 17:17:15
4
- * @Last Modified by: xiaosihan
5
- * @Last Modified time: 2024-01-20 05:33:51
6
- */
7
- import { Color, DoubleSide, HalfFloatType, Matrix4, Mesh, PerspectiveCamera, Plane, PlaneGeometry, ShaderMaterial, Vector3, Vector4, WebGLRenderTarget } from "three";
8
- // 镜子模型
9
- export default class Mirror extends Mesh {
10
- constructor(geometry = Mirror.geometry) {
11
- super(geometry);
12
- }
13
- // 正方形网格
14
- static geometry = (() => {
15
- const geometry = new PlaneGeometry(10, 10, 1, 1);
16
- return geometry;
17
- })();
18
- isReflector = true;
19
- type = 'Reflector';
20
- camera = new PerspectiveCamera();
21
- reflectorPlane = new Plane();
22
- normal = new Vector3();
23
- reflectorWorldPosition = new Vector3();
24
- cameraWorldPosition = new Vector3();
25
- rotationMatrix = new Matrix4();
26
- lookAtPosition = new Vector3(0, 0, -1);
27
- clipPlane = new Vector4();
28
- view = new Vector3();
29
- target = new Vector3();
30
- q = new Vector4();
31
- textureMatrix = new Matrix4();
32
- virtualCamera = this.camera;
33
- renderTarget = new WebGLRenderTarget(2048, 2048, { samples: 0, type: HalfFloatType });
34
- material = new ShaderMaterial({
35
- uniforms: {
36
- 'color': {
37
- value: new Color("#b6b6b6")
38
- },
39
- 'tDiffuse': {
40
- value: this.renderTarget.texture
41
- },
42
- 'textureMatrix': {
43
- value: this.textureMatrix
44
- },
45
- blurAmount: {
46
- value: 0.5
47
- } // 模糊程度,可以根据需求调整
48
- },
1
+ /*
2
+ * @Author: xiaosihan
3
+ * @Date: 2023-08-04 17:17:15
4
+ * @Last Modified by: xiaosihan
5
+ * @Last Modified time: 2024-01-20 05:33:51
6
+ */
7
+ import { Color, DoubleSide, HalfFloatType, Matrix4, Mesh, PerspectiveCamera, Plane, PlaneGeometry, ShaderMaterial, Vector3, Vector4, WebGLRenderTarget } from "three";
8
+ // 镜子模型
9
+ export default class Mirror extends Mesh {
10
+ constructor(geometry = Mirror.geometry) {
11
+ super(geometry);
12
+ }
13
+ // 正方形网格
14
+ static geometry = (() => {
15
+ const geometry = new PlaneGeometry(10, 10, 1, 1);
16
+ return geometry;
17
+ })();
18
+ isReflector = true;
19
+ type = 'Reflector';
20
+ camera = new PerspectiveCamera();
21
+ reflectorPlane = new Plane();
22
+ normal = new Vector3();
23
+ reflectorWorldPosition = new Vector3();
24
+ cameraWorldPosition = new Vector3();
25
+ rotationMatrix = new Matrix4();
26
+ lookAtPosition = new Vector3(0, 0, -1);
27
+ clipPlane = new Vector4();
28
+ view = new Vector3();
29
+ target = new Vector3();
30
+ q = new Vector4();
31
+ textureMatrix = new Matrix4();
32
+ virtualCamera = this.camera;
33
+ renderTarget = new WebGLRenderTarget(2048, 2048, { samples: 0, type: HalfFloatType });
34
+ material = new ShaderMaterial({
35
+ uniforms: {
36
+ 'color': {
37
+ value: new Color("#b6b6b6")
38
+ },
39
+ 'tDiffuse': {
40
+ value: this.renderTarget.texture
41
+ },
42
+ 'textureMatrix': {
43
+ value: this.textureMatrix
44
+ },
45
+ blurAmount: {
46
+ value: 0.5
47
+ } // 模糊程度,可以根据需求调整
48
+ },
49
49
  vertexShader: /* glsl */ `
50
50
  uniform mat4 textureMatrix;
51
51
  varying vec4 vUv;
@@ -61,7 +61,7 @@ export default class Mirror extends Mesh {
61
61
 
62
62
  #include <logdepthbuf_vertex>
63
63
 
64
- }`,
64
+ }`,
65
65
  fragmentShader: /* glsl */ `
66
66
  uniform vec3 color;
67
67
  uniform sampler2D tDiffuse;
@@ -104,93 +104,93 @@ export default class Mirror extends Mesh {
104
104
 
105
105
  #include <tonemapping_fragment>
106
106
  #include <colorspace_fragment>
107
- }`,
108
- depthTest: true,
109
- depthWrite: true,
110
- transparent: true,
111
- side: DoubleSide
112
- });
113
- onBeforeRender = (renderer, scene, camera, geometry, material, group) => {
114
- this.reflectorWorldPosition.setFromMatrixPosition(this.matrixWorld);
115
- this.cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld);
116
- this.rotationMatrix.extractRotation(this.matrixWorld);
117
- this.normal.set(0, 0, 1);
118
- this.normal.applyMatrix4(this.rotationMatrix);
119
- this.view.subVectors(this.reflectorWorldPosition, this.cameraWorldPosition);
120
- // Avoid rendering when reflector is facing away
121
- if (this.view.dot(this.normal) > 0) {
122
- this.normal.set(0, 0, -1);
123
- }
124
- ;
125
- this.view.reflect(this.normal).negate();
126
- this.view.add(this.reflectorWorldPosition);
127
- this.rotationMatrix.extractRotation(camera.matrixWorld);
128
- this.lookAtPosition.set(0, 0, -1);
129
- this.lookAtPosition.applyMatrix4(this.rotationMatrix);
130
- this.lookAtPosition.add(this.cameraWorldPosition);
131
- this.target.subVectors(this.reflectorWorldPosition, this.lookAtPosition);
132
- this.target.reflect(this.normal).negate();
133
- this.target.add(this.reflectorWorldPosition);
134
- this.virtualCamera.position.copy(this.view);
135
- this.virtualCamera.up.set(0, 1, 0);
136
- this.virtualCamera.up.applyMatrix4(this.rotationMatrix);
137
- this.virtualCamera.up.reflect(this.normal);
138
- this.virtualCamera.lookAt(this.target);
139
- this.virtualCamera.far = this.camera.far; // Used in WebGLBackground
140
- this.virtualCamera.updateMatrixWorld();
141
- this.virtualCamera.projectionMatrix.copy(camera.projectionMatrix);
142
- // Update the texture matrix
143
- this.textureMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0);
144
- this.textureMatrix.multiply(this.virtualCamera.projectionMatrix);
145
- this.textureMatrix.multiply(this.virtualCamera.matrixWorldInverse);
146
- this.textureMatrix.multiply(this.matrixWorld);
147
- // Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html
148
- // Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf
149
- this.reflectorPlane.setFromNormalAndCoplanarPoint(this.normal, this.reflectorWorldPosition);
150
- this.reflectorPlane.applyMatrix4(this.virtualCamera.matrixWorldInverse);
151
- this.clipPlane.set(this.reflectorPlane.normal.x, this.reflectorPlane.normal.y, this.reflectorPlane.normal.z, this.reflectorPlane.constant);
152
- const projectionMatrix = this.virtualCamera.projectionMatrix;
153
- this.q.x = (Math.sign(this.clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0];
154
- this.q.y = (Math.sign(this.clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5];
155
- this.q.z = -1.0;
156
- this.q.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14];
157
- // Calculate the scaled plane vector
158
- this.clipPlane.multiplyScalar(2.0 / this.clipPlane.dot(this.q));
159
- // Replacing the third row of the projection matrix
160
- projectionMatrix.elements[2] = this.clipPlane.x;
161
- projectionMatrix.elements[6] = this.clipPlane.y;
162
- projectionMatrix.elements[10] = this.clipPlane.z + 1.0 - 0.003;
163
- projectionMatrix.elements[14] = this.clipPlane.w;
164
- // Render
165
- this.visible = false;
166
- const currentRenderTarget = renderer.getRenderTarget();
167
- const currentXrEnabled = renderer.xr.enabled;
168
- const currentShadowAutoUpdate = renderer.shadowMap.autoUpdate;
169
- renderer.xr.enabled = false; // Avoid camera modification
170
- renderer.shadowMap.autoUpdate = false; // Avoid re-computing shadows
171
- renderer.setRenderTarget(this.renderTarget);
172
- renderer.state.buffers.depth.setMask(true); // make sure the depth buffer is writable so it can be properly cleared, see #18897
173
- if (renderer.autoClear === false)
174
- renderer.clear();
175
- renderer.render(scene, this.virtualCamera);
176
- renderer.xr.enabled = currentXrEnabled;
177
- renderer.shadowMap.autoUpdate = currentShadowAutoUpdate;
178
- renderer.setRenderTarget(currentRenderTarget);
179
- // Restore viewport
180
- //@ts-ignore
181
- const viewport = this.camera.viewport;
182
- if (viewport !== undefined) {
183
- renderer.state.viewport(viewport);
184
- }
185
- this.visible = true;
186
- };
187
- getRenderTarget() {
188
- return this.renderTarget;
189
- }
190
- ;
191
- dispose() {
192
- this.renderTarget.dispose();
193
- // this.material.dispose();
194
- }
195
- ;
196
- }
107
+ }`,
108
+ depthTest: true,
109
+ depthWrite: true,
110
+ transparent: true,
111
+ side: DoubleSide
112
+ });
113
+ onBeforeRender = (renderer, scene, camera, geometry, material, group) => {
114
+ this.reflectorWorldPosition.setFromMatrixPosition(this.matrixWorld);
115
+ this.cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld);
116
+ this.rotationMatrix.extractRotation(this.matrixWorld);
117
+ this.normal.set(0, 0, 1);
118
+ this.normal.applyMatrix4(this.rotationMatrix);
119
+ this.view.subVectors(this.reflectorWorldPosition, this.cameraWorldPosition);
120
+ // Avoid rendering when reflector is facing away
121
+ if (this.view.dot(this.normal) > 0) {
122
+ this.normal.set(0, 0, -1);
123
+ }
124
+ ;
125
+ this.view.reflect(this.normal).negate();
126
+ this.view.add(this.reflectorWorldPosition);
127
+ this.rotationMatrix.extractRotation(camera.matrixWorld);
128
+ this.lookAtPosition.set(0, 0, -1);
129
+ this.lookAtPosition.applyMatrix4(this.rotationMatrix);
130
+ this.lookAtPosition.add(this.cameraWorldPosition);
131
+ this.target.subVectors(this.reflectorWorldPosition, this.lookAtPosition);
132
+ this.target.reflect(this.normal).negate();
133
+ this.target.add(this.reflectorWorldPosition);
134
+ this.virtualCamera.position.copy(this.view);
135
+ this.virtualCamera.up.set(0, 1, 0);
136
+ this.virtualCamera.up.applyMatrix4(this.rotationMatrix);
137
+ this.virtualCamera.up.reflect(this.normal);
138
+ this.virtualCamera.lookAt(this.target);
139
+ this.virtualCamera.far = this.camera.far; // Used in WebGLBackground
140
+ this.virtualCamera.updateMatrixWorld();
141
+ this.virtualCamera.projectionMatrix.copy(camera.projectionMatrix);
142
+ // Update the texture matrix
143
+ this.textureMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0);
144
+ this.textureMatrix.multiply(this.virtualCamera.projectionMatrix);
145
+ this.textureMatrix.multiply(this.virtualCamera.matrixWorldInverse);
146
+ this.textureMatrix.multiply(this.matrixWorld);
147
+ // Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html
148
+ // Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf
149
+ this.reflectorPlane.setFromNormalAndCoplanarPoint(this.normal, this.reflectorWorldPosition);
150
+ this.reflectorPlane.applyMatrix4(this.virtualCamera.matrixWorldInverse);
151
+ this.clipPlane.set(this.reflectorPlane.normal.x, this.reflectorPlane.normal.y, this.reflectorPlane.normal.z, this.reflectorPlane.constant);
152
+ const projectionMatrix = this.virtualCamera.projectionMatrix;
153
+ this.q.x = (Math.sign(this.clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0];
154
+ this.q.y = (Math.sign(this.clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5];
155
+ this.q.z = -1.0;
156
+ this.q.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14];
157
+ // Calculate the scaled plane vector
158
+ this.clipPlane.multiplyScalar(2.0 / this.clipPlane.dot(this.q));
159
+ // Replacing the third row of the projection matrix
160
+ projectionMatrix.elements[2] = this.clipPlane.x;
161
+ projectionMatrix.elements[6] = this.clipPlane.y;
162
+ projectionMatrix.elements[10] = this.clipPlane.z + 1.0 - 0.003;
163
+ projectionMatrix.elements[14] = this.clipPlane.w;
164
+ // Render
165
+ this.visible = false;
166
+ const currentRenderTarget = renderer.getRenderTarget();
167
+ const currentXrEnabled = renderer.xr.enabled;
168
+ const currentShadowAutoUpdate = renderer.shadowMap.autoUpdate;
169
+ renderer.xr.enabled = false; // Avoid camera modification
170
+ renderer.shadowMap.autoUpdate = false; // Avoid re-computing shadows
171
+ renderer.setRenderTarget(this.renderTarget);
172
+ renderer.state.buffers.depth.setMask(true); // make sure the depth buffer is writable so it can be properly cleared, see #18897
173
+ if (renderer.autoClear === false)
174
+ renderer.clear();
175
+ renderer.render(scene, this.virtualCamera);
176
+ renderer.xr.enabled = currentXrEnabled;
177
+ renderer.shadowMap.autoUpdate = currentShadowAutoUpdate;
178
+ renderer.setRenderTarget(currentRenderTarget);
179
+ // Restore viewport
180
+ //@ts-ignore
181
+ const viewport = this.camera.viewport;
182
+ if (viewport !== undefined) {
183
+ renderer.state.viewport(viewport);
184
+ }
185
+ this.visible = true;
186
+ };
187
+ getRenderTarget() {
188
+ return this.renderTarget;
189
+ }
190
+ ;
191
+ dispose() {
192
+ this.renderTarget.dispose();
193
+ // this.material.dispose();
194
+ }
195
+ ;
196
+ }
@@ -1,44 +1,44 @@
1
- import { Usage } from 'three/src/constants.js';
2
- import type { PathPointList } from './PathPointList.js';
3
- import { BufferGeometry } from 'three/src/core/BufferGeometry.js';
4
- export interface Options {
5
- radius?: number;
6
- width?: number;
7
- progress?: number;
8
- radialSegments?: number;
9
- startRad?: number;
10
- arrow?: boolean;
11
- side?: 'both' | 'left' | 'right';
12
- }
13
- export interface PathGeometryParam {
14
- pathPointList: PathPointList;
15
- options: Options;
16
- usage: Usage;
17
- transparent: boolean;
18
- }
19
- /**
20
- * PathGeometry
21
- */
22
- declare class PathGeometry extends BufferGeometry {
23
- /**
24
- * @param {Object|Number} initData - If initData is number, geometry init by empty data and set it as the max vertex. If initData is Object, it contains pathPointList and options.
25
- * @param {Boolean} [generateUv2=false]
26
- */
27
- constructor(initData: PathGeometryParam, generateUv2?: boolean);
28
- _initByMaxVertex(maxVertex: number, generateUv2: boolean): void;
29
- _initByData(pathPointList: PathPointList, options: Options, usage: Usage, generateUv2: boolean): void;
30
- /**
31
- * Update geometry by PathPointList instance
32
- * @param {PathPointList} pathPointList
33
- * @param {Object} options
34
- * @param {Number} [options.width=0.1]
35
- * @param {Number} [options.progress=1]
36
- * @param {Boolean} [options.arrow=true]
37
- * @param {String} [options.side='both'] - "left"/"right"/"both"
38
- */
39
- update(pathPointList: PathPointList, options: Options): void;
40
- _resizeAttribute(name: string, len: number): void;
41
- _resizeIndex(len: number): void;
42
- _updateAttributes(position: Array<number>, normal: Array<number>, uv: Array<number>, uv2: Array<number> | null, indices: Array<number>): void;
43
- }
44
- export { PathGeometry };
1
+ import { Usage } from 'three/src/constants.js';
2
+ import type { PathPointList } from './PathPointList.js';
3
+ import { BufferGeometry } from 'three/src/core/BufferGeometry.js';
4
+ export interface Options {
5
+ radius?: number;
6
+ width?: number;
7
+ progress?: number;
8
+ radialSegments?: number;
9
+ startRad?: number;
10
+ arrow?: boolean;
11
+ side?: 'both' | 'left' | 'right';
12
+ }
13
+ export interface PathGeometryParam {
14
+ pathPointList: PathPointList;
15
+ options: Options;
16
+ usage: Usage;
17
+ transparent: boolean;
18
+ }
19
+ /**
20
+ * PathGeometry
21
+ */
22
+ declare class PathGeometry extends BufferGeometry {
23
+ /**
24
+ * @param {Object|Number} initData - If initData is number, geometry init by empty data and set it as the max vertex. If initData is Object, it contains pathPointList and options.
25
+ * @param {Boolean} [generateUv2=false]
26
+ */
27
+ constructor(initData: PathGeometryParam, generateUv2?: boolean);
28
+ _initByMaxVertex(maxVertex: number, generateUv2: boolean): void;
29
+ _initByData(pathPointList: PathPointList, options: Options, usage: Usage, generateUv2: boolean): void;
30
+ /**
31
+ * Update geometry by PathPointList instance
32
+ * @param {PathPointList} pathPointList
33
+ * @param {Object} options
34
+ * @param {Number} [options.width=0.1]
35
+ * @param {Number} [options.progress=1]
36
+ * @param {Boolean} [options.arrow=true]
37
+ * @param {String} [options.side='both'] - "left"/"right"/"both"
38
+ */
39
+ update(pathPointList: PathPointList, options: Options): void;
40
+ _resizeAttribute(name: string, len: number): void;
41
+ _resizeIndex(len: number): void;
42
+ _updateAttributes(position: Array<number>, normal: Array<number>, uv: Array<number>, uv2: Array<number> | null, indices: Array<number>): void;
43
+ }
44
+ export { PathGeometry };