three-low-poly 0.9.16 → 0.9.18
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 +9 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +372 -153
- package/dist/index.es.js +1462 -1294
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +8 -8
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,48 @@ export declare function addWaterDisplacement<T extends Material>(material: T, {
|
|
|
45
45
|
waveAmplitude?: number | undefined;
|
|
46
46
|
}): void;
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Generates spherical curve profile points, for use with geometry.
|
|
50
|
+
* Enables connective geometry via holes at the top and bottom of the sphere.
|
|
51
|
+
*
|
|
52
|
+
* Example usage:
|
|
53
|
+
*
|
|
54
|
+
* Tube that connect with a sphere on the bottom:
|
|
55
|
+
* ```
|
|
56
|
+
* const points: Vector2[] = [
|
|
57
|
+
* new Vector2(1, 0),
|
|
58
|
+
* ...appendSphericalCurve(
|
|
59
|
+
* 2, // Radius x
|
|
60
|
+
* 2, // Radius y
|
|
61
|
+
* 5, // Start y
|
|
62
|
+
* 0, // Hole top radius
|
|
63
|
+
* 1, // Hole bottom radius
|
|
64
|
+
* 32, // Segments
|
|
65
|
+
* ),
|
|
66
|
+
* ];
|
|
67
|
+
*
|
|
68
|
+
* const latheGeometry = new LatheGeometry(points, 32);
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* Tube that connect with a sphere on the top:
|
|
72
|
+
* ```
|
|
73
|
+
* const points: Vector2[] = [
|
|
74
|
+
* ...appendSphericalCurve(
|
|
75
|
+
* 2, // Radius x
|
|
76
|
+
* 2, // Radius y
|
|
77
|
+
* 1, // Start y
|
|
78
|
+
* 1, // Hole top radius
|
|
79
|
+
* 0, // Hole bottom radius
|
|
80
|
+
* 32, // Segments
|
|
81
|
+
* ),
|
|
82
|
+
* new Vector2(1, 5),
|
|
83
|
+
* ];
|
|
84
|
+
*
|
|
85
|
+
* const latheGeometry = new LatheGeometry(points, 32);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function appendSphericalCurve(sphereRadiusX: number, sphereRadiusY: number, sphereStartY: number, holeTopRadius?: number, holeBottomRadius?: number, segments?: number): Vector2[];
|
|
89
|
+
|
|
48
90
|
/**
|
|
49
91
|
* Atmospheric scattering shader.
|
|
50
92
|
*
|
|
@@ -275,7 +317,7 @@ export declare class BifurcatedStaircaseGeometry extends BufferGeometry {
|
|
|
275
317
|
constructor(stepWidth?: number, stepHeight?: number, stepDepth?: number, numStepsCentral?: number, numStepsBranch?: number, branchAngle?: number);
|
|
276
318
|
}
|
|
277
319
|
|
|
278
|
-
export declare class Bone extends Mesh {
|
|
320
|
+
export declare class Bone extends Mesh<BoneGeometry, MeshStandardMaterial> {
|
|
279
321
|
constructor();
|
|
280
322
|
}
|
|
281
323
|
|
|
@@ -295,9 +337,11 @@ export declare class BoneGeometry extends BufferGeometry {
|
|
|
295
337
|
}
|
|
296
338
|
|
|
297
339
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
340
|
+
* Book prefab
|
|
341
|
+
*
|
|
342
|
+
* Material indices:
|
|
343
|
+
* 0. cover
|
|
344
|
+
* 1. page
|
|
301
345
|
*/
|
|
302
346
|
export declare class Book extends Mesh<BookGeometry, MeshStandardMaterial[]> {
|
|
303
347
|
constructor({ width, height, depth, coverThickness, pageIndent, coverColor, pageColor, }?: {
|
|
@@ -311,11 +355,18 @@ export declare class Book extends Mesh<BookGeometry, MeshStandardMaterial[]> {
|
|
|
311
355
|
});
|
|
312
356
|
}
|
|
313
357
|
|
|
358
|
+
/**
|
|
359
|
+
* Book
|
|
360
|
+
*
|
|
361
|
+
* Group indices:
|
|
362
|
+
* 0. cover
|
|
363
|
+
* 1. page
|
|
364
|
+
*/
|
|
314
365
|
export declare class BookGeometry extends BufferGeometry {
|
|
315
366
|
constructor(width?: number, height?: number, depth?: number, coverThickness?: number, pageIndent?: number);
|
|
316
367
|
}
|
|
317
368
|
|
|
318
|
-
export declare class Bookshelf extends Mesh {
|
|
369
|
+
export declare class Bookshelf extends Mesh<BookshelfGeometry, MeshStandardMaterial> {
|
|
319
370
|
constructor({ width, //
|
|
320
371
|
height, depth, shelves, frameThickness, open, }?: {
|
|
321
372
|
width?: number | undefined;
|
|
@@ -339,10 +390,6 @@ export declare class BookshelfGeometry extends BufferGeometry {
|
|
|
339
390
|
});
|
|
340
391
|
}
|
|
341
392
|
|
|
342
|
-
export declare class Bottle extends Group {
|
|
343
|
-
constructor();
|
|
344
|
-
}
|
|
345
|
-
|
|
346
393
|
export declare class BubblingEffect extends InstancedMesh {
|
|
347
394
|
private bubblePositions;
|
|
348
395
|
private velocities;
|
|
@@ -408,6 +455,126 @@ export declare function calculateUVBounds(uvs: [number, number][]): {
|
|
|
408
455
|
maxBounds: [number, number];
|
|
409
456
|
};
|
|
410
457
|
|
|
458
|
+
/**
|
|
459
|
+
* Calculate the x-coordinate for a given y-coordinate using the slope-intercept equation of a line.
|
|
460
|
+
* x = x1 + (y - y1) / m
|
|
461
|
+
*
|
|
462
|
+
* Example usage
|
|
463
|
+
* ```
|
|
464
|
+
* const x1 = 0.8, y1 = 0, x2 = 1, y2 = 1.5, y = 1.0;
|
|
465
|
+
* const x = calculateXForY(x1, y1, x2, y2, y);
|
|
466
|
+
* console.log(`The x-position for y=${y} is x=${x.toFixed(4)}`);
|
|
467
|
+
* ```
|
|
468
|
+
*/
|
|
469
|
+
export declare function calculateXFromSlopeIntercept(x1: number, y1: number, x2: number, y2: number, y: number): number;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Calculate the y-coordinate for a given x-coordinate using the slope-intercept equation of a line.
|
|
473
|
+
* y = y1 + m * (x - x1)
|
|
474
|
+
*
|
|
475
|
+
* Example usage
|
|
476
|
+
* ```
|
|
477
|
+
* const x1 = 0.8, y1 = 0, x2 = 1, y2 = 1.5, x = 0.9333;
|
|
478
|
+
* const y = calculateYForX(x1, y1, x2, y2, x);
|
|
479
|
+
* console.log(`The y-position for x=${x} is y=${y.toFixed(4)}`);
|
|
480
|
+
* ```
|
|
481
|
+
*/
|
|
482
|
+
export declare function calculateYFromSlopeIntercept(x1: number, y1: number, x2: number, y2: number, x: number): number;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Dolly backward
|
|
486
|
+
*
|
|
487
|
+
* Example:
|
|
488
|
+
* ```
|
|
489
|
+
* dollyAnimation(camera, 5, 3000, () => {
|
|
490
|
+
* console.log("Dolly animation complete");
|
|
491
|
+
* });
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
export declare function cameraDollyAnimation(camera: Camera, distance: number, duration: number, onComplete?: () => void): void;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* The camera flies through a sequence of points, ideal for showcasing specific elements in the scene.
|
|
498
|
+
*
|
|
499
|
+
* Example:
|
|
500
|
+
* ```
|
|
501
|
+
* flythroughAnimation(
|
|
502
|
+
* camera,
|
|
503
|
+
* [
|
|
504
|
+
* new THREE.Vector3(0, 5, 5),
|
|
505
|
+
* new THREE.Vector3(0, 5, -25.5),
|
|
506
|
+
* new THREE.Vector3(-20.5, 5, 0),
|
|
507
|
+
* ],
|
|
508
|
+
* 6000,
|
|
509
|
+
* () => {
|
|
510
|
+
* console.log("Flythrough animation complete");
|
|
511
|
+
* }
|
|
512
|
+
* );
|
|
513
|
+
* ```
|
|
514
|
+
*/
|
|
515
|
+
export declare function cameraFlythroughAnimation(camera: Camera, waypoints: Vector3[], duration: number, onComplete?: () => void): void;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Orbit around a target
|
|
519
|
+
*
|
|
520
|
+
* Example:
|
|
521
|
+
* ```
|
|
522
|
+
* orbitAnimation(camera, new THREE.Vector3(0, 0, 0), 10, 5000, () => {
|
|
523
|
+
* console.log("Orbit animation complete");
|
|
524
|
+
* });
|
|
525
|
+
* ```
|
|
526
|
+
*/
|
|
527
|
+
export declare function cameraOrbitAnimation(camera: Camera, target: Vector3, radius: number, duration: number, onComplete?: () => void): void;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* The camera swings back and forth like a pendulum.
|
|
531
|
+
*
|
|
532
|
+
* Example:
|
|
533
|
+
* ```
|
|
534
|
+
* pendulumAnimation(camera, new THREE.Vector3(0, 5, 5), 0.5, 9000, 3, () => {
|
|
535
|
+
* console.log("Pendulum animation complete");
|
|
536
|
+
* });
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
539
|
+
export declare function cameraPendulumAnimation(camera: Camera, center: Vector3, radius: number, duration: number, oscillations: number, onComplete?: () => void): void;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* The camera spirals upward, perfect for revealing a large scene or structure.
|
|
543
|
+
*
|
|
544
|
+
* Example:
|
|
545
|
+
* ```
|
|
546
|
+
* spiralAscensionAnimation(camera, new THREE.Vector3(0, 0, 0), 10, 300, 7, 12000, () => {
|
|
547
|
+
* console.log("Spiral ascension animation complete");
|
|
548
|
+
* });
|
|
549
|
+
* ```
|
|
550
|
+
*/
|
|
551
|
+
export declare function cameraSpiralAscensionAnimation(camera: Camera, center: Vector3, radius: number, height: number, revolutions: number, duration: number, onComplete?: () => void): void;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Add a slight random wobble for intensity or realism (e.g., during an explosion).
|
|
555
|
+
*
|
|
556
|
+
* Example:
|
|
557
|
+
* ```
|
|
558
|
+
* wobbleAnimation(camera, 0.5, 1000, () => {
|
|
559
|
+
* console.log("Wobble animation complete");
|
|
560
|
+
* });
|
|
561
|
+
* ```
|
|
562
|
+
*/
|
|
563
|
+
export declare function cameraWobbleAnimation(camera: Camera, intensity: number, duration: number, onComplete?: () => void): void;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* The camera smoothly zooms in toward a target, focusing attention on a specific point,
|
|
567
|
+
* and resets to its original FOV after completion.
|
|
568
|
+
*
|
|
569
|
+
* Example:
|
|
570
|
+
* ```
|
|
571
|
+
* zoomInAnimation(camera, new THREE.Vector3(0, 0, 0), 120, 75, 2000, () => {
|
|
572
|
+
* console.log("Zoom in animation complete");
|
|
573
|
+
* });
|
|
574
|
+
* ```
|
|
575
|
+
*/
|
|
576
|
+
export declare function cameraZoomInAnimation(camera: PerspectiveCamera, target: Vector3, startFov: number, endFov: number, duration: number, onComplete?: () => void): void;
|
|
577
|
+
|
|
411
578
|
export declare class Candle extends Group {
|
|
412
579
|
private candle;
|
|
413
580
|
private flame;
|
|
@@ -480,15 +647,19 @@ export declare const circularEaseInOut: (t: number) => number;
|
|
|
480
647
|
export declare const circularEaseOut: (t: number) => number;
|
|
481
648
|
|
|
482
649
|
export declare const ColorPalette: {
|
|
650
|
+
CADMIUM_RED: number;
|
|
483
651
|
CARDINAL_RED: number;
|
|
484
652
|
CHERRY_RED: number;
|
|
485
653
|
CRIMSON: number;
|
|
654
|
+
ALIZARIN_CRIMSON: number;
|
|
486
655
|
RUST: number;
|
|
487
656
|
DARK_RED: number;
|
|
488
657
|
TANGERINE: number;
|
|
489
658
|
ORANGE_PEEL: number;
|
|
659
|
+
CADMIUM_ORANGE: number;
|
|
490
660
|
ORANGE: number;
|
|
491
661
|
AMBER: number;
|
|
662
|
+
CADMIUM_YELLOW: number;
|
|
492
663
|
GOLD: number;
|
|
493
664
|
YELLOW: number;
|
|
494
665
|
LIME_GREEN: number;
|
|
@@ -496,41 +667,53 @@ export declare const ColorPalette: {
|
|
|
496
667
|
MOSS_GREEN: number;
|
|
497
668
|
FERN_GREEN: number;
|
|
498
669
|
FOREST_GREEN: number;
|
|
670
|
+
SAP_GREEN: number;
|
|
499
671
|
OLIVE_DRAB: number;
|
|
672
|
+
VIRIDIAN_GREEN: number;
|
|
500
673
|
MINT_GREEN: number;
|
|
501
674
|
AQUAMARINE: number;
|
|
675
|
+
PHTHALO_BLUE: number;
|
|
502
676
|
SKY_BLUE: number;
|
|
503
677
|
CERULEAN_BLUE: number;
|
|
504
678
|
AZURE: number;
|
|
505
679
|
OCEAN_BLUE: number;
|
|
506
680
|
ROYAL_BLUE: number;
|
|
507
681
|
MIDNIGHT_BLUE: number;
|
|
682
|
+
ULTRAMARINE_BLUE: number;
|
|
683
|
+
COBALT_VIOLET: number;
|
|
684
|
+
DEEP_VIOLET: number;
|
|
508
685
|
CORAL_PINK: number;
|
|
509
686
|
VIVID_MAGENTA: number;
|
|
510
687
|
MAGENTA: number;
|
|
511
688
|
HOT_PINK: number;
|
|
512
689
|
PINK_SHERBET: number;
|
|
513
690
|
SOFT_PINK: number;
|
|
514
|
-
|
|
515
|
-
|
|
691
|
+
BURNT_SIENNA: number;
|
|
692
|
+
BURNT_UMBER: number;
|
|
516
693
|
SIENNA: number;
|
|
517
694
|
SADDLE_BROWN: number;
|
|
518
695
|
COFFEE_BROWN: number;
|
|
519
696
|
DARK_UMBER: number;
|
|
697
|
+
RAW_UMBER: number;
|
|
698
|
+
YELLOW_OCHRE: number;
|
|
699
|
+
RAW_SIENNA: number;
|
|
700
|
+
TAUPE: number;
|
|
520
701
|
ONYX: number;
|
|
521
702
|
CARBON: number;
|
|
522
703
|
CHARCOAL: number;
|
|
523
704
|
SLATE_GRAY: number;
|
|
524
705
|
ASH_GRAY: number;
|
|
706
|
+
GRAPHITE: number;
|
|
525
707
|
STEEL_GRAY: number;
|
|
526
|
-
|
|
708
|
+
DIM_GRAY: number;
|
|
527
709
|
IRON: number;
|
|
528
710
|
GRAY: number;
|
|
529
711
|
STONE: number;
|
|
530
712
|
SILVER: number;
|
|
713
|
+
LIGHT_GRAY: number;
|
|
531
714
|
PALE_GRAY: number;
|
|
532
715
|
WHITE_SMOKE: number;
|
|
533
|
-
|
|
716
|
+
TITANIUM_WHITE: number;
|
|
534
717
|
};
|
|
535
718
|
|
|
536
719
|
export declare const concave: (t: number) => number;
|
|
@@ -815,12 +998,20 @@ export declare interface DaySkyUniforms {
|
|
|
815
998
|
bottomColor: Uniform<Color>;
|
|
816
999
|
}
|
|
817
1000
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
1001
|
+
/**
|
|
1002
|
+
* Material indices:
|
|
1003
|
+
* 0. Desk surface
|
|
1004
|
+
* 1. Desk legs
|
|
1005
|
+
*/
|
|
1006
|
+
export declare class Desk extends Mesh<DeskGeometry, MeshStandardMaterial[]> {
|
|
821
1007
|
constructor();
|
|
822
1008
|
}
|
|
823
1009
|
|
|
1010
|
+
/**
|
|
1011
|
+
* Group indices:
|
|
1012
|
+
* 0. Desk surface
|
|
1013
|
+
* 1. Desk legs
|
|
1014
|
+
*/
|
|
824
1015
|
export declare class DeskGeometry extends BufferGeometry {
|
|
825
1016
|
constructor();
|
|
826
1017
|
}
|
|
@@ -909,18 +1100,6 @@ export declare const Direction: {
|
|
|
909
1100
|
*/
|
|
910
1101
|
export declare const displacementBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, direction?: Vector3, falloffFn?: (distance: number, radius: number) => number) => void;
|
|
911
1102
|
|
|
912
|
-
/**
|
|
913
|
-
* Dolly backward
|
|
914
|
-
*
|
|
915
|
-
* Example:
|
|
916
|
-
* ```
|
|
917
|
-
* dollyAnimation(camera, 5, 3000, () => {
|
|
918
|
-
* console.log("Dolly animation complete");
|
|
919
|
-
* });
|
|
920
|
-
* ```
|
|
921
|
-
*/
|
|
922
|
-
export declare function dollyAnimation(camera: Camera, distance: number, duration: number, onComplete?: () => void): void;
|
|
923
|
-
|
|
924
1103
|
/**
|
|
925
1104
|
* Easing functions for interpolating values over time.
|
|
926
1105
|
*/
|
|
@@ -965,18 +1144,26 @@ export declare class EllipticLeafGeometry extends BufferGeometry {
|
|
|
965
1144
|
}
|
|
966
1145
|
|
|
967
1146
|
/**
|
|
968
|
-
* Emissive pulse
|
|
1147
|
+
* Emissive pulse animation, producing a flickering light effect for materials that have emissive properties.
|
|
969
1148
|
* The emissive intensity of the material will oscillate between `minIntensity` and `maxIntensity`.
|
|
970
1149
|
*
|
|
971
|
-
* Use with materials that have emissive properties.
|
|
972
|
-
*
|
|
973
1150
|
* Oscillation time = 2π / speed
|
|
974
1151
|
* - Low speed values (e.g., 0.5) will result in a slow pulse
|
|
975
1152
|
* - High speed values (e.g., 10) will result in a rapid flicker
|
|
976
1153
|
*
|
|
977
1154
|
* Requires `update()` frame handler with `clock.getElapsedTime()` for animation.
|
|
1155
|
+
*
|
|
1156
|
+
* Example usage:
|
|
1157
|
+
* ```
|
|
1158
|
+
* const pulseAnimation = new EmissivePulseAnimation();
|
|
1159
|
+
* const clock = new THREE.Clock();
|
|
1160
|
+
*
|
|
1161
|
+
* function animate() {
|
|
1162
|
+
* pulseAnimation.update(clock.getElapsedTime());
|
|
1163
|
+
* }
|
|
1164
|
+
* ```
|
|
978
1165
|
*/
|
|
979
|
-
export declare class
|
|
1166
|
+
export declare class EmissivePulseAnimation {
|
|
980
1167
|
speed: number;
|
|
981
1168
|
maxIntensity: number;
|
|
982
1169
|
minIntensity: number;
|
|
@@ -1003,7 +1190,7 @@ export declare interface EmissivePulseEffectOptions {
|
|
|
1003
1190
|
material: MeshStandardMaterial | MeshPhysicalMaterial | MeshLambertMaterial | MeshPhongMaterial;
|
|
1004
1191
|
}
|
|
1005
1192
|
|
|
1006
|
-
export declare class ErlenmeyerFlask extends Mesh {
|
|
1193
|
+
export declare class ErlenmeyerFlask extends Mesh<ErlenmeyerFlaskGeometry, MeshPhysicalMaterial> {
|
|
1007
1194
|
constructor({ flaskRadius, //
|
|
1008
1195
|
neckRadius, height, neckHeight, radialSegments, }?: {
|
|
1009
1196
|
flaskRadius?: number | undefined;
|
|
@@ -1059,37 +1246,16 @@ export declare const Falloff: {
|
|
|
1059
1246
|
SMOOTHSTEP: (distance: number, radius: number) => number;
|
|
1060
1247
|
};
|
|
1061
1248
|
|
|
1062
|
-
export declare class FenceColumn extends Mesh<FenceColumnGeometry, MeshStandardMaterial> {
|
|
1063
|
-
constructor({ height }?: {
|
|
1064
|
-
height?: number | undefined;
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
/**
|
|
1069
|
-
* Fence Column Geometry, a stone slab fence column shape
|
|
1070
|
-
*/
|
|
1071
|
-
export declare class FenceColumnGeometry extends BufferGeometry {
|
|
1072
|
-
constructor({ height }?: {
|
|
1073
|
-
height?: number | undefined;
|
|
1074
|
-
});
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
1249
|
export declare function findClosestColor(inputColor: number, dataset: number[]): number | null;
|
|
1078
1250
|
|
|
1079
1251
|
export declare function findClosestColorChannelWise(inputColor: number, dataset: number[]): number | null;
|
|
1080
1252
|
|
|
1081
|
-
export declare class Flask extends Group {
|
|
1082
|
-
constructor();
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
1253
|
/**
|
|
1086
1254
|
* Flattens vertices to a given plane defined by a target height or normal direction.
|
|
1087
1255
|
*/
|
|
1088
1256
|
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;
|
|
1089
1257
|
|
|
1090
|
-
export declare class FlorenceFlask extends Mesh {
|
|
1091
|
-
geometry: FlorenceFlaskGeometry;
|
|
1092
|
-
material: MeshPhysicalMaterial;
|
|
1258
|
+
export declare class FlorenceFlask extends Mesh<FlorenceFlaskGeometry, MeshPhysicalMaterial> {
|
|
1093
1259
|
constructor();
|
|
1094
1260
|
}
|
|
1095
1261
|
|
|
@@ -1097,27 +1263,6 @@ export declare class FlorenceFlaskGeometry extends BufferGeometry {
|
|
|
1097
1263
|
constructor();
|
|
1098
1264
|
}
|
|
1099
1265
|
|
|
1100
|
-
/**
|
|
1101
|
-
* The camera flies through a sequence of points, ideal for showcasing specific elements in the scene.
|
|
1102
|
-
*
|
|
1103
|
-
* Example:
|
|
1104
|
-
* ```
|
|
1105
|
-
* flythroughAnimation(
|
|
1106
|
-
* camera,
|
|
1107
|
-
* [
|
|
1108
|
-
* new THREE.Vector3(0, 5, 5),
|
|
1109
|
-
* new THREE.Vector3(0, 5, -25.5),
|
|
1110
|
-
* new THREE.Vector3(-20.5, 5, 0),
|
|
1111
|
-
* ],
|
|
1112
|
-
* 6000,
|
|
1113
|
-
* () => {
|
|
1114
|
-
* console.log("Flythrough animation complete");
|
|
1115
|
-
* }
|
|
1116
|
-
* );
|
|
1117
|
-
* ```
|
|
1118
|
-
*/
|
|
1119
|
-
export declare function flythroughAnimation(camera: Camera, waypoints: Vector3[], duration: number, onComplete?: () => void): void;
|
|
1120
|
-
|
|
1121
1266
|
export declare const gaussian: (t: number) => number;
|
|
1122
1267
|
|
|
1123
1268
|
export declare class Gear extends Mesh {
|
|
@@ -1154,7 +1299,7 @@ export declare function hexToHsl(hex: number): [number, number, number];
|
|
|
1154
1299
|
*/
|
|
1155
1300
|
export declare function hexToRgb(hex: number): [number, number, number];
|
|
1156
1301
|
|
|
1157
|
-
export declare class Hill extends Mesh {
|
|
1302
|
+
export declare class Hill extends Mesh<HillGeometry, MeshStandardMaterial> {
|
|
1158
1303
|
constructor({ radius, //
|
|
1159
1304
|
height, widthSegments, heightSegments, phiStart, phiLength, }?: {
|
|
1160
1305
|
radius?: number | undefined;
|
|
@@ -1208,6 +1353,24 @@ export declare function interpolateCurve(curveFunction: (t: number) => number, s
|
|
|
1208
1353
|
|
|
1209
1354
|
export declare const inverse: (t: number) => number;
|
|
1210
1355
|
|
|
1356
|
+
/**
|
|
1357
|
+
* Material indices
|
|
1358
|
+
* 0. Jar
|
|
1359
|
+
* 1. Cork
|
|
1360
|
+
*/
|
|
1361
|
+
export declare class Jar extends Mesh<JarGeometry, MeshStandardMaterial[]> {
|
|
1362
|
+
constructor();
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Group indices
|
|
1367
|
+
* 0. Jar
|
|
1368
|
+
* 1. Cork
|
|
1369
|
+
*/
|
|
1370
|
+
export declare class JarGeometry extends BufferGeometry {
|
|
1371
|
+
constructor();
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1211
1374
|
export declare class Lantern extends Group {
|
|
1212
1375
|
constructor(height?: number, baseWidth?: number);
|
|
1213
1376
|
}
|
|
@@ -1236,7 +1399,7 @@ export declare class LeverPanel extends Group {
|
|
|
1236
1399
|
}
|
|
1237
1400
|
|
|
1238
1401
|
/**
|
|
1239
|
-
* A lightning
|
|
1402
|
+
* A lightning animation that can be used to simulate a lightning storm.
|
|
1240
1403
|
* This effect is applied to a light source.
|
|
1241
1404
|
*
|
|
1242
1405
|
* Example usage:
|
|
@@ -1245,12 +1408,14 @@ export declare class LeverPanel extends Group {
|
|
|
1245
1408
|
* scene.add(lightning);
|
|
1246
1409
|
* lightning.position.set(5, 10, -5);
|
|
1247
1410
|
*
|
|
1411
|
+
* const lightningAnimation = new LightningAnimation();
|
|
1412
|
+
*
|
|
1248
1413
|
* setRandomInterval(() => {
|
|
1249
1414
|
* lightningEffect.triggerLightning();
|
|
1250
1415
|
* }, 250, 1250);
|
|
1251
1416
|
* ```
|
|
1252
1417
|
*/
|
|
1253
|
-
export declare class
|
|
1418
|
+
export declare class LightningAnimation {
|
|
1254
1419
|
private light?;
|
|
1255
1420
|
minIntensity: number;
|
|
1256
1421
|
maxIntensity: number;
|
|
@@ -1272,6 +1437,11 @@ declare interface LightningEffectOptions {
|
|
|
1272
1437
|
|
|
1273
1438
|
export declare const linear: (t: number) => number;
|
|
1274
1439
|
|
|
1440
|
+
export declare const LineEquations: {
|
|
1441
|
+
calculateXFromSlopeIntercept: typeof calculateXFromSlopeIntercept;
|
|
1442
|
+
calculateYFromSlopeIntercept: typeof calculateYFromSlopeIntercept;
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1275
1445
|
export declare const logarithmic: (t: number) => number;
|
|
1276
1446
|
|
|
1277
1447
|
export declare const logarithmicCurve: (t: number, base?: number, factor?: number) => number;
|
|
@@ -1304,7 +1474,27 @@ export declare class LShapedStaircaseGeometry extends BufferGeometry {
|
|
|
1304
1474
|
constructor(stepWidth?: number, stepHeight?: number, stepDepth?: number, numStepsPerFlight?: number, landingDepth?: number);
|
|
1305
1475
|
}
|
|
1306
1476
|
|
|
1307
|
-
|
|
1477
|
+
/**
|
|
1478
|
+
* Material indices:
|
|
1479
|
+
* 0. Base
|
|
1480
|
+
* 1. Building
|
|
1481
|
+
* 2. Roof
|
|
1482
|
+
* 3. Arched entrance
|
|
1483
|
+
*/
|
|
1484
|
+
export declare class Mausoleum extends Mesh<MausoleumGeometry, MeshStandardMaterial[]> {
|
|
1485
|
+
constructor();
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* Mausoleum Geometry
|
|
1490
|
+
*
|
|
1491
|
+
* Group indices:
|
|
1492
|
+
* 0. Base
|
|
1493
|
+
* 1. Building
|
|
1494
|
+
* 2. Roof
|
|
1495
|
+
* 3. Arched entrance
|
|
1496
|
+
*/
|
|
1497
|
+
export declare class MausoleumGeometry extends BufferGeometry {
|
|
1308
1498
|
constructor();
|
|
1309
1499
|
}
|
|
1310
1500
|
|
|
@@ -1338,7 +1528,21 @@ export declare class MortarGeometry extends BufferGeometry {
|
|
|
1338
1528
|
constructor();
|
|
1339
1529
|
}
|
|
1340
1530
|
|
|
1341
|
-
|
|
1531
|
+
/**
|
|
1532
|
+
* Material indices:
|
|
1533
|
+
* 0. Rocks
|
|
1534
|
+
* 1. Moss
|
|
1535
|
+
*/
|
|
1536
|
+
export declare class MossyRocks extends Mesh<MossyRocksGeometry, MeshStandardMaterial[]> {
|
|
1537
|
+
constructor();
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* Group indices:
|
|
1542
|
+
* 0. Rocks
|
|
1543
|
+
* 1. Moss
|
|
1544
|
+
*/
|
|
1545
|
+
export declare class MossyRocksGeometry extends BufferGeometry {
|
|
1342
1546
|
constructor();
|
|
1343
1547
|
}
|
|
1344
1548
|
|
|
@@ -1359,7 +1563,7 @@ export declare class MossyRocks extends Group {
|
|
|
1359
1563
|
* }
|
|
1360
1564
|
* ```
|
|
1361
1565
|
*/
|
|
1362
|
-
export declare class Mound extends Mesh {
|
|
1566
|
+
export declare class Mound extends Mesh<MoundGeometry, MeshStandardMaterial> {
|
|
1363
1567
|
constructor({ radius, //
|
|
1364
1568
|
widthSegments, heightSegments, phiStart, phiLength, thetaLength, }?: {
|
|
1365
1569
|
radius?: number | undefined;
|
|
@@ -1499,18 +1703,6 @@ declare interface ObeliskHeadstoneOptions {
|
|
|
1499
1703
|
totalHeight?: number;
|
|
1500
1704
|
}
|
|
1501
1705
|
|
|
1502
|
-
/**
|
|
1503
|
-
* Orbit around a target
|
|
1504
|
-
*
|
|
1505
|
-
* Example:
|
|
1506
|
-
* ```
|
|
1507
|
-
* orbitAnimation(camera, new THREE.Vector3(0, 0, 0), 10, 5000, () => {
|
|
1508
|
-
* console.log("Orbit animation complete");
|
|
1509
|
-
* });
|
|
1510
|
-
* ```
|
|
1511
|
-
*/
|
|
1512
|
-
export declare function orbitAnimation(camera: Camera, target: Vector3, radius: number, duration: number, onComplete?: () => void): void;
|
|
1513
|
-
|
|
1514
1706
|
/**
|
|
1515
1707
|
* Prefab for a panel.
|
|
1516
1708
|
* Designed to be used as a control panel for switches, lights, levels, dials, and gauges.
|
|
@@ -1573,18 +1765,6 @@ export declare const ParametricCurveUtils: {
|
|
|
1573
1765
|
*/
|
|
1574
1766
|
export declare function parseHexCode(hex: string): [number, number, number];
|
|
1575
1767
|
|
|
1576
|
-
/**
|
|
1577
|
-
* The camera swings back and forth like a pendulum.
|
|
1578
|
-
*
|
|
1579
|
-
* Example:
|
|
1580
|
-
* ```
|
|
1581
|
-
* pendulumAnimation(camera, new THREE.Vector3(0, 5, 5), 0.5, 9000, 3, () => {
|
|
1582
|
-
* console.log("Pendulum animation complete");
|
|
1583
|
-
* });
|
|
1584
|
-
* ```
|
|
1585
|
-
*/
|
|
1586
|
-
export declare function pendulumAnimation(camera: Camera, center: Vector3, radius: number, duration: number, oscillations: number, onComplete?: () => void): void;
|
|
1587
|
-
|
|
1588
1768
|
/**
|
|
1589
1769
|
* Planar UV Mapping
|
|
1590
1770
|
* Projects UVs onto the geometry from a single direction (like shining a projector onto a surface).
|
|
@@ -1619,6 +1799,30 @@ export declare function planarUVMapping(vertices: [number, number, number][], ax
|
|
|
1619
1799
|
*/
|
|
1620
1800
|
export declare function polarUVMapping(vertices: [number, number, number][]): [number, number][];
|
|
1621
1801
|
|
|
1802
|
+
/**
|
|
1803
|
+
* Potion bottle, with optional liquid fill
|
|
1804
|
+
*
|
|
1805
|
+
* Material indices
|
|
1806
|
+
* 0. Bottle
|
|
1807
|
+
* 1. Cork
|
|
1808
|
+
* 2. Liquid (optional)
|
|
1809
|
+
*/
|
|
1810
|
+
export declare class PotionBottle extends Mesh<PotionBottleGeometry, MeshStandardMaterial[]> {
|
|
1811
|
+
constructor();
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* Potion bottle geometry
|
|
1816
|
+
*
|
|
1817
|
+
* Group indices
|
|
1818
|
+
* 0. Bottle
|
|
1819
|
+
* 1. Cork
|
|
1820
|
+
* 2. Liquid (optional)
|
|
1821
|
+
*/
|
|
1822
|
+
export declare class PotionBottleGeometry extends BufferGeometry {
|
|
1823
|
+
constructor();
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1622
1826
|
export declare const quadraticCurve: (t: number, p0: number, p1: number, p2: number) => number;
|
|
1623
1827
|
|
|
1624
1828
|
export declare const quadraticEaseIn: (t: number) => number;
|
|
@@ -1677,7 +1881,7 @@ export declare function rgbToHex(r: number, g: number, b: number): number;
|
|
|
1677
1881
|
*/
|
|
1678
1882
|
export declare function rgbToHsl(r: number, g: number, b: number): [number, number, number];
|
|
1679
1883
|
|
|
1680
|
-
export declare class Rock extends Mesh {
|
|
1884
|
+
export declare class Rock extends Mesh<RockGeometry, MeshStandardMaterial> {
|
|
1681
1885
|
constructor(radius?: number, widthSegments?: number, heightSegments?: number);
|
|
1682
1886
|
}
|
|
1683
1887
|
|
|
@@ -1685,7 +1889,11 @@ export declare class RockGeometry extends BufferGeometry {
|
|
|
1685
1889
|
constructor(radius?: number, widthSegments?: number, heightSegments?: number);
|
|
1686
1890
|
}
|
|
1687
1891
|
|
|
1688
|
-
export declare class Rocks extends
|
|
1892
|
+
export declare class Rocks extends Mesh<RocksGeometry, MeshStandardMaterial> {
|
|
1893
|
+
constructor();
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
export declare class RocksGeometry extends BufferGeometry {
|
|
1689
1897
|
constructor();
|
|
1690
1898
|
}
|
|
1691
1899
|
|
|
@@ -1805,18 +2013,6 @@ export declare function sphericalUVMapping(vertices: [number, number, number][])
|
|
|
1805
2013
|
*/
|
|
1806
2014
|
export declare const spikeBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, inward?: boolean, falloffFn?: (distance: number, radius: number) => number) => void;
|
|
1807
2015
|
|
|
1808
|
-
/**
|
|
1809
|
-
* The camera spirals upward, perfect for revealing a large scene or structure.
|
|
1810
|
-
*
|
|
1811
|
-
* Example:
|
|
1812
|
-
* ```
|
|
1813
|
-
* spiralAscensionAnimation(camera, new THREE.Vector3(0, 0, 0), 10, 300, 7, 12000, () => {
|
|
1814
|
-
* console.log("Spiral ascension animation complete");
|
|
1815
|
-
* });
|
|
1816
|
-
* ```
|
|
1817
|
-
*/
|
|
1818
|
-
export declare function spiralAscensionAnimation(camera: Camera, center: Vector3, radius: number, height: number, revolutions: number, duration: number, onComplete?: () => void): void;
|
|
1819
|
-
|
|
1820
2016
|
export declare class SpiralStaircaseGeometry extends BufferGeometry {
|
|
1821
2017
|
constructor(stepWidth?: number, stepDepth?: number, stepHeight?: number, numSteps?: number, radius?: number, angleIncrement?: number);
|
|
1822
2018
|
}
|
|
@@ -1839,9 +2035,7 @@ export declare class StaircaseGeometry extends BufferGeometry {
|
|
|
1839
2035
|
constructor(width?: number, stepHeight?: number, stepDepth?: number, numSteps?: number);
|
|
1840
2036
|
}
|
|
1841
2037
|
|
|
1842
|
-
export declare class Stand extends Mesh {
|
|
1843
|
-
geometry: StandGeometry;
|
|
1844
|
-
material: MeshStandardMaterial;
|
|
2038
|
+
export declare class Stand extends Mesh<StandGeometry, MeshStandardMaterial> {
|
|
1845
2039
|
constructor({ radius, //
|
|
1846
2040
|
height, count, thickness, radialSegments, }?: {
|
|
1847
2041
|
radius?: number | undefined;
|
|
@@ -1871,11 +2065,40 @@ export declare class StarShape extends Shape {
|
|
|
1871
2065
|
constructor(points?: number, innerRadius?: number, outerRadius?: number);
|
|
1872
2066
|
}
|
|
1873
2067
|
|
|
1874
|
-
export declare class
|
|
2068
|
+
export declare class StoneFencePost extends Mesh<StoneFencePostGeometry, MeshStandardMaterial> {
|
|
2069
|
+
constructor({ height }?: {
|
|
2070
|
+
height?: number | undefined;
|
|
2071
|
+
});
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
/**
|
|
2075
|
+
* Fence Column Geometry, a stone slab fence column shape
|
|
2076
|
+
*/
|
|
2077
|
+
export declare class StoneFencePostGeometry extends BufferGeometry {
|
|
2078
|
+
constructor({ height }?: {
|
|
2079
|
+
height?: number | undefined;
|
|
2080
|
+
});
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
* Material indices
|
|
2085
|
+
* 0: Base
|
|
2086
|
+
* 1: Coil
|
|
2087
|
+
*/
|
|
2088
|
+
export declare class TeslaCoil extends Mesh<TeslaCoilGeometry, MeshStandardMaterial[]> {
|
|
1875
2089
|
constructor();
|
|
1876
2090
|
}
|
|
1877
2091
|
|
|
1878
|
-
|
|
2092
|
+
/**
|
|
2093
|
+
* Group indices
|
|
2094
|
+
* 0: Base
|
|
2095
|
+
* 1: Coil
|
|
2096
|
+
*/
|
|
2097
|
+
export declare class TeslaCoilGeometry extends BufferGeometry {
|
|
2098
|
+
constructor();
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
export declare class TestTube extends Mesh<TestTubeGeometry, MeshPhysicalMaterial> {
|
|
1879
2102
|
constructor(radiusTop?: number, radiusBottom?: number, height?: number, segments?: number);
|
|
1880
2103
|
}
|
|
1881
2104
|
|
|
@@ -1888,7 +2111,27 @@ export declare class TestTubeRack extends Group {
|
|
|
1888
2111
|
}
|
|
1889
2112
|
|
|
1890
2113
|
/**
|
|
1891
|
-
*
|
|
2114
|
+
* Calculate the thetaLength to achieve a specific hole radius in a sphere.
|
|
2115
|
+
* thetaLength = asin(w / (2 * R))
|
|
2116
|
+
*
|
|
2117
|
+
* Returns the thetaLength in radians.
|
|
2118
|
+
*
|
|
2119
|
+
* Example usage:
|
|
2120
|
+
* ```
|
|
2121
|
+
* const sphereRadius = 5; // Radius of the sphere
|
|
2122
|
+
* const holeRadius = 1; // Desired radius of the hole at the top
|
|
2123
|
+
* const thetaLength = thetaLengthForRadius(sphereRadius, holeRadius);
|
|
2124
|
+
* ```
|
|
2125
|
+
*/
|
|
2126
|
+
export declare const thetaLengthForRadius: (sphereRadius: number, holeRadius: number) => number;
|
|
2127
|
+
|
|
2128
|
+
/**
|
|
2129
|
+
* Material indices:
|
|
2130
|
+
* 0. Trunk
|
|
2131
|
+
* 1. leafSize
|
|
2132
|
+
*
|
|
2133
|
+
* Example usage:
|
|
2134
|
+
* ```
|
|
1892
2135
|
* const tree = new Tree({
|
|
1893
2136
|
* trunkRadiusTop: 0.25,
|
|
1894
2137
|
* trunkRadiusBottom: 0.4,
|
|
@@ -1901,8 +2144,9 @@ export declare class TestTubeRack extends Group {
|
|
|
1901
2144
|
* leafSpreadRadius: 1.5,
|
|
1902
2145
|
* leafColor: 0x228b22,
|
|
1903
2146
|
* });
|
|
2147
|
+
* ```
|
|
1904
2148
|
*/
|
|
1905
|
-
export declare class Tree extends Mesh {
|
|
2149
|
+
export declare class Tree extends Mesh<TreeGeometry, MeshStandardMaterial[]> {
|
|
1906
2150
|
constructor({ trunkRadiusTop, trunkRadiusBottom, trunkHeight, trunkSegments, trunkColor, leafSize, leafCount, leafDetail, leafSpreadRadius, leafColor, }?: {
|
|
1907
2151
|
trunkRadiusTop?: number | undefined;
|
|
1908
2152
|
trunkRadiusBottom?: number | undefined;
|
|
@@ -1956,7 +2200,7 @@ export declare function updateNoiseDisplacementTime<T extends Material>(material
|
|
|
1956
2200
|
*/
|
|
1957
2201
|
export declare function updateWaterDisplacementTime<T extends Material>(material: T, deltaTime: number): void;
|
|
1958
2202
|
|
|
1959
|
-
export declare class WineBottle extends Mesh {
|
|
2203
|
+
export declare class WineBottle extends Mesh<WineBottleGeometry, MeshPhysicalMaterial> {
|
|
1960
2204
|
constructor();
|
|
1961
2205
|
}
|
|
1962
2206
|
|
|
@@ -1970,18 +2214,6 @@ export declare class WineBottleGeometry extends BufferGeometry {
|
|
|
1970
2214
|
});
|
|
1971
2215
|
}
|
|
1972
2216
|
|
|
1973
|
-
/**
|
|
1974
|
-
* Add a slight random wobble for intensity or realism (e.g., during an explosion).
|
|
1975
|
-
*
|
|
1976
|
-
* Example:
|
|
1977
|
-
* ```
|
|
1978
|
-
* wobbleAnimation(camera, 0.5, 1000, () => {
|
|
1979
|
-
* console.log("Wobble animation complete");
|
|
1980
|
-
* });
|
|
1981
|
-
* ```
|
|
1982
|
-
*/
|
|
1983
|
-
export declare function wobbleAnimation(camera: Camera, intensity: number, duration: number, onComplete?: () => void): void;
|
|
1984
|
-
|
|
1985
2217
|
export declare class WroughtIronBar extends Mesh<WroughtIronBarGeometry, MeshStandardMaterial> {
|
|
1986
2218
|
constructor({ barHeight, //
|
|
1987
2219
|
barRadius, spikeHeight, spikeRadius, spikeScaleZ, radialSegments, }?: {
|
|
@@ -2043,17 +2275,4 @@ export declare class WroughtIronFenceGeometry extends BufferGeometry {
|
|
|
2043
2275
|
});
|
|
2044
2276
|
}
|
|
2045
2277
|
|
|
2046
|
-
/**
|
|
2047
|
-
* The camera smoothly zooms in toward a target, focusing attention on a specific point,
|
|
2048
|
-
* and resets to its original FOV after completion.
|
|
2049
|
-
*
|
|
2050
|
-
* Example:
|
|
2051
|
-
* ```
|
|
2052
|
-
* zoomInAnimation(camera, new THREE.Vector3(0, 0, 0), 120, 75, 2000, () => {
|
|
2053
|
-
* console.log("Zoom in animation complete");
|
|
2054
|
-
* });
|
|
2055
|
-
* ```
|
|
2056
|
-
*/
|
|
2057
|
-
export declare function zoomInAnimation(camera: PerspectiveCamera, target: Vector3, startFov: number, endFov: number, duration: number, onComplete?: () => void): void;
|
|
2058
|
-
|
|
2059
2278
|
export { }
|