three-low-poly 0.9.23 → 0.9.25
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/README.md +75 -18
- package/dist/index.cjs +116 -113
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1851 -412
- package/dist/index.iife.js +116 -113
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +4220 -3309
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { BoxGeometry } from 'three';
|
|
2
2
|
import { BufferGeometry } from 'three';
|
|
3
|
-
import { Camera } from 'three';
|
|
4
3
|
import { Color } from 'three';
|
|
4
|
+
import { ColorRepresentation } from 'three';
|
|
5
5
|
import { DataTexture } from 'three';
|
|
6
|
+
import { DirectionalLight } from 'three';
|
|
6
7
|
import { ExtrudeGeometry } from 'three';
|
|
7
8
|
import { Group } from 'three';
|
|
8
9
|
import { InstancedMesh } from 'three';
|
|
9
|
-
import { Light } from 'three';
|
|
10
10
|
import { Material } from 'three';
|
|
11
11
|
import { Mesh } from 'three';
|
|
12
|
+
import { MeshBasicMaterial } from 'three';
|
|
12
13
|
import { MeshLambertMaterial } from 'three';
|
|
13
14
|
import { MeshPhongMaterial } from 'three';
|
|
14
15
|
import { MeshPhysicalMaterial } from 'three';
|
|
15
16
|
import { MeshStandardMaterial } from 'three';
|
|
16
17
|
import { Object3D } from 'three';
|
|
18
|
+
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
17
19
|
import { ParametricGeometry } from 'three-stdlib';
|
|
18
20
|
import { PerspectiveCamera } from 'three';
|
|
21
|
+
import { Plane } from 'three';
|
|
22
|
+
import { PlaneGeometry } from 'three';
|
|
23
|
+
import { PointLight } from 'three';
|
|
24
|
+
import { Points } from 'three';
|
|
25
|
+
import { Quaternion } from 'three';
|
|
19
26
|
import { ShaderMaterial } from 'three';
|
|
20
27
|
import { Shape } from 'three';
|
|
21
28
|
import { SphereGeometry } from 'three';
|
|
@@ -161,6 +168,8 @@ export declare function alignToRow<T extends Object3D>(objects: T[], direction?:
|
|
|
161
168
|
*/
|
|
162
169
|
export declare function appendSphericalCurve(sphereRadiusX: number, sphereRadiusY: number, sphereStartY: number, holeTopRadius?: number, holeBottomRadius?: number, segments?: number): Vector2[];
|
|
163
170
|
|
|
171
|
+
export declare function applySnapshot(camera: PerspectiveCamera, controls: OrbitControls | undefined, snapshot: CameraSnapshot): void;
|
|
172
|
+
|
|
164
173
|
/**
|
|
165
174
|
* Atmospheric scattering shader.
|
|
166
175
|
*
|
|
@@ -387,10 +396,6 @@ export declare const Axis: {
|
|
|
387
396
|
XYZ: Vector3;
|
|
388
397
|
};
|
|
389
398
|
|
|
390
|
-
export declare class BifurcatedStaircaseGeometry extends BufferGeometry {
|
|
391
|
-
constructor(stepWidth?: number, stepHeight?: number, stepDepth?: number, numStepsCentral?: number, numStepsBranch?: number, branchAngle?: number);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
399
|
declare interface BloomTransitionOptions extends SceneTransitionFXOptions {
|
|
395
400
|
maxBloom?: number;
|
|
396
401
|
}
|
|
@@ -400,6 +405,22 @@ declare interface BlurTransitionOptions extends SceneTransitionFXOptions {
|
|
|
400
405
|
kernelSize?: number;
|
|
401
406
|
}
|
|
402
407
|
|
|
408
|
+
export declare const blurTransitionShader: {
|
|
409
|
+
uniforms: {
|
|
410
|
+
tDiffuse: {
|
|
411
|
+
value: null;
|
|
412
|
+
};
|
|
413
|
+
kernelSize: {
|
|
414
|
+
value: number;
|
|
415
|
+
};
|
|
416
|
+
resolution: {
|
|
417
|
+
value: null;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
vertexShader: string;
|
|
421
|
+
fragmentShader: string;
|
|
422
|
+
};
|
|
423
|
+
|
|
403
424
|
export declare class Bone extends Mesh<BoneGeometry, MeshStandardMaterial> {
|
|
404
425
|
constructor();
|
|
405
426
|
}
|
|
@@ -482,32 +503,20 @@ export declare enum BoxSide {
|
|
|
482
503
|
BACK = "back"
|
|
483
504
|
}
|
|
484
505
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
private depth;
|
|
491
|
-
constructor(options?: BubblingEffectOptions);
|
|
492
|
-
/**
|
|
493
|
-
* Updates the position of a specific bubble instance in the InstancedMesh.
|
|
494
|
-
*/
|
|
495
|
-
private updateInstanceMatrix;
|
|
496
|
-
/**
|
|
497
|
-
* Updates bubble positions, moving them upward and resetting them
|
|
498
|
-
* to the bottom if they reach the top.
|
|
499
|
-
*/
|
|
500
|
-
update(): void;
|
|
501
|
-
}
|
|
506
|
+
/**
|
|
507
|
+
* Build merged box geometries for the outer frame and diagonal lead cames.
|
|
508
|
+
* Diagonal bars are trimmed to the rectangular opening (segment clip, not stencil).
|
|
509
|
+
*/
|
|
510
|
+
export declare function buildDiamondLatticeParts({ width, height, centerY, grid, leadThickness: barT, leadDepth: barD, }: DiamondLatticePartOptions): BoxGeometry[];
|
|
502
511
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}
|
|
512
|
+
/**
|
|
513
|
+
* Build merged box geometries for the outer frame and interior mullions.
|
|
514
|
+
* Orthogonal grid — no clipping required; counts guarantee full panes.
|
|
515
|
+
*/
|
|
516
|
+
export declare function buildGregorianLatticeParts({ width, height, centerY, cellsX, cellsY, mullionThickness: barT, mullionDepth: barD, }: GregorianLatticePartOptions): BoxGeometry[];
|
|
517
|
+
|
|
518
|
+
/** Outer frame bars — shared topology across lattice window openings. */
|
|
519
|
+
export declare function buildRingLatticeFrameParts({ width, height, centerY, frameThickness: barT, frameDepth: barD, }: RingLatticeFramePartOptions): BoxGeometry[];
|
|
511
520
|
|
|
512
521
|
export declare class BunsenBurner extends Group {
|
|
513
522
|
constructor();
|
|
@@ -585,74 +594,84 @@ export declare function calculateXFromSlopeIntercept(x1: number, y1: number, x2:
|
|
|
585
594
|
*/
|
|
586
595
|
export declare function calculateYFromSlopeIntercept(x1: number, y1: number, x2: number, y2: number, x: number): number;
|
|
587
596
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
* ```
|
|
597
|
-
*/
|
|
598
|
-
export declare function cameraDollyAnimation(camera: Camera, distance: number, duration: number, onComplete?: () => void): void;
|
|
597
|
+
export declare interface CameraClip {
|
|
598
|
+
readonly label: string;
|
|
599
|
+
readonly duration: number;
|
|
600
|
+
start(runtime: ClipRuntime): void;
|
|
601
|
+
update(runtime: ClipRuntime, dt: number): ClipPhase;
|
|
602
|
+
/** Called when playback is cancelled mid-clip. */
|
|
603
|
+
cancel?(runtime: ClipRuntime): void;
|
|
604
|
+
}
|
|
599
605
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
* camera,
|
|
607
|
-
* [
|
|
608
|
-
* new THREE.Vector3(0, 5, 5),
|
|
609
|
-
* new THREE.Vector3(0, 5, -25.5),
|
|
610
|
-
* new THREE.Vector3(-20.5, 5, 0),
|
|
611
|
-
* ],
|
|
612
|
-
* 6000,
|
|
613
|
-
* () => {
|
|
614
|
-
* console.log("Flythrough animation complete");
|
|
615
|
-
* }
|
|
616
|
-
* );
|
|
617
|
-
* ```
|
|
618
|
-
*/
|
|
619
|
-
export declare function cameraFlythroughAnimation(camera: Camera, waypoints: Vector3[], duration: number, onComplete?: () => void): void;
|
|
606
|
+
declare interface CameraClipTiming {
|
|
607
|
+
/** Duration in seconds. */
|
|
608
|
+
duration: number;
|
|
609
|
+
/** Progress easing for normalized time `t` in [0, 1]. Defaults to smoothstep. */
|
|
610
|
+
ease?: EasingFunction;
|
|
611
|
+
}
|
|
620
612
|
|
|
621
613
|
/**
|
|
622
|
-
*
|
|
614
|
+
* Single director for camera showcase clips — Unity demo-scene style playback.
|
|
623
615
|
*
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
* console.log("Orbit animation complete");
|
|
628
|
-
* });
|
|
629
|
-
* ```
|
|
630
|
-
*/
|
|
631
|
-
export declare function cameraOrbitAnimation(camera: Camera, target: Vector3, radius: number, duration: number, onComplete?: () => void): void;
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* The camera swings back and forth like a pendulum.
|
|
616
|
+
* One active clip at a time, driven by {@link update} with elapsed seconds (`dt`),
|
|
617
|
+
* not nested `requestAnimationFrame` loops. Disables OrbitControls while playing;
|
|
618
|
+
* re-enables and syncs `controls.target` to the clip focus on complete.
|
|
635
619
|
*
|
|
636
|
-
*
|
|
637
|
-
* ```
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* });
|
|
641
|
-
* ```
|
|
642
|
-
*/
|
|
643
|
-
export declare function cameraPendulumAnimation(camera: Camera, center: Vector3, radius: number, duration: number, oscillations: number, onComplete?: () => void): void;
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* The camera spirals upward, perfect for revealing a large scene or structure.
|
|
620
|
+
* @example
|
|
621
|
+
* ```ts
|
|
622
|
+
* const playback = new CameraPlayback(camera, controls);
|
|
623
|
+
* playback.setRest(); // snapshot current pose as Reset target
|
|
647
624
|
*
|
|
648
|
-
*
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
*
|
|
625
|
+
* onFrame((dt) => {
|
|
626
|
+
* playback.update(dt);
|
|
627
|
+
* controls.update();
|
|
628
|
+
* renderer.render(scene, camera);
|
|
652
629
|
* });
|
|
630
|
+
*
|
|
631
|
+
* playback.play(createOrbitClip({ target, radius: 10, duration: 8 }));
|
|
653
632
|
* ```
|
|
654
633
|
*/
|
|
655
|
-
export declare
|
|
634
|
+
export declare class CameraPlayback {
|
|
635
|
+
private readonly camera;
|
|
636
|
+
private readonly controls?;
|
|
637
|
+
private active;
|
|
638
|
+
private elapsed;
|
|
639
|
+
private readonly focus;
|
|
640
|
+
private rest;
|
|
641
|
+
constructor(camera: PerspectiveCamera, controls?: OrbitControls | undefined);
|
|
642
|
+
/** Whether a clip is actively playing. */
|
|
643
|
+
get isPlaying(): boolean;
|
|
644
|
+
/** Snapshot the current camera + controls pose as the Reset/rest pose. */
|
|
645
|
+
setRest(): void;
|
|
646
|
+
/** Replace the rest pose without stopping playback. */
|
|
647
|
+
setRestSnapshot(snapshot: CameraSnapshot): void;
|
|
648
|
+
/**
|
|
649
|
+
* Begin a clip. Cancels any active clip first.
|
|
650
|
+
* OrbitControls are disabled until the clip completes or {@link stop} is called.
|
|
651
|
+
*/
|
|
652
|
+
play(clip: CameraClip): void;
|
|
653
|
+
/** Cancel the active clip and restore the rest pose. */
|
|
654
|
+
stop(): void;
|
|
655
|
+
/** Alias for {@link stop} — return to the rest pose. */
|
|
656
|
+
reset(): void;
|
|
657
|
+
/**
|
|
658
|
+
* Advance the active clip. Call from the scene `onFrame` callback each frame.
|
|
659
|
+
* @param dt Elapsed seconds since last frame.
|
|
660
|
+
*/
|
|
661
|
+
update(dt: number): void;
|
|
662
|
+
/** Release references; call from example dispose. */
|
|
663
|
+
dispose(): void;
|
|
664
|
+
private cancelActive;
|
|
665
|
+
private runtime;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/** Rest pose captured when playback is constructed or reset. */
|
|
669
|
+
export declare interface CameraSnapshot {
|
|
670
|
+
position: Vector3;
|
|
671
|
+
quaternion: Quaternion;
|
|
672
|
+
fov: number;
|
|
673
|
+
target: Vector3;
|
|
674
|
+
}
|
|
656
675
|
|
|
657
676
|
/**
|
|
658
677
|
* CameraTransition provides smooth animated transitions between perspective and orthographic cameras.
|
|
@@ -735,31 +754,6 @@ export declare interface CameraTransitionOptions {
|
|
|
735
754
|
onComplete?: () => void;
|
|
736
755
|
}
|
|
737
756
|
|
|
738
|
-
/**
|
|
739
|
-
* Add a slight random wobble for intensity or realism (e.g., during an explosion).
|
|
740
|
-
*
|
|
741
|
-
* Example:
|
|
742
|
-
* ```
|
|
743
|
-
* cameraWobbleAnimation(camera, 0.5, 1000, () => {
|
|
744
|
-
* console.log("Wobble animation complete");
|
|
745
|
-
* });
|
|
746
|
-
* ```
|
|
747
|
-
*/
|
|
748
|
-
export declare function cameraWobbleAnimation(camera: Camera, intensity: number, duration: number, onComplete?: () => void): void;
|
|
749
|
-
|
|
750
|
-
/**
|
|
751
|
-
* The camera smoothly zooms in toward a target, focusing attention on a specific point,
|
|
752
|
-
* and resets to its original FOV after completion.
|
|
753
|
-
*
|
|
754
|
-
* Example:
|
|
755
|
-
* ```
|
|
756
|
-
* cameraZoomInAnimation(camera, new THREE.Vector3(0, 0, 0), 120, 75, 2000, () => {
|
|
757
|
-
* console.log("Zoom in animation complete");
|
|
758
|
-
* });
|
|
759
|
-
* ```
|
|
760
|
-
*/
|
|
761
|
-
export declare function cameraZoomInAnimation(camera: PerspectiveCamera, target: Vector3, startFov: number, endFov: number, duration: number, onComplete?: () => void): void;
|
|
762
|
-
|
|
763
757
|
/**
|
|
764
758
|
* Material indices
|
|
765
759
|
* 0: Stick
|
|
@@ -800,6 +794,8 @@ export declare class CandleGeometry extends BufferGeometry {
|
|
|
800
794
|
*/
|
|
801
795
|
export declare const capHeightFromRadius: (radius: number, thetaLength: number) => number;
|
|
802
796
|
|
|
797
|
+
export declare function captureSnapshot(camera: PerspectiveCamera, controls?: OrbitControls): CameraSnapshot;
|
|
798
|
+
|
|
803
799
|
/**
|
|
804
800
|
* Calculate the width of a spherical cap.
|
|
805
801
|
* w = 2 * R * sin(thetaLength)
|
|
@@ -866,11 +862,22 @@ export declare function centerObjectGeometry<T extends Object3D>(object: T, targ
|
|
|
866
862
|
*/
|
|
867
863
|
export declare const checkerboardTexture: (size: number) => DataTexture;
|
|
868
864
|
|
|
869
|
-
export declare
|
|
865
|
+
export declare type ClipPhase = "running" | "complete";
|
|
870
866
|
|
|
871
|
-
|
|
867
|
+
/** Per-frame mutable state shared with the active clip. */
|
|
868
|
+
export declare interface ClipRuntime {
|
|
869
|
+
camera: PerspectiveCamera;
|
|
870
|
+
controls: OrbitControls | null;
|
|
871
|
+
/** Seconds elapsed in the active clip. */
|
|
872
|
+
elapsed: number;
|
|
873
|
+
/** Clip duration in seconds. */
|
|
874
|
+
duration: number;
|
|
875
|
+
/** Look-at point the clip is focused on — synced to OrbitControls on complete. */
|
|
876
|
+
focus: Vector3;
|
|
877
|
+
}
|
|
872
878
|
|
|
873
|
-
|
|
879
|
+
/** Clip a segment to an axis-aligned rectangle; returns endpoints inside the opening. */
|
|
880
|
+
export declare function clipSegmentToAabb(x1: number, y1: number, x2: number, y2: number, minX: number, minY: number, maxX: number, maxY: number): [number, number, number, number] | null;
|
|
874
881
|
|
|
875
882
|
export declare const ColorPalette: {
|
|
876
883
|
CADMIUM_RED: number;
|
|
@@ -944,10 +951,6 @@ export declare const ColorPalette: {
|
|
|
944
951
|
TITANIUM_WHITE: number;
|
|
945
952
|
};
|
|
946
953
|
|
|
947
|
-
export declare const concave: (t: number) => number;
|
|
948
|
-
|
|
949
|
-
export declare const convex: (t: number) => number;
|
|
950
|
-
|
|
951
954
|
/**
|
|
952
955
|
* Function to create cubic Bezier curve points
|
|
953
956
|
*
|
|
@@ -983,6 +986,9 @@ export declare const createCubicCurvePoints: (start: Vector2, control1: Vector2,
|
|
|
983
986
|
*/
|
|
984
987
|
export declare const createDampedCurvePoints: (start: Vector2, end: Vector2, damping: number, segments?: number) => Vector2[];
|
|
985
988
|
|
|
989
|
+
/** Dolly in or out along the current view direction. */
|
|
990
|
+
export declare function createDollyClip(options: DollyClipOptions): CameraClip;
|
|
991
|
+
|
|
986
992
|
/**
|
|
987
993
|
* Function to create exponential curve points
|
|
988
994
|
*
|
|
@@ -1001,6 +1007,9 @@ export declare const createDampedCurvePoints: (start: Vector2, end: Vector2, dam
|
|
|
1001
1007
|
*/
|
|
1002
1008
|
export declare const createExponentialCurvePoints: (start: Vector2, end: Vector2, base: number, factor: number, segments?: number) => Vector2[];
|
|
1003
1009
|
|
|
1010
|
+
/** Waypoint tour through a sequence of positions. */
|
|
1011
|
+
export declare function createFlythroughClip(options: FlythroughClipOptions): CameraClip;
|
|
1012
|
+
|
|
1004
1013
|
/**
|
|
1005
1014
|
* Hexagonal tile pattern factory with density control.
|
|
1006
1015
|
*
|
|
@@ -1057,6 +1066,15 @@ export declare function createHexagonalTilesByRadius(options: HexagonalTileRadiu
|
|
|
1057
1066
|
*/
|
|
1058
1067
|
export declare const createLogarithmicCurvePoints: (start: Vector2, end: Vector2, base: number, factor: number, segments?: number) => Vector2[];
|
|
1059
1068
|
|
|
1069
|
+
/**
|
|
1070
|
+
* Four clipping planes for a rectangular opening (shadow + mesh clip).
|
|
1071
|
+
* Fragments are discarded when `dot(normal, position) > constant`.
|
|
1072
|
+
*/
|
|
1073
|
+
export declare function createOpeningClippingPlanes(width: number, height: number, centerY?: number): Plane[];
|
|
1074
|
+
|
|
1075
|
+
/** Circle the scene — showcase reel orbit. */
|
|
1076
|
+
export declare function createOrbitClip(options: OrbitClipOptions): CameraClip;
|
|
1077
|
+
|
|
1060
1078
|
/**
|
|
1061
1079
|
* Function to create parabolic curve points
|
|
1062
1080
|
*
|
|
@@ -1076,6 +1094,12 @@ export declare const createLogarithmicCurvePoints: (start: Vector2, end: Vector2
|
|
|
1076
1094
|
*/
|
|
1077
1095
|
export declare const createParabolicCurvePoints: (start: Vector2, end: Vector2, a: number, b: number, c: number, segments?: number) => Vector2[];
|
|
1078
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* Atmospheric focus drift — slow Ken Burns sway while locked on a subject.
|
|
1099
|
+
* Not a full orbit; subtle back-and-forth for mood and screen capture.
|
|
1100
|
+
*/
|
|
1101
|
+
export declare function createPendulumClip(options: PendulumClipOptions): CameraClip;
|
|
1102
|
+
|
|
1079
1103
|
/**
|
|
1080
1104
|
* Generates vertices for two triangles based upon a quad.
|
|
1081
1105
|
*
|
|
@@ -1146,6 +1170,17 @@ p2: [number, number, number], p3: [number, number, number], p4: [number, number,
|
|
|
1146
1170
|
*/
|
|
1147
1171
|
export declare const createQuadraticCurvePoints: (start: Vector2, control: Vector2, end: Vector2, segments?: number) => Vector2[];
|
|
1148
1172
|
|
|
1173
|
+
/**
|
|
1174
|
+
* Create a random source.
|
|
1175
|
+
*
|
|
1176
|
+
* - **No seed** — wraps `Math.random()`. Unique every runtime; default for examples.
|
|
1177
|
+
* - **With seed** — {@link mulberry32} stream. Same seed ⇒ same sequence.
|
|
1178
|
+
*/
|
|
1179
|
+
export declare function createRandom(seed?: number): RandomSource;
|
|
1180
|
+
|
|
1181
|
+
/** Hollow square profile extruded for one lattice ring (local XY, facing +Z). */
|
|
1182
|
+
export declare function createRingLatticeGeometry(outer: number, wall: number, depth: number): ExtrudeGeometry;
|
|
1183
|
+
|
|
1149
1184
|
/**
|
|
1150
1185
|
* Function to create sigmoid curve points
|
|
1151
1186
|
*
|
|
@@ -1162,6 +1197,39 @@ export declare const createQuadraticCurvePoints: (start: Vector2, control: Vecto
|
|
|
1162
1197
|
*/
|
|
1163
1198
|
export declare const createSigmoidCurvePoints: (start: Vector2, end: Vector2, a: number, segments?: number) => Vector2[];
|
|
1164
1199
|
|
|
1200
|
+
/**
|
|
1201
|
+
* Scene-transition spiral — orbit upward while looking down at the scene.
|
|
1202
|
+
* Camera rises and optionally widens its orbit; `lookAt` stays on the ground
|
|
1203
|
+
* target so the view pitches into a bird's-eye survey (not a horizontal orbit).
|
|
1204
|
+
*/
|
|
1205
|
+
export declare function createSpiralClip(options: SpiralClipOptions): CameraClip;
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* Impact wobble — short head-shake / recovery shake (gameplay feedback).
|
|
1209
|
+
* Decaying sinusoidal offset, not random noise. For showcase orbit rigs use
|
|
1210
|
+
* {@link createPendulumClip} instead.
|
|
1211
|
+
*/
|
|
1212
|
+
export declare function createWobbleClip(options: WobbleClipOptions): CameraClip;
|
|
1213
|
+
|
|
1214
|
+
/** Focus punch — smooth FOV narrow toward a target. Restores FOV on cancel; keeps end FOV on complete. */
|
|
1215
|
+
export declare function createZoomClip(options: ZoomClipOptions): CameraClip;
|
|
1216
|
+
|
|
1217
|
+
export declare const crossfadeShader: {
|
|
1218
|
+
uniforms: {
|
|
1219
|
+
tDiffuseA: {
|
|
1220
|
+
value: null;
|
|
1221
|
+
};
|
|
1222
|
+
tDiffuseB: {
|
|
1223
|
+
value: null;
|
|
1224
|
+
};
|
|
1225
|
+
mixRatio: {
|
|
1226
|
+
value: number;
|
|
1227
|
+
};
|
|
1228
|
+
};
|
|
1229
|
+
vertexShader: string;
|
|
1230
|
+
fragmentShader: string;
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1165
1233
|
export declare class CrossHeadstone extends Mesh<CrossHeadstoneGeometry, MeshStandardMaterial> {
|
|
1166
1234
|
constructor({ width, height, depth, }?: CrossHeadstoneOptions);
|
|
1167
1235
|
}
|
|
@@ -1176,14 +1244,6 @@ declare interface CrossHeadstoneOptions {
|
|
|
1176
1244
|
depth?: number;
|
|
1177
1245
|
}
|
|
1178
1246
|
|
|
1179
|
-
export declare const cubicCurve: (t: number, p0: number, p1: number, p2: number, p3: number) => number;
|
|
1180
|
-
|
|
1181
|
-
export declare const cubicIn: (t: number) => number;
|
|
1182
|
-
|
|
1183
|
-
export declare const cubicInOut: (t: number) => number;
|
|
1184
|
-
|
|
1185
|
-
export declare const cubicOut: (t: number) => number;
|
|
1186
|
-
|
|
1187
1247
|
/**
|
|
1188
1248
|
* Cubic UV Mapping
|
|
1189
1249
|
* Applies a texture by projecting UVs along each face of a cube.
|
|
@@ -1223,8 +1283,6 @@ export declare function cubicUVMappingBatch(vertices: [number, number, number][]
|
|
|
1223
1283
|
*/
|
|
1224
1284
|
export declare function cylindricalUVMapping(vertices: [number, number, number][]): [number, number][];
|
|
1225
1285
|
|
|
1226
|
-
export declare const dampedCurve: (t: number, damping?: number) => number;
|
|
1227
|
-
|
|
1228
1286
|
export declare class DaySkybox extends Mesh {
|
|
1229
1287
|
geometry: BoxGeometry;
|
|
1230
1288
|
material: ShaderMaterial & {
|
|
@@ -1264,6 +1322,22 @@ export declare interface DaySkyUniforms {
|
|
|
1264
1322
|
bottomColor: Uniform<Color>;
|
|
1265
1323
|
}
|
|
1266
1324
|
|
|
1325
|
+
/**
|
|
1326
|
+
* Derive an independent sub-stream seed from a master seed and domain salt.
|
|
1327
|
+
*
|
|
1328
|
+
* XOR the salt before mixing so each subsystem gets its own mulberry32 stream
|
|
1329
|
+
* without sequential `seed + 1` collision risk. Use stable hex constants per
|
|
1330
|
+
* domain (`0x101` books, `0x202` fog, `0x303` windows, …).
|
|
1331
|
+
*
|
|
1332
|
+
* @example
|
|
1333
|
+
* ```ts
|
|
1334
|
+
* const master = 1337;
|
|
1335
|
+
* const bookRng = createRandom(deriveSubSeed(master, 0x101));
|
|
1336
|
+
* const fogRng = createRandom(deriveSubSeed(master, 0x202));
|
|
1337
|
+
* ```
|
|
1338
|
+
*/
|
|
1339
|
+
export declare function deriveSubSeed(masterSeed: number, salt: number): number;
|
|
1340
|
+
|
|
1267
1341
|
/**
|
|
1268
1342
|
* Material indices:
|
|
1269
1343
|
* 0. Desk surface
|
|
@@ -1282,41 +1356,117 @@ export declare class DeskGeometry extends BufferGeometry {
|
|
|
1282
1356
|
constructor();
|
|
1283
1357
|
}
|
|
1284
1358
|
|
|
1359
|
+
/** Derive uniform cell size from center-to-corner periods. Legacy — prefer grid counts. */
|
|
1360
|
+
export declare function diamondLatticeCellFromCount(width: number, height: number, cellsAcross: number): number;
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* Perpendicular distance from the window center to a corner along the diamond
|
|
1364
|
+
* grid axis (45° families share this spacing when square).
|
|
1365
|
+
*/
|
|
1366
|
+
export declare function diamondLatticeCornerSpan(width: number, height: number): number;
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* Axis-aligned diamond lattice — north/south vertices share a vertical axis,
|
|
1370
|
+
* east/west share a horizontal axis (`<>` not `><`).
|
|
1371
|
+
*/
|
|
1372
|
+
export declare interface DiamondLatticeGrid {
|
|
1373
|
+
/** Horizontal half-diagonal of each quarrel (east–west point spacing). */
|
|
1374
|
+
a: number;
|
|
1375
|
+
/** Vertical half-diagonal of each quarrel (north–south point spacing). */
|
|
1376
|
+
b: number;
|
|
1377
|
+
/**
|
|
1378
|
+
* Came angle from +X; the two families run at `+angle` and `−angle`.
|
|
1379
|
+
* Equals 45° only when `a === b`.
|
|
1380
|
+
*/
|
|
1381
|
+
angle: number;
|
|
1382
|
+
/** Shared perpendicular spacing for both came families. */
|
|
1383
|
+
spacing: number;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1285
1386
|
/**
|
|
1286
|
-
*
|
|
1387
|
+
* Build an axis-aligned diamond grid from cell counts.
|
|
1287
1388
|
*
|
|
1288
|
-
*
|
|
1289
|
-
*
|
|
1290
|
-
*
|
|
1291
|
-
* 2: Exterior walls
|
|
1389
|
+
* `cellsX` quarrels span the width (east–west); `cellsY` span the height.
|
|
1390
|
+
* Equal counts on a square opening yield square diamonds; `5×10` elongates them
|
|
1391
|
+
* vertically while keeping north/south tips on the same vertical axis.
|
|
1292
1392
|
*/
|
|
1293
|
-
export declare
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1393
|
+
export declare function diamondLatticeGridFromCells(width: number, height: number, cellsX: number, cellsY: number): DiamondLatticeGrid;
|
|
1394
|
+
|
|
1395
|
+
declare interface DiamondLatticePartOptions {
|
|
1396
|
+
width: number;
|
|
1397
|
+
height: number;
|
|
1398
|
+
/** Center Y of the opening in local space. Defaults to `0`. */
|
|
1399
|
+
centerY?: number;
|
|
1400
|
+
grid: DiamondLatticeGrid;
|
|
1401
|
+
leadThickness: number;
|
|
1402
|
+
leadDepth: number;
|
|
1303
1403
|
}
|
|
1304
1404
|
|
|
1405
|
+
/** @deprecated Use {@link diamondLatticeGridFromCells}. */
|
|
1406
|
+
export declare function diamondLatticeSpacingFromGrid(width: number, height: number, cellsX: number, cellsY: number): {
|
|
1407
|
+
plus45: number;
|
|
1408
|
+
minus45: number;
|
|
1409
|
+
};
|
|
1410
|
+
|
|
1305
1411
|
/**
|
|
1306
|
-
*
|
|
1412
|
+
* Diamond lattice window — diagonal lead cames with axis-aligned quarrels (`<>`).
|
|
1307
1413
|
*
|
|
1308
|
-
*
|
|
1309
|
-
* 0
|
|
1310
|
-
* 1: Floor
|
|
1311
|
-
* 2: Exterior walls
|
|
1414
|
+
* Local frame: centered on the opening, XY plane facing +Z. Lead and optional
|
|
1415
|
+
* glass share `z = 0`. Pair with a scene-owned backing plane behind the wall.
|
|
1312
1416
|
*/
|
|
1313
|
-
export declare class
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
});
|
|
1417
|
+
export declare class DiamondLatticeWindow extends Group {
|
|
1418
|
+
readonly lattice: Mesh<DiamondLatticeWindowGeometry, MeshStandardMaterial>;
|
|
1419
|
+
readonly glass?: Mesh<PlaneGeometry, MeshPhysicalMaterial>;
|
|
1420
|
+
readonly cellsX: number;
|
|
1421
|
+
readonly cellsY: number;
|
|
1422
|
+
readonly fittedGrid: DiamondLatticeGrid;
|
|
1423
|
+
constructor({ leadColor, glass, glassColor, glassEmissive, glassEmissiveIntensity, ...geometryOptions }?: DiamondLatticeWindowOptions);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Diamond lattice window — outer frame plus diagonal cames.
|
|
1428
|
+
* Quarrel tips align to the vertical and horizontal axes (`<>`).
|
|
1429
|
+
* Built in the XY plane facing +Z.
|
|
1430
|
+
*
|
|
1431
|
+
* Glass is a separate pane on {@link DiamondLatticeWindow} — this geometry is
|
|
1432
|
+
* lead and frame only (casts shadow; glass typically does not).
|
|
1433
|
+
*/
|
|
1434
|
+
export declare class DiamondLatticeWindowGeometry extends BufferGeometry {
|
|
1435
|
+
readonly cellsX: number;
|
|
1436
|
+
readonly cellsY: number;
|
|
1437
|
+
readonly fittedGrid: DiamondLatticeGrid;
|
|
1438
|
+
constructor({ width, height, leadThickness, leadDepth, cellsX, cellsY, centerY, }?: DiamondLatticeWindowGeometryOptions);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
declare interface DiamondLatticeWindowGeometryOptions {
|
|
1442
|
+
/** Opening width (world units). */
|
|
1443
|
+
width?: number;
|
|
1444
|
+
/** Opening height (world units). */
|
|
1445
|
+
height?: number;
|
|
1446
|
+
/** Lead came thickness (cross-section). Defaults to `0.055`. */
|
|
1447
|
+
leadThickness?: number;
|
|
1448
|
+
/** Lead depth (Z extent). Defaults to `0.11`. */
|
|
1449
|
+
leadDepth?: number;
|
|
1450
|
+
/** Quarrels spanning east–west across the opening. Defaults to `10`. */
|
|
1451
|
+
cellsX?: number;
|
|
1452
|
+
/** Quarrels spanning north–south across the opening. Defaults to `10`. */
|
|
1453
|
+
cellsY?: number;
|
|
1454
|
+
/** Vertical center of the opening in local geometry space. Defaults to `0`. */
|
|
1455
|
+
centerY?: number;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
declare interface DiamondLatticeWindowOptions extends DiamondLatticeWindowGeometryOptions {
|
|
1459
|
+
/** Lead + outer frame tint. Defaults to `#0c0f14`. */
|
|
1460
|
+
leadColor?: ColorRepresentation;
|
|
1461
|
+
/**
|
|
1462
|
+
* Optional glass pane coplanar with the lattice (same Z center).
|
|
1463
|
+
* Mad-science uses an emissive sky mesh in the scene instead.
|
|
1464
|
+
*/
|
|
1465
|
+
glass?: boolean;
|
|
1466
|
+
glassColor?: ColorRepresentation;
|
|
1467
|
+
/** Glass emissive for moonlit / storm backlight. Defaults to off. */
|
|
1468
|
+
glassEmissive?: ColorRepresentation;
|
|
1469
|
+
glassEmissiveIntensity?: number;
|
|
1320
1470
|
}
|
|
1321
1471
|
|
|
1322
1472
|
/**
|
|
@@ -1399,6 +1549,12 @@ export declare const Direction: {
|
|
|
1399
1549
|
*/
|
|
1400
1550
|
export declare const displacementBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, direction?: Vector3, falloffFn?: (distance: number, radius: number) => number) => void;
|
|
1401
1551
|
|
|
1552
|
+
export declare interface DollyClipOptions extends CameraClipTiming {
|
|
1553
|
+
/** Distance along view axis — positive pulls back, negative pushes in. */
|
|
1554
|
+
distance: number;
|
|
1555
|
+
ease?: EasingFunction;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1402
1558
|
/**
|
|
1403
1559
|
* Easing functions for interpolating values over time.
|
|
1404
1560
|
*
|
|
@@ -1407,7 +1563,7 @@ export declare const displacementBrush: <T extends BufferGeometry>(geometry: T,
|
|
|
1407
1563
|
*
|
|
1408
1564
|
* @example
|
|
1409
1565
|
* ```typescript
|
|
1410
|
-
* import { Easing
|
|
1566
|
+
* import { Easing } from 'three-low-poly';
|
|
1411
1567
|
*
|
|
1412
1568
|
* // Using with transitions (namespace)
|
|
1413
1569
|
* cameraTransition.transitionTo(camera, {
|
|
@@ -1415,12 +1571,6 @@ export declare const displacementBrush: <T extends BufferGeometry>(geometry: T,
|
|
|
1415
1571
|
* easing: Easing.cubicInOut // Function reference
|
|
1416
1572
|
* });
|
|
1417
1573
|
*
|
|
1418
|
-
* // Or using direct import
|
|
1419
|
-
* cameraTransition.transitionTo(camera, {
|
|
1420
|
-
* duration: 1000,
|
|
1421
|
-
* easing: cubicInOut // Direct function reference
|
|
1422
|
-
* });
|
|
1423
|
-
*
|
|
1424
1574
|
* // Or using string reference
|
|
1425
1575
|
* cameraTransition.transitionTo(camera, {
|
|
1426
1576
|
* duration: 1000,
|
|
@@ -1478,6 +1628,80 @@ export declare const Easing: {
|
|
|
1478
1628
|
*/
|
|
1479
1629
|
export declare type EasingFunction = (t: number) => number;
|
|
1480
1630
|
|
|
1631
|
+
/**
|
|
1632
|
+
* Carbonation bubbles rising through a bounded volume — seltzer, soda, or
|
|
1633
|
+
* brewing liquid. Each instance drifts upward at its own speed and respawns
|
|
1634
|
+
* near {@link EffervescenceEffectOptions.baseY} after reaching the top.
|
|
1635
|
+
*
|
|
1636
|
+
* Spawn positions use a square footprint (`width` × `depth`). {@link EffervescenceEffectOptions.spread}
|
|
1637
|
+
* pulls that box inward so round jars do not get occasional corner outliers.
|
|
1638
|
+
* Position and scale the effect to sit inside a jar, flask, or panel viewport.
|
|
1639
|
+
* Call {@link EffervescenceEffect.update} each frame with elapsed time in seconds.
|
|
1640
|
+
*
|
|
1641
|
+
* @example
|
|
1642
|
+
* ```typescript
|
|
1643
|
+
* const fizz = new EffervescenceEffect({ width: 1.2, height: 2.5, count: 30 });
|
|
1644
|
+
* fizz.position.set(0, 1.2, 0);
|
|
1645
|
+
* scene.add(fizz);
|
|
1646
|
+
*
|
|
1647
|
+
* onFrame((dt) => fizz.update(dt));
|
|
1648
|
+
* ```
|
|
1649
|
+
*/
|
|
1650
|
+
export declare class EffervescenceEffect extends InstancedMesh {
|
|
1651
|
+
private readonly width;
|
|
1652
|
+
private readonly height;
|
|
1653
|
+
private readonly depth;
|
|
1654
|
+
private readonly baseY;
|
|
1655
|
+
private readonly spread;
|
|
1656
|
+
private readonly px;
|
|
1657
|
+
private readonly py;
|
|
1658
|
+
private readonly pz;
|
|
1659
|
+
private readonly speed;
|
|
1660
|
+
private readonly dummy;
|
|
1661
|
+
constructor(options?: EffervescenceEffectOptions);
|
|
1662
|
+
/**
|
|
1663
|
+
* Advance bubble positions. Pass elapsed frame time in seconds (e.g. from
|
|
1664
|
+
* `createScene`'s `onFrame` callback).
|
|
1665
|
+
*/
|
|
1666
|
+
update(dt: number): void;
|
|
1667
|
+
/** Release geometry and materials held by the field. */
|
|
1668
|
+
dispose(): this;
|
|
1669
|
+
private respawn;
|
|
1670
|
+
private writeMatrices;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
export declare interface EffervescenceEffectOptions {
|
|
1674
|
+
/** Override bubble geometry. Defaults to a small `SphereGeometry`. */
|
|
1675
|
+
geometry?: BufferGeometry;
|
|
1676
|
+
/** Override the default bubble material. */
|
|
1677
|
+
material?: Material;
|
|
1678
|
+
/** Number of bubble instances. Defaults to `24`. */
|
|
1679
|
+
count?: number;
|
|
1680
|
+
/** Horizontal spread (world units). Defaults to `1.5`. */
|
|
1681
|
+
width?: number;
|
|
1682
|
+
/** Vertical column height (world units). Defaults to `3`. */
|
|
1683
|
+
height?: number;
|
|
1684
|
+
/** Depth spread (world units). Defaults to `1.5`. */
|
|
1685
|
+
depth?: number;
|
|
1686
|
+
/**
|
|
1687
|
+
* Horizontal spawn inset (0–1). Scales width/depth spawn area inward so a
|
|
1688
|
+
* square volume fits round vessels. `1` = full box; `0.88` (default) trims corners.
|
|
1689
|
+
*/
|
|
1690
|
+
spread?: number;
|
|
1691
|
+
/** World Y where bubbles spawn when they recycle. Defaults to `0`. */
|
|
1692
|
+
baseY?: number;
|
|
1693
|
+
/** Minimum rise speed (units/s). Defaults to `0.35`. */
|
|
1694
|
+
speedMin?: number;
|
|
1695
|
+
/** Maximum rise speed (units/s). Defaults to `0.85`. */
|
|
1696
|
+
speedMax?: number;
|
|
1697
|
+
/** Bubble tint when using the default material. Defaults to `0xffffff`. */
|
|
1698
|
+
color?: ColorRepresentation;
|
|
1699
|
+
/** Default material opacity. Defaults to `0.6`. */
|
|
1700
|
+
opacity?: number;
|
|
1701
|
+
/** Default material emissive intensity. Defaults to `0`. */
|
|
1702
|
+
emissiveIntensity?: number;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1481
1705
|
export declare class ElectricPanel extends Group {
|
|
1482
1706
|
constructor();
|
|
1483
1707
|
}
|
|
@@ -1487,52 +1711,55 @@ export declare class EllipticLeafGeometry extends BufferGeometry {
|
|
|
1487
1711
|
}
|
|
1488
1712
|
|
|
1489
1713
|
/**
|
|
1490
|
-
*
|
|
1491
|
-
*
|
|
1714
|
+
* Smooth emissive pulse for fake LEDs — animates `emissiveIntensity` on an existing
|
|
1715
|
+
* mesh material without adding geometry or scene lights.
|
|
1492
1716
|
*
|
|
1493
|
-
*
|
|
1494
|
-
*
|
|
1495
|
-
*
|
|
1717
|
+
* Pair with a prefab such as {@link PanelLight}: place the mesh, pass its material
|
|
1718
|
+
* here, call `update(dt)` each frame. For a bank of same-color LEDs, give each
|
|
1719
|
+
* instance a different `speed` so they breathe out of sync.
|
|
1496
1720
|
*
|
|
1497
|
-
*
|
|
1498
|
-
*
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
1501
|
-
*
|
|
1502
|
-
*
|
|
1721
|
+
* @example
|
|
1722
|
+
* ```ts
|
|
1723
|
+
* const led = new PanelLight({ emissive: 0xff0000 });
|
|
1724
|
+
* scene.add(led);
|
|
1725
|
+
*
|
|
1726
|
+
* const pulse = new EmissivePulseEffect({
|
|
1727
|
+
* material: led.material,
|
|
1728
|
+
* speed: 1.4,
|
|
1729
|
+
* minIntensity: 0.05,
|
|
1730
|
+
* maxIntensity: 2,
|
|
1731
|
+
* });
|
|
1503
1732
|
*
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1506
|
-
* }
|
|
1507
|
-
* ```
|
|
1733
|
+
* onFrame((dt) => pulse.update(dt));
|
|
1734
|
+
* ```
|
|
1508
1735
|
*/
|
|
1509
|
-
export declare class
|
|
1736
|
+
export declare class EmissivePulseEffect {
|
|
1510
1737
|
speed: number;
|
|
1511
|
-
maxIntensity: number;
|
|
1512
1738
|
minIntensity: number;
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
*
|
|
1520
|
-
* Example:
|
|
1521
|
-
* ```
|
|
1522
|
-
* const clock = new THREE.Clock();
|
|
1523
|
-
* effect.update(clock.getElapsedTime());
|
|
1524
|
-
* ```
|
|
1525
|
-
*/
|
|
1526
|
-
update(elapsedTime?: number): void;
|
|
1739
|
+
maxIntensity: number;
|
|
1740
|
+
readonly material: EmissivePulseMaterial;
|
|
1741
|
+
private elapsed;
|
|
1742
|
+
constructor({ material, speed, maxIntensity, minIntensity, }: EmissivePulseEffectOptions);
|
|
1743
|
+
/** Advance the pulse by `dt` seconds (elapsed time, not frame index). */
|
|
1744
|
+
update(dt: number): void;
|
|
1527
1745
|
}
|
|
1528
1746
|
|
|
1529
1747
|
export declare interface EmissivePulseEffectOptions {
|
|
1748
|
+
/** Material whose `emissiveIntensity` will oscillate. Must have emissive set. */
|
|
1749
|
+
material: EmissivePulseMaterial;
|
|
1750
|
+
/**
|
|
1751
|
+
* Pulse frequency in radians per second (`abs(sin(elapsed * speed))`).
|
|
1752
|
+
* Defaults to `2`. Primary differentiator when many LEDs share one color.
|
|
1753
|
+
*/
|
|
1530
1754
|
speed?: number;
|
|
1531
|
-
|
|
1755
|
+
/** Lower bound of the pulse. Defaults to `0.2`. */
|
|
1532
1756
|
minIntensity?: number;
|
|
1533
|
-
|
|
1757
|
+
/** Upper bound of the pulse. Defaults to `0.8`. */
|
|
1758
|
+
maxIntensity?: number;
|
|
1534
1759
|
}
|
|
1535
1760
|
|
|
1761
|
+
export declare type EmissivePulseMaterial = MeshStandardMaterial | MeshPhysicalMaterial | MeshLambertMaterial | MeshPhongMaterial;
|
|
1762
|
+
|
|
1536
1763
|
export declare class ErlenmeyerFlask extends Mesh<ErlenmeyerFlaskGeometry, MeshPhysicalMaterial> {
|
|
1537
1764
|
constructor({ flaskRadius, //
|
|
1538
1765
|
neckRadius, height, neckHeight, radialSegments, }?: {
|
|
@@ -1555,22 +1782,17 @@ export declare class ErlenmeyerFlaskGeometry extends BufferGeometry {
|
|
|
1555
1782
|
});
|
|
1556
1783
|
}
|
|
1557
1784
|
|
|
1558
|
-
export declare const expoIn: (t: number) => number;
|
|
1559
|
-
|
|
1560
|
-
export declare const expoInOut: (t: number) => number;
|
|
1561
|
-
|
|
1562
|
-
export declare const exponentialCurve: (t: number, base?: number, factor?: number) => number;
|
|
1563
|
-
|
|
1564
|
-
export declare const expoOut: (t: number) => number;
|
|
1565
|
-
|
|
1566
1785
|
export declare const fadeShader: {
|
|
1567
1786
|
uniforms: {
|
|
1568
1787
|
tDiffuse: {
|
|
1569
1788
|
value: null;
|
|
1570
1789
|
};
|
|
1571
|
-
|
|
1790
|
+
fadeAmount: {
|
|
1572
1791
|
value: number;
|
|
1573
1792
|
};
|
|
1793
|
+
fadeColor: {
|
|
1794
|
+
value: null;
|
|
1795
|
+
};
|
|
1574
1796
|
};
|
|
1575
1797
|
vertexShader: string;
|
|
1576
1798
|
fragmentShader: string;
|
|
@@ -1584,19 +1806,40 @@ declare interface FadeTransitionOptions_2 extends SceneTransitionFXOptions {
|
|
|
1584
1806
|
color?: THREE.ColorRepresentation;
|
|
1585
1807
|
}
|
|
1586
1808
|
|
|
1809
|
+
export declare const fadeTransitionSceneShader: {
|
|
1810
|
+
uniforms: {
|
|
1811
|
+
tDiffuseA: {
|
|
1812
|
+
value: null;
|
|
1813
|
+
};
|
|
1814
|
+
tDiffuseB: {
|
|
1815
|
+
value: null;
|
|
1816
|
+
};
|
|
1817
|
+
mixRatio: {
|
|
1818
|
+
value: number;
|
|
1819
|
+
};
|
|
1820
|
+
fadeColor: {
|
|
1821
|
+
value: null;
|
|
1822
|
+
};
|
|
1823
|
+
};
|
|
1824
|
+
vertexShader: string;
|
|
1825
|
+
fragmentShader: string;
|
|
1826
|
+
};
|
|
1827
|
+
|
|
1587
1828
|
export declare const Falloff: {
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1829
|
+
linear: (distance: number, radius: number) => number;
|
|
1830
|
+
quadratic: (distance: number, radius: number) => number;
|
|
1831
|
+
squareRoot: (distance: number, radius: number) => number;
|
|
1832
|
+
logarithmic: (distance: number, radius: number) => number;
|
|
1833
|
+
sine: (distance: number, radius: number) => number;
|
|
1834
|
+
exponential: (distance: number, radius: number) => number;
|
|
1835
|
+
cubic: (distance: number, radius: number) => number;
|
|
1836
|
+
gaussian: (distance: number, radius: number) => number;
|
|
1837
|
+
inverse: (distance: number, radius: number) => number;
|
|
1838
|
+
smoothstep: (distance: number, radius: number) => number;
|
|
1598
1839
|
};
|
|
1599
1840
|
|
|
1841
|
+
export declare type FalloffFunction = (distance: number, radius: number) => number;
|
|
1842
|
+
|
|
1600
1843
|
export declare function findClosestColor(inputColor: number, dataset: number[]): number | null;
|
|
1601
1844
|
|
|
1602
1845
|
export declare function findClosestColorChannelWise(inputColor: number, dataset: number[]): number | null;
|
|
@@ -1612,6 +1855,12 @@ export declare function findClosestColorChannelWise(inputColor: number, dataset:
|
|
|
1612
1855
|
*/
|
|
1613
1856
|
export declare function findClosestPoint(point: Vector3, mesh: Mesh): Vector3;
|
|
1614
1857
|
|
|
1858
|
+
/**
|
|
1859
|
+
* Snap cell size so diagonal cames align symmetrically at all four frame edges.
|
|
1860
|
+
* Legacy single-spacing helper — prefer {@link diamondLatticeGridFromCells}.
|
|
1861
|
+
*/
|
|
1862
|
+
export declare function fitDiamondLatticeCell(width: number, height: number, preferredCell: number): number;
|
|
1863
|
+
|
|
1615
1864
|
export declare class Flame extends Mesh<FlameGeometry, MeshStandardMaterial> {
|
|
1616
1865
|
constructor({ height, radius, segmentsU, segmentsV }?: {
|
|
1617
1866
|
height?: number | undefined;
|
|
@@ -1621,14 +1870,61 @@ export declare class Flame extends Mesh<FlameGeometry, MeshStandardMaterial> {
|
|
|
1621
1870
|
});
|
|
1622
1871
|
}
|
|
1623
1872
|
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1873
|
+
/**
|
|
1874
|
+
* Calm flame flicker from detuned sines — drives optional real lights, flame
|
|
1875
|
+
* materials, and {@link GlowHalo} opacity in sync. Time-based (`update(dt)`).
|
|
1876
|
+
*
|
|
1877
|
+
* Use without a `light` for mass candlefields (halo + bloom only). Add a
|
|
1878
|
+
* `light` for hero sconces that must cast on walls and props.
|
|
1879
|
+
*/
|
|
1880
|
+
export declare class FlameFlickerEffect {
|
|
1881
|
+
readonly seed: number;
|
|
1882
|
+
light?: PointLight;
|
|
1883
|
+
lightIntensity: number;
|
|
1884
|
+
flame?: MeshBasicMaterial;
|
|
1885
|
+
halo?: GlowHalo;
|
|
1886
|
+
haloOpacity: number;
|
|
1887
|
+
private readonly flameColor;
|
|
1888
|
+
private elapsed;
|
|
1889
|
+
constructor({ seed, light, lightIntensity, flame, flameColor, halo, haloOpacity, }?: FlameFlickerEffectOptions);
|
|
1890
|
+
/**
|
|
1891
|
+
* Flicker factor at elapsed time — lazy sum of detuned sines (~0.5–1.1).
|
|
1892
|
+
*/
|
|
1893
|
+
static factor(elapsed: number, seed: number): number;
|
|
1894
|
+
/** Current flicker factor after the last `update`. */
|
|
1895
|
+
get level(): number;
|
|
1896
|
+
update(dt: number): void;
|
|
1897
|
+
/** Billboard linked halo toward the eye, if present. */
|
|
1898
|
+
faceCamera(eye: Vector3): void;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
export declare interface FlameFlickerEffectOptions {
|
|
1902
|
+
/**
|
|
1903
|
+
* Desyncs multiple instances. Defaults to `Math.random() * 100`.
|
|
1904
|
+
*/
|
|
1905
|
+
seed?: number;
|
|
1906
|
+
/** Optional real light — use sparingly; casts on geometry but counts against light limits. */
|
|
1907
|
+
light?: PointLight;
|
|
1908
|
+
/** Base intensity when `light` is set. Defaults to `4`. */
|
|
1909
|
+
lightIntensity?: number;
|
|
1910
|
+
/** Optional flame core material (e.g. `MeshBasicMaterial` on a small sphere). */
|
|
1911
|
+
flame?: MeshBasicMaterial;
|
|
1912
|
+
/** Flame tint when `flame` is set. Defaults to `0xffaa44`. */
|
|
1913
|
+
flameColor?: ColorRepresentation;
|
|
1914
|
+
/** Optional {@link GlowHalo}; opacity scales with the flicker factor. */
|
|
1915
|
+
halo?: GlowHalo;
|
|
1916
|
+
/** Halo opacity multiplier at flicker peak. Defaults to `0.75`. */
|
|
1917
|
+
haloOpacity?: number;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
export declare class FlameGeometry extends ParametricGeometry {
|
|
1921
|
+
constructor({ height, radius, segmentsU, segmentsV }?: {
|
|
1922
|
+
height?: number | undefined;
|
|
1923
|
+
radius?: number | undefined;
|
|
1924
|
+
segmentsU?: number | undefined;
|
|
1925
|
+
segmentsV?: number | undefined;
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1632
1928
|
|
|
1633
1929
|
/**
|
|
1634
1930
|
* Flattens vertices to a given plane defined by a target height or normal direction.
|
|
@@ -1643,7 +1939,12 @@ export declare class FlorenceFlaskGeometry extends BufferGeometry {
|
|
|
1643
1939
|
constructor();
|
|
1644
1940
|
}
|
|
1645
1941
|
|
|
1646
|
-
export declare
|
|
1942
|
+
export declare interface FlythroughClipOptions extends CameraClipTiming {
|
|
1943
|
+
waypoints: Vector3[];
|
|
1944
|
+
/** Optional look-at points per waypoint; defaults to next waypoint. */
|
|
1945
|
+
lookAt?: Vector3[];
|
|
1946
|
+
ease?: EasingFunction;
|
|
1947
|
+
}
|
|
1647
1948
|
|
|
1648
1949
|
export declare class Gear extends Mesh {
|
|
1649
1950
|
constructor({ sides, innerRadius, outerRadius, holeSides, holeRadius, depth }?: {
|
|
@@ -1681,6 +1982,251 @@ declare interface GlitchTransitionOptions extends SceneTransitionFXOptions {
|
|
|
1681
1982
|
maxIntensity?: number;
|
|
1682
1983
|
}
|
|
1683
1984
|
|
|
1985
|
+
/**
|
|
1986
|
+
* Soft additive glow billboard — reads as light without a {@link PointLight}.
|
|
1987
|
+
* Pair with {@link FlameFlickerEffect} for organic pulse, or use alone for
|
|
1988
|
+
* cheap mass lighting (many halos + bloom, no light-count limit).
|
|
1989
|
+
*
|
|
1990
|
+
* Call `faceCamera(camera.position)` each frame so the card faces the eye.
|
|
1991
|
+
*/
|
|
1992
|
+
export declare class GlowHalo extends Object3D {
|
|
1993
|
+
readonly mesh: Mesh<PlaneGeometry, MeshBasicMaterial>;
|
|
1994
|
+
private texture;
|
|
1995
|
+
private readonly baseColor;
|
|
1996
|
+
constructor({ color, size, opacity, }?: GlowHaloOptions);
|
|
1997
|
+
/** Billboard toward the camera (or any eye position). */
|
|
1998
|
+
faceCamera(eye: Vector3): void;
|
|
1999
|
+
/** Set halo opacity (e.g. scaled each frame by {@link FlameFlickerEffect}). */
|
|
2000
|
+
setOpacity(opacity: number): void;
|
|
2001
|
+
get opacity(): number;
|
|
2002
|
+
setColor(color: ColorRepresentation): void;
|
|
2003
|
+
dispose(): void;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
export declare interface GlowHaloOptions {
|
|
2007
|
+
/** Warm glow tint. Defaults to `0xffaa44`. */
|
|
2008
|
+
color?: ColorRepresentation;
|
|
2009
|
+
/** Billboard plane edge length in world units. Defaults to `1.2`. */
|
|
2010
|
+
size?: number;
|
|
2011
|
+
/** Base opacity before flicker scaling. Defaults to `0.75`. */
|
|
2012
|
+
opacity?: number;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
/** Pane dimensions derived from opening size and cell counts. */
|
|
2016
|
+
export declare interface GregorianLatticeGrid {
|
|
2017
|
+
/** Width of each rectangular pane. */
|
|
2018
|
+
paneWidth: number;
|
|
2019
|
+
/** Height of each rectangular pane. */
|
|
2020
|
+
paneHeight: number;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
/**
|
|
2024
|
+
* Derive pane size from cell counts.
|
|
2025
|
+
*
|
|
2026
|
+
* `cellsX` panes span the opening width; `cellsY` span the height. Mullions
|
|
2027
|
+
* divide the opening evenly so every segment is a full rectangle.
|
|
2028
|
+
*/
|
|
2029
|
+
export declare function gregorianLatticeGridFromCells(width: number, height: number, cellsX: number, cellsY: number): GregorianLatticeGrid;
|
|
2030
|
+
|
|
2031
|
+
declare interface GregorianLatticePartOptions {
|
|
2032
|
+
width: number;
|
|
2033
|
+
height: number;
|
|
2034
|
+
/** Center Y of the opening in local space. Defaults to `0`. */
|
|
2035
|
+
centerY?: number;
|
|
2036
|
+
cellsX: number;
|
|
2037
|
+
cellsY: number;
|
|
2038
|
+
mullionThickness: number;
|
|
2039
|
+
mullionDepth: number;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
/**
|
|
2043
|
+
* Gregorian lattice window — rectangular pane grid with orthogonal mullions.
|
|
2044
|
+
*
|
|
2045
|
+
* Local frame: centered on the opening, XY plane facing +Z. Mullions and
|
|
2046
|
+
* optional glass share `z = 0`.
|
|
2047
|
+
*/
|
|
2048
|
+
export declare class GregorianLatticeWindow extends Group {
|
|
2049
|
+
readonly mullions: Mesh<GregorianLatticeWindowGeometry, MeshStandardMaterial>;
|
|
2050
|
+
readonly glass?: Mesh<PlaneGeometry, MeshPhysicalMaterial>;
|
|
2051
|
+
readonly cellsX: number;
|
|
2052
|
+
readonly cellsY: number;
|
|
2053
|
+
readonly fittedGrid: GregorianLatticeGrid;
|
|
2054
|
+
constructor({ mullionColor, glass, glassColor, glassEmissive, glassEmissiveIntensity, ...geometryOptions }?: GregorianLatticeWindowOptions);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
/**
|
|
2058
|
+
* Gregorian lattice window — outer frame plus orthogonal mullions in a rectangular grid.
|
|
2059
|
+
* Built in the XY plane facing +Z.
|
|
2060
|
+
*/
|
|
2061
|
+
export declare class GregorianLatticeWindowGeometry extends BufferGeometry {
|
|
2062
|
+
readonly cellsX: number;
|
|
2063
|
+
readonly cellsY: number;
|
|
2064
|
+
readonly fittedGrid: GregorianLatticeGrid;
|
|
2065
|
+
constructor({ width, height, mullionThickness, mullionDepth, cellsX, cellsY, centerY, }?: GregorianLatticeWindowGeometryOptions);
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
declare interface GregorianLatticeWindowGeometryOptions {
|
|
2069
|
+
/** Opening width (world units). */
|
|
2070
|
+
width?: number;
|
|
2071
|
+
/** Opening height (world units). */
|
|
2072
|
+
height?: number;
|
|
2073
|
+
/** Mullion thickness (cross-section). Defaults to `0.055`. */
|
|
2074
|
+
mullionThickness?: number;
|
|
2075
|
+
/** Mullion depth (Z extent). Defaults to `0.11`. */
|
|
2076
|
+
mullionDepth?: number;
|
|
2077
|
+
/** Rectangular panes across the opening width. Defaults to `4`. */
|
|
2078
|
+
cellsX?: number;
|
|
2079
|
+
/** Rectangular panes up the opening height. Defaults to `6`. */
|
|
2080
|
+
cellsY?: number;
|
|
2081
|
+
/** Vertical center of the opening in local geometry space. Defaults to `0`. */
|
|
2082
|
+
centerY?: number;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
declare interface GregorianLatticeWindowOptions extends GregorianLatticeWindowGeometryOptions {
|
|
2086
|
+
/** Frame + mullion tint. Defaults to `#5c4033` (wood). */
|
|
2087
|
+
mullionColor?: ColorRepresentation;
|
|
2088
|
+
/** Optional glass pane coplanar with the mullions (same Z center). */
|
|
2089
|
+
glass?: boolean;
|
|
2090
|
+
glassColor?: ColorRepresentation;
|
|
2091
|
+
glassEmissive?: ColorRepresentation;
|
|
2092
|
+
glassEmissiveIntensity?: number;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
/**
|
|
2096
|
+
* Creeping ground mist — soft horizontal cards drifting above the floor.
|
|
2097
|
+
* Interior patches wrap toroidally within `area`; optional perimeter patches
|
|
2098
|
+
* sit on/outside the fence on edges opposite the camera. One texture, one
|
|
2099
|
+
* `update(dt)` — perimeter is placement logic, not a separate effect.
|
|
2100
|
+
*/
|
|
2101
|
+
export declare class GroundFogEffect extends Object3D {
|
|
2102
|
+
private readonly patches;
|
|
2103
|
+
private readonly area;
|
|
2104
|
+
private readonly heightAt;
|
|
2105
|
+
private readonly texture;
|
|
2106
|
+
private elapsed;
|
|
2107
|
+
constructor({ count, area, perimeterCount, plotHalf, terrainHalf, cameraFacing, color, heightAt, }?: GroundFogEffectOptions);
|
|
2108
|
+
update(dt: number): void;
|
|
2109
|
+
dispose(): void;
|
|
2110
|
+
private makeInteriorPatch;
|
|
2111
|
+
private makePerimeterPatch;
|
|
2112
|
+
private makeMesh;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
export declare interface GroundFogEffectOptions {
|
|
2116
|
+
/** Interior mist cards scattered across the plot. Defaults to `14`. */
|
|
2117
|
+
count?: number;
|
|
2118
|
+
/** Half-extent of the interior scatter (world units). Defaults to `16`. */
|
|
2119
|
+
area?: number;
|
|
2120
|
+
/**
|
|
2121
|
+
* Large cards hugging the plot perimeter — softens terrain cutoffs on the
|
|
2122
|
+
* horizons opposite the camera. Defaults to `0` (interior only).
|
|
2123
|
+
*/
|
|
2124
|
+
perimeterCount?: number;
|
|
2125
|
+
/** Half-extent of the inner bounded plot (fence, wall, scene edge, etc.). Defaults to `12`. */
|
|
2126
|
+
plotHalf?: number;
|
|
2127
|
+
/** Terrain half-extent; perimeter cards spill outward toward this edge. Defaults to `16`. */
|
|
2128
|
+
terrainHalf?: number;
|
|
2129
|
+
/**
|
|
2130
|
+
* Horizontal direction from plot center toward the camera. Perimeter patches
|
|
2131
|
+
* concentrate on the opposite edges. Defaults to `{ x: 1, z: 1 }`.
|
|
2132
|
+
*/
|
|
2133
|
+
cameraFacing?: {
|
|
2134
|
+
x: number;
|
|
2135
|
+
z: number;
|
|
2136
|
+
};
|
|
2137
|
+
/** Mist tint. Defaults to `#9fb0c8`. */
|
|
2138
|
+
color?: ColorRepresentation;
|
|
2139
|
+
/**
|
|
2140
|
+
* Sample ground height at world (x, z). Defaults to flat `y = 0`.
|
|
2141
|
+
* Portfolio graveyard uses undulating terrain via the same callback.
|
|
2142
|
+
*/
|
|
2143
|
+
heightAt?: (x: number, z: number) => number;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
/**
|
|
2147
|
+
* Hanging wrought-iron lantern — open cage struts around a solid emissive
|
|
2148
|
+
* inner octahedron (glass-pane lamp). Mount, cage, and lamp use separate
|
|
2149
|
+
* material groups. Pair {@link GlowHalo} and {@link FlameFlickerEffect} at
|
|
2150
|
+
* `cageCenterY` for bloom and flicker.
|
|
2151
|
+
*
|
|
2152
|
+
* Local frame: origin at the chain top (hang point).
|
|
2153
|
+
*/
|
|
2154
|
+
export declare class HangingLantern extends Mesh<HangingLanternGeometry, MeshStandardMaterial[]> {
|
|
2155
|
+
readonly drop: number;
|
|
2156
|
+
readonly cageCenterY: number;
|
|
2157
|
+
constructor({ color, mountColor, cageColor, lampColor, lampEmissiveIntensity, lampOpacity, inner, ...geometryOptions }?: HangingLanternOptions);
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* Wrought-iron hanging lantern frame — chain, cap, and open octahedron cage
|
|
2162
|
+
* built from edge struts.
|
|
2163
|
+
*
|
|
2164
|
+
* Material groups: `0` mount (chain + cap), `1` cage struts, `2` inner lamp
|
|
2165
|
+
* (solid octahedron).
|
|
2166
|
+
*
|
|
2167
|
+
* Local frame: origin at the chain top (hang point). The cage top vertex
|
|
2168
|
+
* attaches at the cap center, optionally lowered by `cageGap`.
|
|
2169
|
+
*/
|
|
2170
|
+
export declare class HangingLanternGeometry extends BufferGeometry {
|
|
2171
|
+
readonly drop: number;
|
|
2172
|
+
readonly chainWidth: number;
|
|
2173
|
+
readonly capWidth: number;
|
|
2174
|
+
readonly capHeight: number;
|
|
2175
|
+
readonly capDepth: number;
|
|
2176
|
+
readonly capOffset: number;
|
|
2177
|
+
readonly cageRadius: number;
|
|
2178
|
+
readonly cageStretch: number;
|
|
2179
|
+
readonly cageGap: number;
|
|
2180
|
+
readonly cageBarWidth: number;
|
|
2181
|
+
readonly innerScale: number;
|
|
2182
|
+
readonly inner: boolean;
|
|
2183
|
+
/** Y of the cage center in local space (negative, below the hang point). */
|
|
2184
|
+
readonly cageCenterY: number;
|
|
2185
|
+
constructor({ drop, chainWidth, capWidth, capHeight, capDepth, capOffset, cageRadius, cageStretch, cageGap, cageBarWidth, innerScale, inner, }?: HangingLanternGeometryOptions);
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
export declare interface HangingLanternGeometryOptions {
|
|
2189
|
+
/** Chain length from the hang point. Defaults to `3`. */
|
|
2190
|
+
drop?: number;
|
|
2191
|
+
/** Chain link cross-section. Defaults to `0.05`. */
|
|
2192
|
+
chainWidth?: number;
|
|
2193
|
+
/** Cap width (X). Defaults to `0.18`. */
|
|
2194
|
+
capWidth?: number;
|
|
2195
|
+
/** Cap height (Y). Defaults to `0.16`. */
|
|
2196
|
+
capHeight?: number;
|
|
2197
|
+
/** Cap depth (Z). Defaults to `0.18`. */
|
|
2198
|
+
capDepth?: number;
|
|
2199
|
+
/** Cap center offset below the chain bottom. Defaults to `0.02`. */
|
|
2200
|
+
capOffset?: number;
|
|
2201
|
+
/** Cage vertex radius before stretch. Defaults to `0.42`. */
|
|
2202
|
+
cageRadius?: number;
|
|
2203
|
+
/** Vertical stretch on the cage. Defaults to `1.4`. */
|
|
2204
|
+
cageStretch?: number;
|
|
2205
|
+
/** Extra downward offset below the cap-center cage attach. Defaults to `0`. */
|
|
2206
|
+
cageGap?: number;
|
|
2207
|
+
/** Cage strut thickness. Defaults to `0.03`. */
|
|
2208
|
+
cageBarWidth?: number;
|
|
2209
|
+
/** Inner lamp scale relative to the cage (inset to sit inside struts). Defaults to `0.96`. */
|
|
2210
|
+
innerScale?: number;
|
|
2211
|
+
/** Include the solid inner octahedron lamp volume. Defaults to `true`. */
|
|
2212
|
+
inner?: boolean;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
export declare interface HangingLanternOptions extends HangingLanternGeometryOptions {
|
|
2216
|
+
/** Wrought-iron tint for mount and cage. Defaults to `#171a1f`. */
|
|
2217
|
+
color?: ColorRepresentation;
|
|
2218
|
+
/** Mount iron tint (chain + cap). Defaults to `color`. */
|
|
2219
|
+
mountColor?: ColorRepresentation;
|
|
2220
|
+
/** Cage strut tint. Defaults to `color`. */
|
|
2221
|
+
cageColor?: ColorRepresentation;
|
|
2222
|
+
/** Inner lamp tint (emissive octahedron). Defaults to `#ffb45a`. */
|
|
2223
|
+
lampColor?: ColorRepresentation;
|
|
2224
|
+
/** Inner lamp emissive strength. Defaults to `1.4`. */
|
|
2225
|
+
lampEmissiveIntensity?: number;
|
|
2226
|
+
/** Inner lamp opacity for a glass-pane read. Defaults to `0.88`. */
|
|
2227
|
+
lampOpacity?: number;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
1684
2230
|
export declare class Heart extends Mesh {
|
|
1685
2231
|
constructor({ size, width, height, tipDepth, depth }?: {
|
|
1686
2232
|
size?: number | undefined;
|
|
@@ -1798,8 +2344,6 @@ export declare function hslToRgb(h: number, s: number, l: number): [number, numb
|
|
|
1798
2344
|
*/
|
|
1799
2345
|
export declare function interpolateCurve(curveFunction: (t: number) => number, startRadius: number, endRadius: number, startHeight: number, endHeight: number, segments?: number, min?: number, max?: number): Vector2[];
|
|
1800
2346
|
|
|
1801
|
-
export declare const inverse: (t: number) => number;
|
|
1802
|
-
|
|
1803
2347
|
/**
|
|
1804
2348
|
* Material indices
|
|
1805
2349
|
* 0. Jar
|
|
@@ -1818,140 +2362,178 @@ export declare class JarGeometry extends BufferGeometry {
|
|
|
1818
2362
|
constructor();
|
|
1819
2363
|
}
|
|
1820
2364
|
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
constructor(options?: LeafEffectOptions);
|
|
1832
|
-
update(): void;
|
|
2365
|
+
/**
|
|
2366
|
+
* Tabletop lantern — frame around an emissive glass body. Geometry only; add
|
|
2367
|
+
* {@link GlowHalo} and {@link FlameFlickerEffect} at `lampCenterY` in the
|
|
2368
|
+
* scene.
|
|
2369
|
+
*
|
|
2370
|
+
* Local frame: sits on the Y=0 plane.
|
|
2371
|
+
*/
|
|
2372
|
+
export declare class Lantern extends Mesh<LanternGeometry, MeshStandardMaterial[]> {
|
|
2373
|
+
readonly lampCenterY: number;
|
|
2374
|
+
constructor(heightOrOptions?: number | LanternOptions, baseWidth?: number);
|
|
1833
2375
|
}
|
|
1834
2376
|
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
2377
|
+
/**
|
|
2378
|
+
* Tabletop lantern — wood/metal base, roof, and handle framing an emissive
|
|
2379
|
+
* glass body.
|
|
2380
|
+
*
|
|
2381
|
+
* Material groups: `0` frame (base + roof + handle), `1` glass body.
|
|
2382
|
+
*
|
|
2383
|
+
* Local frame: sits on the Y=0 plane; lamp center at `lampCenterY`.
|
|
2384
|
+
*/
|
|
2385
|
+
export declare class LanternGeometry extends BufferGeometry {
|
|
2386
|
+
readonly baseWidth: number;
|
|
2387
|
+
readonly bodyHeight: number;
|
|
2388
|
+
readonly baseHeight: number;
|
|
2389
|
+
readonly innerScale: number;
|
|
2390
|
+
readonly inner: boolean;
|
|
2391
|
+
readonly lampCenterY: number;
|
|
2392
|
+
constructor({ baseWidth, bodyHeight, baseHeight, roofHeight, roofRadius, glassRadiusScale, innerScale, handleRadius, handleTubeRadius, handleLift, segments, inner, }?: LanternGeometryOptions);
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
export declare interface LanternGeometryOptions {
|
|
2396
|
+
/** Base / foot radius. Defaults to `0.5`. */
|
|
2397
|
+
baseWidth?: number;
|
|
2398
|
+
/** Glass body height. Defaults to `1.3`. */
|
|
2399
|
+
bodyHeight?: number;
|
|
2400
|
+
/** Base height. Defaults to `0.2`. */
|
|
2401
|
+
baseHeight?: number;
|
|
2402
|
+
/** Roof cone height. Defaults to `0.5`. */
|
|
2403
|
+
roofHeight?: number;
|
|
2404
|
+
/** Roof cone radius. Defaults to `baseWidth * 1.1`. */
|
|
2405
|
+
roofRadius?: number;
|
|
2406
|
+
/** Glass radius relative to `baseWidth`. Defaults to `0.9`. */
|
|
2407
|
+
glassRadiusScale?: number;
|
|
2408
|
+
/** Glass height inset relative to `bodyHeight`. Defaults to `0.96`. */
|
|
2409
|
+
innerScale?: number;
|
|
2410
|
+
/** Carry-handle major radius. Defaults to `baseWidth * 0.8`. */
|
|
2411
|
+
handleRadius?: number;
|
|
2412
|
+
/** Carry-handle tube radius. Defaults to `0.05`. */
|
|
2413
|
+
handleTubeRadius?: number;
|
|
2414
|
+
/** Gap above the roof to the handle center. Defaults to `0.35`. */
|
|
2415
|
+
handleLift?: number;
|
|
2416
|
+
/** Radial segments on round parts. Defaults to `8`. */
|
|
2417
|
+
segments?: number;
|
|
2418
|
+
/** Include the emissive glass body. Defaults to `true`. */
|
|
2419
|
+
inner?: boolean;
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
export declare interface LanternOptions extends LanternGeometryOptions {
|
|
2423
|
+
/** Frame tint (base, roof, handle). Defaults to `#8b4513`. */
|
|
2424
|
+
color?: ColorRepresentation;
|
|
2425
|
+
/** Glass lamp tint. Defaults to `#ffd700`. */
|
|
2426
|
+
lampColor?: ColorRepresentation;
|
|
2427
|
+
/** Glass emissive strength. Defaults to `1.2`. */
|
|
2428
|
+
lampEmissiveIntensity?: number;
|
|
2429
|
+
/** Glass opacity. Defaults to `0.75`. */
|
|
2430
|
+
lampOpacity?: number;
|
|
1842
2431
|
}
|
|
1843
2432
|
|
|
1844
|
-
|
|
1845
|
-
|
|
2433
|
+
/**
|
|
2434
|
+
* Folded autumn leaf prefab — {@link LeafGeometry} with flat-shaded double-sided
|
|
2435
|
+
* material matching the graveyard blowing-leaves look.
|
|
2436
|
+
*
|
|
2437
|
+
* Local frame: tip at +Y, base at −Y, fold rises along +Z.
|
|
2438
|
+
*/
|
|
2439
|
+
export declare class Leaf extends Mesh<LeafGeometry, MeshStandardMaterial> {
|
|
2440
|
+
readonly size: number;
|
|
2441
|
+
readonly lift: number;
|
|
2442
|
+
constructor({ color, ...geometryOptions }?: LeafOptions);
|
|
1846
2443
|
}
|
|
1847
2444
|
|
|
1848
2445
|
/**
|
|
1849
|
-
*
|
|
1850
|
-
*
|
|
2446
|
+
* Low-poly folded leaf — a pointed ellipse with a gently raised midrib so it
|
|
2447
|
+
* catches rim light instead of reading as a flat sliver. Spine vertices sit
|
|
2448
|
+
* slightly above the mirrored rim outline, giving a soft V cross-section under
|
|
2449
|
+
* flat shading.
|
|
1851
2450
|
*
|
|
1852
|
-
*
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
* });
|
|
1859
|
-
* scene.add(candle);
|
|
1860
|
-
*
|
|
1861
|
-
* // Create a point light
|
|
1862
|
-
* const candleLight = new THREE.PointLight(0xffa500, 1, 5);
|
|
1863
|
-
* scene.add(candleLight);
|
|
1864
|
-
*
|
|
1865
|
-
* // Apply the animator to the light
|
|
1866
|
-
* const lightAnimation = new LightFlickerAnimation({
|
|
1867
|
-
* light: candleLight,
|
|
1868
|
-
* maxIntensity: 2.2,
|
|
1869
|
-
* x: candle.position.x,
|
|
1870
|
-
* y: candle.position.y + 1 + 0.125, // height + half flame height
|
|
1871
|
-
* z: candle.position.z,
|
|
1872
|
-
* });
|
|
1873
|
-
* animations.push(lightAnimation);
|
|
1874
|
-
*
|
|
1875
|
-
* // Update the light animation in the render loop
|
|
1876
|
-
* renderer.setAnimationLoop(() => {
|
|
1877
|
-
* lightAnimation.update();
|
|
1878
|
-
* });
|
|
1879
|
-
* ```
|
|
1880
|
-
*/
|
|
1881
|
-
export declare class LightFlickerAnimation {
|
|
1882
|
-
private light?;
|
|
1883
|
-
minIntensity: number;
|
|
1884
|
-
maxIntensity: number;
|
|
1885
|
-
x: number;
|
|
1886
|
-
y: number;
|
|
1887
|
-
z: number;
|
|
1888
|
-
jitterX: number;
|
|
1889
|
-
jitterY: number;
|
|
1890
|
-
jitterZ: number;
|
|
1891
|
-
constructor({ light, minIntensity, maxIntensity, x, y, z, jitterX, jitterY, jitterZ, }?: Partial<LightFlickerAnimationOptions>);
|
|
1892
|
-
update(): void;
|
|
2451
|
+
* Local frame: tip at +Y, base at −Y, fold rises along +Z.
|
|
2452
|
+
*/
|
|
2453
|
+
export declare class LeafGeometry extends BufferGeometry {
|
|
2454
|
+
readonly size: number;
|
|
2455
|
+
readonly lift: number;
|
|
2456
|
+
constructor({ size, lift }?: LeafGeometryOptions);
|
|
1893
2457
|
}
|
|
1894
2458
|
|
|
1895
|
-
export declare interface
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
2459
|
+
export declare interface LeafGeometryOptions {
|
|
2460
|
+
/** Overall leaf scale. Defaults to `0.13`. */
|
|
2461
|
+
size?: number;
|
|
2462
|
+
/** Midrib rise above the rim as a fraction of size. Defaults to `0.22`. */
|
|
2463
|
+
lift?: number;
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
export declare interface LeafOptions extends LeafGeometryOptions {
|
|
2467
|
+
/** Leaf tint. Defaults to `#a8702c`. */
|
|
2468
|
+
color?: ColorRepresentation;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
export declare class LeverPanel extends Group {
|
|
2472
|
+
constructor();
|
|
1905
2473
|
}
|
|
1906
2474
|
|
|
1907
2475
|
/**
|
|
1908
|
-
*
|
|
1909
|
-
* This effect is applied to a light source.
|
|
2476
|
+
* Thunderstorm lightning that drives a {@link DirectionalLight} each frame.
|
|
1910
2477
|
*
|
|
1911
|
-
*
|
|
1912
|
-
*
|
|
1913
|
-
*
|
|
1914
|
-
*
|
|
1915
|
-
*
|
|
2478
|
+
* Rather than scheduling timeouts (which need careful teardown), each strike
|
|
2479
|
+
* enqueues two or three decaying intensity spikes a few frames apart — the
|
|
2480
|
+
* characteristic stutter of real lightning. Read {@link LightningEffect.level}
|
|
2481
|
+
* after {@link LightningEffect.update} to sync fog, sky, rain, or emissive
|
|
2482
|
+
* surfaces with the flash.
|
|
2483
|
+
*
|
|
2484
|
+
* @example
|
|
2485
|
+
* ```typescript
|
|
2486
|
+
* const bolt = new DirectionalLight(0xcdd8ff, 0);
|
|
2487
|
+
* bolt.position.set(5, 12, -8);
|
|
2488
|
+
* bolt.target.position.set(0, 0, 0);
|
|
2489
|
+
* scene.add(bolt, bolt.target);
|
|
1916
2490
|
*
|
|
1917
|
-
* const
|
|
2491
|
+
* const storm = new LightningEffect({ light: bolt, peak: 12, minGap: 3, maxGap: 9 });
|
|
1918
2492
|
*
|
|
1919
|
-
*
|
|
1920
|
-
*
|
|
1921
|
-
*
|
|
2493
|
+
* function animate(delta: number) {
|
|
2494
|
+
* storm.update(delta);
|
|
2495
|
+
* const flash = storm.level; // 0..~1.2
|
|
2496
|
+
* renderer.render(scene, camera);
|
|
2497
|
+
* }
|
|
1922
2498
|
* ```
|
|
1923
2499
|
*/
|
|
1924
|
-
export declare class
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
2500
|
+
export declare class LightningEffect {
|
|
2501
|
+
/** Current flash level, 0 = dark. Read after each {@link LightningEffect.update}. */
|
|
2502
|
+
level: number;
|
|
2503
|
+
private readonly light;
|
|
2504
|
+
private readonly peak;
|
|
2505
|
+
private readonly minGap;
|
|
2506
|
+
private readonly maxGap;
|
|
2507
|
+
private readonly spikes;
|
|
2508
|
+
private clock;
|
|
2509
|
+
private nextStrike;
|
|
2510
|
+
constructor({ light, peak, minGap, maxGap }: LightningEffectOptions);
|
|
2511
|
+
/**
|
|
2512
|
+
* Advance the strike schedule and update the driven light intensity. Pass
|
|
2513
|
+
* elapsed frame time in seconds.
|
|
2514
|
+
*/
|
|
2515
|
+
update(dt: number): void;
|
|
2516
|
+
/** Force the driven light dark, e.g. when lightning is toggled off. */
|
|
2517
|
+
quiet(): void;
|
|
2518
|
+
private strike;
|
|
1934
2519
|
}
|
|
1935
2520
|
|
|
1936
|
-
declare interface LightningEffectOptions {
|
|
1937
|
-
light
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
2521
|
+
export declare interface LightningEffectOptions {
|
|
2522
|
+
/** Directional light driven by lightning flashes. Start at intensity `0`. */
|
|
2523
|
+
light: DirectionalLight;
|
|
2524
|
+
/** Peak light intensity at full flash. Defaults to `12`. */
|
|
2525
|
+
peak?: number;
|
|
2526
|
+
/** Minimum seconds between strikes. Defaults to `3`. */
|
|
2527
|
+
minGap?: number;
|
|
2528
|
+
/** Maximum seconds between strikes. Defaults to `9`. */
|
|
2529
|
+
maxGap?: number;
|
|
1942
2530
|
}
|
|
1943
2531
|
|
|
1944
|
-
export declare const linear: (t: number) => number;
|
|
1945
|
-
|
|
1946
2532
|
export declare const LineEquations: {
|
|
1947
2533
|
calculateXFromSlopeIntercept: typeof calculateXFromSlopeIntercept;
|
|
1948
2534
|
calculateYFromSlopeIntercept: typeof calculateYFromSlopeIntercept;
|
|
1949
2535
|
};
|
|
1950
2536
|
|
|
1951
|
-
export declare const logarithmic: (t: number) => number;
|
|
1952
|
-
|
|
1953
|
-
export declare const logarithmicCurve: (t: number, base?: number, factor?: number) => number;
|
|
1954
|
-
|
|
1955
2537
|
/**
|
|
1956
2538
|
* Generates a random number skewed towards the maximum value.
|
|
1957
2539
|
*
|
|
@@ -1962,7 +2544,7 @@ export declare const logarithmicCurve: (t: number, base?: number, factor?: numbe
|
|
|
1962
2544
|
* @param {number} [max=1] - Maximum value of the range.
|
|
1963
2545
|
* @returns {number} A random number between `min` and `max`, skewed towards `max`.
|
|
1964
2546
|
*/
|
|
1965
|
-
export declare function logarithmicRandomMax(exponent?: number, min?: number, max?: number): number;
|
|
2547
|
+
export declare function logarithmicRandomMax(exponent?: number, min?: number, max?: number, source?: RandomSource): number;
|
|
1966
2548
|
|
|
1967
2549
|
/**
|
|
1968
2550
|
* Generates a random number skewed towards the minimum value.
|
|
@@ -1974,10 +2556,56 @@ export declare function logarithmicRandomMax(exponent?: number, min?: number, ma
|
|
|
1974
2556
|
* @param {number} [max=1] - Maximum value of the range.
|
|
1975
2557
|
* @returns {number} A random number between `min` and `max`, skewed towards `min`.
|
|
1976
2558
|
*/
|
|
1977
|
-
export declare function logarithmicRandomMin(exponent?: number, min?: number, max?: number): number;
|
|
2559
|
+
export declare function logarithmicRandomMin(exponent?: number, min?: number, max?: number, source?: RandomSource): number;
|
|
2560
|
+
|
|
2561
|
+
/**
|
|
2562
|
+
* L-shaped staircase prefab — two flights with a square width × width landing.
|
|
2563
|
+
*/
|
|
2564
|
+
export declare class LShapedStaircase extends Mesh<LShapedStaircaseGeometry, MeshStandardMaterial> {
|
|
2565
|
+
readonly width: number;
|
|
2566
|
+
readonly riserHeight: number;
|
|
2567
|
+
readonly treadDepth: number;
|
|
2568
|
+
readonly stepsPerFlight: number;
|
|
2569
|
+
readonly landingSize: number;
|
|
2570
|
+
readonly flightRun: number;
|
|
2571
|
+
readonly totalHeight: number;
|
|
2572
|
+
constructor({ color, ...geometryOptions }?: LShapedStaircaseOptions);
|
|
2573
|
+
}
|
|
1978
2574
|
|
|
2575
|
+
/**
|
|
2576
|
+
* L-shaped staircase with a square landing (width × width) at the 90° turn.
|
|
2577
|
+
*
|
|
2578
|
+
* Local frame:
|
|
2579
|
+
* - First flight climbs +Z, centered on X = 0.
|
|
2580
|
+
* - Landing is a width² platform starting at the last tread (no cantilever over
|
|
2581
|
+
* the lower flight) and extending forward at the turn.
|
|
2582
|
+
* - Second flight climbs −X from the left edge of the landing.
|
|
2583
|
+
*/
|
|
1979
2584
|
export declare class LShapedStaircaseGeometry extends BufferGeometry {
|
|
1980
|
-
|
|
2585
|
+
readonly width: number;
|
|
2586
|
+
readonly riserHeight: number;
|
|
2587
|
+
readonly treadDepth: number;
|
|
2588
|
+
readonly stepsPerFlight: number;
|
|
2589
|
+
readonly landingSize: number;
|
|
2590
|
+
readonly flightRun: number;
|
|
2591
|
+
readonly totalHeight: number;
|
|
2592
|
+
constructor({ width, riserHeight, treadDepth, stepsPerFlight, }?: LShapedStaircaseGeometryOptions);
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
export declare interface LShapedStaircaseGeometryOptions {
|
|
2596
|
+
/** Stair width (tread left–right extent). Defaults to `2`. */
|
|
2597
|
+
width?: number;
|
|
2598
|
+
/** Vertical rise per step (riser). Defaults to `0.3`. */
|
|
2599
|
+
riserHeight?: number;
|
|
2600
|
+
/** Horizontal run per step (tread depth). Defaults to `0.5`. */
|
|
2601
|
+
treadDepth?: number;
|
|
2602
|
+
/** Steps in each flight (before and after the landing). Defaults to `5`. */
|
|
2603
|
+
stepsPerFlight?: number;
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
export declare interface LShapedStaircaseOptions extends LShapedStaircaseGeometryOptions {
|
|
2607
|
+
/** Tread and riser tint. Defaults to `#8b4513`. */
|
|
2608
|
+
color?: ColorRepresentation;
|
|
1981
2609
|
}
|
|
1982
2610
|
|
|
1983
2611
|
/**
|
|
@@ -2008,24 +2636,6 @@ export declare class Microscope extends Group {
|
|
|
2008
2636
|
constructor();
|
|
2009
2637
|
}
|
|
2010
2638
|
|
|
2011
|
-
export declare class Moon extends Mesh<SphereGeometry, ShaderMaterial> {
|
|
2012
|
-
constructor();
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
/**
|
|
2016
|
-
* Moon shader
|
|
2017
|
-
* Simple moon effect with noise
|
|
2018
|
-
*/
|
|
2019
|
-
export declare const moonShader: {
|
|
2020
|
-
uniforms: {
|
|
2021
|
-
time: {
|
|
2022
|
-
value: number;
|
|
2023
|
-
};
|
|
2024
|
-
};
|
|
2025
|
-
vertexShader: string;
|
|
2026
|
-
fragmentShader: string;
|
|
2027
|
-
};
|
|
2028
|
-
|
|
2029
2639
|
export declare class MortarAndPestle extends Group {
|
|
2030
2640
|
constructor();
|
|
2031
2641
|
}
|
|
@@ -2110,6 +2720,12 @@ export declare class MoundGeometry extends BufferGeometry {
|
|
|
2110
2720
|
});
|
|
2111
2721
|
}
|
|
2112
2722
|
|
|
2723
|
+
/**
|
|
2724
|
+
* Fast seeded PRNG — portfolio Gotham/Water parity.
|
|
2725
|
+
* Returns a closure yielding floats in [0, 1).
|
|
2726
|
+
*/
|
|
2727
|
+
export declare function mulberry32(seed: number): RandomStream;
|
|
2728
|
+
|
|
2113
2729
|
export declare class NightSkybox extends Mesh {
|
|
2114
2730
|
geometry: SphereGeometry;
|
|
2115
2731
|
material: ShaderMaterial & {
|
|
@@ -2209,6 +2825,16 @@ declare interface ObeliskHeadstoneOptions {
|
|
|
2209
2825
|
totalHeight?: number;
|
|
2210
2826
|
}
|
|
2211
2827
|
|
|
2828
|
+
export declare interface OrbitClipOptions extends CameraClipTiming {
|
|
2829
|
+
target: Vector3;
|
|
2830
|
+
/** Horizontal distance from target. Defaults to current camera distance. */
|
|
2831
|
+
radius?: number;
|
|
2832
|
+
/** Elevation above target Y in radians. Defaults to current camera elevation. */
|
|
2833
|
+
elevation?: number;
|
|
2834
|
+
/** Revolutions over the clip. Defaults to `1`. */
|
|
2835
|
+
revolutions?: number;
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2212
2838
|
/**
|
|
2213
2839
|
* Prefab for a panel.
|
|
2214
2840
|
* Designed to be used as a control panel for switches, lights, levels, dials, and gauges.
|
|
@@ -2243,8 +2869,6 @@ export declare interface PanelOptions {
|
|
|
2243
2869
|
depth?: number;
|
|
2244
2870
|
}
|
|
2245
2871
|
|
|
2246
|
-
export declare const parabolicCurve: (t: number, a?: number, b?: number, c?: number) => number;
|
|
2247
|
-
|
|
2248
2872
|
/**
|
|
2249
2873
|
* Prismatic parallelogram, with horizontal skew (offset in X for the slant).
|
|
2250
2874
|
*/
|
|
@@ -2253,14 +2877,14 @@ export declare class ParallelogramBoxGeometry extends BufferGeometry {
|
|
|
2253
2877
|
}
|
|
2254
2878
|
|
|
2255
2879
|
export declare const ParametricCurve: {
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2880
|
+
cubic: (t: number, p0: number, p1: number, p2: number, p3: number) => number;
|
|
2881
|
+
damped: (t: number, damping?: number) => number;
|
|
2882
|
+
exponential: (t: number, base?: number, factor?: number) => number;
|
|
2883
|
+
logarithmic: (t: number, base?: number, factor?: number) => number;
|
|
2884
|
+
parabolic: (t: number, a?: number, b?: number, c?: number) => number;
|
|
2885
|
+
quadratic: (t: number, p0: number, p1: number, p2: number) => number;
|
|
2886
|
+
sigmoid: (t: number, a?: number) => number;
|
|
2887
|
+
sinusoidal: (t: number) => number;
|
|
2264
2888
|
};
|
|
2265
2889
|
|
|
2266
2890
|
export declare const ParametricCurveUtils: {
|
|
@@ -2278,6 +2902,97 @@ export declare const ParametricCurveUtils: {
|
|
|
2278
2902
|
*/
|
|
2279
2903
|
export declare function parseHexCode(hex: string): [number, number, number];
|
|
2280
2904
|
|
|
2905
|
+
export declare interface PendulumClipOptions extends CameraClipTiming {
|
|
2906
|
+
target: Vector3;
|
|
2907
|
+
/** Distance from target. Defaults to current camera distance. */
|
|
2908
|
+
distance?: number;
|
|
2909
|
+
/** Peak azimuth swing in radians — keep small for Ken Burns mood (e.g. `0.12`). */
|
|
2910
|
+
azimuthAmplitude?: number;
|
|
2911
|
+
/** Slow back-and-forth cycles over the clip. Defaults to `2`. */
|
|
2912
|
+
oscillations?: number;
|
|
2913
|
+
ease?: EasingFunction;
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
/**
|
|
2917
|
+
* Soft, slow-drifting petals (or leaves) falling through a bounded volume —
|
|
2918
|
+
* cherry-blossom float rather than stiff tumble. Each instance drifts downward
|
|
2919
|
+
* with gentle horizontal wander and a light sinusoidal flutter.
|
|
2920
|
+
*
|
|
2921
|
+
* Call {@link PetalDriftEffect.update} each frame with elapsed time in seconds.
|
|
2922
|
+
*
|
|
2923
|
+
* @example
|
|
2924
|
+
* ```typescript
|
|
2925
|
+
* const petals = new PetalDriftEffect({
|
|
2926
|
+
* count: 80,
|
|
2927
|
+
* color: [0xffd6f0, 0xfff0f8, 0xf8c8e0],
|
|
2928
|
+
* flutter: 0.3,
|
|
2929
|
+
* });
|
|
2930
|
+
* scene.add(petals);
|
|
2931
|
+
*
|
|
2932
|
+
* onFrame((dt) => petals.update(dt));
|
|
2933
|
+
* ```
|
|
2934
|
+
*/
|
|
2935
|
+
export declare class PetalDriftEffect extends InstancedMesh {
|
|
2936
|
+
private readonly width;
|
|
2937
|
+
private readonly height;
|
|
2938
|
+
private readonly depth;
|
|
2939
|
+
private readonly floorY;
|
|
2940
|
+
private readonly flutter;
|
|
2941
|
+
private readonly px;
|
|
2942
|
+
private readonly py;
|
|
2943
|
+
private readonly pz;
|
|
2944
|
+
private readonly fallSpeed;
|
|
2945
|
+
private readonly driftX;
|
|
2946
|
+
private readonly driftZ;
|
|
2947
|
+
private readonly rotX;
|
|
2948
|
+
private readonly rotY;
|
|
2949
|
+
private readonly rotZ;
|
|
2950
|
+
private readonly phase;
|
|
2951
|
+
private readonly dummy;
|
|
2952
|
+
private clock;
|
|
2953
|
+
constructor(options?: PetalDriftEffectOptions);
|
|
2954
|
+
/**
|
|
2955
|
+
* Advance petal positions and flutter. Pass elapsed frame time in seconds.
|
|
2956
|
+
*/
|
|
2957
|
+
update(dt: number): void;
|
|
2958
|
+
/** Release geometry and materials held by the field. */
|
|
2959
|
+
dispose(): this;
|
|
2960
|
+
private respawn;
|
|
2961
|
+
private writeMatrices;
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
export declare interface PetalDriftEffectOptions {
|
|
2965
|
+
/** Override petal geometry. Defaults to {@link EllipticLeafGeometry}. */
|
|
2966
|
+
geometry?: BufferGeometry;
|
|
2967
|
+
/** Override the default petal material. */
|
|
2968
|
+
material?: Material;
|
|
2969
|
+
/** Number of petal instances. Defaults to `120`. */
|
|
2970
|
+
count?: number;
|
|
2971
|
+
/** Horizontal spread (world units). Defaults to `16`. */
|
|
2972
|
+
width?: number;
|
|
2973
|
+
/** Vertical spawn span (world units). Defaults to `8`. */
|
|
2974
|
+
height?: number;
|
|
2975
|
+
/** Depth spread (world units). Defaults to `16`. */
|
|
2976
|
+
depth?: number;
|
|
2977
|
+
/** World Y where petals respawn after drifting below the floor. Defaults to `0`. */
|
|
2978
|
+
floorY?: number;
|
|
2979
|
+
/** Minimum fall speed (units/s). Defaults to `0.12`. */
|
|
2980
|
+
fallSpeedMin?: number;
|
|
2981
|
+
/** Maximum fall speed (units/s). Defaults to `0.28`. */
|
|
2982
|
+
fallSpeedMax?: number;
|
|
2983
|
+
/** Minimum horizontal drift speed (units/s). Defaults to `0.04`. */
|
|
2984
|
+
driftMin?: number;
|
|
2985
|
+
/** Maximum horizontal drift speed (units/s). Defaults to `0.14`. */
|
|
2986
|
+
driftMax?: number;
|
|
2987
|
+
/**
|
|
2988
|
+
* Flutter strength (radians). Subtle rotation sway as each petal falls.
|
|
2989
|
+
* Defaults to `0.35`.
|
|
2990
|
+
*/
|
|
2991
|
+
flutter?: number;
|
|
2992
|
+
/** Single petal color or palette; multiple entries pick a random color per petal. */
|
|
2993
|
+
color?: ColorRepresentation | ColorRepresentation[];
|
|
2994
|
+
}
|
|
2995
|
+
|
|
2281
2996
|
/**
|
|
2282
2997
|
* Planar UV Mapping
|
|
2283
2998
|
* Projects UVs onto the geometry from a single direction (like shining a projector onto a surface).
|
|
@@ -2336,26 +3051,6 @@ export declare class PotionBottleGeometry extends BufferGeometry {
|
|
|
2336
3051
|
constructor();
|
|
2337
3052
|
}
|
|
2338
3053
|
|
|
2339
|
-
export declare const quadIn: (t: number) => number;
|
|
2340
|
-
|
|
2341
|
-
export declare const quadInOut: (t: number) => number;
|
|
2342
|
-
|
|
2343
|
-
export declare const quadOut: (t: number) => number;
|
|
2344
|
-
|
|
2345
|
-
export declare const quadraticCurve: (t: number, p0: number, p1: number, p2: number) => number;
|
|
2346
|
-
|
|
2347
|
-
export declare const quartIn: (t: number) => number;
|
|
2348
|
-
|
|
2349
|
-
export declare const quartInOut: (t: number) => number;
|
|
2350
|
-
|
|
2351
|
-
export declare const quartOut: (t: number) => number;
|
|
2352
|
-
|
|
2353
|
-
export declare const quintIn: (t: number) => number;
|
|
2354
|
-
|
|
2355
|
-
export declare const quintInOut: (t: number) => number;
|
|
2356
|
-
|
|
2357
|
-
export declare const quintOut: (t: number) => number;
|
|
2358
|
-
|
|
2359
3054
|
/**
|
|
2360
3055
|
* Calculate the radius to achieve a spherical cap height.
|
|
2361
3056
|
* R = r / (1 - cos(thetaLength))
|
|
@@ -2368,18 +3063,230 @@ export declare const radiusFromCapHeight: (height: number, thetaLength: number)
|
|
|
2368
3063
|
*/
|
|
2369
3064
|
export declare const radiusFromCapWidth: (width: number, thetaLength: number) => number;
|
|
2370
3065
|
|
|
3066
|
+
/**
|
|
3067
|
+
* Misty rainfall as instanced vertical streaks.
|
|
3068
|
+
*
|
|
3069
|
+
* Each streak is a thin, gradient-textured quad animated through a bounded
|
|
3070
|
+
* volume. By default streaks fall straight down with no rotation. Optional
|
|
3071
|
+
* {@link RainEffectOptions.windDirection} / {@link RainEffectOptions.windStrength}
|
|
3072
|
+
* tilt streaks **and** drift them horizontally together, so motion matches the
|
|
3073
|
+
* visual angle. Streak materials use `DoubleSide` so thin quads stay visible
|
|
3074
|
+
* from any camera angle. Scene fog dissolves distant streaks when the material's
|
|
3075
|
+
* `fog` flag is enabled.
|
|
3076
|
+
*
|
|
3077
|
+
* **`intensity`** (0–1) scales how many instances draw, how fast they fall, and
|
|
3078
|
+
* their opacity — useful for storm ramps or lightning flashes.
|
|
3079
|
+
*
|
|
3080
|
+
* @example
|
|
3081
|
+
* ```typescript
|
|
3082
|
+
* const rain = new RainEffect({ area: 12, height: 16, intensity: 0.4 });
|
|
3083
|
+
* scene.add(rain);
|
|
3084
|
+
* scene.fog = new Fog(0x0a0a12, 4, 28);
|
|
3085
|
+
*
|
|
3086
|
+
* function animate(delta: number) {
|
|
3087
|
+
* rain.update(delta);
|
|
3088
|
+
* renderer.render(scene, camera);
|
|
3089
|
+
* }
|
|
3090
|
+
* ```
|
|
3091
|
+
*/
|
|
3092
|
+
export declare class RainEffect extends InstancedMesh {
|
|
3093
|
+
/** Rainfall strength (0–1). Adjust at runtime for storm variation. */
|
|
3094
|
+
intensity: number;
|
|
3095
|
+
private readonly maxCount;
|
|
3096
|
+
private readonly area;
|
|
3097
|
+
private readonly height;
|
|
3098
|
+
private readonly groundY;
|
|
3099
|
+
private readonly baseOpacity;
|
|
3100
|
+
private readonly windDirection;
|
|
3101
|
+
private readonly windStrength;
|
|
3102
|
+
private readonly fallDirection;
|
|
3103
|
+
private readonly streakOrientation;
|
|
3104
|
+
private readonly sx;
|
|
3105
|
+
private readonly sz;
|
|
3106
|
+
private readonly topY;
|
|
3107
|
+
private readonly len;
|
|
3108
|
+
private readonly speed;
|
|
3109
|
+
private readonly streakTexture?;
|
|
3110
|
+
private readonly dummy;
|
|
3111
|
+
private clock;
|
|
3112
|
+
constructor(options?: RainEffectOptions);
|
|
3113
|
+
/**
|
|
3114
|
+
* Advance streak positions and refresh instance transforms. Pass elapsed frame
|
|
3115
|
+
* time in seconds (e.g. from `createScene`'s `onFrame` callback).
|
|
3116
|
+
*/
|
|
3117
|
+
update(dt: number): void;
|
|
3118
|
+
/** Release geometry, materials, and the procedural streak texture. */
|
|
3119
|
+
dispose(): this;
|
|
3120
|
+
private applyIntensity;
|
|
3121
|
+
private updateFallDirection;
|
|
3122
|
+
private writeMatrices;
|
|
3123
|
+
}
|
|
3124
|
+
|
|
3125
|
+
export declare interface RainEffectOptions {
|
|
3126
|
+
/** Override the streak quad geometry. Defaults to a thin `PlaneGeometry`. */
|
|
3127
|
+
geometry?: BufferGeometry;
|
|
3128
|
+
/** Override the default streak material. */
|
|
3129
|
+
material?: Material;
|
|
3130
|
+
/** Maximum number of streak instances. Defaults to `1400`. */
|
|
3131
|
+
count?: number;
|
|
3132
|
+
/** Horizontal half-extent of the rainfall area (square centered on the origin). Defaults to `26`. */
|
|
3133
|
+
area?: number;
|
|
3134
|
+
/** Vertical span above `groundY`. Defaults to `22`. */
|
|
3135
|
+
height?: number;
|
|
3136
|
+
/** World Y where streaks recycle. Defaults to `0`. */
|
|
3137
|
+
groundY?: number;
|
|
3138
|
+
/** Streak quad width. Defaults to `0.009`. */
|
|
3139
|
+
width?: number;
|
|
3140
|
+
/** Streak color. Defaults to `#aebfd6`. */
|
|
3141
|
+
color?: ColorRepresentation;
|
|
3142
|
+
/** Base material opacity at full intensity. Defaults to `0.16`. */
|
|
3143
|
+
opacity?: number;
|
|
3144
|
+
/** Minimum streak length. Defaults to `0.18`. */
|
|
3145
|
+
lengthMin?: number;
|
|
3146
|
+
/** Maximum streak length. Defaults to `0.42`. */
|
|
3147
|
+
lengthMax?: number;
|
|
3148
|
+
/** Minimum fall speed (units/s). Defaults to `11`. */
|
|
3149
|
+
speedMin?: number;
|
|
3150
|
+
/** Maximum fall speed (units/s). Defaults to `19`. */
|
|
3151
|
+
speedMax?: number;
|
|
3152
|
+
/**
|
|
3153
|
+
* Horizontal compass direction the wind blows (radians, 0 = +X, π/2 = +Z).
|
|
3154
|
+
* Only used when {@link RainEffectOptions.windStrength} is greater than zero.
|
|
3155
|
+
* Defaults to `0`.
|
|
3156
|
+
*/
|
|
3157
|
+
windDirection?: number;
|
|
3158
|
+
/**
|
|
3159
|
+
* How much rain tilts and drifts from vertical, as `tan(angleFromVertical)`.
|
|
3160
|
+
* `0` = straight down (default). `0.15` ≈ 8.5° lean with matching horizontal drift.
|
|
3161
|
+
*/
|
|
3162
|
+
windStrength?: number;
|
|
3163
|
+
/**
|
|
3164
|
+
* Rainfall strength (0–1). Scales visible instance count, fall speed, and opacity.
|
|
3165
|
+
* Defaults to `0.5`.
|
|
3166
|
+
*/
|
|
3167
|
+
intensity?: number;
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
/**
|
|
3171
|
+
* Grouped exports — same function API, namespace import like {@link Easing}.
|
|
3172
|
+
*
|
|
3173
|
+
* @example
|
|
3174
|
+
* ```ts
|
|
3175
|
+
* import { Random } from "three-low-poly";
|
|
3176
|
+
* const rng = Random.create(deriveSubSeed(1337, 0x101));
|
|
3177
|
+
* ```
|
|
3178
|
+
*/
|
|
3179
|
+
export declare const Random: {
|
|
3180
|
+
readonly create: typeof createRandom;
|
|
3181
|
+
readonly mulberry32: typeof mulberry32;
|
|
3182
|
+
readonly splitmix32: typeof splitmix32;
|
|
3183
|
+
readonly deriveSubSeed: typeof deriveSubSeed;
|
|
3184
|
+
readonly range: typeof randomRange;
|
|
3185
|
+
readonly pick: typeof randomPick;
|
|
3186
|
+
};
|
|
3187
|
+
|
|
2371
3188
|
/**
|
|
2372
3189
|
* Generates a random number between `min` and `max`.
|
|
2373
3190
|
*/
|
|
2374
|
-
export declare function randomFloat(min?: number, max?: number): number;
|
|
3191
|
+
export declare function randomFloat(min?: number, max?: number, source?: RandomSource): number;
|
|
2375
3192
|
|
|
2376
3193
|
/**
|
|
2377
3194
|
* Generates a random integer between `min` and `max`.
|
|
2378
3195
|
*/
|
|
2379
|
-
export declare function randomInteger(min?: number, max?: number): number;
|
|
3196
|
+
export declare function randomInteger(min?: number, max?: number, source?: RandomSource): number;
|
|
3197
|
+
|
|
3198
|
+
/** Pick from a non-empty array using any stream — website `pick()` parity. */
|
|
3199
|
+
export declare function randomPick<T>(stream: RandomStream, arr: readonly T[]): T;
|
|
3200
|
+
|
|
3201
|
+
/** Float in [min, max) from any stream — website `range()` parity. */
|
|
3202
|
+
export declare function randomRange(stream: RandomStream, min: number, max: number): number;
|
|
3203
|
+
|
|
3204
|
+
/**
|
|
3205
|
+
* Random source — a stream plus distribution helpers.
|
|
3206
|
+
* Returned by {@link createRandom}; also accepted by {@link RandomNumberUtils}.
|
|
3207
|
+
*/
|
|
3208
|
+
export declare interface RandomSource {
|
|
3209
|
+
/** `true` when backed by {@link mulberry32}; `false` when using `Math.random()`. */
|
|
3210
|
+
readonly seeded: boolean;
|
|
3211
|
+
/** Next float in [0, 1). */
|
|
3212
|
+
next(): number;
|
|
3213
|
+
/** Float in [min, max). */
|
|
3214
|
+
float(min?: number, max?: number): number;
|
|
3215
|
+
/** Integer in [min, max] (inclusive). */
|
|
3216
|
+
int(min?: number, max?: number): number;
|
|
3217
|
+
/** Uniform element from a non-empty array. */
|
|
3218
|
+
pick<T>(arr: readonly T[]): T;
|
|
3219
|
+
/** `true` with given probability (default 0.5). */
|
|
3220
|
+
boolean(probability?: number): boolean;
|
|
3221
|
+
/**
|
|
3222
|
+
* Skew toward `max`. Lower `exponent` = stronger bias.
|
|
3223
|
+
* Mirrors {@link logarithmicRandomMax}.
|
|
3224
|
+
*/
|
|
3225
|
+
skewMax(exponent?: number, min?: number, max?: number): number;
|
|
3226
|
+
/**
|
|
3227
|
+
* Skew toward `min`. Lower `exponent` = stronger bias.
|
|
3228
|
+
* Mirrors {@link logarithmicRandomMin}.
|
|
3229
|
+
*/
|
|
3230
|
+
skewMin(exponent?: number, min?: number, max?: number): number;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
/**
|
|
3234
|
+
* Randomness for procedural generation — unseeded by default, reproducible on demand.
|
|
3235
|
+
*
|
|
3236
|
+
* ---
|
|
3237
|
+
*
|
|
3238
|
+
* ### Layer 1 — stream primitive (portfolio parity)
|
|
3239
|
+
*
|
|
3240
|
+
* - {@link mulberry32} — fast seeded PRNG; returns a `() => number` closure yielding
|
|
3241
|
+
* floats in `[0, 1)`. Same algorithm as Gotham/Water on the portfolio site.
|
|
3242
|
+
*
|
|
3243
|
+
* ### Seed mixing
|
|
3244
|
+
*
|
|
3245
|
+
* - {@link splitmix32} — mixer only, **not** a stream. Maps one 32-bit value to another.
|
|
3246
|
+
* - {@link deriveSubSeed} — `splitmix32(masterSeed ^ salt)`. Fan one user-facing master
|
|
3247
|
+
* seed into independent sub-streams per subsystem. Use stable hex salts per domain
|
|
3248
|
+
* (`0x101` books, `0x202` fog, `0x303` windows, …) instead of `seed + n` offsets.
|
|
3249
|
+
*
|
|
3250
|
+
* ### Layer 2 — library ergonomics
|
|
3251
|
+
*
|
|
3252
|
+
* - {@link createRandom} — **no seed** → wraps `Math.random()`, unique every runtime
|
|
3253
|
+
* (showcase default). **With seed** → {@link mulberry32} stream, same seed ⇒ same sequence.
|
|
3254
|
+
* - Returns a {@link RandomSource}: `next`, `float`, `int`, `pick`, `boolean`, `skewMax`, `skewMin`.
|
|
3255
|
+
* - {@link Random} namespace — grouped exports, same API as standalone functions (like {@link Easing}).
|
|
3256
|
+
*
|
|
3257
|
+
* ### Layer 3 — {@link RandomNumberUtils}
|
|
3258
|
+
*
|
|
3259
|
+
* Existing helpers (`randomFloat`, `logarithmicRandomMax`, …) accept an optional
|
|
3260
|
+
* {@link RandomSource} as their last argument. Omit it for unseeded default behavior.
|
|
3261
|
+
*
|
|
3262
|
+
* ---
|
|
3263
|
+
*
|
|
3264
|
+
* @example Unique runtime (default)
|
|
3265
|
+
* ```ts
|
|
3266
|
+
* const rng = createRandom();
|
|
3267
|
+
* rng.float(0, 10); // different every page load
|
|
3268
|
+
* ```
|
|
3269
|
+
*
|
|
3270
|
+
* @example Reproducible layout with sub-seeds
|
|
3271
|
+
* ```ts
|
|
3272
|
+
* const master = 1337;
|
|
3273
|
+
* const books = createRandom(deriveSubSeed(master, 0x101));
|
|
3274
|
+
* const fog = createRandom(deriveSubSeed(master, 0x202));
|
|
3275
|
+
* ```
|
|
3276
|
+
*
|
|
3277
|
+
* @example Namespace import
|
|
3278
|
+
* ```ts
|
|
3279
|
+
* const rng = Random.create(deriveSubSeed(1337, 0x101));
|
|
3280
|
+
* ```
|
|
3281
|
+
*/
|
|
3282
|
+
/** Callable stream returning floats in [0, 1). */
|
|
3283
|
+
export declare type RandomStream = () => number;
|
|
2380
3284
|
|
|
2381
3285
|
export declare function randomTransformVertices<T extends BufferGeometry>(geometry: T, axis?: Vector3, minScale?: number, maxScale?: number): T;
|
|
2382
3286
|
|
|
3287
|
+
/** Resolve uniform ring spacing — `cell` wins over the `cellsX` density hint. */
|
|
3288
|
+
export declare function resolveRingLatticeCell(width: number, _height: number, cell?: number, cellsX?: number): number;
|
|
3289
|
+
|
|
2383
3290
|
export declare function rgbToHex(r: number, g: number, b: number): number;
|
|
2384
3291
|
|
|
2385
3292
|
/**
|
|
@@ -2394,6 +3301,84 @@ export declare function rgbToHex(r: number, g: number, b: number): number;
|
|
|
2394
3301
|
*/
|
|
2395
3302
|
export declare function rgbToHsl(r: number, g: number, b: number): [number, number, number];
|
|
2396
3303
|
|
|
3304
|
+
/** Ring-spacing factor — overlap tightens as this approaches 1. */
|
|
3305
|
+
export declare const RING_LATTICE_SPACING_FACTOR = 0.96;
|
|
3306
|
+
|
|
3307
|
+
declare interface RingLatticeFramePartOptions {
|
|
3308
|
+
width: number;
|
|
3309
|
+
height: number;
|
|
3310
|
+
centerY?: number;
|
|
3311
|
+
frameThickness: number;
|
|
3312
|
+
frameDepth: number;
|
|
3313
|
+
}
|
|
3314
|
+
|
|
3315
|
+
export declare interface RingLatticeGrid {
|
|
3316
|
+
/** Requested ring-center spacing before the overlap factor. */
|
|
3317
|
+
cell: number;
|
|
3318
|
+
/** Effective center spacing (`cell × 0.96`). */
|
|
3319
|
+
latticeCell: number;
|
|
3320
|
+
/** Outer half-extent of each square ring profile. */
|
|
3321
|
+
ringOuter: number;
|
|
3322
|
+
/** Ring instance count. */
|
|
3323
|
+
count: number;
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
declare interface RingLatticeSpotOptions {
|
|
3327
|
+
width: number;
|
|
3328
|
+
height: number;
|
|
3329
|
+
centerY?: number;
|
|
3330
|
+
cell: number;
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
/** Ring-center positions overscanning the opening (stencil trims the excess). */
|
|
3334
|
+
export declare function ringLatticeSpots({ width, height, centerY, cell, }: RingLatticeSpotOptions): {
|
|
3335
|
+
spots: [number, number][];
|
|
3336
|
+
grid: RingLatticeGrid;
|
|
3337
|
+
};
|
|
3338
|
+
|
|
3339
|
+
/**
|
|
3340
|
+
* Ring lattice window — overlapping square rings on a uniform grid (diaper /
|
|
3341
|
+
* trellis fretwork), stencil-clipped to a rectangular opening.
|
|
3342
|
+
*/
|
|
3343
|
+
export declare class RingLatticeWindow extends Group {
|
|
3344
|
+
readonly lattice: InstancedMesh;
|
|
3345
|
+
readonly frame: Mesh;
|
|
3346
|
+
readonly glass?: Mesh<PlaneGeometry, MeshPhysicalMaterial>;
|
|
3347
|
+
readonly cell: number;
|
|
3348
|
+
readonly fittedGrid: RingLatticeGrid;
|
|
3349
|
+
private readonly clipPlanesLocal;
|
|
3350
|
+
private readonly clipPlanesWorld;
|
|
3351
|
+
constructor({ width, height, cell: cellOption, cellsX, centerY, ringThickness, ringDepth, frameThickness, frameDepth, latticeColor, glass, glassColor, glassEmissive, glassEmissiveIntensity, }?: RingLatticeWindowOptions);
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
declare interface RingLatticeWindowOptions {
|
|
3355
|
+
/** Opening width (world units). */
|
|
3356
|
+
width?: number;
|
|
3357
|
+
/** Opening height (world units). */
|
|
3358
|
+
height?: number;
|
|
3359
|
+
/** Uniform ring-center spacing. Overrides `cellsX` when set. Defaults to `0.55`. */
|
|
3360
|
+
cell?: number;
|
|
3361
|
+
/** Density hint — `cell = width / cellsX` when `cell` is omitted. */
|
|
3362
|
+
cellsX?: number;
|
|
3363
|
+
/** Wall thickness of each square ring profile. Defaults to `0.05`. */
|
|
3364
|
+
ringThickness?: number;
|
|
3365
|
+
/** Extrusion depth of each ring. Defaults to `0.06`. */
|
|
3366
|
+
ringDepth?: number;
|
|
3367
|
+
/** Outer frame bar thickness. Defaults to `0.055`. */
|
|
3368
|
+
frameThickness?: number;
|
|
3369
|
+
/** Outer frame depth (Z). Defaults to `0.11`. */
|
|
3370
|
+
frameDepth?: number;
|
|
3371
|
+
/** Vertical center of the opening in local space. Defaults to `0`. */
|
|
3372
|
+
centerY?: number;
|
|
3373
|
+
/** Lattice + frame tint. Defaults to `#0c0f14`. */
|
|
3374
|
+
latticeColor?: ColorRepresentation;
|
|
3375
|
+
/** Optional glass pane recessed slightly on −Z. */
|
|
3376
|
+
glass?: boolean;
|
|
3377
|
+
glassColor?: ColorRepresentation;
|
|
3378
|
+
glassEmissive?: ColorRepresentation;
|
|
3379
|
+
glassEmissiveIntensity?: number;
|
|
3380
|
+
}
|
|
3381
|
+
|
|
2397
3382
|
export declare class Rock extends Mesh<RockGeometry, MeshStandardMaterial> {
|
|
2398
3383
|
constructor(radius?: number, widthSegments?: number, heightSegments?: number);
|
|
2399
3384
|
}
|
|
@@ -2421,22 +3406,24 @@ export declare class RoundedHeadstoneGeometry extends BufferGeometry {
|
|
|
2421
3406
|
/**
|
|
2422
3407
|
* Creates a row of books with a given count.
|
|
2423
3408
|
*/
|
|
2424
|
-
export declare function rowOfBooksByCount<T extends Material>({ coverMaterial, pagesMaterial, count, scaleXMin, scaleXMax, scaleYMin, scaleYMax, scaleZMin, scaleZMax, }: RowOfBooksOptions<T>): InstancedMesh;
|
|
3409
|
+
export declare function rowOfBooksByCount<T extends Material>({ coverMaterial, pagesMaterial, count, scaleXMin, scaleXMax, scaleYMin, scaleYMax, scaleZMin, scaleZMax, seed, }: RowOfBooksOptions<T>): InstancedMesh;
|
|
2425
3410
|
|
|
2426
3411
|
/**
|
|
2427
3412
|
* Creates a row of books with a total length.
|
|
2428
3413
|
*/
|
|
2429
|
-
export declare function rowOfBooksByLength<T extends Material>({ coverMaterial, pagesMaterial, length, scaleXMin, scaleXMax, scaleYMin, scaleYMax, scaleZMin, scaleZMax, }: RowOfBooksOptions<T>): InstancedMesh;
|
|
3414
|
+
export declare function rowOfBooksByLength<T extends Material>({ coverMaterial, pagesMaterial, length, scaleXMin, scaleXMax, scaleYMin, scaleYMax, scaleZMin, scaleZMax, seed, }: RowOfBooksOptions<T>): InstancedMesh;
|
|
2430
3415
|
|
|
2431
3416
|
/**
|
|
2432
3417
|
* Creates a row of books from the scales array of Vector3.
|
|
2433
3418
|
*/
|
|
2434
|
-
export declare function rowOfBooksByScales<T extends Material>({ coverMaterial, pagesMaterial, scales, }: RowOfBooksByScalesOptions<T>): InstancedMesh;
|
|
3419
|
+
export declare function rowOfBooksByScales<T extends Material>({ coverMaterial, pagesMaterial, scales, source, }: RowOfBooksByScalesOptions<T>): InstancedMesh;
|
|
2435
3420
|
|
|
2436
3421
|
declare interface RowOfBooksByScalesOptions<T extends Material = Material> {
|
|
2437
3422
|
coverMaterial: T;
|
|
2438
3423
|
pagesMaterial: T;
|
|
2439
3424
|
scales: Vector3[];
|
|
3425
|
+
/** Shared stream for shelf jitter — must be the same source that built `scales`. */
|
|
3426
|
+
source: RandomSource;
|
|
2440
3427
|
}
|
|
2441
3428
|
|
|
2442
3429
|
declare interface RowOfBooksOptions<T extends Material = Material> {
|
|
@@ -2450,6 +3437,8 @@ declare interface RowOfBooksOptions<T extends Material = Material> {
|
|
|
2450
3437
|
scaleYMax?: number;
|
|
2451
3438
|
scaleZMin?: number;
|
|
2452
3439
|
scaleZMax?: number;
|
|
3440
|
+
/** Optional seed for reproducible layout. Omit for unique runtime. */
|
|
3441
|
+
seed?: number;
|
|
2453
3442
|
}
|
|
2454
3443
|
|
|
2455
3444
|
/**
|
|
@@ -2559,6 +3548,9 @@ export declare class SceneTransition {
|
|
|
2559
3548
|
* - Fade: Classic fade through a color (black, white, or custom)
|
|
2560
3549
|
* - Glitch: Digital distortion/glitch effect with heavy artifacts
|
|
2561
3550
|
*
|
|
3551
|
+
* Built-in shader passes for blur and fade are automatically created. For bloom and glitch
|
|
3552
|
+
* effects, you'll need to provide those passes manually.
|
|
3553
|
+
*
|
|
2562
3554
|
* Note: Requires post-processing imports from three/addons
|
|
2563
3555
|
*
|
|
2564
3556
|
* @example
|
|
@@ -2569,12 +3561,22 @@ export declare class SceneTransition {
|
|
|
2569
3561
|
* import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
|
|
2570
3562
|
*
|
|
2571
3563
|
* const composer = new EffectComposer(renderer);
|
|
2572
|
-
* const
|
|
3564
|
+
* const renderPass = new RenderPass(sceneA, camera);
|
|
3565
|
+
* composer.addPass(renderPass);
|
|
2573
3566
|
*
|
|
2574
|
-
*
|
|
2575
|
-
*
|
|
2576
|
-
*
|
|
2577
|
-
*
|
|
3567
|
+
* // Pass ShaderPass to enable built-in blur and fade effects
|
|
3568
|
+
* const sceneTransitionFX = new SceneTransitionFX(renderer, composer, ShaderPass);
|
|
3569
|
+
*
|
|
3570
|
+
* // Blur and fade transitions work out of the box
|
|
3571
|
+
* sceneTransitionFX.blur(sceneA, sceneB, camera, { duration: 2000 });
|
|
3572
|
+
* sceneTransitionFX.fade(sceneA, sceneB, camera, { duration: 2000, color: 0x000000 });
|
|
3573
|
+
*
|
|
3574
|
+
* // For bloom, provide the pass manually
|
|
3575
|
+
* const bloomPass = new UnrealBloomPass(new THREE.Vector2(width, height), 0, 0.4, 0.85);
|
|
3576
|
+
* bloomPass.enabled = false;
|
|
3577
|
+
* composer.addPass(bloomPass);
|
|
3578
|
+
* sceneTransitionFX.setBloomPass(bloomPass);
|
|
3579
|
+
* sceneTransitionFX.bloom(sceneA, sceneB, camera, { duration: 2000, maxBloom: 15.0 });
|
|
2578
3580
|
* ```
|
|
2579
3581
|
*/
|
|
2580
3582
|
export declare class SceneTransitionFX {
|
|
@@ -2600,7 +3602,11 @@ export declare class SceneTransitionFX {
|
|
|
2600
3602
|
private fadeColor;
|
|
2601
3603
|
private onUpdateCallback?;
|
|
2602
3604
|
private onCompleteCallback?;
|
|
2603
|
-
constructor(renderer: THREE.WebGLRenderer, composer: any);
|
|
3605
|
+
constructor(renderer: THREE.WebGLRenderer, composer: any, ShaderPass?: any);
|
|
3606
|
+
/**
|
|
3607
|
+
* Create default shader passes for blur and fade effects
|
|
3608
|
+
*/
|
|
3609
|
+
private createDefaultPasses;
|
|
2604
3610
|
/**
|
|
2605
3611
|
* Set the bloom pass for bloom transitions
|
|
2606
3612
|
*/
|
|
@@ -2709,21 +3715,11 @@ export declare function setRandomInterval(callback: () => void, minDelay: number
|
|
|
2709
3715
|
*/
|
|
2710
3716
|
export declare function setRandomTimeout(callback: () => void, minDelay: number, maxDelay: number): NodeJS.Timeout;
|
|
2711
3717
|
|
|
2712
|
-
export declare const sigmoidCurve: (t: number, a?: number) => number;
|
|
2713
|
-
|
|
2714
|
-
export declare const sineIn: (t: number) => number;
|
|
2715
|
-
|
|
2716
|
-
export declare const sineInOut: (t: number) => number;
|
|
2717
|
-
|
|
2718
|
-
export declare const sineOut: (t: number) => number;
|
|
2719
|
-
|
|
2720
3718
|
/**
|
|
2721
3719
|
* Smooths out the vertices by averaging their positions with neighboring vertices within a given radius.
|
|
2722
3720
|
*/
|
|
2723
3721
|
export declare const smoothBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number) => void;
|
|
2724
3722
|
|
|
2725
|
-
export declare const smoothstep: (t: number) => number;
|
|
2726
|
-
|
|
2727
3723
|
/**
|
|
2728
3724
|
* Convert spherical coordinates to Cartesian coordinates.
|
|
2729
3725
|
* @param {number} radius - The radius of the sphere.
|
|
@@ -2759,14 +3755,89 @@ export declare function sphericalUVMapping(vertices: [number, number, number][])
|
|
|
2759
3755
|
*/
|
|
2760
3756
|
export declare const spikeBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, inward?: boolean, falloffFn?: (distance: number, radius: number) => number) => void;
|
|
2761
3757
|
|
|
3758
|
+
export declare interface SpiralClipOptions extends CameraClipTiming {
|
|
3759
|
+
/** Ground point to look down at (typically scene center, `y = 0`). */
|
|
3760
|
+
target: Vector3;
|
|
3761
|
+
/** Orbit radius at the start of the clip. */
|
|
3762
|
+
radius: number;
|
|
3763
|
+
/** Optional wider radius at the end — pulls back as you rise. Defaults to `radius`. */
|
|
3764
|
+
endRadius?: number;
|
|
3765
|
+
/** Total vertical rise over the clip. */
|
|
3766
|
+
height: number;
|
|
3767
|
+
revolutions: number;
|
|
3768
|
+
ease?: EasingFunction;
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
/**
|
|
3772
|
+
* Turret-style spiral staircase prefab — wraps {@link SpiralStaircaseGeometry}.
|
|
3773
|
+
*/
|
|
3774
|
+
export declare class SpiralStaircase extends Mesh<SpiralStaircaseGeometry, MeshStandardMaterial> {
|
|
3775
|
+
readonly innerRadius: number;
|
|
3776
|
+
readonly width: number;
|
|
3777
|
+
readonly outerRadius: number;
|
|
3778
|
+
readonly treadDepth: number;
|
|
3779
|
+
readonly riserHeight: number;
|
|
3780
|
+
readonly stepCount: number;
|
|
3781
|
+
readonly stepAngle: number;
|
|
3782
|
+
readonly totalHeight: number;
|
|
3783
|
+
readonly totalTurn: number;
|
|
3784
|
+
constructor({ color, ...geometryOptions }?: SpiralStaircaseOptions);
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
/**
|
|
3788
|
+
* Turret-style spiral staircase — trapezoidal treads between an inner newel radius
|
|
3789
|
+
* and an outer wall radius, ascending counter-clockwise when viewed from above.
|
|
3790
|
+
*
|
|
3791
|
+
* Each step is a four-sided tread (no pinched center point). Step angle is
|
|
3792
|
+
* derived from tread depth at the mid-radius so treads meet without overlapping.
|
|
3793
|
+
*/
|
|
2762
3794
|
export declare class SpiralStaircaseGeometry extends BufferGeometry {
|
|
2763
|
-
|
|
3795
|
+
readonly innerRadius: number;
|
|
3796
|
+
readonly width: number;
|
|
3797
|
+
readonly outerRadius: number;
|
|
3798
|
+
readonly treadDepth: number;
|
|
3799
|
+
readonly riserHeight: number;
|
|
3800
|
+
readonly stepCount: number;
|
|
3801
|
+
readonly startAngle: number;
|
|
3802
|
+
readonly stepAngle: number;
|
|
3803
|
+
readonly totalHeight: number;
|
|
3804
|
+
readonly totalTurn: number;
|
|
3805
|
+
constructor({ innerRadius, width, treadDepth, riserHeight, stepCount, startAngle, stepAngle: stepAngleOption, }?: SpiralStaircaseGeometryOptions);
|
|
3806
|
+
}
|
|
3807
|
+
|
|
3808
|
+
export declare interface SpiralStaircaseGeometryOptions {
|
|
3809
|
+
/** Newel / center-hole radius (inner edge of every tread). Defaults to `0.45`. */
|
|
3810
|
+
innerRadius?: number;
|
|
3811
|
+
/** Radial tread width (outer − inner radius). Defaults to `1.95`. */
|
|
3812
|
+
width?: number;
|
|
3813
|
+
/** Arc run per step at the walking line (mid-radius). Defaults to `0.45`. */
|
|
3814
|
+
treadDepth?: number;
|
|
3815
|
+
/** Vertical rise per step (riser). Defaults to `0.2`. */
|
|
3816
|
+
riserHeight?: number;
|
|
3817
|
+
/** Number of steps. Defaults to `20`. */
|
|
3818
|
+
stepCount?: number;
|
|
3819
|
+
/** Spiral start angle in radians (+X = 0, CCW). Defaults to `0`. */
|
|
3820
|
+
startAngle?: number;
|
|
3821
|
+
/** Override step angle (radians). When omitted, derived from `treadDepth`. */
|
|
3822
|
+
stepAngle?: number;
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3825
|
+
export declare interface SpiralStaircaseOptions extends SpiralStaircaseGeometryOptions {
|
|
3826
|
+
/** Tread and riser tint. Defaults to `#8b4513`. */
|
|
3827
|
+
color?: ColorRepresentation;
|
|
2764
3828
|
}
|
|
2765
3829
|
|
|
2766
3830
|
export declare class SpiralTube extends Group {
|
|
2767
3831
|
constructor();
|
|
2768
3832
|
}
|
|
2769
3833
|
|
|
3834
|
+
/**
|
|
3835
|
+
* Seed mixer — maps one 32-bit value to another well-distributed value.
|
|
3836
|
+
* Use with {@link deriveSubSeed}, not as a drop-in stream replacement for
|
|
3837
|
+
* {@link mulberry32}.
|
|
3838
|
+
*/
|
|
3839
|
+
export declare function splitmix32(seed: number): number;
|
|
3840
|
+
|
|
2770
3841
|
export declare class SquareHeadstone extends Mesh<SquareHeadstoneGeometry, MeshStandardMaterial> {
|
|
2771
3842
|
constructor(width?: number, height?: number, depth?: number);
|
|
2772
3843
|
}
|
|
@@ -2775,10 +3846,53 @@ export declare class SquareHeadstoneGeometry extends BufferGeometry {
|
|
|
2775
3846
|
constructor(width?: number, height?: number, depth?: number);
|
|
2776
3847
|
}
|
|
2777
3848
|
|
|
2778
|
-
|
|
3849
|
+
/**
|
|
3850
|
+
* Straight run staircase prefab — {@link StaircaseGeometry} with a wood-tone
|
|
3851
|
+
* default material.
|
|
3852
|
+
*
|
|
3853
|
+
* Local frame: centered on width, rises along +Y, runs along +Z.
|
|
3854
|
+
*/
|
|
3855
|
+
export declare class Staircase extends Mesh<StaircaseGeometry, MeshStandardMaterial> {
|
|
3856
|
+
readonly width: number;
|
|
3857
|
+
readonly riserHeight: number;
|
|
3858
|
+
readonly treadDepth: number;
|
|
3859
|
+
readonly stepCount: number;
|
|
3860
|
+
readonly totalHeight: number;
|
|
3861
|
+
readonly totalDepth: number;
|
|
3862
|
+
constructor({ color, ...geometryOptions }?: StaircaseOptions);
|
|
3863
|
+
}
|
|
2779
3864
|
|
|
3865
|
+
/**
|
|
3866
|
+
* Straight run staircase — open risers and treads (no side stringers yet).
|
|
3867
|
+
*
|
|
3868
|
+
* Local frame: centered on width, rises along +Y, runs along +Z. Each step
|
|
3869
|
+
* emits a front riser (+Z) and a top tread (+Y). UVs are normalized per face
|
|
3870
|
+
* (0–1) so materials can tile per step.
|
|
3871
|
+
*/
|
|
2780
3872
|
export declare class StaircaseGeometry extends BufferGeometry {
|
|
2781
|
-
|
|
3873
|
+
readonly width: number;
|
|
3874
|
+
readonly riserHeight: number;
|
|
3875
|
+
readonly treadDepth: number;
|
|
3876
|
+
readonly stepCount: number;
|
|
3877
|
+
readonly totalHeight: number;
|
|
3878
|
+
readonly totalDepth: number;
|
|
3879
|
+
constructor({ width, riserHeight, treadDepth, stepCount, }?: StaircaseGeometryOptions);
|
|
3880
|
+
}
|
|
3881
|
+
|
|
3882
|
+
export declare interface StaircaseGeometryOptions {
|
|
3883
|
+
/** Stair width (tread left–right extent). Defaults to `2`. */
|
|
3884
|
+
width?: number;
|
|
3885
|
+
/** Vertical rise per step (riser). Defaults to `0.3`. */
|
|
3886
|
+
riserHeight?: number;
|
|
3887
|
+
/** Horizontal run per step (tread depth). Defaults to `0.5`. */
|
|
3888
|
+
treadDepth?: number;
|
|
3889
|
+
/** Number of steps. Defaults to `10`. */
|
|
3890
|
+
stepCount?: number;
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
export declare interface StaircaseOptions extends StaircaseGeometryOptions {
|
|
3894
|
+
/** Tread and riser tint. Defaults to `#8b4513`. */
|
|
3895
|
+
color?: ColorRepresentation;
|
|
2782
3896
|
}
|
|
2783
3897
|
|
|
2784
3898
|
export declare class Stand extends Mesh<StandGeometry, MeshStandardMaterial> {
|
|
@@ -2812,6 +3926,121 @@ export declare class Star extends Mesh {
|
|
|
2812
3926
|
});
|
|
2813
3927
|
}
|
|
2814
3928
|
|
|
3929
|
+
export declare interface StarBurstShapeOptions {
|
|
3930
|
+
/** Burst ray count. Defaults to `4`. */
|
|
3931
|
+
sides?: number;
|
|
3932
|
+
innerRadius?: number;
|
|
3933
|
+
outerRadius?: number;
|
|
3934
|
+
/** Extrusion depth; keep small for flat starbursts. Defaults to `0.05`. */
|
|
3935
|
+
depth?: number;
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
/**
|
|
3939
|
+
* Procedural star field distributed on a spherical shell — intended as an infinite sky dome.
|
|
3940
|
+
*
|
|
3941
|
+
* Stars are placed in world space around the origin. To keep the shell centered on the
|
|
3942
|
+
* viewer, add this object to the **scene** (not the camera) and copy the camera position
|
|
3943
|
+
* every frame. Parenting to the camera is not supported: Three.js does not render
|
|
3944
|
+
* objects attached to the active camera.
|
|
3945
|
+
*
|
|
3946
|
+
* **Styles**
|
|
3947
|
+
*
|
|
3948
|
+
* - `points` — lightweight `Points` sprites using a canvas starburst texture.
|
|
3949
|
+
* - `burst` — instanced 3D starbursts ({@link BurstGeometry}) that face the shell center.
|
|
3950
|
+
* Uses `DoubleSide` so stars remain visible when the camera sits inside the shell.
|
|
3951
|
+
*
|
|
3952
|
+
* **Sizing** — `sizeMin` / `sizeMax` are angular extents (radians at unit distance),
|
|
3953
|
+
* multiplied by each star's distance from the origin so stars look similar regardless
|
|
3954
|
+
* of shell depth (`minRadius`–`maxRadius`).
|
|
3955
|
+
*
|
|
3956
|
+
* **Rendering** — `frustumCulled` is disabled and materials use `depthWrite: false` so
|
|
3957
|
+
* the field draws reliably as a background layer. For per-star color variation in burst
|
|
3958
|
+
* mode, colors are written via `InstancedMesh.setColorAt`, not `vertexColors` on the
|
|
3959
|
+
* base material.
|
|
3960
|
+
*
|
|
3961
|
+
* @example
|
|
3962
|
+
* ```typescript
|
|
3963
|
+
* const stars = new StarFieldEffect({
|
|
3964
|
+
* style: "burst",
|
|
3965
|
+
* count: 2500,
|
|
3966
|
+
* radius: 480,
|
|
3967
|
+
* twinkle: true,
|
|
3968
|
+
* });
|
|
3969
|
+
*
|
|
3970
|
+
* scene.add(stars);
|
|
3971
|
+
*
|
|
3972
|
+
* function animate() {
|
|
3973
|
+
* stars.position.copy(camera.position); // sky dome follows the viewer
|
|
3974
|
+
* stars.update(); // no-op when twinkle is false
|
|
3975
|
+
* renderer.render(scene, camera);
|
|
3976
|
+
* }
|
|
3977
|
+
* ```
|
|
3978
|
+
*
|
|
3979
|
+
* Call {@link dispose} when removing the effect to free geometry, materials, and the
|
|
3980
|
+
* points sprite texture.
|
|
3981
|
+
*/
|
|
3982
|
+
export declare class StarFieldEffect extends Object3D {
|
|
3983
|
+
readonly style: "points" | "burst";
|
|
3984
|
+
private readonly field;
|
|
3985
|
+
private readonly twinkle;
|
|
3986
|
+
private readonly baseSize;
|
|
3987
|
+
private readonly baseScales?;
|
|
3988
|
+
private readonly twinklePhases?;
|
|
3989
|
+
private spriteTexture?;
|
|
3990
|
+
private readonly dummy;
|
|
3991
|
+
constructor(options?: StarFieldEffectOptions);
|
|
3992
|
+
get drawable(): Points | InstancedMesh;
|
|
3993
|
+
get geometry(): BufferGeometry;
|
|
3994
|
+
get material(): Material | Material[];
|
|
3995
|
+
/** Release GPU resources held by the field (and sprite texture, if any). */
|
|
3996
|
+
dispose(): void;
|
|
3997
|
+
/**
|
|
3998
|
+
* Animate twinkling. No-op when `twinkle` is `false`.
|
|
3999
|
+
*
|
|
4000
|
+
* Points style modulates sprite size; burst style pulses each instance scale with
|
|
4001
|
+
* a per-star phase offset. Pass elapsed time in seconds (defaults to `performance.now()`).
|
|
4002
|
+
*/
|
|
4003
|
+
update(elapsed?: number): void;
|
|
4004
|
+
private createPointsField;
|
|
4005
|
+
private createBurstField;
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
export declare interface StarFieldEffectOptions {
|
|
4009
|
+
/**
|
|
4010
|
+
* Rendering style.
|
|
4011
|
+
*
|
|
4012
|
+
* - `points` (default) — billboard sprites with a procedural starburst texture
|
|
4013
|
+
* (not the default square `Points` marker).
|
|
4014
|
+
* - `burst` — instanced {@link BurstGeometry} meshes oriented toward the shell center.
|
|
4015
|
+
*/
|
|
4016
|
+
style?: "points" | "burst";
|
|
4017
|
+
/** Shape parameters for both styles; `burst` uses them for geometry, `points` for the sprite. */
|
|
4018
|
+
burst?: StarBurstShapeOptions;
|
|
4019
|
+
/** Override the burst mesh geometry (`style: "burst"` only). */
|
|
4020
|
+
geometry?: BufferGeometry;
|
|
4021
|
+
/** Override the default field material. */
|
|
4022
|
+
material?: Material;
|
|
4023
|
+
/** Number of stars. Defaults to `1500`. */
|
|
4024
|
+
count?: number;
|
|
4025
|
+
/** Shell radius when `minRadius` / `maxRadius` are omitted. Defaults to `500`. */
|
|
4026
|
+
radius?: number;
|
|
4027
|
+
/** Inner shell radius. Defaults to `radius`. */
|
|
4028
|
+
minRadius?: number;
|
|
4029
|
+
/** Outer shell radius. Defaults to `radius`. */
|
|
4030
|
+
maxRadius?: number;
|
|
4031
|
+
/**
|
|
4032
|
+
* Minimum angular size (radians at 1 unit distance). Scaled by each star's shell distance
|
|
4033
|
+
* so apparent size stays consistent. Defaults to `0.008`.
|
|
4034
|
+
*/
|
|
4035
|
+
sizeMin?: number;
|
|
4036
|
+
/** Maximum angular size. Defaults to `0.025`. */
|
|
4037
|
+
sizeMax?: number;
|
|
4038
|
+
/** Single color or palette; multiple entries pick a random color per star. */
|
|
4039
|
+
color?: ColorRepresentation | ColorRepresentation[];
|
|
4040
|
+
/** Enable pulsing brightness; call {@link StarFieldEffect.update} each frame when `true`. */
|
|
4041
|
+
twinkle?: boolean;
|
|
4042
|
+
}
|
|
4043
|
+
|
|
2815
4044
|
/**
|
|
2816
4045
|
* Extrude geometry of Star Shape.
|
|
2817
4046
|
*/
|
|
@@ -2864,8 +4093,22 @@ export declare class TestTubeGeometry extends BufferGeometry {
|
|
|
2864
4093
|
constructor(radiusTop?: number, radiusBottom?: number, height?: number, segments?: number, openEnded?: boolean);
|
|
2865
4094
|
}
|
|
2866
4095
|
|
|
4096
|
+
/**
|
|
4097
|
+
* Wooden rack with instanced test tubes and emissive liquid fills.
|
|
4098
|
+
*
|
|
4099
|
+
* Glass shells use `DoubleSide` and `depthWrite: false`; liquid draws first
|
|
4100
|
+
* (`renderOrder` 1), glass second (`renderOrder` 2) so fills stay visible at
|
|
4101
|
+
* most camera angles.
|
|
4102
|
+
*/
|
|
2867
4103
|
export declare class TestTubeRack extends Group {
|
|
2868
|
-
constructor(count?: number, colors?:
|
|
4104
|
+
constructor(count?: number, colors?: ColorRepresentation[]);
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
export declare interface TestTubeRackOptions {
|
|
4108
|
+
/** Number of tubes. Defaults to `3`. */
|
|
4109
|
+
count?: number;
|
|
4110
|
+
/** Liquid color per tube; cycles when fewer entries than tubes. */
|
|
4111
|
+
colors?: ColorRepresentation[];
|
|
2869
4112
|
}
|
|
2870
4113
|
|
|
2871
4114
|
/**
|
|
@@ -2958,6 +4201,107 @@ export declare function updateNoiseDisplacementTime<T extends Material>(material
|
|
|
2958
4201
|
*/
|
|
2959
4202
|
export declare function updateWaterDisplacementTime<T extends Material>(material: T, deltaTime: number): void;
|
|
2960
4203
|
|
|
4204
|
+
/**
|
|
4205
|
+
* Wall-mounted oil-lamp sconce — iron mount and cap/bowl frame around an
|
|
4206
|
+
* emissive glass chimney. Pair {@link GlowHalo} and {@link FlameFlickerEffect}
|
|
4207
|
+
* at `(lightCenterX, lightCenterY, lightCenterZ)` for bloom and flicker.
|
|
4208
|
+
*
|
|
4209
|
+
* Local frame: faces +X from a −X wall.
|
|
4210
|
+
*/
|
|
4211
|
+
export declare class WallSconce extends Mesh<WallSconceGeometry, MeshStandardMaterial[]> {
|
|
4212
|
+
readonly lightCenterX: number;
|
|
4213
|
+
readonly lightCenterY: number;
|
|
4214
|
+
readonly lightCenterZ: number;
|
|
4215
|
+
constructor({ color, mountColor, frameColor, lampColor, lampEmissiveIntensity, lampOpacity, inner, ...geometryOptions }?: WallSconceOptions);
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
/**
|
|
4219
|
+
* Wall-mounted oil-lamp sconce — iron mount, cap, and bowl framing an emissive
|
|
4220
|
+
* glass chimney.
|
|
4221
|
+
*
|
|
4222
|
+
* Material groups: `0` mount (plate + bracket), `1` iron frame (cap + bowl),
|
|
4223
|
+
* `2` glass chimney.
|
|
4224
|
+
*
|
|
4225
|
+
* Local frame: faces +X from a −X wall; lamp center at
|
|
4226
|
+
* `(bodyOffsetX, chimneyCenterY, 0)`.
|
|
4227
|
+
*/
|
|
4228
|
+
export declare class WallSconceGeometry extends BufferGeometry {
|
|
4229
|
+
readonly bodyOffsetX: number;
|
|
4230
|
+
readonly chimneyCenterY: number;
|
|
4231
|
+
readonly innerScale: number;
|
|
4232
|
+
readonly inner: boolean;
|
|
4233
|
+
readonly lightCenterX: number;
|
|
4234
|
+
readonly lightCenterY: number;
|
|
4235
|
+
readonly lightCenterZ: number;
|
|
4236
|
+
constructor({ plateThickness, plateHeight, plateDepth, plateOffsetX, bracketLength, bracketHeight, bracketDepth, bracketOffsetX, bracketOffsetY, bodyOffsetX, chimneyHeight, chimneyTopRadius, chimneyBottomRadius, chimneyCenterY, capRadius, capHeight, capCenterY, bowlTopRadius, bowlBottomRadius, bowlHeight, bowlCenterY, radialSegments, innerScale, inner, }?: WallSconceGeometryOptions);
|
|
4237
|
+
}
|
|
4238
|
+
|
|
4239
|
+
export declare interface WallSconceGeometryOptions {
|
|
4240
|
+
/** Wall-plate thickness (X). Defaults to `0.05`. */
|
|
4241
|
+
plateThickness?: number;
|
|
4242
|
+
/** Wall-plate height (Y). Defaults to `0.22`. */
|
|
4243
|
+
plateHeight?: number;
|
|
4244
|
+
/** Wall-plate depth (Z). Defaults to `0.28`. */
|
|
4245
|
+
plateDepth?: number;
|
|
4246
|
+
/** Wall-plate center X (negative = into the wall). Defaults to `-0.055`. */
|
|
4247
|
+
plateOffsetX?: number;
|
|
4248
|
+
/** Bracket length into the room (X). Defaults to `0.1`. */
|
|
4249
|
+
bracketLength?: number;
|
|
4250
|
+
/** Bracket height (Y). Defaults to `0.05`. */
|
|
4251
|
+
bracketHeight?: number;
|
|
4252
|
+
/** Bracket depth (Z). Defaults to `0.07`. */
|
|
4253
|
+
bracketDepth?: number;
|
|
4254
|
+
/** Bracket center X. Defaults to `-0.005`. */
|
|
4255
|
+
bracketOffsetX?: number;
|
|
4256
|
+
/** Bracket center Y. Defaults to `0.1`. */
|
|
4257
|
+
bracketOffsetY?: number;
|
|
4258
|
+
/** Chimney / lamp body center X. Defaults to `0.06`. */
|
|
4259
|
+
bodyOffsetX?: number;
|
|
4260
|
+
/** Chimney height. Defaults to `0.3`. */
|
|
4261
|
+
chimneyHeight?: number;
|
|
4262
|
+
/** Chimney top radius. Defaults to `0.1`. */
|
|
4263
|
+
chimneyTopRadius?: number;
|
|
4264
|
+
/** Chimney bottom radius. Defaults to `0.105`. */
|
|
4265
|
+
chimneyBottomRadius?: number;
|
|
4266
|
+
/** Chimney center Y. Defaults to `-0.05`. */
|
|
4267
|
+
chimneyCenterY?: number;
|
|
4268
|
+
/** Cap radius. Defaults to `0.115`. */
|
|
4269
|
+
capRadius?: number;
|
|
4270
|
+
/** Cap height. Defaults to `0.05`. */
|
|
4271
|
+
capHeight?: number;
|
|
4272
|
+
/** Cap center Y. Defaults to `0.12`. */
|
|
4273
|
+
capCenterY?: number;
|
|
4274
|
+
/** Bowl top radius. Defaults to `0.09`. */
|
|
4275
|
+
bowlTopRadius?: number;
|
|
4276
|
+
/** Bowl bottom radius. Defaults to `0.11`. */
|
|
4277
|
+
bowlBottomRadius?: number;
|
|
4278
|
+
/** Bowl height. Defaults to `0.05`. */
|
|
4279
|
+
bowlHeight?: number;
|
|
4280
|
+
/** Bowl center Y. Defaults to `-0.22`. */
|
|
4281
|
+
bowlCenterY?: number;
|
|
4282
|
+
/** Radial segments on cylinders. Defaults to `8`. */
|
|
4283
|
+
radialSegments?: number;
|
|
4284
|
+
/** Glass chimney scale relative to the frame opening. Defaults to `0.96`. */
|
|
4285
|
+
innerScale?: number;
|
|
4286
|
+
/** Include the emissive glass chimney. Defaults to `true`. */
|
|
4287
|
+
inner?: boolean;
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
export declare interface WallSconceOptions extends WallSconceGeometryOptions {
|
|
4291
|
+
/** Wrought-iron tint for mount and frame. Defaults to `#1c1e24`. */
|
|
4292
|
+
color?: ColorRepresentation;
|
|
4293
|
+
/** Mount iron tint (plate + bracket). Defaults to `color`. */
|
|
4294
|
+
mountColor?: ColorRepresentation;
|
|
4295
|
+
/** Frame iron tint (cap + bowl). Defaults to `color`. */
|
|
4296
|
+
frameColor?: ColorRepresentation;
|
|
4297
|
+
/** Glass chimney tint. Defaults to `#e8a058`. */
|
|
4298
|
+
lampColor?: ColorRepresentation;
|
|
4299
|
+
/** Glass emissive strength. Defaults to `1.4`. */
|
|
4300
|
+
lampEmissiveIntensity?: number;
|
|
4301
|
+
/** Glass opacity. Defaults to `0.88`. */
|
|
4302
|
+
lampOpacity?: number;
|
|
4303
|
+
}
|
|
4304
|
+
|
|
2961
4305
|
export declare class WineBottle extends Mesh<WineBottleGeometry, MeshPhysicalMaterial> {
|
|
2962
4306
|
constructor();
|
|
2963
4307
|
}
|
|
@@ -2972,6 +4316,94 @@ export declare class WineBottleGeometry extends BufferGeometry {
|
|
|
2972
4316
|
});
|
|
2973
4317
|
}
|
|
2974
4318
|
|
|
4319
|
+
/**
|
|
4320
|
+
* Will-o'-the-wisps drifting through a bounded volume — eerie green orbs that
|
|
4321
|
+
* bob around spawn points with a pulsing point light. Ported from the portfolio
|
|
4322
|
+
* graveyard scene.
|
|
4323
|
+
*
|
|
4324
|
+
* @example
|
|
4325
|
+
* ```ts
|
|
4326
|
+
* const wisps = new WispEffect({ count: 3 });
|
|
4327
|
+
* scene.add(wisps);
|
|
4328
|
+
* onFrame((dt) => wisps.update(dt));
|
|
4329
|
+
* ```
|
|
4330
|
+
*/
|
|
4331
|
+
export declare class WispEffect extends Object3D {
|
|
4332
|
+
private readonly wisps;
|
|
4333
|
+
private readonly orbGeometry;
|
|
4334
|
+
private readonly orbMaterial;
|
|
4335
|
+
private readonly halfWidth;
|
|
4336
|
+
private readonly depth;
|
|
4337
|
+
private readonly heightMin;
|
|
4338
|
+
private readonly heightMax;
|
|
4339
|
+
private readonly driftX;
|
|
4340
|
+
private readonly driftY;
|
|
4341
|
+
private readonly driftZ;
|
|
4342
|
+
private readonly speedMin;
|
|
4343
|
+
private readonly speedMax;
|
|
4344
|
+
private readonly castLight;
|
|
4345
|
+
private readonly lightDistance;
|
|
4346
|
+
private readonly lightDecay;
|
|
4347
|
+
private readonly lightIntensity;
|
|
4348
|
+
private readonly lightPulseAmplitude;
|
|
4349
|
+
private readonly lightPulseSpeed;
|
|
4350
|
+
private elapsed;
|
|
4351
|
+
constructor({ count, width, depth, heightMin, heightMax, color, orbRadius, driftX, driftY, driftZ, speedMin, speedMax, castLight, lightDistance, lightDecay, lightIntensity, lightPulseAmplitude, lightPulseSpeed, }?: WispEffectOptions);
|
|
4352
|
+
update(dt: number): void;
|
|
4353
|
+
dispose(): void;
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
export declare interface WispEffectOptions {
|
|
4357
|
+
/** Number of drifting wisps. Defaults to `3`. */
|
|
4358
|
+
count?: number;
|
|
4359
|
+
/** Horizontal spawn extent (world units, centered on the effect). Defaults to `16`. */
|
|
4360
|
+
width?: number;
|
|
4361
|
+
/** Depth spawn maximum (world units, from z = 0). Defaults to `8`. */
|
|
4362
|
+
depth?: number;
|
|
4363
|
+
/** Minimum spawn height. Defaults to `1`. */
|
|
4364
|
+
heightMin?: number;
|
|
4365
|
+
/** Maximum spawn height. Defaults to `2`. */
|
|
4366
|
+
heightMax?: number;
|
|
4367
|
+
/** Wisp tint. Defaults to `0x6dffb0` (portfolio graveyard). */
|
|
4368
|
+
color?: ColorRepresentation;
|
|
4369
|
+
/** Orb radius. Defaults to `0.08`. */
|
|
4370
|
+
orbRadius?: number;
|
|
4371
|
+
/** Horizontal drift radius (X). Defaults to `1.6`. */
|
|
4372
|
+
driftX?: number;
|
|
4373
|
+
/** Vertical drift radius (Y). Defaults to `0.3`. */
|
|
4374
|
+
driftY?: number;
|
|
4375
|
+
/** Depth drift radius (Z). Defaults to `1.6`. */
|
|
4376
|
+
driftZ?: number;
|
|
4377
|
+
/** Minimum motion speed multiplier. Defaults to `0.3`. */
|
|
4378
|
+
speedMin?: number;
|
|
4379
|
+
/** Maximum motion speed multiplier. Defaults to `0.7`. */
|
|
4380
|
+
speedMax?: number;
|
|
4381
|
+
/**
|
|
4382
|
+
* Attach a {@link PointLight} per wisp (keep `count` low).
|
|
4383
|
+
* Defaults to `true` to match the portfolio graveyard.
|
|
4384
|
+
*/
|
|
4385
|
+
castLight?: boolean;
|
|
4386
|
+
/** Point light distance when `castLight`. Defaults to `6`. */
|
|
4387
|
+
lightDistance?: number;
|
|
4388
|
+
/** Point light decay when `castLight`. Defaults to `2`. */
|
|
4389
|
+
lightDecay?: number;
|
|
4390
|
+
/**
|
|
4391
|
+
* Light intensity = `lightIntensity + sin(t * lightPulseSpeed) * lightPulseAmplitude`.
|
|
4392
|
+
* Defaults to `2.5`.
|
|
4393
|
+
*/
|
|
4394
|
+
lightIntensity?: number;
|
|
4395
|
+
/** Defaults to `1.2`. */
|
|
4396
|
+
lightPulseAmplitude?: number;
|
|
4397
|
+
/** Defaults to `3`. */
|
|
4398
|
+
lightPulseSpeed?: number;
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4401
|
+
export declare interface WobbleClipOptions extends CameraClipTiming {
|
|
4402
|
+
/** Peak positional shake in world units. */
|
|
4403
|
+
intensity: number;
|
|
4404
|
+
ease?: EasingFunction;
|
|
4405
|
+
}
|
|
4406
|
+
|
|
2975
4407
|
export declare class WroughtIronBar extends Mesh<WroughtIronBarGeometry, MeshStandardMaterial> {
|
|
2976
4408
|
constructor({ barHeight, //
|
|
2977
4409
|
barRadius, spikeHeight, spikeRadius, spikeScaleZ, radialSegments, }?: {
|
|
@@ -3033,4 +4465,11 @@ export declare class WroughtIronFenceGeometry extends BufferGeometry {
|
|
|
3033
4465
|
});
|
|
3034
4466
|
}
|
|
3035
4467
|
|
|
4468
|
+
export declare interface ZoomClipOptions extends CameraClipTiming {
|
|
4469
|
+
target: Vector3;
|
|
4470
|
+
/** Narrower FOV at the end of the clip (e.g. `35` from `75`). */
|
|
4471
|
+
endFov: number;
|
|
4472
|
+
ease?: EasingFunction;
|
|
4473
|
+
}
|
|
4474
|
+
|
|
3036
4475
|
export { }
|