three-base 2.0.172 → 2.0.175

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 (115) hide show
  1. package/FPScontrol.d.ts +15 -24
  2. package/FPScontrol.js +63 -87
  3. package/FPScontrol.ts +64 -88
  4. package/Ground1/Ground1.d.ts +4 -2
  5. package/Ground1/Ground1.js +77 -57
  6. package/Ground1/Ground1.ts +77 -57
  7. package/Mirror.js +0 -4
  8. package/Mirror.ts +0 -4
  9. package/MktMesh/MktMesh.d.ts +3 -2
  10. package/MktMesh/MktMesh.js +27 -8
  11. package/MktMesh/MktMesh.ts +24 -8
  12. package/MktMesh/mktMappingShader.d.ts +6 -5
  13. package/MktMesh/mktMappingShader.js +26 -19
  14. package/MktMesh/mktMappingShader.ts +28 -19
  15. package/MktMesh/mktShader.d.ts +127 -58
  16. package/MktMesh/mktShader.js +192 -117
  17. package/MktMesh/mktShader.ts +251 -127
  18. package/MktMesh/panoSlotRoster.d.ts +2 -2
  19. package/MktMesh/panoSlotRoster.js +9 -7
  20. package/MktMesh/panoSlotRoster.ts +9 -7
  21. package/MktMesh/panoTileStitcher.d.ts +20 -13
  22. package/MktMesh/panoTileStitcher.js +97 -76
  23. package/MktMesh/panoTileStitcher.ts +119 -90
  24. package/PipeMesh/PipeJoint.d.ts +22 -0
  25. package/PipeMesh/PipeJoint.js +33 -0
  26. package/PipeMesh/PipeJoint.ts +38 -0
  27. package/PipeMesh/PipeMesh.d.ts +94 -22
  28. package/PipeMesh/PipeMesh.js +192 -53
  29. package/PipeMesh/PipeMesh.ts +223 -76
  30. package/PipeMesh/PipeStraight.d.ts +19 -0
  31. package/PipeMesh/PipeStraight.js +34 -0
  32. package/PipeMesh/PipeStraight.ts +45 -0
  33. package/PipeMesh/axisSnap.d.ts +52 -0
  34. package/PipeMesh/axisSnap.js +52 -0
  35. package/PipeMesh/axisSnap.ts +93 -0
  36. package/PipeMesh/directRoute.d.ts +85 -0
  37. package/PipeMesh/directRoute.js +126 -0
  38. package/PipeMesh/directRoute.ts +190 -0
  39. package/PipeMesh/index.d.ts +6 -0
  40. package/PipeMesh/index.js +6 -0
  41. package/PipeMesh/index.ts +7 -1
  42. package/PipeMesh/pipeMaterial.d.ts +16 -0
  43. package/PipeMesh/pipeMaterial.js +23 -0
  44. package/PipeMesh/pipeMaterial.ts +26 -0
  45. package/ThreeBase.d.ts +1 -39
  46. package/ThreeBase.js +38 -147
  47. package/ThreeBase.ts +1176 -1302
  48. package/instanced/InstancedBatch.d.ts +14 -1
  49. package/instanced/InstancedBatch.js +53 -3
  50. package/instanced/InstancedBatch.ts +62 -3
  51. package/instanced/InstancedChild.d.ts +24 -0
  52. package/instanced/InstancedChild.js +40 -0
  53. package/instanced/InstancedChild.ts +41 -0
  54. package/instanced/InstancedGroup.d.ts +48 -0
  55. package/instanced/InstancedGroup.js +45 -1
  56. package/instanced/InstancedGroup.ts +85 -0
  57. package/package.json +2 -7
  58. package/pass/debugDepthState.d.ts +16 -8
  59. package/pass/debugDepthState.js +4 -0
  60. package/pass/debugDepthState.ts +27 -9
  61. package/pass/glow_pass.js +11 -94
  62. package/pass/glow_pass.ts +11 -97
  63. package/pass/ssao_pass.d.ts +9 -23
  64. package/pass/ssao_pass.js +41 -128
  65. package/pass/ssao_pass.ts +36 -166
  66. package/pass/stroke_pass.js +3 -0
  67. package/pass/stroke_pass.ts +4 -0
  68. package/shaders/debugDepthCompareShader.d.ts +1 -1
  69. package/shaders/debugDepthCompareShader.js +1 -1
  70. package/shaders/debugDepthCompareShader.ts +1 -1
  71. package/shaders/debugDepthJudgeShader.d.ts +1 -1
  72. package/shaders/debugDepthJudgeShader.js +1 -1
  73. package/shaders/debugDepthJudgeShader.ts +1 -1
  74. package/PipeMesh/PathGeometry.d.ts +0 -44
  75. package/PipeMesh/PathGeometry.js +0 -307
  76. package/PipeMesh/PathGeometry.ts +0 -343
  77. package/PipeMesh/PathPoint.d.ts +0 -17
  78. package/PipeMesh/PathPoint.js +0 -31
  79. package/PipeMesh/PathPoint.ts +0 -36
  80. package/PipeMesh/PathPointList.d.ts +0 -31
  81. package/PipeMesh/PathPointList.js +0 -209
  82. package/PipeMesh/PathPointList.ts +0 -227
  83. package/PipeMesh/PathTubeGeometry.d.ts +0 -25
  84. package/PipeMesh/PathTubeGeometry.js +0 -130
  85. package/PipeMesh/PathTubeGeometry.ts +0 -146
  86. package/WaterFlow/FloatingDuck.d.ts +0 -88
  87. package/WaterFlow/FloatingDuck.js +0 -307
  88. package/WaterFlow/FloatingDuck.ts +0 -445
  89. package/WaterFlow/GPUFluidSimulation.d.ts +0 -56
  90. package/WaterFlow/GPUFluidSimulation.js +0 -785
  91. package/WaterFlow/GPUFluidSimulation.ts +0 -827
  92. package/WaterFlow/ReservoirSystem.d.ts +0 -106
  93. package/WaterFlow/ReservoirSystem.js +0 -621
  94. package/WaterFlow/ReservoirSystem.ts +0 -754
  95. package/WaterFlow/SPHField.d.ts +0 -35
  96. package/WaterFlow/SPHField.js +0 -204
  97. package/WaterFlow/SPHField.ts +0 -228
  98. package/WaterFlow/ScreenSpaceFluidPass.d.ts +0 -69
  99. package/WaterFlow/ScreenSpaceFluidPass.js +0 -736
  100. package/WaterFlow/ScreenSpaceFluidPass.ts +0 -789
  101. package/WaterFlow/ShallowWaterSurface.d.ts +0 -45
  102. package/WaterFlow/ShallowWaterSurface.js +0 -441
  103. package/WaterFlow/ShallowWaterSurface.ts +0 -510
  104. package/WaterFlow/WaterFlow.d.ts +0 -87
  105. package/WaterFlow/WaterFlow.js +0 -171
  106. package/WaterFlow/WaterFlow.ts +0 -219
  107. package/WaterFlow/types.d.ts +0 -161
  108. package/WaterFlow/types.js +0 -1
  109. package/WaterFlow/types.ts +0 -189
  110. package/WaterFlow/waterFlowPass.d.ts +0 -3
  111. package/WaterFlow/waterFlowPass.js +0 -20
  112. package/WaterFlow/waterFlowPass.ts +0 -40
  113. package/shaders/debugExcludedShader.d.ts +0 -15
  114. package/shaders/debugExcludedShader.js +0 -48
  115. package/shaders/debugExcludedShader.ts +0 -50
