three-low-poly 0.9.14 → 0.9.16
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.
- package/dist/index.cjs.js +47 -47
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +623 -47
- package/dist/index.es.js +1734 -1263
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +47 -47
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +47 -47
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,13 @@ import { Color } from 'three';
|
|
|
5
5
|
import { DataTexture } from 'three';
|
|
6
6
|
import { Group } from 'three';
|
|
7
7
|
import { InstancedMesh } from 'three';
|
|
8
|
+
import { Light } from 'three';
|
|
8
9
|
import { Material } from 'three';
|
|
9
10
|
import { Mesh } from 'three';
|
|
11
|
+
import { MeshLambertMaterial } from 'three';
|
|
12
|
+
import { MeshPhongMaterial } from 'three';
|
|
13
|
+
import { MeshPhysicalMaterial } from 'three';
|
|
14
|
+
import { MeshStandardMaterial } from 'three';
|
|
10
15
|
import { PerspectiveCamera } from 'three';
|
|
11
16
|
import { ShaderMaterial } from 'three';
|
|
12
17
|
import { Shape } from 'three';
|
|
@@ -21,10 +26,10 @@ import { Vector3 } from 'three';
|
|
|
21
26
|
* @param {Object} options - Options for noise modification.
|
|
22
27
|
* @param {number} [options.time=0.0] - The time value for the noise function.
|
|
23
28
|
* @param {number} [options.intensity=1.0] - The intensity of the displacement.
|
|
24
|
-
* @param {Vector3} [options.
|
|
29
|
+
* @param {Vector3} [options.axis=new Vector3(1, 1, 1)] - The axis of displacement.
|
|
25
30
|
* @param {number} [options.scale=10.0] - The scale of the noise effect.
|
|
26
31
|
*/
|
|
27
|
-
export declare function addNoiseDisplacement<T extends Material>(material: T, { time, intensity,
|
|
32
|
+
export declare function addNoiseDisplacement<T extends Material>(material: T, { time, intensity, axis, scale }?: NoiseDisplacementOptions): void;
|
|
28
33
|
|
|
29
34
|
/**
|
|
30
35
|
* Utility function to add water-like vertex displacement to an existing Three.js material.
|
|
@@ -139,13 +144,132 @@ export declare class AtmosphericSkybox extends Mesh {
|
|
|
139
144
|
sunPosition(theta: number, phi: number): void;
|
|
140
145
|
}
|
|
141
146
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Geometric and mathematical role of the vectors as axes in 3D space.
|
|
149
|
+
*
|
|
150
|
+
* Example usages:
|
|
151
|
+
*
|
|
152
|
+
* Defining a geometry's up vector:
|
|
153
|
+
* ```
|
|
154
|
+
* const upVector = Axis.Z; // Set the Z-axis as the "up" direction
|
|
155
|
+
* object.up.copy(upVector);
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* Rotating or Orienting an Object
|
|
159
|
+
* ```
|
|
160
|
+
* const axis = Axis.XY; // Diagonal upward
|
|
161
|
+
* object.lookAt(object.position.clone().add(axis));
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* Rotate around axis:
|
|
165
|
+
* ```
|
|
166
|
+
* const angle = Math.PI / 4; // 45-degree rotation
|
|
167
|
+
* const rotationAxis = Axis.Y; // Rotate around the Y-axis
|
|
168
|
+
*
|
|
169
|
+
* object.rotateOnAxis(rotationAxis, angle);
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* Scaling along an axis:
|
|
173
|
+
* ```
|
|
174
|
+
* const scalingAxis = Axis.XZ; // Scale equally along X and Z
|
|
175
|
+
* const scaleFactor = 2;
|
|
176
|
+
*
|
|
177
|
+
* object.scale.multiply(scalingAxis.clone().multiplyScalar(scaleFactor));
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* Aligning a Camera
|
|
181
|
+
* ```
|
|
182
|
+
* const cameraAxis = Axis.XZ; // Align the camera diagonally on the XZ plane
|
|
183
|
+
*
|
|
184
|
+
* camera.lookAt(camera.position.clone().add(cameraAxis));
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* Directional lighting
|
|
188
|
+
* ```
|
|
189
|
+
* const lightDirection = Axis.YZ; // Diagonal light along Y and Z axes
|
|
190
|
+
* directionalLight.position.copy(lightDirection.clone().multiplyScalar(10));
|
|
191
|
+
* ```
|
|
192
|
+
*
|
|
193
|
+
* Aligning an Object
|
|
194
|
+
* ```
|
|
195
|
+
* const axis = Axis.X; // Align object to the X-axis
|
|
196
|
+
* object.lookAt(object.position.clone().add(axis));
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* Spawning objects along an axis
|
|
200
|
+
* ```
|
|
201
|
+
* const spawnAxis = Axis.XZ; // Arrange objects diagonally on XZ
|
|
202
|
+
* const count = 10;
|
|
203
|
+
* const spacing = 5;
|
|
204
|
+
*
|
|
205
|
+
* for (let i = 0; i < count; i++) {
|
|
206
|
+
* const position = spawnAxis.clone().multiplyScalar(i * spacing);
|
|
207
|
+
* const newObject = object.clone();
|
|
208
|
+
* newObject.position.copy(position);
|
|
209
|
+
* scene.add(newObject);
|
|
210
|
+
* }
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* Vector projections
|
|
214
|
+
* ```
|
|
215
|
+
* const vector = new Vector3(3, 5, 7);
|
|
216
|
+
* const projectionAxis = Axis.Z; // Project the vector onto the Z-axis
|
|
217
|
+
*
|
|
218
|
+
* const projection = vector.clone().projectOnVector(projectionAxis);
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* Plane definitions
|
|
222
|
+
* ```
|
|
223
|
+
* const normal = Axis.Y; // Y-axis is the normal for a horizontal plane
|
|
224
|
+
* const distanceFromOrigin = 5;
|
|
225
|
+
*
|
|
226
|
+
* const plane = new THREE.Plane(normal, distanceFromOrigin);
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* Plane intersections
|
|
230
|
+
* ```
|
|
231
|
+
* const planeNormal = Axis.Y; // Define a plane normal (horizontal plane)
|
|
232
|
+
* const plane = new THREE.Plane(planeNormal);
|
|
233
|
+
*
|
|
234
|
+
* const rayDirection = Axis.Z; // Ray pointing along Z-axis
|
|
235
|
+
* const rayOrigin = new Vector3(0, 5, 0);
|
|
236
|
+
* const ray = new THREE.Ray(rayOrigin, rayDirection);
|
|
237
|
+
*
|
|
238
|
+
* // Find intersection point
|
|
239
|
+
* const intersectionPoint = new Vector3();
|
|
240
|
+
* plane.intersectLine(new THREE.Line3(rayOrigin, rayOrigin.clone().add(rayDirection)), intersectionPoint);
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* Defining bounds
|
|
244
|
+
* ```
|
|
245
|
+
* const boundsAxis = Axis.XY; // Restrict an object’s movement within XY bounds
|
|
246
|
+
* const maxBounds = 10;
|
|
247
|
+
*
|
|
248
|
+
* object.position.clamp(
|
|
249
|
+
* new Vector3(-maxBounds, -maxBounds, -Infinity),
|
|
250
|
+
* new Vector3(maxBounds, maxBounds, Infinity)
|
|
251
|
+
* );
|
|
252
|
+
* ```
|
|
253
|
+
*
|
|
254
|
+
* Procedural Geometry
|
|
255
|
+
* ```
|
|
256
|
+
* const vertex = new Vector3(0, 0, 0);
|
|
257
|
+
* const axis = Axis.XZ; // Diagonal axis on XZ plane
|
|
258
|
+
*
|
|
259
|
+
* const offset = axis.clone().multiplyScalar(5);
|
|
260
|
+
* vertex.add(offset); // Move vertex in axis
|
|
261
|
+
* geometry.vertices.push(vertex);
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
export declare const Axis: {
|
|
265
|
+
X: Vector3;
|
|
266
|
+
Y: Vector3;
|
|
267
|
+
Z: Vector3;
|
|
268
|
+
XY: Vector3;
|
|
269
|
+
XZ: Vector3;
|
|
270
|
+
YZ: Vector3;
|
|
271
|
+
XYZ: Vector3;
|
|
272
|
+
};
|
|
149
273
|
|
|
150
274
|
export declare class BifurcatedStaircaseGeometry extends BufferGeometry {
|
|
151
275
|
constructor(stepWidth?: number, stepHeight?: number, stepDepth?: number, numStepsCentral?: number, numStepsBranch?: number, branchAngle?: number);
|
|
@@ -170,7 +294,12 @@ export declare class BoneGeometry extends BufferGeometry {
|
|
|
170
294
|
constructor(radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number);
|
|
171
295
|
}
|
|
172
296
|
|
|
173
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Material Order:
|
|
299
|
+
* 1. Cover
|
|
300
|
+
* 2. Page
|
|
301
|
+
*/
|
|
302
|
+
export declare class Book extends Mesh<BookGeometry, MeshStandardMaterial[]> {
|
|
174
303
|
constructor({ width, height, depth, coverThickness, pageIndent, coverColor, pageColor, }?: {
|
|
175
304
|
width?: number | undefined;
|
|
176
305
|
height?: number | undefined;
|
|
@@ -253,6 +382,32 @@ export declare class BurstShape extends Shape {
|
|
|
253
382
|
constructor(sides?: number, innerRadius?: number, outerRadius?: number);
|
|
254
383
|
}
|
|
255
384
|
|
|
385
|
+
/**
|
|
386
|
+
* Calculate the sum of absolute differences for each channel
|
|
387
|
+
* difference = |r1 - r2| + |g1 - g2| + |b1 - b2|
|
|
388
|
+
*/
|
|
389
|
+
export declare function calculateChannelDifference(color1: [number, number, number], color2: [number, number, number]): number;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Calculate the Euclidean distance between two colors in RGB space
|
|
393
|
+
* distance = sqrt((r1 - r2)^2 + (g1 - g2)^2 + (b1 - b2)^2)
|
|
394
|
+
*/
|
|
395
|
+
export declare function calculateDistance(color1: [number, number, number], color2: [number, number, number]): number;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Compute normal based on the quad’s vertices (using the cross product of two edges).
|
|
399
|
+
*/
|
|
400
|
+
export declare function calculateNormal(p1: [number, number, number], p2: [number, number, number], p3: [number, number, number]): [number, number, number];
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Finding Bounds for a List of UVs
|
|
404
|
+
* calculate the min and max values dynamically.
|
|
405
|
+
*/
|
|
406
|
+
export declare function calculateUVBounds(uvs: [number, number][]): {
|
|
407
|
+
minBounds: [number, number];
|
|
408
|
+
maxBounds: [number, number];
|
|
409
|
+
};
|
|
410
|
+
|
|
256
411
|
export declare class Candle extends Group {
|
|
257
412
|
private candle;
|
|
258
413
|
private flame;
|
|
@@ -324,6 +479,60 @@ export declare const circularEaseInOut: (t: number) => number;
|
|
|
324
479
|
|
|
325
480
|
export declare const circularEaseOut: (t: number) => number;
|
|
326
481
|
|
|
482
|
+
export declare const ColorPalette: {
|
|
483
|
+
CARDINAL_RED: number;
|
|
484
|
+
CHERRY_RED: number;
|
|
485
|
+
CRIMSON: number;
|
|
486
|
+
RUST: number;
|
|
487
|
+
DARK_RED: number;
|
|
488
|
+
TANGERINE: number;
|
|
489
|
+
ORANGE_PEEL: number;
|
|
490
|
+
ORANGE: number;
|
|
491
|
+
AMBER: number;
|
|
492
|
+
GOLD: number;
|
|
493
|
+
YELLOW: number;
|
|
494
|
+
LIME_GREEN: number;
|
|
495
|
+
SPRING_GREEN: number;
|
|
496
|
+
MOSS_GREEN: number;
|
|
497
|
+
FERN_GREEN: number;
|
|
498
|
+
FOREST_GREEN: number;
|
|
499
|
+
OLIVE_DRAB: number;
|
|
500
|
+
MINT_GREEN: number;
|
|
501
|
+
AQUAMARINE: number;
|
|
502
|
+
SKY_BLUE: number;
|
|
503
|
+
CERULEAN_BLUE: number;
|
|
504
|
+
AZURE: number;
|
|
505
|
+
OCEAN_BLUE: number;
|
|
506
|
+
ROYAL_BLUE: number;
|
|
507
|
+
MIDNIGHT_BLUE: number;
|
|
508
|
+
CORAL_PINK: number;
|
|
509
|
+
VIVID_MAGENTA: number;
|
|
510
|
+
MAGENTA: number;
|
|
511
|
+
HOT_PINK: number;
|
|
512
|
+
PINK_SHERBET: number;
|
|
513
|
+
SOFT_PINK: number;
|
|
514
|
+
DEEP_VIOLET: number;
|
|
515
|
+
TAUPE: number;
|
|
516
|
+
SIENNA: number;
|
|
517
|
+
SADDLE_BROWN: number;
|
|
518
|
+
COFFEE_BROWN: number;
|
|
519
|
+
DARK_UMBER: number;
|
|
520
|
+
ONYX: number;
|
|
521
|
+
CARBON: number;
|
|
522
|
+
CHARCOAL: number;
|
|
523
|
+
SLATE_GRAY: number;
|
|
524
|
+
ASH_GRAY: number;
|
|
525
|
+
STEEL_GRAY: number;
|
|
526
|
+
COOL_GRAY: number;
|
|
527
|
+
IRON: number;
|
|
528
|
+
GRAY: number;
|
|
529
|
+
STONE: number;
|
|
530
|
+
SILVER: number;
|
|
531
|
+
PALE_GRAY: number;
|
|
532
|
+
WHITE_SMOKE: number;
|
|
533
|
+
WHITE: number;
|
|
534
|
+
};
|
|
535
|
+
|
|
327
536
|
export declare const concave: (t: number) => number;
|
|
328
537
|
|
|
329
538
|
export declare const convex: (t: number) => number;
|
|
@@ -418,6 +627,59 @@ export declare const createLogarithmicCurvePoints: (start: Vector2, end: Vector2
|
|
|
418
627
|
*/
|
|
419
628
|
export declare const createParabolicCurvePoints: (start: Vector2, end: Vector2, a: number, b: number, c: number, segments?: number) => Vector2[];
|
|
420
629
|
|
|
630
|
+
/**
|
|
631
|
+
* Generates vertices for two triangles based upon a quad.
|
|
632
|
+
*
|
|
633
|
+
* Example usages:
|
|
634
|
+
*
|
|
635
|
+
* Create a face of a box:
|
|
636
|
+
* ```
|
|
637
|
+
* const frontQuad = createQuad(
|
|
638
|
+
* [-1, -1, 1], // Bottom-left
|
|
639
|
+
* [ 1, -1, 1], // Bottom-right
|
|
640
|
+
* [-1, 1, 1], // Top-left
|
|
641
|
+
* [ 1, 1, 1], // Top-right
|
|
642
|
+
* [ 0, 0, 1] // Normal (facing forward)
|
|
643
|
+
* );
|
|
644
|
+
* ```
|
|
645
|
+
*
|
|
646
|
+
* Assembling a box:
|
|
647
|
+
* ```
|
|
648
|
+
* const vertices = [
|
|
649
|
+
* ...createQuad([-1, -1, 1], [1, -1, 1], [-1, 1, 1], [1, 1, 1], [0, 0, 1]), // Front face
|
|
650
|
+
* ...createQuad([1, -1, -1], [-1, -1, -1], [1, 1, -1], [-1, 1, -1], [0, 0, -1]), // Back face
|
|
651
|
+
* ...createQuad([-1, 1, 1], [1, 1, 1], [-1, 1, -1], [1, 1, -1], [0, 1, 0]), // Top face
|
|
652
|
+
* ...createQuad([-1, -1, -1], [1, -1, -1], [-1, -1, 1], [1, -1, 1], [0, -1, 0]), // Bottom face
|
|
653
|
+
* ...createQuad([-1, -1, -1], [-1, -1, 1], [-1, 1, -1], [-1, 1, 1], [-1, 0, 0]), // Left face
|
|
654
|
+
* ...createQuad([1, -1, 1], [1, -1, -1], [1, 1, 1], [1, 1, -1], [1, 0, 0]), // Right face
|
|
655
|
+
* ];
|
|
656
|
+
* ```
|
|
657
|
+
*
|
|
658
|
+
* Generating Buffer Geometry:
|
|
659
|
+
* ```
|
|
660
|
+
* const positions = [];
|
|
661
|
+
* const normals = [];
|
|
662
|
+
* const uvs = [];
|
|
663
|
+
*
|
|
664
|
+
* for (const vertex of vertices) {
|
|
665
|
+
* positions.push(...vertex.pos);
|
|
666
|
+
* normals.push(...vertex.norm);
|
|
667
|
+
* uvs.push(...vertex.uv);
|
|
668
|
+
* }
|
|
669
|
+
*
|
|
670
|
+
* const geometry = new THREE.BufferGeometry();
|
|
671
|
+
* geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(positions), 3));
|
|
672
|
+
* geometry.setAttribute('normal', new THREE.BufferAttribute(new Float32Array(normals), 3));
|
|
673
|
+
* geometry.setAttribute('uv', new THREE.BufferAttribute(new Float32Array(uvs), 2));
|
|
674
|
+
* ```
|
|
675
|
+
*/
|
|
676
|
+
export declare function createQuad(p1: [number, number, number], //
|
|
677
|
+
p2: [number, number, number], p3: [number, number, number], p4: [number, number, number], normal?: [number, number, number], uv1?: [number, number], uv2?: [number, number], uv3?: [number, number], uv4?: [number, number]): {
|
|
678
|
+
pos: [number, number, number];
|
|
679
|
+
norm: [number, number, number];
|
|
680
|
+
uv: [number, number];
|
|
681
|
+
}[];
|
|
682
|
+
|
|
421
683
|
/**
|
|
422
684
|
* Function to create quadratic Bezier curve points
|
|
423
685
|
*
|
|
@@ -451,8 +713,8 @@ export declare const createQuadraticCurvePoints: (start: Vector2, control: Vecto
|
|
|
451
713
|
*/
|
|
452
714
|
export declare const createSigmoidCurvePoints: (start: Vector2, end: Vector2, a: number, segments?: number) => Vector2[];
|
|
453
715
|
|
|
454
|
-
export declare class CrossHeadstone extends Mesh {
|
|
455
|
-
constructor({ width, height, depth,
|
|
716
|
+
export declare class CrossHeadstone extends Mesh<CrossHeadstoneGeometry, MeshStandardMaterial> {
|
|
717
|
+
constructor({ width, height, depth, }?: CrossHeadstoneOptions);
|
|
456
718
|
}
|
|
457
719
|
|
|
458
720
|
export declare class CrossHeadstoneGeometry extends BufferGeometry {
|
|
@@ -463,7 +725,6 @@ declare interface CrossHeadstoneOptions {
|
|
|
463
725
|
width?: number;
|
|
464
726
|
height?: number;
|
|
465
727
|
depth?: number;
|
|
466
|
-
material?: Material;
|
|
467
728
|
}
|
|
468
729
|
|
|
469
730
|
export declare const cubicCurve: (t: number, p0: number, p1: number, p2: number, p3: number) => number;
|
|
@@ -474,6 +735,45 @@ export declare const cubicEaseInOut: (t: number) => number;
|
|
|
474
735
|
|
|
475
736
|
export declare const cubicEaseOut: (t: number) => number;
|
|
476
737
|
|
|
738
|
+
/**
|
|
739
|
+
* Cubic UV Mapping
|
|
740
|
+
* Applies a texture by projecting UVs along each face of a cube.
|
|
741
|
+
*
|
|
742
|
+
* Example usage:
|
|
743
|
+
* ```
|
|
744
|
+
* const cubeVertices = [
|
|
745
|
+
* [-1, -1, 1],
|
|
746
|
+
* [1, -1, 1],
|
|
747
|
+
* [-1, 1, 1],
|
|
748
|
+
* [1, 1, 1],
|
|
749
|
+
* ];
|
|
750
|
+
*
|
|
751
|
+
* const cubeUVs = cubicUVMappingBatch(cubeVertices);
|
|
752
|
+
* ```
|
|
753
|
+
*/
|
|
754
|
+
export declare function cubicUVMapping(vertex: [number, number, number]): [number, number];
|
|
755
|
+
|
|
756
|
+
export declare function cubicUVMappingBatch(vertices: [number, number, number][]): [number, number][];
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Cylindrical UV Mapping
|
|
760
|
+
* Projects UV coordinates onto the surface as though the texture is
|
|
761
|
+
* wrapped around the cylinder's height and circumference.
|
|
762
|
+
*
|
|
763
|
+
* Example usage:
|
|
764
|
+
* ```
|
|
765
|
+
* const cylinderVertices = [
|
|
766
|
+
* [1, 0, 0], // Vertex on the "equator"
|
|
767
|
+
* [0, 1, 0], // Vertex on the top
|
|
768
|
+
* [0, -1, 1], // Vertex on the bottom
|
|
769
|
+
* [-1, 0, 0], // Opposite side of the equator
|
|
770
|
+
* ];
|
|
771
|
+
*
|
|
772
|
+
* const cylinderUVs = cylindricalUVMapping(cylinderVertices);
|
|
773
|
+
* ```
|
|
774
|
+
*/
|
|
775
|
+
export declare function cylindricalUVMapping(vertices: [number, number, number][]): [number, number][];
|
|
776
|
+
|
|
477
777
|
export declare const dampedCurve: (t: number, damping?: number) => number;
|
|
478
778
|
|
|
479
779
|
export declare class DaySkybox extends Mesh {
|
|
@@ -515,7 +815,13 @@ export declare interface DaySkyUniforms {
|
|
|
515
815
|
bottomColor: Uniform<Color>;
|
|
516
816
|
}
|
|
517
817
|
|
|
518
|
-
export declare class Desk extends
|
|
818
|
+
export declare class Desk extends Mesh {
|
|
819
|
+
geometry: DeskGeometry;
|
|
820
|
+
material: MeshStandardMaterial[];
|
|
821
|
+
constructor();
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export declare class DeskGeometry extends BufferGeometry {
|
|
519
825
|
constructor();
|
|
520
826
|
}
|
|
521
827
|
|
|
@@ -524,7 +830,9 @@ export declare class DioramaGeometry extends BufferGeometry {
|
|
|
524
830
|
}
|
|
525
831
|
|
|
526
832
|
/**
|
|
527
|
-
*
|
|
833
|
+
* Movement or orientation in a specific direction.
|
|
834
|
+
*
|
|
835
|
+
* Example usages:
|
|
528
836
|
*
|
|
529
837
|
* Moving an Object Along a Direction
|
|
530
838
|
* ```
|
|
@@ -542,22 +850,6 @@ export declare class DioramaGeometry extends BufferGeometry {
|
|
|
542
850
|
* object.position.copy(targetPosition.clone().add(snapDirection.clone().multiplyScalar(10)));
|
|
543
851
|
* ```
|
|
544
852
|
*
|
|
545
|
-
* Rotating or Orienting an Object
|
|
546
|
-
* ```
|
|
547
|
-
* const targetDirection = Direction.XY; // Diagonal upward
|
|
548
|
-
* object.lookAt(object.position.clone().add(targetDirection));
|
|
549
|
-
* ```
|
|
550
|
-
*
|
|
551
|
-
* Procedural Geometry
|
|
552
|
-
* ```
|
|
553
|
-
* const vertex = new Vector3(0, 0, 0);
|
|
554
|
-
* const direction = Direction.XZ; // Diagonal direction on XZ plane
|
|
555
|
-
*
|
|
556
|
-
* const offset = direction.clone().multiplyScalar(5);
|
|
557
|
-
* vertex.add(offset); // Move vertex in direction
|
|
558
|
-
* geometry.vertices.push(vertex);
|
|
559
|
-
* ```
|
|
560
|
-
*
|
|
561
853
|
* Animating Along a Direction
|
|
562
854
|
* ```
|
|
563
855
|
* const distance = 10; // Total distance to travel
|
|
@@ -610,13 +902,6 @@ export declare const Direction: {
|
|
|
610
902
|
RIGHT: Vector3;
|
|
611
903
|
FORWARD: Vector3;
|
|
612
904
|
BACKWARD: Vector3;
|
|
613
|
-
X: Vector3;
|
|
614
|
-
Y: Vector3;
|
|
615
|
-
Z: Vector3;
|
|
616
|
-
XY: Vector3;
|
|
617
|
-
XZ: Vector3;
|
|
618
|
-
YZ: Vector3;
|
|
619
|
-
XYZ: Vector3;
|
|
620
905
|
};
|
|
621
906
|
|
|
622
907
|
/**
|
|
@@ -679,6 +964,45 @@ export declare class EllipticLeafGeometry extends BufferGeometry {
|
|
|
679
964
|
constructor(size?: number);
|
|
680
965
|
}
|
|
681
966
|
|
|
967
|
+
/**
|
|
968
|
+
* Emissive pulse effect, designed for flickering lights.
|
|
969
|
+
* The emissive intensity of the material will oscillate between `minIntensity` and `maxIntensity`.
|
|
970
|
+
*
|
|
971
|
+
* Use with materials that have emissive properties.
|
|
972
|
+
*
|
|
973
|
+
* Oscillation time = 2π / speed
|
|
974
|
+
* - Low speed values (e.g., 0.5) will result in a slow pulse
|
|
975
|
+
* - High speed values (e.g., 10) will result in a rapid flicker
|
|
976
|
+
*
|
|
977
|
+
* Requires `update()` frame handler with `clock.getElapsedTime()` for animation.
|
|
978
|
+
*/
|
|
979
|
+
export declare class EmissivePulseEffect {
|
|
980
|
+
speed: number;
|
|
981
|
+
maxIntensity: number;
|
|
982
|
+
minIntensity: number;
|
|
983
|
+
material: MeshStandardMaterial | MeshPhysicalMaterial | MeshLambertMaterial | MeshPhongMaterial;
|
|
984
|
+
constructor(options: EmissivePulseEffectOptions);
|
|
985
|
+
/**
|
|
986
|
+
* Update the emissive intensity of the material.
|
|
987
|
+
*
|
|
988
|
+
* Use Three.Clock getElapsedTime()
|
|
989
|
+
*
|
|
990
|
+
* Example:
|
|
991
|
+
* ```
|
|
992
|
+
* const clock = new THREE.Clock();
|
|
993
|
+
* effect.update(clock.getElapsedTime());
|
|
994
|
+
* ```
|
|
995
|
+
*/
|
|
996
|
+
update(elapsedTime?: number): void;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
export declare interface EmissivePulseEffectOptions {
|
|
1000
|
+
speed?: number;
|
|
1001
|
+
maxIntensity?: number;
|
|
1002
|
+
minIntensity?: number;
|
|
1003
|
+
material: MeshStandardMaterial | MeshPhysicalMaterial | MeshLambertMaterial | MeshPhongMaterial;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
682
1006
|
export declare class ErlenmeyerFlask extends Mesh {
|
|
683
1007
|
constructor({ flaskRadius, //
|
|
684
1008
|
neckRadius, height, neckHeight, radialSegments, }?: {
|
|
@@ -735,7 +1059,7 @@ export declare const Falloff: {
|
|
|
735
1059
|
SMOOTHSTEP: (distance: number, radius: number) => number;
|
|
736
1060
|
};
|
|
737
1061
|
|
|
738
|
-
export declare class FenceColumn extends Mesh {
|
|
1062
|
+
export declare class FenceColumn extends Mesh<FenceColumnGeometry, MeshStandardMaterial> {
|
|
739
1063
|
constructor({ height }?: {
|
|
740
1064
|
height?: number | undefined;
|
|
741
1065
|
});
|
|
@@ -750,6 +1074,10 @@ export declare class FenceColumnGeometry extends BufferGeometry {
|
|
|
750
1074
|
});
|
|
751
1075
|
}
|
|
752
1076
|
|
|
1077
|
+
export declare function findClosestColor(inputColor: number, dataset: number[]): number | null;
|
|
1078
|
+
|
|
1079
|
+
export declare function findClosestColorChannelWise(inputColor: number, dataset: number[]): number | null;
|
|
1080
|
+
|
|
753
1081
|
export declare class Flask extends Group {
|
|
754
1082
|
constructor();
|
|
755
1083
|
}
|
|
@@ -759,6 +1087,16 @@ export declare class Flask extends Group {
|
|
|
759
1087
|
*/
|
|
760
1088
|
export declare const flattenBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, targetHeight: number, strength: number, direction?: Vector3, falloffFn?: (distance: number, radius: number) => number) => void;
|
|
761
1089
|
|
|
1090
|
+
export declare class FlorenceFlask extends Mesh {
|
|
1091
|
+
geometry: FlorenceFlaskGeometry;
|
|
1092
|
+
material: MeshPhysicalMaterial;
|
|
1093
|
+
constructor();
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
export declare class FlorenceFlaskGeometry extends BufferGeometry {
|
|
1097
|
+
constructor();
|
|
1098
|
+
}
|
|
1099
|
+
|
|
762
1100
|
/**
|
|
763
1101
|
* The camera flies through a sequence of points, ideal for showcasing specific elements in the scene.
|
|
764
1102
|
*
|
|
@@ -790,6 +1128,16 @@ export declare class GearShape extends Shape {
|
|
|
790
1128
|
constructor(sides?: number, innerRadius?: number, outerRadius?: number, holeSides?: number, holeRadius?: number);
|
|
791
1129
|
}
|
|
792
1130
|
|
|
1131
|
+
/**
|
|
1132
|
+
* Example usage:
|
|
1133
|
+
* ```
|
|
1134
|
+
* const baseHue = Math.floor(Math.random() * 360);
|
|
1135
|
+
* const color1 = getAnalogousColors(baseHue);
|
|
1136
|
+
* const color2 = getAnalogousColors(baseHue);
|
|
1137
|
+
* ```
|
|
1138
|
+
*/
|
|
1139
|
+
export declare function getAnalogousColors(baseHue: number): [number, number, number];
|
|
1140
|
+
|
|
793
1141
|
export declare class Heart extends Mesh {
|
|
794
1142
|
constructor(size?: number, width?: number, height?: number, tipDepth?: number, depth?: number);
|
|
795
1143
|
}
|
|
@@ -798,6 +1146,14 @@ export declare class HeartShape extends Shape {
|
|
|
798
1146
|
constructor(size?: number, width?: number, height?: number, tipDepth?: number);
|
|
799
1147
|
}
|
|
800
1148
|
|
|
1149
|
+
export declare function hexToHsl(hex: number): [number, number, number];
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* Convert hexadecimal literal numeric color value to RGB array
|
|
1153
|
+
* @param hex
|
|
1154
|
+
*/
|
|
1155
|
+
export declare function hexToRgb(hex: number): [number, number, number];
|
|
1156
|
+
|
|
801
1157
|
export declare class Hill extends Mesh {
|
|
802
1158
|
constructor({ radius, //
|
|
803
1159
|
height, widthSegments, heightSegments, phiStart, phiLength, }?: {
|
|
@@ -822,6 +1178,20 @@ export declare class HillGeometry extends BufferGeometry {
|
|
|
822
1178
|
});
|
|
823
1179
|
}
|
|
824
1180
|
|
|
1181
|
+
/**
|
|
1182
|
+
* Example usage:
|
|
1183
|
+
* ```
|
|
1184
|
+
* const h = 200; // Hue
|
|
1185
|
+
* const s = 75; // Saturation
|
|
1186
|
+
* const l = 50; // Lightness
|
|
1187
|
+
*
|
|
1188
|
+
* const [ r, g, b ] = hslToHex(h, s, l);
|
|
1189
|
+
* ```
|
|
1190
|
+
*/
|
|
1191
|
+
export declare function hslToHex(h: number, s: number, l: number): [number, number, number];
|
|
1192
|
+
|
|
1193
|
+
export declare function hslToRgb(h: number, s: number, l: number): [number, number, number];
|
|
1194
|
+
|
|
825
1195
|
/**
|
|
826
1196
|
* Generates an array of interpolated 2D points using an easing function.
|
|
827
1197
|
* @param curveFunction - The easing function to apply to the normalized value.
|
|
@@ -865,6 +1235,41 @@ export declare class LeverPanel extends Group {
|
|
|
865
1235
|
constructor();
|
|
866
1236
|
}
|
|
867
1237
|
|
|
1238
|
+
/**
|
|
1239
|
+
* A lightning effect that can be used to simulate a lightning storm.
|
|
1240
|
+
* This effect is applied to a light source.
|
|
1241
|
+
*
|
|
1242
|
+
* Example usage:
|
|
1243
|
+
* ```
|
|
1244
|
+
* const lightning = new THREE.DirectionalLight(0xffffff, 0);
|
|
1245
|
+
* scene.add(lightning);
|
|
1246
|
+
* lightning.position.set(5, 10, -5);
|
|
1247
|
+
*
|
|
1248
|
+
* setRandomInterval(() => {
|
|
1249
|
+
* lightningEffect.triggerLightning();
|
|
1250
|
+
* }, 250, 1250);
|
|
1251
|
+
* ```
|
|
1252
|
+
*/
|
|
1253
|
+
export declare class LightningEffect {
|
|
1254
|
+
private light?;
|
|
1255
|
+
minIntensity: number;
|
|
1256
|
+
maxIntensity: number;
|
|
1257
|
+
minDuration: number;
|
|
1258
|
+
maxDuration: number;
|
|
1259
|
+
constructor({ light, //
|
|
1260
|
+
minIntensity, maxIntensity, minDuration, maxDuration, }?: LightningEffectOptions);
|
|
1261
|
+
triggerLightning(): void;
|
|
1262
|
+
update(): void;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
declare interface LightningEffectOptions {
|
|
1266
|
+
light?: Light;
|
|
1267
|
+
minIntensity?: number;
|
|
1268
|
+
maxIntensity?: number;
|
|
1269
|
+
minDuration?: number;
|
|
1270
|
+
maxDuration?: number;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
868
1273
|
export declare const linear: (t: number) => number;
|
|
869
1274
|
|
|
870
1275
|
export declare const logarithmic: (t: number) => number;
|
|
@@ -907,10 +1312,24 @@ export declare class Microscope extends Group {
|
|
|
907
1312
|
constructor();
|
|
908
1313
|
}
|
|
909
1314
|
|
|
910
|
-
export declare class Moon extends
|
|
1315
|
+
export declare class Moon extends Mesh<SphereGeometry, ShaderMaterial> {
|
|
911
1316
|
constructor();
|
|
912
1317
|
}
|
|
913
1318
|
|
|
1319
|
+
/**
|
|
1320
|
+
* Moon shader
|
|
1321
|
+
* Simple moon effect with noise
|
|
1322
|
+
*/
|
|
1323
|
+
export declare const moonShader: {
|
|
1324
|
+
uniforms: {
|
|
1325
|
+
time: {
|
|
1326
|
+
value: number;
|
|
1327
|
+
};
|
|
1328
|
+
};
|
|
1329
|
+
vertexShader: string;
|
|
1330
|
+
fragmentShader: string;
|
|
1331
|
+
};
|
|
1332
|
+
|
|
914
1333
|
export declare class MortarAndPestle extends Group {
|
|
915
1334
|
constructor();
|
|
916
1335
|
}
|
|
@@ -1036,11 +1455,38 @@ export declare const noiseBrush: <T extends BufferGeometry>(geometry: T, positio
|
|
|
1036
1455
|
declare interface NoiseDisplacementOptions {
|
|
1037
1456
|
time?: number;
|
|
1038
1457
|
intensity?: number;
|
|
1039
|
-
|
|
1458
|
+
axis?: Vector3;
|
|
1040
1459
|
scale?: number;
|
|
1041
1460
|
}
|
|
1042
1461
|
|
|
1043
|
-
export declare
|
|
1462
|
+
export declare function normalizeRgb(r: number, g: number, b: number): [number, number, number];
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Generic Normalization Function
|
|
1466
|
+
* This function will normalize 2D UV coordinates based on given bounds.
|
|
1467
|
+
*
|
|
1468
|
+
* Full pipeline:
|
|
1469
|
+
* - Compute UVs
|
|
1470
|
+
* - Calculate bounds
|
|
1471
|
+
* - Normalize UVs
|
|
1472
|
+
*
|
|
1473
|
+
* Example usage:
|
|
1474
|
+
* ```
|
|
1475
|
+
* const planarMapping = (vertex: [number, number, number]) => [vertex[0], vertex[1]];
|
|
1476
|
+
* const uvs = vertices.map(mappingFunction);
|
|
1477
|
+
* const { minBounds, maxBounds } = calculateUVBounds(uvs);
|
|
1478
|
+
* const normalizedUVs = normalizeUVBatch(uvs, minBounds, maxBounds);
|
|
1479
|
+
* ```
|
|
1480
|
+
*/
|
|
1481
|
+
export declare function normalizeUV(uv: [number, number], minU: number, maxU: number, minV: number, maxV: number): [number, number];
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* Batch Normalization for Multiple UVs
|
|
1485
|
+
* If you have multiple UVs, normalize them all based on the overall min/max bounds.
|
|
1486
|
+
*/
|
|
1487
|
+
export declare function normalizeUVBatch(uvs: [number, number][], minBounds: [number, number], maxBounds: [number, number]): [number, number][];
|
|
1488
|
+
|
|
1489
|
+
export declare class ObeliskHeadstone extends Mesh<ObeliskHeadstoneGeometry, MeshStandardMaterial> {
|
|
1044
1490
|
constructor({ totalHeight, baseWidth }?: ObeliskHeadstoneOptions);
|
|
1045
1491
|
}
|
|
1046
1492
|
|
|
@@ -1065,6 +1511,40 @@ declare interface ObeliskHeadstoneOptions {
|
|
|
1065
1511
|
*/
|
|
1066
1512
|
export declare function orbitAnimation(camera: Camera, target: Vector3, radius: number, duration: number, onComplete?: () => void): void;
|
|
1067
1513
|
|
|
1514
|
+
/**
|
|
1515
|
+
* Prefab for a panel.
|
|
1516
|
+
* Designed to be used as a control panel for switches, lights, levels, dials, and gauges.
|
|
1517
|
+
*/
|
|
1518
|
+
export declare class Panel extends Mesh {
|
|
1519
|
+
geometry: BoxGeometry;
|
|
1520
|
+
material: MeshStandardMaterial;
|
|
1521
|
+
constructor({ width, height, depth }?: PanelOptions);
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Prefab for a panel light.
|
|
1526
|
+
* Designed to appear as a LED light
|
|
1527
|
+
*/
|
|
1528
|
+
export declare class PanelLight extends Mesh {
|
|
1529
|
+
geometry: SphereGeometry;
|
|
1530
|
+
material: MeshStandardMaterial;
|
|
1531
|
+
constructor({ radius, //
|
|
1532
|
+
color, emissive, emissiveIntensity, }?: PanelLightOptions);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
export declare interface PanelLightOptions {
|
|
1536
|
+
radius?: number;
|
|
1537
|
+
color?: number;
|
|
1538
|
+
emissive?: number;
|
|
1539
|
+
emissiveIntensity?: number;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
export declare interface PanelOptions {
|
|
1543
|
+
width?: number;
|
|
1544
|
+
height?: number;
|
|
1545
|
+
depth?: number;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1068
1548
|
export declare const parabolicCurve: (t: number, a?: number, b?: number, c?: number) => number;
|
|
1069
1549
|
|
|
1070
1550
|
export declare const ParametricCurve: {
|
|
@@ -1088,6 +1568,11 @@ export declare const ParametricCurveUtils: {
|
|
|
1088
1568
|
createSigmoidCurvePoints: (start: Vector2, end: Vector2, a: number, segments?: number) => Vector2[];
|
|
1089
1569
|
};
|
|
1090
1570
|
|
|
1571
|
+
/**
|
|
1572
|
+
* Convert hex color code color string to RGB array
|
|
1573
|
+
*/
|
|
1574
|
+
export declare function parseHexCode(hex: string): [number, number, number];
|
|
1575
|
+
|
|
1091
1576
|
/**
|
|
1092
1577
|
* The camera swings back and forth like a pendulum.
|
|
1093
1578
|
*
|
|
@@ -1100,6 +1585,40 @@ export declare const ParametricCurveUtils: {
|
|
|
1100
1585
|
*/
|
|
1101
1586
|
export declare function pendulumAnimation(camera: Camera, center: Vector3, radius: number, duration: number, oscillations: number, onComplete?: () => void): void;
|
|
1102
1587
|
|
|
1588
|
+
/**
|
|
1589
|
+
* Planar UV Mapping
|
|
1590
|
+
* Projects UVs onto the geometry from a single direction (like shining a projector onto a surface).
|
|
1591
|
+
*
|
|
1592
|
+
* Example:
|
|
1593
|
+
* ```
|
|
1594
|
+
* const vertices = [
|
|
1595
|
+
* [-1, -1, 1],
|
|
1596
|
+
* [1, -1, 1],
|
|
1597
|
+
* [-1, 1, 1],
|
|
1598
|
+
* [1, 1, 1],
|
|
1599
|
+
* ];
|
|
1600
|
+
*
|
|
1601
|
+
* const uvs = planarUVMapping(vertices, 'z'); // Project onto the Z-axis
|
|
1602
|
+
*/
|
|
1603
|
+
export declare function planarUVMapping(vertices: [number, number, number][], axis: 'x' | 'y' | 'z'): [number, number][];
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* Polar UV Mapping
|
|
1607
|
+
* Map textures onto circular or radial geometries, such as discs or dome-like structures.
|
|
1608
|
+
* Maps the radial distance from the center of the geometry to the v coordinate
|
|
1609
|
+
* and the angular position to the u coordinate.
|
|
1610
|
+
*
|
|
1611
|
+
* const discVertices = [
|
|
1612
|
+
* [1, 0, 0], // Vertex at (1, 0, 0)
|
|
1613
|
+
* [0, 0, 1], // Vertex at (0, 0, 1)
|
|
1614
|
+
* [-1, 0, 0], // Vertex at (-1, 0, 0)
|
|
1615
|
+
* [0, 0, -1], // Vertex at (0, 0, -1)
|
|
1616
|
+
* ];
|
|
1617
|
+
*
|
|
1618
|
+
* const polarUVs = polarUVMapping(discVertices);
|
|
1619
|
+
*/
|
|
1620
|
+
export declare function polarUVMapping(vertices: [number, number, number][]): [number, number][];
|
|
1621
|
+
|
|
1103
1622
|
export declare const quadraticCurve: (t: number, p0: number, p1: number, p2: number) => number;
|
|
1104
1623
|
|
|
1105
1624
|
export declare const quadraticEaseIn: (t: number) => number;
|
|
@@ -1142,7 +1661,21 @@ export declare function randomFloat(min?: number, max?: number): number;
|
|
|
1142
1661
|
*/
|
|
1143
1662
|
export declare function randomInteger(min?: number, max?: number): number;
|
|
1144
1663
|
|
|
1145
|
-
export declare function randomTransformVertices<T extends BufferGeometry>(geometry: T,
|
|
1664
|
+
export declare function randomTransformVertices<T extends BufferGeometry>(geometry: T, axis?: Vector3, minScale?: number, maxScale?: number): T;
|
|
1665
|
+
|
|
1666
|
+
export declare function rgbToHex(r: number, g: number, b: number): number;
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* Converts an RGB color to HSL.
|
|
1670
|
+
*
|
|
1671
|
+
* Example usage:
|
|
1672
|
+
* ```
|
|
1673
|
+
* const rgbColor = { r: 255, g: 0, b: 0 }; // Red
|
|
1674
|
+
* const hslColor = rgbToHsl(rgbColor.r, rgbColor.g, rgbColor.b);
|
|
1675
|
+
* console.log(hslColor); // Output: { h: 0, s: 100, l: 50 }
|
|
1676
|
+
* ```
|
|
1677
|
+
*/
|
|
1678
|
+
export declare function rgbToHsl(r: number, g: number, b: number): [number, number, number];
|
|
1146
1679
|
|
|
1147
1680
|
export declare class Rock extends Mesh {
|
|
1148
1681
|
constructor(radius?: number, widthSegments?: number, heightSegments?: number);
|
|
@@ -1156,7 +1689,7 @@ export declare class Rocks extends Group {
|
|
|
1156
1689
|
constructor();
|
|
1157
1690
|
}
|
|
1158
1691
|
|
|
1159
|
-
export declare class RoundedHeadstone extends Mesh {
|
|
1692
|
+
export declare class RoundedHeadstone extends Mesh<RoundedHeadstoneGeometry, MeshStandardMaterial> {
|
|
1160
1693
|
constructor(width?: number, height?: number, depth?: number, radius?: number);
|
|
1161
1694
|
}
|
|
1162
1695
|
|
|
@@ -1198,6 +1731,30 @@ declare interface RowOfBooksOptions<T extends Material = Material> {
|
|
|
1198
1731
|
scaleZMax?: number;
|
|
1199
1732
|
}
|
|
1200
1733
|
|
|
1734
|
+
/**
|
|
1735
|
+
* Set a random interval that will call the callback function with a random delay between minDelay and maxDelay.
|
|
1736
|
+
*
|
|
1737
|
+
* Example usage:
|
|
1738
|
+
* ```
|
|
1739
|
+
* const clearRandomInterval = setRandomInterval(() => {
|
|
1740
|
+
* console.log('Random interval executed!');
|
|
1741
|
+
* }, 500, 1500); // Random delay between 500ms and 1500ms
|
|
1742
|
+
* ```
|
|
1743
|
+
*/
|
|
1744
|
+
export declare function setRandomInterval(callback: () => void, minDelay: number, maxDelay: number): () => void;
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* Set a random timeout that will call the callback function with a random delay between minDelay and maxDelay.
|
|
1748
|
+
*
|
|
1749
|
+
* Example usage:
|
|
1750
|
+
* ```
|
|
1751
|
+
* setRandomTimeout(() => {
|
|
1752
|
+
* console.log(`Callback ${i} executed!`);
|
|
1753
|
+
* }, 100, 500); // Random timeout between 100ms and 500ms
|
|
1754
|
+
* ```
|
|
1755
|
+
*/
|
|
1756
|
+
export declare function setRandomTimeout(callback: () => void, minDelay: number, maxDelay: number): NodeJS.Timeout;
|
|
1757
|
+
|
|
1201
1758
|
export declare const sigmoidCurve: (t: number, a?: number) => number;
|
|
1202
1759
|
|
|
1203
1760
|
export declare const sineEaseIn: (t: number) => number;
|
|
@@ -1226,6 +1783,23 @@ export declare const sphericalToCartesian: (radius: number, theta: number, phi:
|
|
|
1226
1783
|
z: number;
|
|
1227
1784
|
};
|
|
1228
1785
|
|
|
1786
|
+
/**
|
|
1787
|
+
* Spherical UV Mapping
|
|
1788
|
+
* Wraps UVs around the geometry as if the texture were projected from a globe.
|
|
1789
|
+
*
|
|
1790
|
+
* Example usage:
|
|
1791
|
+
* ```
|
|
1792
|
+
* const sphereVertices = [
|
|
1793
|
+
* [1, 0, 0],
|
|
1794
|
+
* [0, 1, 0],
|
|
1795
|
+
* [0, 0, 1],
|
|
1796
|
+
* ];
|
|
1797
|
+
*
|
|
1798
|
+
* const sphereUVs = sphericalUVMapping(sphereVertices);
|
|
1799
|
+
* ```
|
|
1800
|
+
*/
|
|
1801
|
+
export declare function sphericalUVMapping(vertices: [number, number, number][]): [number, number][];
|
|
1802
|
+
|
|
1229
1803
|
/**
|
|
1230
1804
|
* Creates spikes or depressions centered on the target position, pushing vertices away or pulling them towards the center.
|
|
1231
1805
|
*/
|
|
@@ -1251,7 +1825,7 @@ export declare class SpiralTube extends Group {
|
|
|
1251
1825
|
constructor();
|
|
1252
1826
|
}
|
|
1253
1827
|
|
|
1254
|
-
export declare class SquareHeadstone extends Mesh {
|
|
1828
|
+
export declare class SquareHeadstone extends Mesh<SquareHeadstoneGeometry, MeshStandardMaterial> {
|
|
1255
1829
|
constructor(width?: number, height?: number, depth?: number);
|
|
1256
1830
|
}
|
|
1257
1831
|
|
|
@@ -1266,6 +1840,8 @@ export declare class StaircaseGeometry extends BufferGeometry {
|
|
|
1266
1840
|
}
|
|
1267
1841
|
|
|
1268
1842
|
export declare class Stand extends Mesh {
|
|
1843
|
+
geometry: StandGeometry;
|
|
1844
|
+
material: MeshStandardMaterial;
|
|
1269
1845
|
constructor({ radius, //
|
|
1270
1846
|
height, count, thickness, radialSegments, }?: {
|
|
1271
1847
|
radius?: number | undefined;
|
|
@@ -1406,7 +1982,7 @@ export declare class WineBottleGeometry extends BufferGeometry {
|
|
|
1406
1982
|
*/
|
|
1407
1983
|
export declare function wobbleAnimation(camera: Camera, intensity: number, duration: number, onComplete?: () => void): void;
|
|
1408
1984
|
|
|
1409
|
-
export declare class WroughtIronBar extends Mesh {
|
|
1985
|
+
export declare class WroughtIronBar extends Mesh<WroughtIronBarGeometry, MeshStandardMaterial> {
|
|
1410
1986
|
constructor({ barHeight, //
|
|
1411
1987
|
barRadius, spikeHeight, spikeRadius, spikeScaleZ, radialSegments, }?: {
|
|
1412
1988
|
barHeight?: number | undefined;
|
|
@@ -1433,7 +2009,7 @@ export declare class WroughtIronBarGeometry extends BufferGeometry {
|
|
|
1433
2009
|
});
|
|
1434
2010
|
}
|
|
1435
2011
|
|
|
1436
|
-
export declare class WroughtIronFence extends Mesh {
|
|
2012
|
+
export declare class WroughtIronFence extends Mesh<WroughtIronFenceGeometry, MeshStandardMaterial> {
|
|
1437
2013
|
constructor({ count, //
|
|
1438
2014
|
spacing, barHeight, barRadius, spikeHeight, spikeRadius, spikeScaleZ, railHeight, railDepth, railOffset, radialSegments, }?: {
|
|
1439
2015
|
count?: number | undefined;
|