@react-three/drei 11.0.0-alpha.4 → 11.0.0-alpha.6
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 +17 -1
- package/core/index.d.mts +249 -108
- package/core/index.d.ts +249 -108
- package/core/index.mjs +919 -692
- package/experimental/index.d.mts +24 -4
- package/experimental/index.d.ts +24 -4
- package/experimental/index.mjs +1 -0
- package/external/index.d.mts +42 -6
- package/external/index.d.ts +42 -6
- package/external/index.mjs +4 -4
- package/index.d.mts +266 -110
- package/index.d.ts +266 -110
- package/index.mjs +920 -693
- package/legacy/index.d.mts +344 -142
- package/legacy/index.d.ts +344 -142
- package/legacy/index.mjs +1536 -803
- package/native/index.d.mts +385 -489
- package/native/index.d.ts +385 -489
- package/native/index.mjs +2047 -2434
- package/package.json +8 -9
- package/webgpu/index.d.mts +416 -332
- package/webgpu/index.d.ts +416 -332
- package/webgpu/index.mjs +2273 -1880
package/core/index.d.mts
CHANGED
|
@@ -3,13 +3,12 @@ import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, CSSPropertie
|
|
|
3
3
|
import * as _react_three_fiber from '@react-three/fiber';
|
|
4
4
|
import { ThreeElements, ReactThreeFiber, ThreeElement, Vector2, Vector3, ThreeEvent, Color as Color$1, ObjectMap, ComputeFunction, Euler } from '@react-three/fiber';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
|
-
import { MeshStandardMaterial, Texture as Texture$1, Matrix4, Color, ColorRepresentation, Fog, FogExp2, WebGLCubeRenderTarget, CubeCamera as CubeCamera$1, OrthographicCamera as OrthographicCamera$1, PerspectiveCamera as PerspectiveCamera$1, Event, Camera, Material, Vector3 as Vector3$1, Group, Object3D, LOD, Mesh, ExtrudeGeometry, PositionalAudio as PositionalAudio$1, AnimationClip, AnimationMixer, AnimationAction, BufferGeometry, BufferAttribute, InstancedMesh as InstancedMesh$1, InstancedBufferAttribute, DepthTexture, CubeTexture as CubeTexture$1, Raycaster, Intersection, RenderTargetOptions, Box3, Sphere as Sphere$1, Loader as Loader$1, ColorSpace, Scene, PlaneGeometry, MeshBasicMaterial } from 'three';
|
|
6
|
+
import { MeshStandardMaterial, Texture as Texture$1, Matrix4, Color, ColorRepresentation, Fog, FogExp2, WebGLCubeRenderTarget, CubeCamera as CubeCamera$1, OrthographicCamera as OrthographicCamera$1, PerspectiveCamera as PerspectiveCamera$1, Event, EventDispatcher, Camera, Material, Vector3 as Vector3$1, Group, Object3D, LOD, Mesh, ExtrudeGeometry, PositionalAudio as PositionalAudio$1, AnimationClip, AnimationMixer, AnimationAction, BufferGeometry, BufferAttribute, InstancedMesh as InstancedMesh$1, InstancedBufferAttribute, DepthTexture, CubeTexture as CubeTexture$1, Raycaster, Intersection, RenderTargetOptions, Box3, Sphere as Sphere$1, Loader as Loader$1, ColorSpace, Scene, PlaneGeometry, MeshBasicMaterial } from 'three';
|
|
7
|
+
import { MeshBVHUniformStruct } from 'three-mesh-bvh';
|
|
7
8
|
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
|
|
8
9
|
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
|
|
9
10
|
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
10
11
|
import { ArcballControls as ArcballControls$1 } from 'three/examples/jsm/controls/ArcballControls.js';
|
|
11
|
-
import { DeviceOrientationControls as DeviceOrientationControls$1 } from 'three-stdlib';
|
|
12
|
-
import { DragConfig } from '@use-gesture/react';
|
|
13
12
|
import { FirstPersonControls as FirstPersonControls$1 } from 'three/examples/jsm/controls/FirstPersonControls.js';
|
|
14
13
|
import { FlyControls as FlyControls$1 } from 'three/examples/jsm/controls/FlyControls.js';
|
|
15
14
|
import * as zustand from 'zustand';
|
|
@@ -28,6 +27,7 @@ import { Falsey, Assign } from 'utility-types';
|
|
|
28
27
|
import * as hls_js from 'hls.js';
|
|
29
28
|
import hls_js__default from 'hls.js';
|
|
30
29
|
import { GLTFLoader, GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
30
|
+
import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
|
|
31
31
|
import * as detect_gpu from 'detect-gpu';
|
|
32
32
|
import { GetGPUTier } from 'detect-gpu';
|
|
33
33
|
import Stats$1 from 'stats-gl';
|
|
@@ -186,12 +186,31 @@ declare module '@react-three/fiber' {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
declare module '@react-three/fiber' {
|
|
190
|
+
interface ThreeElements {
|
|
191
|
+
meshRefractionMaterial_: ThreeElements['shaderMaterial'] & {
|
|
192
|
+
envMap?: THREE.CubeTexture | THREE.Texture | null;
|
|
193
|
+
bounces?: number;
|
|
194
|
+
ior?: number;
|
|
195
|
+
correctMips?: boolean;
|
|
196
|
+
aberrationStrength?: number;
|
|
197
|
+
fresnel?: number;
|
|
198
|
+
bvh?: MeshBVHUniformStruct;
|
|
199
|
+
color?: ReactThreeFiber.Color;
|
|
200
|
+
opacity?: number;
|
|
201
|
+
resolution?: [number, number] | THREE.Vector2;
|
|
202
|
+
viewMatrixInverse?: THREE.Matrix4;
|
|
203
|
+
projectionMatrixInverse?: THREE.Matrix4;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
189
208
|
declare module '@react-three/fiber' {
|
|
190
209
|
interface ThreeElements {
|
|
191
210
|
portalMaterialImpl: ThreeElements['shaderMaterial'] & {
|
|
192
211
|
resolution: ReactThreeFiber.Vector2;
|
|
193
|
-
blur
|
|
194
|
-
blend
|
|
212
|
+
blur?: number;
|
|
213
|
+
blend?: number;
|
|
195
214
|
size?: number;
|
|
196
215
|
sdf?: THREE.Texture;
|
|
197
216
|
map?: THREE.Texture;
|
|
@@ -258,8 +277,8 @@ declare module '@react-three/fiber' {
|
|
|
258
277
|
}
|
|
259
278
|
declare class SegmentObject {
|
|
260
279
|
color: THREE.Color;
|
|
261
|
-
start
|
|
262
|
-
end
|
|
280
|
+
start?: THREE.Vector3;
|
|
281
|
+
end?: THREE.Vector3;
|
|
263
282
|
constructor();
|
|
264
283
|
}
|
|
265
284
|
|
|
@@ -313,6 +332,34 @@ type ArcballControlsProps = Omit<Overwrite<ThreeElement<typeof ArcballControls$1
|
|
|
313
332
|
}>, 'ref' | 'args'>;
|
|
314
333
|
declare const ArcballControls: ForwardRefComponent<ArcballControlsProps, ArcballControls$1>;
|
|
315
334
|
|
|
335
|
+
interface StandardControlsEventMap {
|
|
336
|
+
change: {};
|
|
337
|
+
start: {};
|
|
338
|
+
end: {};
|
|
339
|
+
}
|
|
340
|
+
declare class DeviceOrientationControls$1 extends EventDispatcher<StandardControlsEventMap> {
|
|
341
|
+
object: Camera;
|
|
342
|
+
private changeEvent;
|
|
343
|
+
private EPS;
|
|
344
|
+
enabled: boolean;
|
|
345
|
+
deviceOrientation: Partial<DeviceOrientationEvent>;
|
|
346
|
+
screenOrientation: string | number;
|
|
347
|
+
alphaOffset: number;
|
|
348
|
+
constructor(object: Camera);
|
|
349
|
+
private onDeviceOrientationChangeEvent;
|
|
350
|
+
private onScreenOrientationChangeEvent;
|
|
351
|
+
private zee;
|
|
352
|
+
private euler;
|
|
353
|
+
private q0;
|
|
354
|
+
private q1;
|
|
355
|
+
private setObjectQuaternion;
|
|
356
|
+
connect: () => void;
|
|
357
|
+
disconnect: () => void;
|
|
358
|
+
private lastQuaternion;
|
|
359
|
+
update: () => void;
|
|
360
|
+
dispose: () => void;
|
|
361
|
+
}
|
|
362
|
+
|
|
316
363
|
type DeviceOrientationControlsProps = Omit<ThreeElement<typeof DeviceOrientationControls$1>, 'ref' | 'args'> & {
|
|
317
364
|
camera?: THREE.Camera;
|
|
318
365
|
onChange?: (e?: THREE.Event) => void;
|
|
@@ -320,6 +367,10 @@ type DeviceOrientationControlsProps = Omit<ThreeElement<typeof DeviceOrientation
|
|
|
320
367
|
};
|
|
321
368
|
declare const DeviceOrientationControls: ForwardRefComponent<DeviceOrientationControlsProps, DeviceOrientationControls$1>;
|
|
322
369
|
|
|
370
|
+
type DragConfig = {
|
|
371
|
+
threshold?: number;
|
|
372
|
+
filterTaps?: boolean;
|
|
373
|
+
};
|
|
323
374
|
type DragControlsProps = {
|
|
324
375
|
autoTransform?: boolean;
|
|
325
376
|
matrix?: THREE.Matrix4;
|
|
@@ -479,6 +530,7 @@ type ScrollControlsProps = {
|
|
|
479
530
|
maxSpeed?: number;
|
|
480
531
|
prepend?: boolean;
|
|
481
532
|
enabled?: boolean;
|
|
533
|
+
pixelPerfect?: boolean;
|
|
482
534
|
style?: React.CSSProperties;
|
|
483
535
|
children: React.ReactNode;
|
|
484
536
|
};
|
|
@@ -495,9 +547,10 @@ type ScrollControlsState = {
|
|
|
495
547
|
range(from: number, distance: number, margin?: number): number;
|
|
496
548
|
curve(from: number, distance: number, margin?: number): number;
|
|
497
549
|
visible(from: number, distance: number, margin?: number): boolean;
|
|
550
|
+
pixelPerfect: boolean;
|
|
498
551
|
};
|
|
499
552
|
declare function useScroll(): ScrollControlsState;
|
|
500
|
-
declare function ScrollControls({ eps, enabled, infinite, horizontal, pages, distance, damping, maxSpeed, prepend, style, children, }: ScrollControlsProps): React.JSX.Element;
|
|
553
|
+
declare function ScrollControls({ eps, enabled, infinite, horizontal, pages, distance, damping, maxSpeed, prepend, pixelPerfect, style, children, }: ScrollControlsProps): React.JSX.Element;
|
|
501
554
|
interface ScrollPropsWithFalseHtml {
|
|
502
555
|
children?: React.ReactNode;
|
|
503
556
|
html?: false;
|
|
@@ -569,6 +622,7 @@ type CloudsProps = Omit<ThreeElements['group'], 'ref'> & {
|
|
|
569
622
|
frustumCulled?: boolean;
|
|
570
623
|
};
|
|
571
624
|
type CloudProps = Omit<ThreeElements['group'], 'ref'> & {
|
|
625
|
+
materialFactory?: (baseMaterial: typeof Material) => Material;
|
|
572
626
|
seed?: number;
|
|
573
627
|
segments?: number;
|
|
574
628
|
bounds?: ReactThreeFiber.Vector3;
|
|
@@ -586,9 +640,52 @@ type CloudProps = Omit<ThreeElements['group'], 'ref'> & {
|
|
|
586
640
|
opacity?: number;
|
|
587
641
|
color?: ReactThreeFiber.Color;
|
|
588
642
|
};
|
|
589
|
-
declare const Clouds: React.ForwardRefExoticComponent<Omit<
|
|
590
|
-
|
|
591
|
-
|
|
643
|
+
declare const Clouds: React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<Group<THREE.Object3DEventMap>, _react_three_fiber.MathProps<Group<THREE.Object3DEventMap>> & _react_three_fiber.ReactProps<Group<THREE.Object3DEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<Group<THREE.Object3DEventMap>>>>, Omit<_react_three_fiber.InstanceProps<Group<THREE.Object3DEventMap>, typeof Group>, "object">>>, "ref"> & {
|
|
644
|
+
texture?: string;
|
|
645
|
+
limit?: number;
|
|
646
|
+
range?: number;
|
|
647
|
+
material?: typeof Material;
|
|
648
|
+
materialFactory?: (baseMaterial: typeof Material) => Material;
|
|
649
|
+
frustumCulled?: boolean;
|
|
650
|
+
} & React.RefAttributes<Group<THREE.Object3DEventMap>>>;
|
|
651
|
+
declare const CloudInstance: React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<Group<THREE.Object3DEventMap>, _react_three_fiber.MathProps<Group<THREE.Object3DEventMap>> & _react_three_fiber.ReactProps<Group<THREE.Object3DEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<Group<THREE.Object3DEventMap>>>>, Omit<_react_three_fiber.InstanceProps<Group<THREE.Object3DEventMap>, typeof Group>, "object">>>, "ref"> & {
|
|
652
|
+
materialFactory?: (baseMaterial: typeof Material) => Material;
|
|
653
|
+
seed?: number;
|
|
654
|
+
segments?: number;
|
|
655
|
+
bounds?: ReactThreeFiber.Vector3;
|
|
656
|
+
concentrate?: "random" | "inside" | "outside";
|
|
657
|
+
scale?: ReactThreeFiber.Vector3;
|
|
658
|
+
volume?: number;
|
|
659
|
+
smallestVolume?: number;
|
|
660
|
+
distribute?: (cloud: CloudState, index: number) => {
|
|
661
|
+
point: Vector3$1;
|
|
662
|
+
volume?: number;
|
|
663
|
+
};
|
|
664
|
+
growth?: number;
|
|
665
|
+
speed?: number;
|
|
666
|
+
fade?: number;
|
|
667
|
+
opacity?: number;
|
|
668
|
+
color?: ReactThreeFiber.Color;
|
|
669
|
+
} & React.RefAttributes<Group<THREE.Object3DEventMap>>>;
|
|
670
|
+
declare const Cloud: React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<Group<THREE.Object3DEventMap>, _react_three_fiber.MathProps<Group<THREE.Object3DEventMap>> & _react_three_fiber.ReactProps<Group<THREE.Object3DEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<Group<THREE.Object3DEventMap>>>>, Omit<_react_three_fiber.InstanceProps<Group<THREE.Object3DEventMap>, typeof Group>, "object">>>, "ref"> & {
|
|
671
|
+
materialFactory?: (baseMaterial: typeof Material) => Material;
|
|
672
|
+
seed?: number;
|
|
673
|
+
segments?: number;
|
|
674
|
+
bounds?: ReactThreeFiber.Vector3;
|
|
675
|
+
concentrate?: "random" | "inside" | "outside";
|
|
676
|
+
scale?: ReactThreeFiber.Vector3;
|
|
677
|
+
volume?: number;
|
|
678
|
+
smallestVolume?: number;
|
|
679
|
+
distribute?: (cloud: CloudState, index: number) => {
|
|
680
|
+
point: Vector3$1;
|
|
681
|
+
volume?: number;
|
|
682
|
+
};
|
|
683
|
+
growth?: number;
|
|
684
|
+
speed?: number;
|
|
685
|
+
fade?: number;
|
|
686
|
+
opacity?: number;
|
|
687
|
+
color?: ReactThreeFiber.Color;
|
|
688
|
+
} & React.RefAttributes<Group<THREE.Object3DEventMap>>>;
|
|
592
689
|
|
|
593
690
|
type CatmullRomLineProps = Omit<LineProps, 'ref' | 'segments'> & {
|
|
594
691
|
closed?: boolean;
|
|
@@ -708,25 +805,25 @@ type Args<T> = T extends new (...args: any) => any ? ConstructorParameters<T> :
|
|
|
708
805
|
type ShapeProps<T> = Omit<ThreeElements['mesh'], 'ref' | 'args'> & {
|
|
709
806
|
args?: Args<T>;
|
|
710
807
|
};
|
|
711
|
-
declare const Box: ForwardRefComponent<ShapeProps<typeof THREE.BoxGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
712
|
-
declare const Circle: ForwardRefComponent<ShapeProps<typeof THREE.CircleGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
713
|
-
declare const Cone: ForwardRefComponent<ShapeProps<typeof THREE.ConeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
714
|
-
declare const Cylinder: ForwardRefComponent<ShapeProps<typeof THREE.CylinderGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
715
|
-
declare const Sphere: ForwardRefComponent<ShapeProps<typeof THREE.SphereGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
716
|
-
declare const Plane: ForwardRefComponent<ShapeProps<typeof THREE.PlaneGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
717
|
-
declare const Tube: ForwardRefComponent<ShapeProps<typeof THREE.TubeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
718
|
-
declare const Torus: ForwardRefComponent<ShapeProps<typeof THREE.TorusGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
719
|
-
declare const TorusKnot: ForwardRefComponent<ShapeProps<typeof THREE.TorusKnotGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
720
|
-
declare const Tetrahedron: ForwardRefComponent<ShapeProps<typeof THREE.TetrahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
721
|
-
declare const Ring: ForwardRefComponent<ShapeProps<typeof THREE.RingGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
722
|
-
declare const Polyhedron: ForwardRefComponent<ShapeProps<typeof THREE.PolyhedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
723
|
-
declare const Icosahedron: ForwardRefComponent<ShapeProps<typeof THREE.IcosahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
724
|
-
declare const Octahedron: ForwardRefComponent<ShapeProps<typeof THREE.OctahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
725
|
-
declare const Dodecahedron: ForwardRefComponent<ShapeProps<typeof THREE.DodecahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
726
|
-
declare const Extrude: ForwardRefComponent<ShapeProps<typeof THREE.ExtrudeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
727
|
-
declare const Lathe: ForwardRefComponent<ShapeProps<typeof THREE.LatheGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
728
|
-
declare const Capsule: ForwardRefComponent<ShapeProps<typeof THREE.CapsuleGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
729
|
-
declare const Shape: ForwardRefComponent<ShapeProps<typeof THREE.ShapeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
808
|
+
declare const Box: ForwardRefComponent<ShapeProps<typeof THREE.BoxGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
809
|
+
declare const Circle: ForwardRefComponent<ShapeProps<typeof THREE.CircleGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
810
|
+
declare const Cone: ForwardRefComponent<ShapeProps<typeof THREE.ConeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
811
|
+
declare const Cylinder: ForwardRefComponent<ShapeProps<typeof THREE.CylinderGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
812
|
+
declare const Sphere: ForwardRefComponent<ShapeProps<typeof THREE.SphereGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
813
|
+
declare const Plane: ForwardRefComponent<ShapeProps<typeof THREE.PlaneGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
814
|
+
declare const Tube: ForwardRefComponent<ShapeProps<typeof THREE.TubeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
815
|
+
declare const Torus: ForwardRefComponent<ShapeProps<typeof THREE.TorusGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
816
|
+
declare const TorusKnot: ForwardRefComponent<ShapeProps<typeof THREE.TorusKnotGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
817
|
+
declare const Tetrahedron: ForwardRefComponent<ShapeProps<typeof THREE.TetrahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
818
|
+
declare const Ring: ForwardRefComponent<ShapeProps<typeof THREE.RingGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
819
|
+
declare const Polyhedron: ForwardRefComponent<ShapeProps<typeof THREE.PolyhedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
820
|
+
declare const Icosahedron: ForwardRefComponent<ShapeProps<typeof THREE.IcosahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
821
|
+
declare const Octahedron: ForwardRefComponent<ShapeProps<typeof THREE.OctahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
822
|
+
declare const Dodecahedron: ForwardRefComponent<ShapeProps<typeof THREE.DodecahedronGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
823
|
+
declare const Extrude: ForwardRefComponent<ShapeProps<typeof THREE.ExtrudeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
824
|
+
declare const Lathe: ForwardRefComponent<ShapeProps<typeof THREE.LatheGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
825
|
+
declare const Capsule: ForwardRefComponent<ShapeProps<typeof THREE.CapsuleGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
826
|
+
declare const Shape: ForwardRefComponent<ShapeProps<typeof THREE.ShapeGeometry>, THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>>;
|
|
730
827
|
|
|
731
828
|
type Glyph = {
|
|
732
829
|
_cachedOutline: string[];
|
|
@@ -765,60 +862,13 @@ type Text3DProps = Omit<ThreeElements['mesh'], 'ref'> & {
|
|
|
765
862
|
font: FontData | string;
|
|
766
863
|
bevelSegments?: number;
|
|
767
864
|
smooth?: number;
|
|
768
|
-
|
|
865
|
+
height?: number;
|
|
866
|
+
} & Omit<TextGeometryParameters, 'font' | 'depth'>;
|
|
769
867
|
declare const Text3D: ForwardRefComponent<React.PropsWithChildren<Text3DProps & {
|
|
770
868
|
letterSpacing?: number;
|
|
771
869
|
lineHeight?: number;
|
|
772
870
|
}>, THREE.Mesh>;
|
|
773
871
|
|
|
774
|
-
interface WireframeMaterialProps extends THREE.ShaderMaterialParameters {
|
|
775
|
-
fillOpacity?: number;
|
|
776
|
-
fillMix?: number;
|
|
777
|
-
strokeOpacity?: number;
|
|
778
|
-
thickness?: number;
|
|
779
|
-
colorBackfaces?: boolean;
|
|
780
|
-
dashInvert?: boolean;
|
|
781
|
-
dash?: boolean;
|
|
782
|
-
dashRepeats?: number;
|
|
783
|
-
dashLength?: number;
|
|
784
|
-
squeeze?: boolean;
|
|
785
|
-
squeezeMin?: number;
|
|
786
|
-
squeezeMax?: number;
|
|
787
|
-
stroke?: THREE.ColorRepresentation;
|
|
788
|
-
backfaceStroke?: THREE.ColorRepresentation;
|
|
789
|
-
fill?: THREE.ColorRepresentation;
|
|
790
|
-
}
|
|
791
|
-
declare const WireframeMaterial: _react_three_fiber.ConstructorRepresentation<THREE.ShaderMaterial & {
|
|
792
|
-
strokeOpacity: number;
|
|
793
|
-
fillOpacity: number;
|
|
794
|
-
fillMix: number;
|
|
795
|
-
thickness: number;
|
|
796
|
-
colorBackfaces: boolean;
|
|
797
|
-
dashInvert: boolean;
|
|
798
|
-
dash: boolean;
|
|
799
|
-
dashRepeats: number;
|
|
800
|
-
dashLength: number;
|
|
801
|
-
squeeze: boolean;
|
|
802
|
-
squeezeMin: number;
|
|
803
|
-
squeezeMax: number;
|
|
804
|
-
stroke: THREE.Color;
|
|
805
|
-
backfaceStroke: THREE.Color;
|
|
806
|
-
fill: THREE.Color;
|
|
807
|
-
}> & {
|
|
808
|
-
key: string;
|
|
809
|
-
};
|
|
810
|
-
|
|
811
|
-
declare module '@react-three/fiber' {
|
|
812
|
-
interface ThreeElements {
|
|
813
|
-
meshWireframeMaterial: ThreeElement<typeof WireframeMaterial>;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
interface WireframeProps {
|
|
817
|
-
geometry?: THREE.BufferGeometry | React.RefObject<THREE.BufferGeometry>;
|
|
818
|
-
simplify?: boolean;
|
|
819
|
-
}
|
|
820
|
-
declare function Wireframe({ geometry: customGeometry, ...props }: WireframeProps & WireframeMaterialProps): React.JSX.Element;
|
|
821
|
-
|
|
822
872
|
type GizmoHelperContext = {
|
|
823
873
|
tweenCamera: (direction: Vector3$1) => void;
|
|
824
874
|
};
|
|
@@ -865,6 +915,17 @@ type OnDragStartProps = {
|
|
|
865
915
|
origin: THREE.Vector3;
|
|
866
916
|
directions: THREE.Vector3[];
|
|
867
917
|
};
|
|
918
|
+
type OnDragProps = {
|
|
919
|
+
local: THREE.Matrix4;
|
|
920
|
+
deltaLocal: THREE.Matrix4;
|
|
921
|
+
world: THREE.Matrix4;
|
|
922
|
+
deltaWorld: THREE.Matrix4;
|
|
923
|
+
};
|
|
924
|
+
type OnHoverProps = {
|
|
925
|
+
component: 'Arrow' | 'Slider' | 'Rotator' | 'Sphere';
|
|
926
|
+
axis: 0 | 1 | 2;
|
|
927
|
+
hovering: boolean;
|
|
928
|
+
};
|
|
868
929
|
|
|
869
930
|
type PivotControlsProps = {
|
|
870
931
|
enabled?: boolean;
|
|
@@ -874,6 +935,7 @@ type PivotControlsProps = {
|
|
|
874
935
|
offset?: [number, number, number];
|
|
875
936
|
rotation?: [number, number, number];
|
|
876
937
|
matrix?: THREE.Matrix4;
|
|
938
|
+
object?: THREE.Object3D | React.MutableRefObject<THREE.Object3D>;
|
|
877
939
|
anchor?: [number, number, number];
|
|
878
940
|
autoTransform?: boolean;
|
|
879
941
|
activeAxes?: [boolean, boolean, boolean];
|
|
@@ -889,8 +951,9 @@ type PivotControlsProps = {
|
|
|
889
951
|
annotations?: boolean;
|
|
890
952
|
annotationsClass?: string;
|
|
891
953
|
onDragStart?: (props: OnDragStartProps) => void;
|
|
892
|
-
onDrag?: (
|
|
893
|
-
onDragEnd?: () => void;
|
|
954
|
+
onDrag?: (props: OnDragProps) => void;
|
|
955
|
+
onDragEnd?: (props: OnDragProps) => void;
|
|
956
|
+
onHover?: (props: OnHoverProps) => void;
|
|
894
957
|
depthTest?: boolean;
|
|
895
958
|
renderOrder?: number;
|
|
896
959
|
opacity?: number;
|
|
@@ -932,8 +995,8 @@ type HelperType = Object3D & {
|
|
|
932
995
|
dispose: () => void;
|
|
933
996
|
};
|
|
934
997
|
type HelperConstructor = new (...args: any[]) => any;
|
|
935
|
-
type HelperArgs<T> = T extends [infer _, ...infer R] ? R :
|
|
936
|
-
declare function useHelper<T extends HelperConstructor>(object3D: React.RefObject<Object3D> | Falsey, helperConstructor: T, ...args: HelperArgs<ConstructorParameters<T>>): React.RefObject<HelperType | null>;
|
|
998
|
+
type HelperArgs<T> = T extends [infer _, ...infer R] ? R : [];
|
|
999
|
+
declare function useHelper<T extends HelperConstructor>(object3D: React.RefObject<Object3D | null> | Falsey, helperConstructor: T, ...args: HelperArgs<ConstructorParameters<T>>): React.RefObject<HelperType | null>;
|
|
937
1000
|
type HelperProps<T extends HelperConstructor> = {
|
|
938
1001
|
type: T;
|
|
939
1002
|
args?: HelperArgs<ConstructorParameters<T>>;
|
|
@@ -976,6 +1039,7 @@ type InstancedAttributeProps = Omit<ThreeElements['instancedBufferAttribute'], '
|
|
|
976
1039
|
defaultValue: any;
|
|
977
1040
|
normalized?: boolean;
|
|
978
1041
|
usage?: number;
|
|
1042
|
+
type?: 'float' | 'int' | 'uint' | 'short' | 'ushort' | 'byte';
|
|
979
1043
|
};
|
|
980
1044
|
type InstancedMesh = Omit<THREE.InstancedMesh, 'instanceMatrix' | 'instanceColor'> & {
|
|
981
1045
|
instanceMatrix: THREE.InstancedBufferAttribute;
|
|
@@ -989,7 +1053,7 @@ declare class PositionMesh extends THREE.Group {
|
|
|
989
1053
|
get geometry(): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap> | undefined;
|
|
990
1054
|
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
|
|
991
1055
|
}
|
|
992
|
-
declare const Instance: React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<PositionMesh, _react_three_fiber.MathProps<PositionMesh> & _react_three_fiber.ReactProps<PositionMesh> & Partial<_react_three_fiber.EventHandlers>>>, Omit<_react_three_fiber.InstanceProps<PositionMesh, typeof PositionMesh>, "object">>>, "ref"> & {
|
|
1056
|
+
declare const Instance: React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<PositionMesh, _react_three_fiber.MathProps<PositionMesh> & _react_three_fiber.ReactProps<PositionMesh> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<PositionMesh>>>, Omit<_react_three_fiber.InstanceProps<PositionMesh, typeof PositionMesh>, "object">>>, "ref"> & {
|
|
993
1057
|
context?: React.Context<Api$1>;
|
|
994
1058
|
} & React.RefAttributes<unknown>>;
|
|
995
1059
|
declare const Instances: ForwardRefComponent<InstancesProps, THREE.InstancedMesh>;
|
|
@@ -998,10 +1062,21 @@ interface MergedProps extends Omit<InstancesProps, 'children'> {
|
|
|
998
1062
|
children: (...instances: [React.FC<InstanceProps> & Record<string, React.FC<InstanceProps>>, ...React.FC<InstanceProps>[]]) => React.ReactNode;
|
|
999
1063
|
}
|
|
1000
1064
|
declare const Merged: ForwardRefComponent<MergedProps, THREE.Group>;
|
|
1001
|
-
declare function createInstances<T = InstanceProps>(): readonly [React.ForwardRefExoticComponent<Omit<
|
|
1065
|
+
declare function createInstances<T = InstanceProps>(): readonly [React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.InstancedMeshEventMap>, _react_three_fiber.MathProps<THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.InstancedMeshEventMap>> & _react_three_fiber.ReactProps<THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.InstancedMeshEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.InstancedMeshEventMap>>>>, Omit<_react_three_fiber.InstanceProps<THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.InstancedMeshEventMap>, typeof THREE.InstancedMesh>, "object">>>, "ref" | "args"> & {
|
|
1066
|
+
context?: React.Context<Api$1>;
|
|
1067
|
+
range?: number;
|
|
1068
|
+
limit?: number;
|
|
1069
|
+
frames?: number;
|
|
1070
|
+
} & React.RefAttributes<THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.InstancedMeshEventMap>>>, React.ForwardRefExoticComponent<React.PropsWithoutRef<T & Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<PositionMesh, _react_three_fiber.MathProps<PositionMesh> & _react_three_fiber.ReactProps<PositionMesh> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<PositionMesh>>>, Omit<_react_three_fiber.InstanceProps<PositionMesh, typeof PositionMesh>, "object">>>, "ref"> & {
|
|
1002
1071
|
context?: React.Context<Api$1>;
|
|
1003
1072
|
}> & React.RefAttributes<PositionMesh & T>>];
|
|
1004
|
-
declare const InstancedAttribute: React.ForwardRefExoticComponent<Omit<
|
|
1073
|
+
declare const InstancedAttribute: React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<THREE.InstancedBufferAttribute, _react_three_fiber.MathProps<THREE.InstancedBufferAttribute> & _react_three_fiber.ReactProps<THREE.InstancedBufferAttribute> & _react_three_fiber.NodeProps<THREE.InstancedBufferAttribute>>>, Omit<_react_three_fiber.InstanceProps<THREE.InstancedBufferAttribute, typeof THREE.InstancedBufferAttribute>, "object">>>, "ref" | "args"> & {
|
|
1074
|
+
name: string;
|
|
1075
|
+
defaultValue: any;
|
|
1076
|
+
normalized?: boolean;
|
|
1077
|
+
usage?: number;
|
|
1078
|
+
type?: "float" | "int" | "uint" | "short" | "ushort" | "byte";
|
|
1079
|
+
} & React.RefAttributes<THREE.InstancedBufferAttribute>>;
|
|
1005
1080
|
|
|
1006
1081
|
type Size = {
|
|
1007
1082
|
w: number;
|
|
@@ -1105,7 +1180,40 @@ type SpriteAnimatorState = {
|
|
|
1105
1180
|
ref: React.Ref<THREE.Group>;
|
|
1106
1181
|
};
|
|
1107
1182
|
declare function useSpriteAnimator(): SpriteAnimatorState | null;
|
|
1108
|
-
declare const SpriteAnimator: React.ForwardRefExoticComponent<
|
|
1183
|
+
declare const SpriteAnimator: React.ForwardRefExoticComponent<{
|
|
1184
|
+
startFrame?: number;
|
|
1185
|
+
endFrame?: number;
|
|
1186
|
+
fps?: number;
|
|
1187
|
+
frameName?: string;
|
|
1188
|
+
textureDataURL?: string;
|
|
1189
|
+
textureImageURL?: string;
|
|
1190
|
+
loop?: boolean;
|
|
1191
|
+
numberOfFrames?: number;
|
|
1192
|
+
autoPlay?: boolean;
|
|
1193
|
+
animationNames?: Array<string>;
|
|
1194
|
+
onStart?: (data: AnimationEventData) => void;
|
|
1195
|
+
onEnd?: (data: AnimationEventData) => void;
|
|
1196
|
+
onLoopEnd?: (data: AnimationEventData) => void;
|
|
1197
|
+
onFrame?: (data: AnimationEventData) => void;
|
|
1198
|
+
play?: boolean;
|
|
1199
|
+
pause?: boolean;
|
|
1200
|
+
flipX?: boolean;
|
|
1201
|
+
alphaTest?: number;
|
|
1202
|
+
asSprite?: boolean;
|
|
1203
|
+
offset?: number;
|
|
1204
|
+
playBackwards?: boolean;
|
|
1205
|
+
resetOnEnd?: boolean;
|
|
1206
|
+
instanceItems?: Vector3[];
|
|
1207
|
+
maxItems?: number;
|
|
1208
|
+
spriteDataset?: {
|
|
1209
|
+
spriteTexture: THREE.Texture;
|
|
1210
|
+
spriteData: SpriteData | null;
|
|
1211
|
+
aspect: Vector3;
|
|
1212
|
+
} | null;
|
|
1213
|
+
canvasRenderingContext2DSettings?: CanvasRenderingContext2DSettings;
|
|
1214
|
+
roundFramePosition?: boolean;
|
|
1215
|
+
meshProps?: CommonMeshProps;
|
|
1216
|
+
} & Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<THREE.Group<THREE.Object3DEventMap>, _react_three_fiber.MathProps<THREE.Group<THREE.Object3DEventMap>> & _react_three_fiber.ReactProps<THREE.Group<THREE.Object3DEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<THREE.Group<THREE.Object3DEventMap>>>>, Omit<_react_three_fiber.InstanceProps<THREE.Group<THREE.Object3DEventMap>, typeof THREE.Group>, "object">>>, "ref"> & React.RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
|
|
1109
1217
|
|
|
1110
1218
|
type Api<T extends AnimationClip> = {
|
|
1111
1219
|
ref: React.RefObject<Object3D | undefined | null>;
|
|
@@ -1191,7 +1299,7 @@ declare const Svg: ForwardRefComponent<SvgProps, Object3D>;
|
|
|
1191
1299
|
declare function useDepthBuffer({ size, frames }?: {
|
|
1192
1300
|
size?: number;
|
|
1193
1301
|
frames?: number;
|
|
1194
|
-
}): DepthTexture | null;
|
|
1302
|
+
}): DepthTexture<THREE.DepthTextureImageData> | null;
|
|
1195
1303
|
|
|
1196
1304
|
interface CubeTextureOptions {
|
|
1197
1305
|
path: string;
|
|
@@ -1290,33 +1398,52 @@ declare function Fbx({ path, ...props }: {
|
|
|
1290
1398
|
type Path = string | string[];
|
|
1291
1399
|
type UseDraco = boolean | string;
|
|
1292
1400
|
type UseMeshopt = boolean;
|
|
1293
|
-
type
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1401
|
+
type UseKTX2 = boolean | string;
|
|
1402
|
+
type ExtendLoader$1 = (loader: GLTFLoader) => void;
|
|
1403
|
+
interface UseGLTFOptions {
|
|
1404
|
+
draco?: UseDraco;
|
|
1405
|
+
meshopt?: UseMeshopt;
|
|
1406
|
+
ktx2?: UseKTX2;
|
|
1407
|
+
extendLoader?: ExtendLoader$1;
|
|
1408
|
+
}
|
|
1409
|
+
declare function useGLTF<T extends Path>(path: T, optionsOrDraco?: UseGLTFOptions | UseDraco, useMeshoptArg?: UseMeshopt, useKTX2Arg?: UseKTX2, extendLoaderArg?: ExtendLoader$1): T extends any[] ? (GLTF & ObjectMap)[] : GLTF & ObjectMap;
|
|
1410
|
+
declare namespace useGLTF {
|
|
1411
|
+
var preload: (path: Path, optionsOrDraco?: UseGLTFOptions | UseDraco, useMeshoptArg?: UseMeshopt, useKTX2Arg?: UseKTX2, extendLoaderArg?: ExtendLoader$1) => void;
|
|
1412
|
+
var clear: (path: Path) => void;
|
|
1413
|
+
var setDecoderPath: (path: string) => void;
|
|
1414
|
+
var setKTX2TranscoderPath: (path: string) => void;
|
|
1415
|
+
}
|
|
1300
1416
|
type GltfProps = Omit<CloneProps, 'object'> & {
|
|
1301
1417
|
src: string;
|
|
1302
1418
|
useDraco?: UseDraco;
|
|
1303
1419
|
useMeshOpt?: UseMeshopt;
|
|
1304
|
-
extendLoader?: ExtendLoader;
|
|
1420
|
+
extendLoader?: ExtendLoader$1;
|
|
1421
|
+
options?: UseGLTFOptions;
|
|
1305
1422
|
};
|
|
1306
|
-
declare const Gltf: React.ForwardRefExoticComponent<Omit<
|
|
1423
|
+
declare const Gltf: React.ForwardRefExoticComponent<Omit<CloneProps, "object"> & {
|
|
1424
|
+
src: string;
|
|
1425
|
+
useDraco?: UseDraco;
|
|
1426
|
+
useMeshOpt?: UseMeshopt;
|
|
1427
|
+
extendLoader?: ExtendLoader$1;
|
|
1428
|
+
options?: UseGLTFOptions;
|
|
1429
|
+
} & React.RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
|
|
1307
1430
|
|
|
1308
|
-
|
|
1431
|
+
type ExtendLoader = (loader: KTX2Loader) => void;
|
|
1432
|
+
declare function useKTX2<Url extends string[] | string | Record<string, string>>(input: Url, basisPath?: boolean | string, extendLoader?: ExtendLoader): Url extends any[] ? Texture$1[] : Url extends object ? {
|
|
1309
1433
|
[key in keyof Url]: Texture$1;
|
|
1310
1434
|
} : Texture$1;
|
|
1311
1435
|
declare namespace useKTX2 {
|
|
1312
|
-
var preload: (url: string
|
|
1436
|
+
var preload: (url: string | string[], basisPath?: boolean | string, extendLoader?: ExtendLoader) => void;
|
|
1313
1437
|
var clear: (input: string | string[]) => void;
|
|
1438
|
+
var setTranscoderPath: (path: string) => void;
|
|
1314
1439
|
}
|
|
1315
|
-
|
|
1440
|
+
type Ktx2Props = {
|
|
1316
1441
|
children?: (texture: ReturnType<typeof useKTX2>) => React.ReactNode;
|
|
1317
1442
|
input: Parameters<typeof useKTX2>[0];
|
|
1318
1443
|
basisPath?: Parameters<typeof useKTX2>[1];
|
|
1319
|
-
|
|
1444
|
+
extendLoader?: ExtendLoader;
|
|
1445
|
+
};
|
|
1446
|
+
declare const Ktx2: ({ children, input, basisPath, extendLoader }: Ktx2Props) => React.JSX.Element;
|
|
1320
1447
|
|
|
1321
1448
|
type Data = {
|
|
1322
1449
|
errors: string[];
|
|
@@ -1347,6 +1474,13 @@ declare const Texture: ({ children, input, onLoad, }: {
|
|
|
1347
1474
|
onLoad?: Parameters<typeof useTexture>[1];
|
|
1348
1475
|
}) => React.JSX.Element;
|
|
1349
1476
|
|
|
1477
|
+
declare const useVariants: (model: GLTF, inVariant?: string) => {
|
|
1478
|
+
variants: any;
|
|
1479
|
+
activeVariant: string | null;
|
|
1480
|
+
setVariant: (variantName: string | null) => void;
|
|
1481
|
+
materials: Material<THREE.MaterialEventMap>[];
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1350
1484
|
type WebcamVideoTextureProps = Omit<VideoTextureProps, 'src'> & {
|
|
1351
1485
|
constraints?: MediaStreamConstraints;
|
|
1352
1486
|
};
|
|
@@ -1432,7 +1566,7 @@ declare const StatsGl: ForwardRefComponent<StatsGlProps, HTMLDivElement>;
|
|
|
1432
1566
|
type FBOSettings = {
|
|
1433
1567
|
depth?: boolean;
|
|
1434
1568
|
} & RenderTargetOptions;
|
|
1435
|
-
declare function useFBO(width?: number | FBOSettings, height?: number, settings?: FBOSettings): THREE.WebGLRenderTarget<THREE.Texture<unknown>>;
|
|
1569
|
+
declare function useFBO(width?: number | FBOSettings, height?: number, settings?: FBOSettings): THREE.WebGLRenderTarget<THREE.Texture<unknown, THREE.TextureEventMap>>;
|
|
1436
1570
|
type UseFBOParams = Parameters<typeof useFBO>;
|
|
1437
1571
|
type FboProps = {
|
|
1438
1572
|
children?: (target: Fbo) => React.ReactNode;
|
|
@@ -1446,7 +1580,7 @@ declare const Fbo: React.ForwardRefExoticComponent<{
|
|
|
1446
1580
|
height?: UseFBOParams[1];
|
|
1447
1581
|
} & {
|
|
1448
1582
|
depth?: boolean;
|
|
1449
|
-
} & THREE.RenderTargetOptions & React.RefAttributes<THREE.WebGLRenderTarget<THREE.Texture<unknown>>>>;
|
|
1583
|
+
} & THREE.RenderTargetOptions & React.RefAttributes<THREE.WebGLRenderTarget<THREE.Texture<unknown, THREE.TextureEventMap>>>>;
|
|
1450
1584
|
|
|
1451
1585
|
type FisheyeProps = ThreeElements['mesh'] & {
|
|
1452
1586
|
zoom?: number;
|
|
@@ -1500,7 +1634,7 @@ type RenderCubeTextureProps = Omit<ThreeElements['texture'], 'ref' | 'args' | 'r
|
|
|
1500
1634
|
};
|
|
1501
1635
|
type RenderCubeTextureApi = {
|
|
1502
1636
|
scene: THREE.Scene;
|
|
1503
|
-
fbo:
|
|
1637
|
+
fbo: WebGLCubeRenderTarget;
|
|
1504
1638
|
camera: THREE.CubeCamera;
|
|
1505
1639
|
};
|
|
1506
1640
|
declare const RenderCubeTexture: ForwardRefComponent<RenderCubeTextureProps, RenderCubeTextureApi>;
|
|
@@ -1652,7 +1786,7 @@ type EnvironmentLoaderProps = {
|
|
|
1652
1786
|
extensions?: (loader: Loader$1) => void;
|
|
1653
1787
|
colorSpace?: ColorSpace;
|
|
1654
1788
|
};
|
|
1655
|
-
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>):
|
|
1789
|
+
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>): CubeTexture$1<unknown> | Texture$1<unknown, THREE.TextureEventMap>;
|
|
1656
1790
|
declare namespace useEnvironment {
|
|
1657
1791
|
var preload: (preloadOptions?: EnvironmentLoaderPreloadOptions) => void;
|
|
1658
1792
|
var clear: (clearOptions?: EnvironmentLoaderClearOptions) => void;
|
|
@@ -1723,7 +1857,13 @@ type ResizeProps = Omit<ThreeElements['group'], 'ref'> & {
|
|
|
1723
1857
|
box3?: THREE.Box3;
|
|
1724
1858
|
precise?: boolean;
|
|
1725
1859
|
};
|
|
1726
|
-
declare const Resize: React.ForwardRefExoticComponent<Omit<
|
|
1860
|
+
declare const Resize: React.ForwardRefExoticComponent<Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<THREE.Group<THREE.Object3DEventMap>, _react_three_fiber.MathProps<THREE.Group<THREE.Object3DEventMap>> & _react_three_fiber.ReactProps<THREE.Group<THREE.Object3DEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<THREE.Group<THREE.Object3DEventMap>>>>, Omit<_react_three_fiber.InstanceProps<THREE.Group<THREE.Object3DEventMap>, typeof THREE.Group>, "object">>>, "ref"> & {
|
|
1861
|
+
width?: boolean;
|
|
1862
|
+
height?: boolean;
|
|
1863
|
+
depth?: boolean;
|
|
1864
|
+
box3?: THREE.Box3;
|
|
1865
|
+
precise?: boolean;
|
|
1866
|
+
} & React.RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
|
|
1727
1867
|
|
|
1728
1868
|
type ScreenSizerProps = Omit<ThreeElements['object3D'], 'ref'> & {
|
|
1729
1869
|
scale?: number;
|
|
@@ -1828,6 +1968,7 @@ interface HtmlProps extends Omit<Assign<React.HTMLAttributes<HTMLDivElement>, Th
|
|
|
1828
1968
|
geometry?: React.ReactNode;
|
|
1829
1969
|
castShadow?: boolean;
|
|
1830
1970
|
receiveShadow?: boolean;
|
|
1971
|
+
pixelPerfect?: boolean;
|
|
1831
1972
|
}
|
|
1832
1973
|
declare const Html: ForwardRefComponent<HtmlProps, HTMLDivElement>;
|
|
1833
1974
|
|
|
@@ -1854,5 +1995,5 @@ type SelectProps = Omit<ThreeElements['group'], 'ref'> & {
|
|
|
1854
1995
|
declare function Select({ box, multiple, children, onChange, onChangePointerUp, border, backgroundColor, filter: customFilter, ...props }: SelectProps): React.JSX.Element;
|
|
1855
1996
|
declare function useSelect(): THREE.Object3D[];
|
|
1856
1997
|
|
|
1857
|
-
export { AdaptiveDpr, AdaptiveEvents, ArcballControls, BBAnchor, Backdrop, Billboard, Bounds, Box, CameraShake, Capsule, CatmullRomLine, Center, Circle, Clone, Cloud, CloudInstance, Clouds, ComputedAttribute, Cone, CubeCamera, CubeTexture, CubicBezierLine, CurveModifier, CycleRaycast, Cylinder, Decal, Detailed, DetectGPU, DeviceOrientationControls, Dodecahedron, DragControls, Edges, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, Example, Extrude, Fbo, Fbx, FirstPersonControls, Fisheye, Float, FlyControls, GizmoHelper, GizmoViewcube, GizmoViewport, Gltf, Helper, Html, Hud, Icosahedron, Instance, InstancedAttribute, Instances, IsObject, KeyboardControls, Ktx2, Lathe, Lightformer, Loader, MapControls, Mask, MatcapTexture, Merged, MotionPathControls, NormalTexture, Octahedron, OrbitControls, OrthographicCamera, PerformanceMonitor, PerspectiveCamera, PivotControls, Plane, Point, PointMaterial, PointMaterialImpl, PointerLockControls, Points, PointsBuffer, Polyhedron, PositionMesh, PositionPoint, PositionalAudio, Preload, PresentationControls, Progress, QuadraticBezierLine, RenderCubeTexture, RenderTexture, Resize, Ring, RoundedBox, RoundedBoxGeometry, Sampler, ScreenQuad, ScreenSizer, ScreenSpace, ScreenVideoTexture, Scroll, ScrollControls, Select, Shadow, Shape, Sky, Sphere, SpriteAnimator, Stage, Stats, StatsGl, Svg, Tetrahedron, Text3D, Texture, Torus, TorusKnot, TrackballControls, TrailTexture, TransformControls, Tube, VideoTexture, View, WebcamVideoTexture,
|
|
1858
|
-
export type { ArcballControlsProps, Args, BBAnchorProps, BackdropProps, BillboardProps, BoundsApi, BoundsProps, CalculatePosition, CameraShakeProps, CatmullRomLineProps, CenterProps, CloneProps, CloudProps, CloudsProps, ComputedAttributeProps, ContainerProps, CubeCameraOptions, CubeCameraProps, CubeTextureProps, CubicBezierLineProps, CurveModifierProps, CurveModifierRef, CycleRaycastProps, DecalProps, DetailedProps, DetectGPUProps, DeviceOrientationControlsProps, DragControlsProps, EdgesProps, EnvironmentLoaderProps, EnvironmentProps, ExampleApi, ExampleProps, FboProps, FirstPersonControlsProps, FisheyeProps, FloatProps, FlyControlsProps, FontData, FrameData, GizmoHelperProps, GltfProps, Glyph, HelperProps, HtmlProps, HudProps, InstanceProps, InstancedAttributeProps, InstancesProps, KeyboardControlsEntry, KeyboardControlsProps, LightProps, LoaderOptions, MapControlsProps, MaskProps, MergedProps, MetaData, MotionPathProps, MotionPathRef, OnCenterCallbackProps, OrbitControlsChangeEvent, OrbitControlsProps, OrthographicCameraProps, PerformanceMonitorApi, PerformanceMonitorProps, PerspectiveCameraProps, PivotControlsProps, PointMaterialProps, PointerLockControlsProps, PointsBuffersProps, PointsInstancesProps, PositionalAudioProps, PreloadProps, PresentationControlProps, PresetsType, QuadraticBezierLineProps, QuadraticBezierLineRef, RenderCubeTextureApi, RenderCubeTextureProps, RenderTextureProps, ResizeProps, RoundedBoxGeometryProps, RoundedBoxProps, SamplerProps, ScreenQuadProps, ScreenSizerProps, ScreenSpaceProps, ScreenVideoTextureProps, ScrollControlsProps, ScrollControlsState, ScrollProps, SelectProps, ShadowProps, ShadowType, ShakeController, ShapeProps, Size, SizeProps, SkyProps, SpriteAnimatorProps, SpriteData, StageProps, StatsGlProps, StatsProps, SvgProps, Text3DProps, TrackballControlsProps, TrailTextureProps, TransformControlsProps, TransformFn, VideoTextureProps, ViewProps, ViewportProps, WebcamVideoTextureProps, useSurfaceSamplerProps };
|
|
1998
|
+
export { AdaptiveDpr, AdaptiveEvents, ArcballControls, BBAnchor, Backdrop, Billboard, Bounds, Box, CameraShake, Capsule, CatmullRomLine, Center, Circle, Clone, Cloud, CloudInstance, Clouds, ComputedAttribute, Cone, CubeCamera, CubeTexture, CubicBezierLine, CurveModifier, CycleRaycast, Cylinder, Decal, Detailed, DetectGPU, DeviceOrientationControls, Dodecahedron, DragControls, Edges, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, Example, Extrude, Fbo, Fbx, FirstPersonControls, Fisheye, Float, FlyControls, GizmoHelper, GizmoViewcube, GizmoViewport, Gltf, Helper, Html, Hud, Icosahedron, Instance, InstancedAttribute, Instances, IsObject, KeyboardControls, Ktx2, Lathe, Lightformer, Loader, MapControls, Mask, MatcapTexture, Merged, MotionPathControls, NormalTexture, Octahedron, OrbitControls, OrthographicCamera, PerformanceMonitor, PerspectiveCamera, PivotControls, Plane, Point, PointMaterial, PointMaterialImpl, PointerLockControls, Points, PointsBuffer, Polyhedron, PositionMesh, PositionPoint, PositionalAudio, Preload, PresentationControls, Progress, QuadraticBezierLine, RenderCubeTexture, RenderTexture, Resize, Ring, RoundedBox, RoundedBoxGeometry, Sampler, ScreenQuad, ScreenSizer, ScreenSpace, ScreenVideoTexture, Scroll, ScrollControls, Select, Shadow, Shape, Sky, Sphere, SpriteAnimator, Stage, Stats, StatsGl, Svg, Tetrahedron, Text3D, Texture, Torus, TorusKnot, TrackballControls, TrailTexture, TransformControls, Tube, VideoTexture, View, WebcamVideoTexture, calcPosFromAngles, checkIfFrameIsEmpty, createInstances, getFirstFrame, meshBounds, presetsObj, useAnimations, useAspect, useBounds, useContextBridge, useCubeCamera, useCubeTexture, useCursor, useCustomRaycast, useDepthBuffer, useDetectGPU, useEnvironment, useFBO, useFBX, useFont, useGLTF, useGizmoContext, useHelper, useIntersect, useKTX2, useKeyboardControls, useMask, useMatcapTexture, useMotion, useNormalTexture, usePerformanceMonitor, useProgress, useScroll, useSelect, useSpriteAnimator, useSpriteLoader, useSurfaceSampler, useTexture, useTrailTexture, useVariants, useVideoTexture };
|
|
1999
|
+
export type { ArcballControlsProps, Args, BBAnchorProps, BackdropProps, BillboardProps, BoundsApi, BoundsProps, CalculatePosition, CameraShakeProps, CatmullRomLineProps, CenterProps, CloneProps, CloudProps, CloudsProps, ComputedAttributeProps, ContainerProps, CubeCameraOptions, CubeCameraProps, CubeTextureProps, CubicBezierLineProps, CurveModifierProps, CurveModifierRef, CycleRaycastProps, DecalProps, DetailedProps, DetectGPUProps, DeviceOrientationControlsProps, DragConfig, DragControlsProps, EdgesProps, EdgesRef, EnvironmentLoaderProps, EnvironmentProps, ExampleApi, ExampleProps, FboProps, FirstPersonControlsProps, FisheyeProps, FloatProps, FlyControlsProps, FontData, FrameData, GizmoHelperProps, GltfProps, Glyph, HelperProps, HtmlProps, HudProps, InstanceProps, InstancedAttributeProps, InstancesProps, KeyboardControlsEntry, KeyboardControlsProps, Ktx2Props, LightProps, LoaderOptions, MapControlsProps, MaskProps, MergedProps, MetaData, MotionPathProps, MotionPathRef, OnCenterCallbackProps, OnDragProps, OnDragStartProps, OnHoverProps, OrbitControlsChangeEvent, OrbitControlsProps, OrthographicCameraProps, PerformanceMonitorApi, PerformanceMonitorProps, PerspectiveCameraProps, PivotControlsProps, PointMaterialProps, PointerLockControlsProps, PointsBuffersProps, PointsInstancesProps, PositionalAudioProps, PreloadProps, PresentationControlProps, PresetsType, QuadraticBezierLineProps, QuadraticBezierLineRef, RenderCubeTextureApi, RenderCubeTextureProps, RenderTextureProps, ResizeProps, RoundedBoxGeometryProps, RoundedBoxProps, SamplerProps, ScreenQuadProps, ScreenSizerProps, ScreenSpaceProps, ScreenVideoTextureProps, ScrollControlsProps, ScrollControlsState, ScrollProps, SelectProps, ShadowProps, ShadowType, ShakeController, ShapeProps, Size, SizeProps, SkyProps, SpriteAnimatorProps, SpriteData, StageProps, StatsGlProps, StatsOptions, StatsProps, SvgProps, Text3DProps, TrackballControlsProps, TrailTextureProps, TransformControlsProps, TransformFn, UseGLTFOptions, VideoTextureProps, ViewProps, ViewportProps, WebcamVideoTextureProps, useSurfaceSamplerProps };
|