@@ -1,106 +0,0 @@
1
- import * as THREE from 'three';
2
- import { ShallowWaterSurface } from './ShallowWaterSurface';
3
- import type { BasinConfig } from './types';
4
- /**
5
- * 构造选项:几何口径(length/width/壁高)+ 平面位置(centerX/centerZ)+ 尾流水面网格分辨率。
6
- * flowTexture 是溢出水花着色器采样的噪声图,缺省时 uniforms.uFlowMap 为 undefined。
7
- */
8
- export interface ReservoirOptions {
9
- flowTexture?: THREE.Texture;
10
- length?: number;
11
- width?: number;
12
- bottomY?: number;
13
- rimY?: number;
14
- centerX?: number;
15
- centerZ?: number;
16
- waveWidth?: number;
17
- waveHeight?: number;
18
- }
19
- /** update 的入参:入口水流量 + 撞击点/能量 + 是否正在喷射。 */
20
- export interface ReservoirUpdateOptions {
21
- flowRate: number;
22
- captureFraction?: number;
23
- impactX: number;
24
- impactZ?: number;
25
- impactEnergy?: number;
26
- emitting?: boolean;
27
- }
28
- /** update 的出参:本次入流/溢流的口径,供调用方做音效或统计。 */
29
- export interface ReservoirUpdateResult {
30
- captured: boolean;
31
- captureFraction: number;
32
- incomingRate: number;
33
- missedRate: number;
34
- overflowRate: number;
35
- }
36
- export declare class ReservoirSystem {
37
- /** 几何口径(全部由构造参数推导,构造后不变)。 */
38
- private readonly length;
39
- private readonly width;
40
- private readonly bottomY;
41
- private readonly rimY;
42
- private readonly innerBottomY;
43
- private readonly maxWaterY;
44
- private readonly innerLength;
45
- private readonly innerWidth;
46
- private readonly surfaceArea;
47
- private readonly capacity;
48
- /** 水量与溢流状态(每帧变化)。 */
49
- private volume;
50
- private overflowRate;
51
- private motionOverflowRate;
52
- private overflowIntensity;
53
- private active;
54
- private particleFluidMode;
55
- /** 容器晃动(xz 两个分量复用 Vector2 的 x/y)。 */
56
- private readonly motionPreviousPosition;
57
- private readonly motionVelocity;
58
- private readonly motionAcceleration;
59
- private readonly sloshOffset;
60
- private readonly sloshVelocity;
61
- private readonly motionWaveImpulse;
62
- /** 池体节点与拾取体。 */
63
- readonly renderer: THREE.WebGLRenderer;
64
- readonly group: THREE.Group;
65
- readonly hitMeshes: THREE.Mesh[];
66
- readonly rimFoamMaterial: THREE.MeshBasicMaterial;
67
- readonly rimFoamGroup: THREE.Group;
68
- readonly waterMaterial: THREE.ShaderMaterial;
69
- readonly waterBody: THREE.Mesh;
70
- /** 浅水波面;非WebGL2 或缺浮点扩展时为 null(此时只保留水体盒)。 */
71
- readonly surface: ShallowWaterSurface | null;
72
- readonly overflowMaterial: THREE.ShaderMaterial;
73
- readonly overflowGroup: THREE.Group;
74
- /** 溢流粒子(GPU points)的缓冲与状态。 */
75
- readonly dropCount: number;
76
- private readonly dropPositions;
77
- private readonly dropVelocities;
78
- private readonly dropLife;
79
- private readonly dropMaxLife;
80
- private readonly dropBounces;
81
- private readonly dropSizes;
82
- private readonly dropAlpha;
83
- private dropCursor;
84
- private dropAccumulator;
85
- readonly dropMaterial: THREE.ShaderMaterial;
86
- readonly spillPoints: THREE.Points;
87
- constructor(renderer: THREE.WebGLRenderer, { flowTexture, length, width, bottomY, rimY, centerX, centerZ, waveWidth, waveHeight, }?: ReservoirOptions);
88
- setActive(active: boolean): void;
89
- setParticleFluidMode(enabled: boolean): void;
90
- moveTo(x: number, z: number): void;
91
- reset(fillRatio?: number): void;
92
- updateContainerMotion(delta: number): void;
93
- clearSpillParticles(): void;
94
- spawnSpillParticle(): void;
95
- updateSpillParticles(delta: number): void;
96
- updateGeometry(): void;
97
- update(delta: number, elapsed: number, { flowRate, captureFraction, impactX, impactZ, impactEnergy, emitting, }: ReservoirUpdateOptions): ReservoirUpdateResult;
98
- setPixelRatio(pixelRatio: number): void;
99
- get fillRatio(): number;
100
- get waterY(): number;
101
- get centerX(): number;
102
- get centerZ(): number;
103
- get minX(): number;
104
- get maxX(): number;
105
- get collisionBounds(): BasinConfig;
106
- }