@react-three/drei 9.109.3 → 9.109.5
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/core/AccumulativeShadows.d.ts +61 -0
- package/core/AdaptiveDpr.d.ts +3 -0
- package/core/AdaptiveEvents.d.ts +1 -0
- package/core/ArcballControls.d.ts +15 -0
- package/core/AsciiRenderer.d.ts +12 -0
- package/core/BBAnchor.d.ts +7 -0
- package/core/Backdrop.d.ts +14 -0
- package/core/BakeShadows.d.ts +1 -0
- package/core/Billboard.cjs.js +1 -1
- package/core/Billboard.d.ts +9 -0
- package/core/Billboard.js +1 -3
- package/core/Bounds.d.ts +35 -0
- package/core/Bvh.d.ts +18 -0
- package/core/CameraControls.d.ts +22 -0
- package/core/CameraShake.d.ts +17 -0
- package/core/CatmullRomLine.d.ts +11 -0
- package/core/Caustics.d.ts +35 -0
- package/core/Center.d.ts +31 -0
- package/core/Clone.d.ts +15 -0
- package/core/Cloud.d.ts +59 -0
- package/core/ComputedAttribute.d.ts +9 -0
- package/core/ContactShadows.d.ts +17 -0
- package/core/CubeCamera.d.ts +21 -0
- package/core/CubeTexture.d.ts +15 -0
- package/core/CubicBezierLine.d.ts +13 -0
- package/core/CurveModifier.d.ts +10 -0
- package/core/Decal.d.ts +16 -0
- package/core/Detailed.d.ts +10 -0
- package/core/DetectGPU.d.ts +8 -0
- package/core/DeviceOrientationControls.d.ts +10 -0
- package/core/Edges.d.ts +13 -0
- package/core/Effects.d.ts +29 -0
- package/core/Environment.d.ts +39 -0
- package/core/Example.d.ts +13 -0
- package/core/Fbo.d.ts +28 -0
- package/core/Fbx.d.ts +11 -0
- package/core/FirstPersonControls.d.ts +8 -0
- package/core/Fisheye.d.ts +9 -0
- package/core/Float.d.ts +13 -0
- package/core/FlyControls.d.ts +10 -0
- package/core/GizmoHelper.d.ts +15 -0
- package/core/GizmoViewcube.d.ts +14 -0
- package/core/GizmoViewport.d.ts +16 -0
- package/core/Gltf.d.ts +20 -0
- package/core/GradientTexture.d.ts +18 -0
- package/core/Grid.d.ts +27 -0
- package/core/Helper.d.ts +16 -0
- package/core/Hud.d.ts +7 -0
- package/core/Image.d.ts +40 -0
- package/core/Instances.d.ts +43 -0
- package/core/Ktx2.d.ts +14 -0
- package/core/Lightformer.d.ts +14 -0
- package/core/Line.d.ts +13 -0
- package/core/MapControls.d.ts +14 -0
- package/core/MarchingCubes.d.ts +24 -0
- package/core/Mask.d.ts +17 -0
- package/core/MatcapTexture.d.ts +9 -0
- package/core/MeshDiscardMaterial.d.ts +11 -0
- package/core/MeshDistortMaterial.d.ts +41 -0
- package/core/MeshPortalMaterial.d.ts +28 -0
- package/core/MeshReflectorMaterial.d.ts +27 -0
- package/core/MeshRefractionMaterial.d.ts +22 -0
- package/core/MeshTransmissionMaterial.d.ts +35 -0
- package/core/MeshWobbleMaterial.d.ts +38 -0
- package/core/MotionPathControls.d.ts +27 -0
- package/core/NormalTexture.d.ts +14 -0
- package/core/OrbitControls.d.ts +22 -0
- package/core/OrthographicCamera.d.ts +14 -0
- package/core/Outlines.d.ts +16 -0
- package/core/PerformanceMonitor.d.ts +36 -0
- package/core/PerspectiveCamera.d.ts +14 -0
- package/core/PointMaterial.d.ts +16 -0
- package/core/PointerLockControls.d.ts +15 -0
- package/core/Points.d.ts +34 -0
- package/core/PositionalAudio.d.ts +9 -0
- package/core/Preload.d.ts +8 -0
- package/core/Progress.d.ts +14 -0
- package/core/QuadraticBezierLine.d.ts +16 -0
- package/core/Reflector.d.ts +30 -0
- package/core/RenderCubeTexture.d.ts +30 -0
- package/core/RenderTexture.d.ts +18 -0
- package/core/Resize.d.ts +10 -0
- package/core/RoundedBox.d.ts +12 -0
- package/core/Sampler.d.ts +28 -0
- package/core/ScreenQuad.d.ts +5 -0
- package/core/ScreenSizer.d.ts +7 -0
- package/core/ScreenSpace.d.ts +6 -0
- package/core/Segments.d.ts +31 -0
- package/core/Shadow.d.ts +12 -0
- package/core/ShadowAlpha.d.ts +8 -0
- package/core/Sky.d.ts +17 -0
- package/core/Sparkles.d.ts +21 -0
- package/core/Splat.d.ts +58 -0
- package/core/SpotLight.d.ts +26 -0
- package/core/SpriteAnimator.d.ts +38 -0
- package/core/Stage.d.ts +26 -0
- package/core/Stars.d.ts +24 -0
- package/core/Stats.d.ts +8 -0
- package/core/StatsGl.d.ts +9 -0
- package/core/Svg.d.ts +13 -0
- package/core/Text.d.ts +38 -0
- package/core/Text3D.d.ts +23 -0
- package/core/Texture.d.ts +20 -0
- package/core/TrackballControls.d.ts +15 -0
- package/core/Trail.d.ts +21 -0
- package/core/TrailTexture.d.ts +18 -0
- package/core/TransformControls.d.ts +28 -0
- package/core/VideoTexture.d.ts +14 -0
- package/core/Wireframe.d.ts +17 -0
- package/core/calculateScaleFactor.d.ts +3 -0
- package/core/index.d.ts +122 -0
- package/core/meshBounds.d.ts +2 -0
- package/core/shaderMaterial.d.ts +7 -0
- package/core/shapes.d.ts +25 -0
- package/core/softShadows.d.ts +7 -0
- package/core/useAnimations.d.ts +13 -0
- package/core/useAspect.d.ts +1 -0
- package/core/useBoxProjectedEnv.d.ts +19 -0
- package/core/useCamera.d.ts +3 -0
- package/core/useContextBridge.d.ts +4 -0
- package/core/useDepthBuffer.d.ts +6 -0
- package/core/useEnvironment.d.ts +11 -0
- package/core/useFont.d.ts +24 -0
- package/core/useIntersect.d.ts +3 -0
- package/core/useSpriteLoader.d.ts +10 -0
- package/helpers/constants.d.ts +1 -0
- package/helpers/deprecated.d.ts +8 -0
- package/helpers/environment-assets.d.ts +13 -0
- package/helpers/ts-utils.d.ts +3 -0
- package/helpers/useEffectfulState.d.ts +4 -0
- package/index.cjs.js +1 -1
- package/index.d.ts +1 -0
- package/materials/BlurPass.d.ts +23 -0
- package/materials/ConvolutionMaterial.d.ts +7 -0
- package/materials/DiscardMaterial.d.ts +3 -0
- package/materials/MeshReflectorMaterial.d.ts +66 -0
- package/materials/MeshRefractionMaterial.d.ts +7 -0
- package/materials/SpotLightMaterial.d.ts +4 -0
- package/materials/WireframeMaterial.d.ts +48 -0
- package/native/index.d.ts +1 -0
- package/package.json +1 -1
- package/web/CycleRaycast.d.ts +10 -0
- package/web/DragControls.d.ts +17 -0
- package/web/FaceControls.d.ts +42 -0
- package/web/FaceLandmarker.d.ts +15 -0
- package/web/Facemesh.d.ts +150 -0
- package/web/Html.d.ts +34 -0
- package/web/KeyboardControls.d.ts +37 -0
- package/web/Loader.d.ts +12 -0
- package/web/PresentationControls.d.ts +17 -0
- package/web/ScrollControls.d.ts +45 -0
- package/web/Select.d.ts +14 -0
- package/web/View.d.ts +36 -0
- package/web/index.d.ts +15 -0
- package/web/pivotControls/AxisArrow.d.ts +7 -0
- package/web/pivotControls/AxisRotator.d.ts +7 -0
- package/web/pivotControls/PlaneSlider.d.ts +7 -0
- package/web/pivotControls/ScalingSphere.d.ts +7 -0
- package/web/pivotControls/context.d.ts +32 -0
- package/web/pivotControls/index.d.ts +39 -0
- package/web/useCursor.d.ts +1 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ReactThreeFiber } from '@react-three/fiber';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export type AccumulativeShadowsProps = {
|
|
6
|
+
frames?: number;
|
|
7
|
+
blend?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
scale?: number;
|
|
10
|
+
temporal?: boolean;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
alphaTest?: number;
|
|
13
|
+
color?: string;
|
|
14
|
+
colorBlend?: number;
|
|
15
|
+
resolution?: number;
|
|
16
|
+
toneMapped?: boolean;
|
|
17
|
+
};
|
|
18
|
+
interface AccumulativeContext {
|
|
19
|
+
lights: Map<any, any>;
|
|
20
|
+
temporal: boolean;
|
|
21
|
+
frames: number;
|
|
22
|
+
blend: number;
|
|
23
|
+
count: number;
|
|
24
|
+
getMesh: () => THREE.Mesh<THREE.PlaneGeometry, SoftShadowMaterialProps & THREE.ShaderMaterial>;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
update: (frames?: number) => void;
|
|
27
|
+
}
|
|
28
|
+
interface AccumulativeLightContext {
|
|
29
|
+
update: () => void;
|
|
30
|
+
}
|
|
31
|
+
type SoftShadowMaterialProps = {
|
|
32
|
+
map: THREE.Texture;
|
|
33
|
+
color?: ReactThreeFiber.Color;
|
|
34
|
+
alphaTest?: number;
|
|
35
|
+
blend?: number;
|
|
36
|
+
};
|
|
37
|
+
declare global {
|
|
38
|
+
namespace JSX {
|
|
39
|
+
interface IntrinsicElements {
|
|
40
|
+
softShadowMaterial: JSX.IntrinsicElements['shaderMaterial'] & SoftShadowMaterialProps;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export declare const accumulativeContext: React.Context<AccumulativeContext>;
|
|
45
|
+
export declare const AccumulativeShadows: ForwardRefComponent<JSX.IntrinsicElements['group'] & AccumulativeShadowsProps, AccumulativeContext>;
|
|
46
|
+
export type RandomizedLightProps = {
|
|
47
|
+
frames?: number;
|
|
48
|
+
position?: [x: number, y: number, z: number];
|
|
49
|
+
radius?: number;
|
|
50
|
+
amount?: number;
|
|
51
|
+
intensity?: number;
|
|
52
|
+
ambient?: number;
|
|
53
|
+
castShadow?: boolean;
|
|
54
|
+
bias?: number;
|
|
55
|
+
mapSize?: number;
|
|
56
|
+
size?: number;
|
|
57
|
+
near?: number;
|
|
58
|
+
far?: number;
|
|
59
|
+
};
|
|
60
|
+
export declare const RandomizedLight: ForwardRefComponent<JSX.IntrinsicElements['group'] & RandomizedLightProps, AccumulativeLightContext>;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdaptiveEvents(): null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactThreeFiber } from '@react-three/fiber';
|
|
2
|
+
import { ArcballControls as ArcballControlsImpl } from 'three-stdlib';
|
|
3
|
+
import type { Event, OrthographicCamera, PerspectiveCamera } from 'three';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export type ArcballControlsProps = Omit<ReactThreeFiber.Overwrite<ReactThreeFiber.Object3DNode<ArcballControlsImpl, typeof ArcballControlsImpl>, {
|
|
6
|
+
target?: ReactThreeFiber.Vector3;
|
|
7
|
+
camera?: OrthographicCamera | PerspectiveCamera;
|
|
8
|
+
domElement?: HTMLElement;
|
|
9
|
+
regress?: boolean;
|
|
10
|
+
makeDefault?: boolean;
|
|
11
|
+
onChange?: (e?: Event) => void;
|
|
12
|
+
onStart?: (e?: Event) => void;
|
|
13
|
+
onEnd?: (e?: Event) => void;
|
|
14
|
+
}>, 'ref'>;
|
|
15
|
+
export declare const ArcballControls: ForwardRefComponent<ArcballControlsProps, ArcballControlsImpl>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type AsciiRendererProps = {
|
|
3
|
+
renderIndex?: number;
|
|
4
|
+
bgColor?: string;
|
|
5
|
+
fgColor?: string;
|
|
6
|
+
characters?: string;
|
|
7
|
+
invert?: boolean;
|
|
8
|
+
color?: boolean;
|
|
9
|
+
resolution?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function AsciiRenderer({ renderIndex, bgColor, fgColor, characters, invert, color, resolution, }: AsciiRendererProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { GroupProps } from '@react-three/fiber';
|
|
4
|
+
export interface BBAnchorProps extends GroupProps {
|
|
5
|
+
anchor: THREE.Vector3 | [number, number, number];
|
|
6
|
+
}
|
|
7
|
+
export declare const BBAnchor: ({ anchor, ...props }: BBAnchorProps) => React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type BackdropProps = JSX.IntrinsicElements['group'] & {
|
|
3
|
+
floor?: number;
|
|
4
|
+
segments?: number;
|
|
5
|
+
receiveShadow?: boolean;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare function Backdrop({ children, floor, segments, receiveShadow, ...props }: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
children: any;
|
|
11
|
+
floor?: number | undefined;
|
|
12
|
+
segments?: number | undefined;
|
|
13
|
+
receiveShadow: any;
|
|
14
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function BakeShadows(): null;
|
package/core/Billboard.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),r=require("react"),t=require("three"),n=require("@react-three/fiber");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),r=require("react"),t=require("three"),n=require("@react-three/fiber");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var c=u(e),a=o(r);const i=a.forwardRef((function({children:e,follow:r=!0,lockX:u=!1,lockY:o=!1,lockZ:i=!1,...l},f){const d=a.useRef(null),s=a.useRef(null),p=new t.Quaternion;return n.useFrame((({camera:e})=>{if(!r||!s.current)return;const t=s.current.rotation.clone();s.current.updateMatrix(),s.current.updateWorldMatrix(!1,!1),s.current.getWorldQuaternion(p),e.getWorldQuaternion(d.current.quaternion).premultiply(p.invert()),u&&(s.current.rotation.x=t.x),o&&(s.current.rotation.y=t.y),i&&(s.current.rotation.z=t.z)})),a.useImperativeHandle(f,(()=>s.current),[]),a.createElement("group",c.default({ref:s},l),a.createElement("group",{ref:d},e))}));exports.Billboard=i;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Group } from 'three';
|
|
2
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
3
|
+
export type BillboardProps = {
|
|
4
|
+
follow?: boolean;
|
|
5
|
+
lockX?: boolean;
|
|
6
|
+
lockY?: boolean;
|
|
7
|
+
lockZ?: boolean;
|
|
8
|
+
} & JSX.IntrinsicElements['group'];
|
|
9
|
+
export declare const Billboard: ForwardRefComponent<BillboardProps, Group>;
|
package/core/Billboard.js
CHANGED
|
@@ -44,9 +44,7 @@ const Billboard = /* @__PURE__ */React.forwardRef(function Billboard({
|
|
|
44
44
|
});
|
|
45
45
|
React.useImperativeHandle(fref, () => localRef.current, []);
|
|
46
46
|
return /*#__PURE__*/React.createElement("group", _extends({
|
|
47
|
-
ref: localRef
|
|
48
|
-
matrixAutoUpdate: false,
|
|
49
|
-
matrixWorldAutoUpdate: false
|
|
47
|
+
ref: localRef
|
|
50
48
|
}, props), /*#__PURE__*/React.createElement("group", {
|
|
51
49
|
ref: inner
|
|
52
50
|
}, children));
|
package/core/Bounds.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export type SizeProps = {
|
|
4
|
+
box: THREE.Box3;
|
|
5
|
+
size: THREE.Vector3;
|
|
6
|
+
center: THREE.Vector3;
|
|
7
|
+
distance: number;
|
|
8
|
+
};
|
|
9
|
+
export type BoundsApi = {
|
|
10
|
+
getSize: () => SizeProps;
|
|
11
|
+
refresh(object?: THREE.Object3D | THREE.Box3): BoundsApi;
|
|
12
|
+
reset(): BoundsApi;
|
|
13
|
+
moveTo(position: THREE.Vector3 | [number, number, number]): BoundsApi;
|
|
14
|
+
lookAt({ target, up, }: {
|
|
15
|
+
target?: THREE.Vector3 | [number, number, number];
|
|
16
|
+
up?: THREE.Vector3 | [number, number, number];
|
|
17
|
+
}): BoundsApi;
|
|
18
|
+
to({ position, target }: {
|
|
19
|
+
position: [number, number, number];
|
|
20
|
+
target: [number, number, number];
|
|
21
|
+
}): BoundsApi;
|
|
22
|
+
fit(): BoundsApi;
|
|
23
|
+
clip(): BoundsApi;
|
|
24
|
+
};
|
|
25
|
+
export type BoundsProps = JSX.IntrinsicElements['group'] & {
|
|
26
|
+
maxDuration?: number;
|
|
27
|
+
margin?: number;
|
|
28
|
+
observe?: boolean;
|
|
29
|
+
fit?: boolean;
|
|
30
|
+
clip?: boolean;
|
|
31
|
+
interpolateFunc?: (t: number) => number;
|
|
32
|
+
onFit?: (data: SizeProps) => void;
|
|
33
|
+
};
|
|
34
|
+
export declare function Bounds({ children, maxDuration, margin, observe, fit, clip, interpolateFunc, onFit, }: BoundsProps): React.JSX.Element;
|
|
35
|
+
export declare function useBounds(): BoundsApi;
|
package/core/Bvh.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Mesh, Group } from 'three';
|
|
3
|
+
import { SplitStrategy } from 'three-mesh-bvh';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export interface BVHOptions {
|
|
6
|
+
strategy?: SplitStrategy;
|
|
7
|
+
verbose?: boolean;
|
|
8
|
+
setBoundingBox?: boolean;
|
|
9
|
+
maxDepth?: number;
|
|
10
|
+
maxLeafTris?: number;
|
|
11
|
+
indirect?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type BvhProps = BVHOptions & JSX.IntrinsicElements['group'] & {
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
firstHitOnly?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function useBVH(mesh: React.MutableRefObject<Mesh | undefined>, options?: BVHOptions): void;
|
|
18
|
+
export declare const Bvh: ForwardRefComponent<BvhProps, Group>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EventDispatcher, OrthographicCamera, PerspectiveCamera } from 'three';
|
|
2
|
+
import { ReactThreeFiber } from '@react-three/fiber';
|
|
3
|
+
import CameraControlsImpl from 'camera-controls';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export type CameraControlsProps = Omit<ReactThreeFiber.Overwrite<ReactThreeFiber.Node<CameraControlsImpl, typeof CameraControlsImpl>, {
|
|
6
|
+
camera?: PerspectiveCamera | OrthographicCamera;
|
|
7
|
+
domElement?: HTMLElement;
|
|
8
|
+
makeDefault?: boolean;
|
|
9
|
+
onStart?: (e?: {
|
|
10
|
+
type: 'controlstart';
|
|
11
|
+
}) => void;
|
|
12
|
+
onEnd?: (e?: {
|
|
13
|
+
type: 'controlend';
|
|
14
|
+
}) => void;
|
|
15
|
+
onChange?: (e?: {
|
|
16
|
+
type: 'update';
|
|
17
|
+
}) => void;
|
|
18
|
+
events?: boolean;
|
|
19
|
+
regress?: boolean;
|
|
20
|
+
}>, 'ref' | keyof EventDispatcher>;
|
|
21
|
+
export declare const CameraControls: ForwardRefComponent<CameraControlsProps, CameraControlsImpl>;
|
|
22
|
+
export type CameraControls = CameraControlsImpl;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
2
|
+
export interface ShakeController {
|
|
3
|
+
getIntensity: () => number;
|
|
4
|
+
setIntensity: (val: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface CameraShakeProps {
|
|
7
|
+
intensity?: number;
|
|
8
|
+
decay?: boolean;
|
|
9
|
+
decayRate?: number;
|
|
10
|
+
maxYaw?: number;
|
|
11
|
+
maxPitch?: number;
|
|
12
|
+
maxRoll?: number;
|
|
13
|
+
yawFrequency?: number;
|
|
14
|
+
pitchFrequency?: number;
|
|
15
|
+
rollFrequency?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const CameraShake: ForwardRefComponent<CameraShakeProps, ShakeController | undefined>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Line2 } from 'three-stdlib';
|
|
2
|
+
import { LineProps } from './Line';
|
|
3
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
4
|
+
type Props = Omit<LineProps, 'ref'> & {
|
|
5
|
+
closed?: boolean;
|
|
6
|
+
curveType?: 'centripetal' | 'chordal' | 'catmullrom';
|
|
7
|
+
tension?: number;
|
|
8
|
+
segments?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const CatmullRomLine: ForwardRefComponent<Props, Line2>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ReactThreeFiber } from '@react-three/fiber';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
type CausticsProps = JSX.IntrinsicElements['group'] & {
|
|
6
|
+
frames?: number;
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
causticsOnly: boolean;
|
|
9
|
+
backside: boolean;
|
|
10
|
+
ior?: number;
|
|
11
|
+
backsideIOR?: number;
|
|
12
|
+
worldRadius?: number;
|
|
13
|
+
intensity?: number;
|
|
14
|
+
color?: ReactThreeFiber.Color;
|
|
15
|
+
resolution?: number;
|
|
16
|
+
lightSource?: [x: number, y: number, z: number] | React.MutableRefObject<THREE.Object3D>;
|
|
17
|
+
};
|
|
18
|
+
declare global {
|
|
19
|
+
namespace JSX {
|
|
20
|
+
interface IntrinsicElements {
|
|
21
|
+
causticsProjectionMaterial: ReactThreeFiber.MeshNormalMaterialProps & {
|
|
22
|
+
viewMatrix?: {
|
|
23
|
+
value: THREE.Matrix4;
|
|
24
|
+
};
|
|
25
|
+
color?: ReactThreeFiber.Color;
|
|
26
|
+
causticsTexture?: THREE.Texture;
|
|
27
|
+
causticsTextureB?: THREE.Texture;
|
|
28
|
+
lightProjMatrix?: THREE.Matrix4;
|
|
29
|
+
lightViewMatrix?: THREE.Matrix4;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export declare const Caustics: ForwardRefComponent<CausticsProps, THREE.Group>;
|
|
35
|
+
export {};
|
package/core/Center.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Box3, Vector3, Sphere, Group, Object3D } from 'three';
|
|
2
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
3
|
+
export type OnCenterCallbackProps = {
|
|
4
|
+
parent: Object3D;
|
|
5
|
+
container: Object3D;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
depth: number;
|
|
9
|
+
boundingBox: Box3;
|
|
10
|
+
boundingSphere: Sphere;
|
|
11
|
+
center: Vector3;
|
|
12
|
+
verticalAlignment: number;
|
|
13
|
+
horizontalAlignment: number;
|
|
14
|
+
depthAlignment: number;
|
|
15
|
+
};
|
|
16
|
+
export type CenterProps = {
|
|
17
|
+
top?: boolean;
|
|
18
|
+
right?: boolean;
|
|
19
|
+
bottom?: boolean;
|
|
20
|
+
left?: boolean;
|
|
21
|
+
front?: boolean;
|
|
22
|
+
back?: boolean;
|
|
23
|
+
disable?: boolean;
|
|
24
|
+
disableX?: boolean;
|
|
25
|
+
disableY?: boolean;
|
|
26
|
+
disableZ?: boolean;
|
|
27
|
+
precise?: boolean;
|
|
28
|
+
onCentered?: (props: OnCenterCallbackProps) => void;
|
|
29
|
+
cacheKey?: any;
|
|
30
|
+
};
|
|
31
|
+
export declare const Center: ForwardRefComponent<JSX.IntrinsicElements['group'] & CenterProps, Group>;
|
package/core/Clone.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { MeshProps } from '@react-three/fiber';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export type CloneProps = {
|
|
6
|
+
object: THREE.Object3D | THREE.Object3D[];
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
deep?: boolean | 'materialsOnly' | 'geometriesOnly';
|
|
9
|
+
keys?: string[];
|
|
10
|
+
inject?: MeshProps | React.ReactNode | ((object: THREE.Object3D) => React.ReactNode);
|
|
11
|
+
castShadow?: boolean;
|
|
12
|
+
receiveShadow?: boolean;
|
|
13
|
+
isChild?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const Clone: ForwardRefComponent<Omit<JSX.IntrinsicElements['group'], 'children'> & CloneProps, THREE.Group>;
|
package/core/Cloud.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Color, Group, Vector3, Material, MeshLambertMaterial, Matrix4 } from 'three';
|
|
3
|
+
import { MaterialNode, ReactThreeFiber } from '@react-three/fiber';
|
|
4
|
+
declare global {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
cloudMaterial: MaterialNode<MeshLambertMaterial, typeof MeshLambertMaterial>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
type CloudState = {
|
|
12
|
+
uuid: string;
|
|
13
|
+
index: number;
|
|
14
|
+
segments: number;
|
|
15
|
+
dist: number;
|
|
16
|
+
matrix: Matrix4;
|
|
17
|
+
bounds: Vector3;
|
|
18
|
+
position: Vector3;
|
|
19
|
+
volume: number;
|
|
20
|
+
length: number;
|
|
21
|
+
ref: React.MutableRefObject<Group>;
|
|
22
|
+
speed: number;
|
|
23
|
+
growth: number;
|
|
24
|
+
opacity: number;
|
|
25
|
+
fade: number;
|
|
26
|
+
density: number;
|
|
27
|
+
rotation: number;
|
|
28
|
+
rotationFactor: number;
|
|
29
|
+
color: Color;
|
|
30
|
+
};
|
|
31
|
+
type CloudsProps = JSX.IntrinsicElements['group'] & {
|
|
32
|
+
texture?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
range?: number;
|
|
35
|
+
material?: typeof Material;
|
|
36
|
+
frustumCulled?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type CloudProps = JSX.IntrinsicElements['group'] & {
|
|
39
|
+
seed?: number;
|
|
40
|
+
segments?: number;
|
|
41
|
+
bounds?: ReactThreeFiber.Vector3;
|
|
42
|
+
concentrate?: 'random' | 'inside' | 'outside';
|
|
43
|
+
scale?: ReactThreeFiber.Vector3;
|
|
44
|
+
volume?: number;
|
|
45
|
+
smallestVolume?: number;
|
|
46
|
+
distribute?: (cloud: CloudState, index: number) => {
|
|
47
|
+
point: Vector3;
|
|
48
|
+
volume?: number;
|
|
49
|
+
};
|
|
50
|
+
growth?: number;
|
|
51
|
+
speed?: number;
|
|
52
|
+
fade?: number;
|
|
53
|
+
opacity?: number;
|
|
54
|
+
color?: ReactThreeFiber.Color;
|
|
55
|
+
};
|
|
56
|
+
export declare const Clouds: React.ForwardRefExoticComponent<Omit<CloudsProps, "ref"> & React.RefAttributes<Group>>;
|
|
57
|
+
export declare const CloudInstance: React.ForwardRefExoticComponent<Omit<CloudProps, "ref"> & React.RefAttributes<Group>>;
|
|
58
|
+
export declare const Cloud: React.ForwardRefExoticComponent<Omit<CloudProps, "ref"> & React.RefAttributes<Group>>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BufferAttributeProps } from '@react-three/fiber';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { BufferAttribute, BufferGeometry } from 'three';
|
|
4
|
+
type Props = {
|
|
5
|
+
compute: (geometry: BufferGeometry) => BufferAttribute;
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ComputedAttribute: ({ compute, name, ...props }: React.PropsWithChildren<Props & BufferAttributeProps>) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
3
|
+
export type ContactShadowsProps = {
|
|
4
|
+
opacity?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
blur?: number;
|
|
8
|
+
near?: number;
|
|
9
|
+
far?: number;
|
|
10
|
+
smooth?: boolean;
|
|
11
|
+
resolution?: number;
|
|
12
|
+
frames?: number;
|
|
13
|
+
scale?: number | [x: number, y: number];
|
|
14
|
+
color?: THREE.ColorRepresentation;
|
|
15
|
+
depthWrite?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const ContactShadows: ForwardRefComponent<Omit<JSX.IntrinsicElements['group'], 'scale'> & ContactShadowsProps, THREE.Group>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { Fog, FogExp2, Texture } from 'three';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export type CubeCameraOptions = {
|
|
5
|
+
resolution?: number;
|
|
6
|
+
near?: number;
|
|
7
|
+
far?: number;
|
|
8
|
+
envMap?: THREE.Texture;
|
|
9
|
+
fog?: Fog | FogExp2;
|
|
10
|
+
};
|
|
11
|
+
export declare function useCubeCamera({ resolution, near, far, envMap, fog }?: CubeCameraOptions): {
|
|
12
|
+
fbo: THREE.WebGLCubeRenderTarget;
|
|
13
|
+
camera: THREE.CubeCamera;
|
|
14
|
+
update: () => void;
|
|
15
|
+
};
|
|
16
|
+
type Props = Omit<JSX.IntrinsicElements['group'], 'children'> & {
|
|
17
|
+
children?: (tex: Texture) => React.ReactNode;
|
|
18
|
+
frames?: number;
|
|
19
|
+
} & CubeCameraOptions;
|
|
20
|
+
export declare function CubeCamera({ children, frames, resolution, near, far, envMap, fog, ...props }: Props): React.JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CubeTexture as _CubeTexture, Texture } from 'three';
|
|
3
|
+
type Options = {
|
|
4
|
+
path: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function useCubeTexture(files: string[], { path }: Options): _CubeTexture;
|
|
7
|
+
export declare namespace useCubeTexture {
|
|
8
|
+
var preload: (files: string[], { path }: Options) => undefined;
|
|
9
|
+
}
|
|
10
|
+
type CubeTextureProps = {
|
|
11
|
+
children?: (tex: Texture) => React.ReactNode;
|
|
12
|
+
files: Parameters<typeof useCubeTexture>[0];
|
|
13
|
+
} & Options;
|
|
14
|
+
export declare function CubeTexture({ children, files, ...options }: CubeTextureProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
import { Line2 } from 'three-stdlib';
|
|
3
|
+
import { LineProps } from './Line';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
type Props = Omit<LineProps, 'points' | 'ref'> & {
|
|
6
|
+
start: Vector3 | [number, number, number];
|
|
7
|
+
end: Vector3 | [number, number, number];
|
|
8
|
+
midA: Vector3 | [number, number, number];
|
|
9
|
+
midB: Vector3 | [number, number, number];
|
|
10
|
+
segments?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const CubicBezierLine: ForwardRefComponent<Props, Line2>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { Flow } from 'three-stdlib';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export interface CurveModifierProps {
|
|
6
|
+
children: React.ReactElement<JSX.IntrinsicElements['mesh']>;
|
|
7
|
+
curve?: THREE.Curve<THREE.Vector3>;
|
|
8
|
+
}
|
|
9
|
+
export type CurveModifierRef = Pick<Flow, 'moveAlongCurve'>;
|
|
10
|
+
export declare const CurveModifier: ForwardRefComponent<CurveModifierProps, CurveModifierRef>;
|
package/core/Decal.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import * as FIBER from '@react-three/fiber';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export type DecalProps = Omit<JSX.IntrinsicElements['mesh'], 'children'> & {
|
|
6
|
+
debug?: boolean;
|
|
7
|
+
mesh?: React.MutableRefObject<THREE.Mesh>;
|
|
8
|
+
position?: FIBER.Vector3;
|
|
9
|
+
rotation?: FIBER.Euler | number;
|
|
10
|
+
scale?: FIBER.Vector3;
|
|
11
|
+
map?: THREE.Texture;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
polygonOffsetFactor?: number;
|
|
14
|
+
depthTest?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const Decal: ForwardRefComponent<DecalProps, THREE.Mesh>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LOD, Object3D } from 'three';
|
|
3
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
4
|
+
type Props = JSX.IntrinsicElements['lOD'] & {
|
|
5
|
+
children: React.ReactElement<Object3D>[];
|
|
6
|
+
hysteresis?: number;
|
|
7
|
+
distances: number[];
|
|
8
|
+
};
|
|
9
|
+
export declare const Detailed: ForwardRefComponent<Props, LOD>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GetGPUTier } from 'detect-gpu';
|
|
3
|
+
export declare const useDetectGPU: (props?: GetGPUTier) => import("detect-gpu").TierResult;
|
|
4
|
+
type DetectGPUProps = {
|
|
5
|
+
children?: (result: ReturnType<typeof useDetectGPU>) => React.ReactNode;
|
|
6
|
+
} & Parameters<typeof useDetectGPU>[0];
|
|
7
|
+
export declare function DetectGPU({ children, ...options }: DetectGPUProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactThreeFiber } from '@react-three/fiber';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { DeviceOrientationControls as DeviceOrientationControlsImp } from 'three-stdlib';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export type DeviceOrientationControlsProps = ReactThreeFiber.Object3DNode<DeviceOrientationControlsImp, typeof DeviceOrientationControlsImp> & {
|
|
6
|
+
camera?: THREE.Camera;
|
|
7
|
+
onChange?: (e?: THREE.Event) => void;
|
|
8
|
+
makeDefault?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const DeviceOrientationControls: ForwardRefComponent<DeviceOrientationControlsProps, DeviceOrientationControlsImp>;
|
package/core/Edges.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { ReactThreeFiber, type ThreeElements } from '@react-three/fiber';
|
|
3
|
+
import { LineSegmentsGeometry, LineMaterial, LineMaterialParameters, Line2 } from 'three-stdlib';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
export type EdgesRef = THREE.Mesh<LineSegmentsGeometry, LineMaterial>;
|
|
6
|
+
export type EdgesProps = Partial<ThreeElements['mesh']> & {
|
|
7
|
+
threshold?: number;
|
|
8
|
+
lineWidth?: number;
|
|
9
|
+
} & Omit<LineMaterialParameters, 'vertexColors' | 'color'> & Omit<ReactThreeFiber.Object3DNode<Line2, typeof Line2>, 'args' | 'geometry'> & Omit<ReactThreeFiber.Object3DNode<LineMaterial, [LineMaterialParameters]>, 'color' | 'vertexColors' | 'args'> & {
|
|
10
|
+
geometry?: THREE.BufferGeometry;
|
|
11
|
+
color?: THREE.ColorRepresentation;
|
|
12
|
+
};
|
|
13
|
+
export declare const Edges: ForwardRefComponent<EdgesProps, EdgesRef>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TextureDataType } from 'three';
|
|
2
|
+
import { ReactThreeFiber } from '@react-three/fiber';
|
|
3
|
+
import { EffectComposer, RenderPass, ShaderPass } from 'three-stdlib';
|
|
4
|
+
import { ForwardRefComponent } from '../helpers/ts-utils';
|
|
5
|
+
import { TextureEncoding } from '../helpers/deprecated';
|
|
6
|
+
type Props = ReactThreeFiber.Node<EffectComposer, typeof EffectComposer> & {
|
|
7
|
+
multisamping?: number;
|
|
8
|
+
encoding?: TextureEncoding;
|
|
9
|
+
type?: TextureDataType;
|
|
10
|
+
renderIndex?: number;
|
|
11
|
+
disableGamma?: boolean;
|
|
12
|
+
disableRenderPass?: boolean;
|
|
13
|
+
disableRender?: boolean;
|
|
14
|
+
depthBuffer?: boolean;
|
|
15
|
+
stencilBuffer?: boolean;
|
|
16
|
+
anisotropy?: number;
|
|
17
|
+
};
|
|
18
|
+
declare global {
|
|
19
|
+
namespace JSX {
|
|
20
|
+
interface IntrinsicElements {
|
|
21
|
+
effectComposer: ReactThreeFiber.Node<EffectComposer, typeof EffectComposer>;
|
|
22
|
+
renderPass: ReactThreeFiber.Node<RenderPass, typeof RenderPass>;
|
|
23
|
+
shaderPass: ReactThreeFiber.Node<ShaderPass, typeof ShaderPass>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export declare const isWebGL2Available: () => boolean;
|
|
28
|
+
export declare const Effects: ForwardRefComponent<Props, EffectComposer>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Object3DNode, Euler } from '@react-three/fiber';
|
|
3
|
+
import { Texture, Scene } from 'three';
|
|
4
|
+
import { GroundProjectedEnv as GroundProjectedEnvImpl } from 'three-stdlib';
|
|
5
|
+
import { PresetsType } from '../helpers/environment-assets';
|
|
6
|
+
import { EnvironmentLoaderProps } from './useEnvironment';
|
|
7
|
+
export type EnvironmentProps = {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
frames?: number;
|
|
10
|
+
near?: number;
|
|
11
|
+
far?: number;
|
|
12
|
+
resolution?: number;
|
|
13
|
+
background?: boolean | 'only';
|
|
14
|
+
blur?: number;
|
|
15
|
+
backgroundBlurriness?: number;
|
|
16
|
+
backgroundIntensity?: number;
|
|
17
|
+
backgroundRotation?: Euler;
|
|
18
|
+
environmentIntensity?: number;
|
|
19
|
+
environmentRotation?: Euler;
|
|
20
|
+
map?: Texture;
|
|
21
|
+
preset?: PresetsType;
|
|
22
|
+
scene?: Scene | React.MutableRefObject<Scene>;
|
|
23
|
+
ground?: boolean | {
|
|
24
|
+
radius?: number;
|
|
25
|
+
height?: number;
|
|
26
|
+
scale?: number;
|
|
27
|
+
};
|
|
28
|
+
} & EnvironmentLoaderProps;
|
|
29
|
+
export declare function EnvironmentMap({ scene, background, map, ...config }: EnvironmentProps): null;
|
|
30
|
+
export declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, ...rest }: EnvironmentProps): null;
|
|
31
|
+
export declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): React.JSX.Element;
|
|
32
|
+
declare global {
|
|
33
|
+
namespace JSX {
|
|
34
|
+
interface IntrinsicElements {
|
|
35
|
+
groundProjectedEnvImpl: Object3DNode<GroundProjectedEnvImpl, typeof GroundProjectedEnvImpl>;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export declare function Environment(props: EnvironmentProps): React.JSX.Element;
|