@react-three/drei 8.16.5 → 8.17.0
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 +55 -2
- package/core/Bounds.cjs.js +1 -1
- package/core/Bounds.d.ts +2 -1
- package/core/Bounds.js +24 -13
- package/core/Points.d.ts +1 -1
- package/core/SpotLight.d.ts +1 -1
- package/core/Trail.cjs.js +1 -0
- package/core/Trail.d.ts +20 -0
- package/core/Trail.js +158 -0
- package/core/index.cjs.js +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.js +2 -0
- package/index.cjs.js +1 -1
- package/index.js +1 -0
- package/native/index.cjs.js +1 -1
- package/native/index.js +2 -0
- package/package.json +2 -1
- package/web/index.cjs.js +1 -1
- package/web/index.js +2 -0
package/README.md
CHANGED
|
@@ -65,6 +65,7 @@ The `native` route of the library **does not** export `Html` or `Loader`. The de
|
|
|
65
65
|
<li><a href="#effects">Effects</a></li>
|
|
66
66
|
<li><a href="#gradienttexture">GradientTexture</a></li>
|
|
67
67
|
<li><a href="#edges">Edges</a></li>
|
|
68
|
+
<li><a href="#trail">Trail</a></li>
|
|
68
69
|
<li><a href="#useanimations">useAnimations</a></li>
|
|
69
70
|
</ul>
|
|
70
71
|
<li><a href="#shaders">Shaders</a></li>
|
|
@@ -100,6 +101,7 @@ The `native` route of the library **does not** export `Html` or `Loader`. The de
|
|
|
100
101
|
<li><a href="#usecursor">useCursor</a></li>
|
|
101
102
|
<li><a href="#useintersect">useIntersect</a></li>
|
|
102
103
|
<li><a href="#useboxprojectedenv">useBoxProjectedEnv</a></li>
|
|
104
|
+
<li><a href="#useTrail">useTrail</a></li>
|
|
103
105
|
</ul>
|
|
104
106
|
<li><a href="#loading">Loaders</a></li>
|
|
105
107
|
<ul>
|
|
@@ -641,6 +643,36 @@ Abstracts [THREE.EdgesGeometry](https://threejs.org/docs/index.html?q=EdgesGeome
|
|
|
641
643
|
</mesh>
|
|
642
644
|
```
|
|
643
645
|
|
|
646
|
+
#### Trail
|
|
647
|
+
|
|
648
|
+
[](https://drei.vercel.app/?path=/story/misc-trail--use-trail-st)
|
|
649
|
+
|
|
650
|
+
A declarative, `three.MeshLine` based Trails implementation. You can attach it to any mesh and it will give it a beautiful trail.
|
|
651
|
+
|
|
652
|
+
Props defined bellow with their default values.
|
|
653
|
+
|
|
654
|
+
```jsx
|
|
655
|
+
<Trail
|
|
656
|
+
width={0.2} // Width of the line
|
|
657
|
+
color={'hotpink'} // Color of the line
|
|
658
|
+
length={1} // Length of the line
|
|
659
|
+
decay={1} // How fast the line fades away
|
|
660
|
+
target={undefined} // Optional target. This object will produce the trail.
|
|
661
|
+
attenuation={(width) => width} // A function to define the width in each point along it.
|
|
662
|
+
>
|
|
663
|
+
{/* If `target` is not defined, Trail will use the first `Object3D` child as the target. */}
|
|
664
|
+
<mesh>
|
|
665
|
+
<sphereGeometry />
|
|
666
|
+
<meshBasicMaterial />
|
|
667
|
+
</mesh>
|
|
668
|
+
|
|
669
|
+
{/* You can optionally define a custom meshLineMaterial to use. */}
|
|
670
|
+
{/* <meshLineMaterial color={"red"} /> */}
|
|
671
|
+
</Trail>
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
👉 Inspired by [TheSpite's Codevember 2021 #9](https://spite.github.io/codevember-2021/9/)
|
|
675
|
+
|
|
644
676
|
#### useAnimations
|
|
645
677
|
|
|
646
678
|
[](https://drei.pmnd.rs/?path=/story/abstractions-useanimations--use-animations-st)
|
|
@@ -1137,6 +1169,27 @@ const projection = useBoxProjectedEnv(
|
|
|
1137
1169
|
</CubeCamera>
|
|
1138
1170
|
```
|
|
1139
1171
|
|
|
1172
|
+
#### useTrail
|
|
1173
|
+
|
|
1174
|
+
[](https://drei.vercel.app/?path=/story/misc-trail--use-trail-st)
|
|
1175
|
+
|
|
1176
|
+
A hook to obtain an array of points that make up a [Trail](#trail). You can use this array to drive your own `MeshLine` or make a trail out of anything you please.
|
|
1177
|
+
|
|
1178
|
+
Note: The hook returns a ref (`MutableRefObject<Vector3[]>`) this means updates to it will not trigger a re-draw, thus keeping this cheap.
|
|
1179
|
+
|
|
1180
|
+
```js
|
|
1181
|
+
const points = useTrail(
|
|
1182
|
+
target, // Required target object. This object will produce the trail.
|
|
1183
|
+
length, // Length of the line
|
|
1184
|
+
decay // How fast the line fades away
|
|
1185
|
+
)
|
|
1186
|
+
|
|
1187
|
+
// To use...
|
|
1188
|
+
useFrame(() => {
|
|
1189
|
+
meshLineRef.current.position.setPoints(points.current)
|
|
1190
|
+
})
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1140
1193
|
# Loading
|
|
1141
1194
|
|
|
1142
1195
|
#### Loader
|
|
@@ -1522,10 +1575,10 @@ Calculates a boundary box and centers its children accordingly. `alignTop` adjus
|
|
|
1522
1575
|
<a href="https://codesandbox.io/s/rz2g0"><img width="20%" src="https://codesandbox.io/api/v1/sandboxes/rz2g0/screenshot.png" alt="Demo"/></a>
|
|
1523
1576
|
</p>
|
|
1524
1577
|
|
|
1525
|
-
Calculates a boundary box and centers the camera accordingly. If you are using controls, make sure to pass them the `makeDefault` prop. `fit` fits the current view on first render. `clip` sets the cameras near/far planes.
|
|
1578
|
+
Calculates a boundary box and centers the camera accordingly. If you are using controls, make sure to pass them the `makeDefault` prop. `fit` fits the current view on first render. `clip` sets the cameras near/far planes. `observe` will optionally use r3f's resize-observer to refresh bounds on resize.
|
|
1526
1579
|
|
|
1527
1580
|
```jsx
|
|
1528
|
-
<Bounds fit clip damping={6} margin={1.2}>
|
|
1581
|
+
<Bounds fit clip observe damping={6} margin={1.2}>
|
|
1529
1582
|
<mesh />
|
|
1530
1583
|
</Bounds>
|
|
1531
1584
|
```
|
package/core/Bounds.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("three"),r=require("@react-three/fiber");function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=o(e),n=o(t);const c=e=>e&&e.isOrthographicCamera,i=a.createContext(null);exports.Bounds=function({children:e,damping:t=6,fit:o,clip:s,margin:m=1.2,eps:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("three"),r=require("@react-three/fiber");function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=o(e),n=o(t);const c=e=>e&&e.isOrthographicCamera,i=a.createContext(null);exports.Bounds=function({children:e,damping:t=6,fit:o,clip:s,observe:u,margin:m=1.2,eps:f=.01,onFit:l}){const p=a.useRef(null),{camera:x,invalidate:z,size:d,controls:y}=r.useThree(),h=a.useRef(l);function M(e,t){return Math.abs(e.x-t.x)<f&&Math.abs(e.y-t.y)<f&&Math.abs(e.z-t.z)<f}function g(e,t,r,o){e.x=n.MathUtils.damp(e.x,t.x,r,o),e.y=n.MathUtils.damp(e.y,t.y,r,o),e.z=n.MathUtils.damp(e.z,t.z,r,o)}h.current=l;const[b]=a.useState((()=>({animating:!1,focus:new n.Vector3,camera:new n.Vector3,zoom:1}))),[w]=a.useState((()=>({focus:new n.Vector3,camera:new n.Vector3,zoom:1}))),[v]=a.useState((()=>new n.Box3)),V=a.useMemo((()=>{function e(){const e=v.getSize(new n.Vector3),t=v.getCenter(new n.Vector3),r=Math.max(e.x,e.y,e.z),o=c(x)?4*r:r/(2*Math.atan(Math.PI*x.fov/360)),a=c(x)?4*r:o/x.aspect,i=m*Math.max(o,a);return{box:v,size:e,center:t,distance:i}}return{getSize:e,refresh(t){if((r=t)&&r.isBox3)v.copy(t);else{const e=t||p.current;e.updateWorldMatrix(!0,!0),v.setFromObject(e)}var r;if(v.isEmpty()){const e=x.position.length()||10;v.setFromCenterAndSize(new n.Vector3,new n.Vector3(e,e,e))}if("OrthographicTrackballControls"===(null==y?void 0:y.constructor.name)){const{distance:t}=e(),r=x.position.clone().sub(y.target).normalize().multiplyScalar(t),o=y.target.clone().add(r);x.position.copy(o)}return this},clip(){const{distance:t}=e();return y&&(y.maxDistance=10*t),x.near=t/100,x.far=100*t,x.updateProjectionMatrix(),y&&y.update(),z(),this},fit(){b.camera.copy(x.position),y&&b.focus.copy(y.target);const{center:r,distance:o}=e(),a=r.clone().sub(x.position).normalize().multiplyScalar(o);if(w.camera.copy(r).sub(a),w.focus.copy(r),c(x)){b.zoom=x.zoom;let e=0,o=0;const a=[new n.Vector3(v.min.x,v.min.y,v.min.z),new n.Vector3(v.min.x,v.max.y,v.min.z),new n.Vector3(v.min.x,v.min.y,v.max.z),new n.Vector3(v.min.x,v.max.y,v.max.z),new n.Vector3(v.max.x,v.max.y,v.max.z),new n.Vector3(v.max.x,v.max.y,v.min.z),new n.Vector3(v.max.x,v.min.y,v.max.z),new n.Vector3(v.max.x,v.min.y,v.min.z)];r.applyMatrix4(x.matrixWorldInverse);for(const t of a)t.applyMatrix4(x.matrixWorldInverse),e=Math.max(e,Math.abs(t.y-r.y)),o=Math.max(o,Math.abs(t.x-r.x));e*=2,o*=2;const c=(x.top-x.bottom)/e,i=(x.right-x.left)/o;w.zoom=Math.min(c,i)/m,t||(x.zoom=w.zoom,x.updateProjectionMatrix())}return t?b.animating=!0:(x.position.copy(w.camera),x.lookAt(w.focus),y&&(y.target.copy(w.focus),y.update())),h.current&&h.current(this.getSize()),z(),this}}}),[v,x,y,m,t,z]);a.useLayoutEffect((()=>{if(y){const e=()=>b.animating=!1;return y.addEventListener("start",e),()=>y.removeEventListener("start",e)}}),[y]);const j=a.useRef(0);return a.useEffect((()=>{(u||0==j.current++)&&(V.refresh(),o&&V.fit(),s&&V.clip())}),[d,s,o,u]),r.useFrame(((e,r)=>{if(b.animating){if(g(b.focus,w.focus,t,r),g(b.camera,w.camera,t,r),b.zoom=n.MathUtils.damp(b.zoom,w.zoom,t,r),x.position.copy(b.camera),c(x)&&(x.zoom=b.zoom,x.updateProjectionMatrix()),y?(y.target.copy(b.focus),y.update()):x.lookAt(b.focus),z(),c(x)&&!(Math.abs(b.zoom-w.zoom)<f))return;if(!c(x)&&!M(b.camera,w.camera))return;if(y&&!M(b.focus,w.focus))return;b.animating=!1}})),a.createElement("group",{ref:p},a.createElement(i.Provider,{value:V},e))},exports.useBounds=function(){return a.useContext(i)};
|
package/core/Bounds.d.ts
CHANGED
|
@@ -16,9 +16,10 @@ export declare type BoundsProps = JSX.IntrinsicElements['group'] & {
|
|
|
16
16
|
damping?: number;
|
|
17
17
|
fit?: boolean;
|
|
18
18
|
clip?: boolean;
|
|
19
|
+
observe?: boolean;
|
|
19
20
|
margin?: number;
|
|
20
21
|
eps?: number;
|
|
21
22
|
onFit?: (data: SizeProps) => void;
|
|
22
23
|
};
|
|
23
|
-
export declare function Bounds({ children, damping, fit, clip, margin, eps, onFit }: BoundsProps): JSX.Element;
|
|
24
|
+
export declare function Bounds({ children, damping, fit, clip, observe, margin, eps, onFit }: BoundsProps): JSX.Element;
|
|
24
25
|
export declare function useBounds(): BoundsApi;
|
package/core/Bounds.js
CHANGED
|
@@ -4,8 +4,6 @@ import { useThree, useFrame } from '@react-three/fiber';
|
|
|
4
4
|
|
|
5
5
|
const isOrthographic = def => def && def.isOrthographicCamera;
|
|
6
6
|
|
|
7
|
-
const isObject3D = def => def && def.isObject3D;
|
|
8
|
-
|
|
9
7
|
const isBox3 = def => def && def.isBox3;
|
|
10
8
|
|
|
11
9
|
const context = /*#__PURE__*/React.createContext(null);
|
|
@@ -14,15 +12,19 @@ function Bounds({
|
|
|
14
12
|
damping = 6,
|
|
15
13
|
fit,
|
|
16
14
|
clip,
|
|
15
|
+
observe,
|
|
17
16
|
margin = 1.2,
|
|
18
17
|
eps = 0.01,
|
|
19
18
|
onFit
|
|
20
19
|
}) {
|
|
21
|
-
const ref = React.useRef(null);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
const ref = React.useRef(null); // @ts-expect-error new in @react-three/fiber@7.0.5
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
camera,
|
|
24
|
+
invalidate,
|
|
25
|
+
size,
|
|
26
|
+
controls
|
|
27
|
+
} = useThree();
|
|
26
28
|
const onFitRef = React.useRef(onFit);
|
|
27
29
|
onFitRef.current = onFit;
|
|
28
30
|
|
|
@@ -68,7 +70,11 @@ function Bounds({
|
|
|
68
70
|
getSize,
|
|
69
71
|
|
|
70
72
|
refresh(object) {
|
|
71
|
-
if (
|
|
73
|
+
if (isBox3(object)) box.copy(object);else {
|
|
74
|
+
const target = object || ref.current;
|
|
75
|
+
target.updateWorldMatrix(true, true);
|
|
76
|
+
box.setFromObject(target);
|
|
77
|
+
}
|
|
72
78
|
|
|
73
79
|
if (box.isEmpty()) {
|
|
74
80
|
const max = camera.position.length() || 10;
|
|
@@ -158,10 +164,6 @@ function Bounds({
|
|
|
158
164
|
};
|
|
159
165
|
}, [box, camera, controls, margin, damping, invalidate]);
|
|
160
166
|
React.useLayoutEffect(() => {
|
|
161
|
-
api.refresh();
|
|
162
|
-
if (fit) api.fit();
|
|
163
|
-
if (clip) api.clip();
|
|
164
|
-
|
|
165
167
|
if (controls) {
|
|
166
168
|
// Try to prevent drag hijacking
|
|
167
169
|
const callback = () => current.animating = false;
|
|
@@ -169,7 +171,16 @@ function Bounds({
|
|
|
169
171
|
controls.addEventListener('start', callback);
|
|
170
172
|
return () => controls.removeEventListener('start', callback);
|
|
171
173
|
}
|
|
172
|
-
}, [
|
|
174
|
+
}, [controls]); // Scale pointer on window resize
|
|
175
|
+
|
|
176
|
+
const count = React.useRef(0);
|
|
177
|
+
React.useEffect(() => {
|
|
178
|
+
if (observe || count.current++ === 0) {
|
|
179
|
+
api.refresh();
|
|
180
|
+
if (fit) api.fit();
|
|
181
|
+
if (clip) api.clip();
|
|
182
|
+
}
|
|
183
|
+
}, [size, clip, fit, observe]);
|
|
173
184
|
useFrame((state, delta) => {
|
|
174
185
|
if (current.animating) {
|
|
175
186
|
damp(current.focus, goal.focus, damping, delta);
|
package/core/Points.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ declare type PointsBuffersProps = JSX.IntrinsicElements['points'] & {
|
|
|
11
11
|
sizes?: Float32Array;
|
|
12
12
|
stride?: 2 | 3;
|
|
13
13
|
};
|
|
14
|
-
export declare const PointsBuffer: React.ForwardRefExoticComponent<Pick<PointsBuffersProps, "visible" | "attach" | "attachArray" | "attachObject" | "args" | "children" | "key" | "onUpdate" | "position" | "up" | "scale" | "rotation" | "matrix" | "quaternion" | "layers" | "dispose" | "type" | "id" | "uuid" | "name" | "parent" | "modelViewMatrix" | "normalMatrix" | "matrixWorld" | "matrixAutoUpdate" | "matrixWorldNeedsUpdate" | "castShadow" | "receiveShadow" | "frustumCulled" | "renderOrder" | "animations" | "userData" | "customDepthMaterial" | "customDistanceMaterial" | "isObject3D" | "onBeforeRender" | "onAfterRender" | "applyMatrix4" | "applyQuaternion" | "setRotationFromAxisAngle" | "setRotationFromEuler" | "setRotationFromMatrix" | "setRotationFromQuaternion" | "rotateOnAxis" | "rotateOnWorldAxis" | "rotateX" | "rotateY" | "rotateZ" | "translateOnAxis" | "translateX" | "translateY" | "translateZ" | "localToWorld" | "worldToLocal" | "lookAt" | "add" | "remove" | "removeFromParent" | "clear" | "getObjectById" | "getObjectByName" | "getObjectByProperty" | "getWorldPosition" | "getWorldQuaternion" | "getWorldScale" | "getWorldDirection" | "raycast" | "traverse" | "traverseVisible" | "traverseAncestors" | "updateMatrix" | "updateMatrixWorld" | "updateWorldMatrix" | "toJSON" | "clone" | "copy" | "addEventListener" | "hasEventListener" | "removeEventListener" | "dispatchEvent" | keyof import("@react-three/fiber/dist/declarations/src/core/events").EventHandlers | "material" | "geometry" | "morphTargetInfluences" | "morphTargetDictionary" | "updateMorphTargets" | "colors" | "
|
|
14
|
+
export declare const PointsBuffer: React.ForwardRefExoticComponent<Pick<PointsBuffersProps, "visible" | "attach" | "attachArray" | "attachObject" | "args" | "children" | "key" | "onUpdate" | "position" | "up" | "scale" | "rotation" | "matrix" | "quaternion" | "layers" | "dispose" | "type" | "id" | "uuid" | "name" | "parent" | "modelViewMatrix" | "normalMatrix" | "matrixWorld" | "matrixAutoUpdate" | "matrixWorldNeedsUpdate" | "castShadow" | "receiveShadow" | "frustumCulled" | "renderOrder" | "animations" | "userData" | "customDepthMaterial" | "customDistanceMaterial" | "isObject3D" | "onBeforeRender" | "onAfterRender" | "applyMatrix4" | "applyQuaternion" | "setRotationFromAxisAngle" | "setRotationFromEuler" | "setRotationFromMatrix" | "setRotationFromQuaternion" | "rotateOnAxis" | "rotateOnWorldAxis" | "rotateX" | "rotateY" | "rotateZ" | "translateOnAxis" | "translateX" | "translateY" | "translateZ" | "localToWorld" | "worldToLocal" | "lookAt" | "add" | "remove" | "removeFromParent" | "clear" | "getObjectById" | "getObjectByName" | "getObjectByProperty" | "getWorldPosition" | "getWorldQuaternion" | "getWorldScale" | "getWorldDirection" | "raycast" | "traverse" | "traverseVisible" | "traverseAncestors" | "updateMatrix" | "updateMatrixWorld" | "updateWorldMatrix" | "toJSON" | "clone" | "copy" | "addEventListener" | "hasEventListener" | "removeEventListener" | "dispatchEvent" | keyof import("@react-three/fiber/dist/declarations/src/core/events").EventHandlers | "material" | "geometry" | "morphTargetInfluences" | "morphTargetDictionary" | "updateMorphTargets" | "colors" | "stride" | "isPoints" | "positions" | "sizes"> & React.RefAttributes<THREE.Points<THREE.BufferGeometry, THREE.Material | THREE.Material[]>>>;
|
|
15
15
|
export declare const Points: React.ForwardRefExoticComponent<Pick<PointsInstancesProps | PointsBuffersProps, "visible" | "attach" | "attachArray" | "attachObject" | "args" | "children" | "key" | "onUpdate" | "position" | "up" | "scale" | "rotation" | "matrix" | "quaternion" | "layers" | "dispose" | "type" | "id" | "uuid" | "name" | "parent" | "modelViewMatrix" | "normalMatrix" | "matrixWorld" | "matrixAutoUpdate" | "matrixWorldNeedsUpdate" | "castShadow" | "receiveShadow" | "frustumCulled" | "renderOrder" | "animations" | "userData" | "customDepthMaterial" | "customDistanceMaterial" | "isObject3D" | "onBeforeRender" | "onAfterRender" | "applyMatrix4" | "applyQuaternion" | "setRotationFromAxisAngle" | "setRotationFromEuler" | "setRotationFromMatrix" | "setRotationFromQuaternion" | "rotateOnAxis" | "rotateOnWorldAxis" | "rotateX" | "rotateY" | "rotateZ" | "translateOnAxis" | "translateX" | "translateY" | "translateZ" | "localToWorld" | "worldToLocal" | "lookAt" | "add" | "remove" | "removeFromParent" | "clear" | "getObjectById" | "getObjectByName" | "getObjectByProperty" | "getWorldPosition" | "getWorldQuaternion" | "getWorldScale" | "getWorldDirection" | "raycast" | "traverse" | "traverseVisible" | "traverseAncestors" | "updateMatrix" | "updateMatrixWorld" | "updateWorldMatrix" | "toJSON" | "clone" | "copy" | "addEventListener" | "hasEventListener" | "removeEventListener" | "dispatchEvent" | "onClick" | "onContextMenu" | "onDoubleClick" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerCancel" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOut" | "onWheel" | "onPointerMissed" | "material" | "geometry" | "morphTargetInfluences" | "morphTargetDictionary" | "updateMorphTargets" | "isPoints"> & React.RefAttributes<THREE.Points<THREE.BufferGeometry, THREE.Material | THREE.Material[]>>>;
|
|
16
16
|
export {};
|
package/core/SpotLight.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ declare const SpotLight: React.ForwardRefExoticComponent<Pick<Omit<import("@reac
|
|
|
10
10
|
radiusBottom?: number | undefined;
|
|
11
11
|
opacity?: number | undefined;
|
|
12
12
|
color?: string | number | undefined;
|
|
13
|
-
}, "visible" | "attach" | "attachArray" | "attachObject" | "args" | "children" | "key" | "onUpdate" | "position" | "up" | "scale" | "rotation" | "matrix" | "quaternion" | "layers" | "dispose" | "type" | "id" | "uuid" | "name" | "parent" | "modelViewMatrix" | "normalMatrix" | "matrixWorld" | "matrixAutoUpdate" | "matrixWorldNeedsUpdate" | "castShadow" | "receiveShadow" | "frustumCulled" | "renderOrder" | "animations" | "userData" | "customDepthMaterial" | "customDistanceMaterial" | "isObject3D" | "onBeforeRender" | "onAfterRender" | "applyMatrix4" | "applyQuaternion" | "setRotationFromAxisAngle" | "setRotationFromEuler" | "setRotationFromMatrix" | "setRotationFromQuaternion" | "rotateOnAxis" | "rotateOnWorldAxis" | "rotateX" | "rotateY" | "rotateZ" | "translateOnAxis" | "translateX" | "translateY" | "translateZ" | "localToWorld" | "worldToLocal" | "lookAt" | "add" | "remove" | "removeFromParent" | "clear" | "getObjectById" | "getObjectByName" | "getObjectByProperty" | "getWorldPosition" | "getWorldQuaternion" | "getWorldScale" | "getWorldDirection" | "raycast" | "traverse" | "traverseVisible" | "traverseAncestors" | "updateMatrix" | "updateMatrixWorld" | "updateWorldMatrix" | "toJSON" | "clone" | "copy" | "addEventListener" | "hasEventListener" | "removeEventListener" | "dispatchEvent" | "color" | keyof import("@react-three/fiber/dist/declarations/src/core/events").EventHandlers | "distance" | "opacity" | "decay" | "target" | "angle" | "intensity" | "isLight" | "shadow" | "shadowCameraFov" | "shadowCameraLeft" | "shadowCameraRight" | "shadowCameraTop" | "shadowCameraBottom" | "shadowCameraNear" | "shadowCameraFar" | "shadowBias" | "shadowMapWidth" | "shadowMapHeight" | "power" | "depthBuffer" | "penumbra" | "isSpotLight" | "
|
|
13
|
+
}, "visible" | "attach" | "attachArray" | "attachObject" | "args" | "children" | "key" | "onUpdate" | "position" | "up" | "scale" | "rotation" | "matrix" | "quaternion" | "layers" | "dispose" | "type" | "id" | "uuid" | "name" | "parent" | "modelViewMatrix" | "normalMatrix" | "matrixWorld" | "matrixAutoUpdate" | "matrixWorldNeedsUpdate" | "castShadow" | "receiveShadow" | "frustumCulled" | "renderOrder" | "animations" | "userData" | "customDepthMaterial" | "customDistanceMaterial" | "isObject3D" | "onBeforeRender" | "onAfterRender" | "applyMatrix4" | "applyQuaternion" | "setRotationFromAxisAngle" | "setRotationFromEuler" | "setRotationFromMatrix" | "setRotationFromQuaternion" | "rotateOnAxis" | "rotateOnWorldAxis" | "rotateX" | "rotateY" | "rotateZ" | "translateOnAxis" | "translateX" | "translateY" | "translateZ" | "localToWorld" | "worldToLocal" | "lookAt" | "add" | "remove" | "removeFromParent" | "clear" | "getObjectById" | "getObjectByName" | "getObjectByProperty" | "getWorldPosition" | "getWorldQuaternion" | "getWorldScale" | "getWorldDirection" | "raycast" | "traverse" | "traverseVisible" | "traverseAncestors" | "updateMatrix" | "updateMatrixWorld" | "updateWorldMatrix" | "toJSON" | "clone" | "copy" | "addEventListener" | "hasEventListener" | "removeEventListener" | "dispatchEvent" | "color" | keyof import("@react-three/fiber/dist/declarations/src/core/events").EventHandlers | "distance" | "opacity" | "decay" | "target" | "angle" | "attenuation" | "intensity" | "isLight" | "shadow" | "shadowCameraFov" | "shadowCameraLeft" | "shadowCameraRight" | "shadowCameraTop" | "shadowCameraBottom" | "shadowCameraNear" | "shadowCameraFar" | "shadowBias" | "shadowMapWidth" | "shadowMapHeight" | "power" | "depthBuffer" | "penumbra" | "isSpotLight" | "anglePower" | "radiusTop" | "radiusBottom"> & React.RefAttributes<SpotLightImpl>>;
|
|
14
14
|
export { SpotLight };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@react-three/fiber"),t=require("react"),r=require("three"),n=require("meshline");function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=o(t);const s={width:.2,length:1,decay:1,local:!1,stride:0,interval:1},u=(e,t=1)=>(e.set(e.subarray(t)),e.fill(-1/0,-t),e);function c(t,n){const{length:o,local:c,decay:l,interval:a,stride:f}={...s,...n},d=i.useRef(),[h]=i.useState((()=>new r.Vector3));i.useLayoutEffect((()=>{t&&(d.current=Float32Array.from({length:1e3*o*3},((e,r)=>t.position.getComponent(r%3))))}),[o,t]);const p=i.useRef(new r.Vector3),y=i.useRef(0);return e.useFrame((()=>{if(t&&d.current){if(0===y.current){let e;c?e=t.position:(t.getWorldPosition(h),e=h);const r=100*l;for(let t=0;t<r;t++)e.distanceTo(p.current)<f||(u(d.current,3),d.current.set(e.toArray(),d.current.length-3));p.current.copy(e)}y.current++,y.current=y.current%a}})),d}const l=i.forwardRef(((t,o)=>{const{children:u}=t,{width:l,length:a,decay:f,local:d,stride:h,interval:p}={...s,...t},{color:y="hotpink",attenuation:g,target:m}=t,v=e.useThree((e=>e.size)),b=i.useRef(null),[w,M]=i.useState(null),j=c(w,{length:a,decay:f,local:d,stride:h,interval:p});i.useEffect((()=>{const e=(null==m?void 0:m.current)||b.current.children.find((e=>e instanceof r.Object3D));e&&M(e)}),[j,m]);const O=i.useMemo((()=>new n.MeshLine),[]),E=i.useMemo((()=>{var e;const t=new n.MeshLineMaterial({lineWidth:.1*l,color:y,sizeAttenuation:1,resolution:new r.Vector2(v.width,v.height)});let o;if(Array.isArray(u))o=u.find((e=>{const t=e;return"string"==typeof t.type&&"meshLineMaterial"===t.type}));else{const e=u;"string"==typeof e.type&&"meshLineMaterial"===e.type&&(o=e)}return"object"==typeof(null==(e=o)?void 0:e.props)&&t.setValues(o.props),t}),[l,y,v,u]);return i.useEffect((()=>{E.uniforms.resolution.value.set(v.width,v.height)}),[v]),e.useFrame((()=>{j.current&&O.setPoints(j.current,g)})),i.createElement("group",null,i.createElement("mesh",{ref:o,geometry:O,material:E}),i.createElement("group",{ref:b},u))}));exports.Trail=l,exports.useTrail=c;
|
package/core/Trail.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ColorRepresentation, Object3D } from 'three';
|
|
3
|
+
import { MeshLine } from 'meshline';
|
|
4
|
+
declare type Settings = {
|
|
5
|
+
width: number;
|
|
6
|
+
length: number;
|
|
7
|
+
decay: number;
|
|
8
|
+
local: boolean;
|
|
9
|
+
stride: number;
|
|
10
|
+
interval: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function useTrail(target: Object3D, settings: Partial<Settings>): React.MutableRefObject<Float32Array | undefined>;
|
|
13
|
+
export declare const Trail: React.ForwardRefExoticComponent<{
|
|
14
|
+
color?: ColorRepresentation | undefined;
|
|
15
|
+
attenuation?: ((width: number) => number) | undefined;
|
|
16
|
+
target?: React.MutableRefObject<Object3D<import("three").Event>> | undefined;
|
|
17
|
+
} & Partial<Settings> & {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
} & React.RefAttributes<MeshLine>>;
|
|
20
|
+
export {};
|
package/core/Trail.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { useFrame, useThree } from '@react-three/fiber';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Vector3, Object3D, Vector2 } from 'three';
|
|
4
|
+
import { MeshLine, MeshLineMaterial } from 'meshline';
|
|
5
|
+
|
|
6
|
+
const defaults = {
|
|
7
|
+
width: 0.2,
|
|
8
|
+
length: 1,
|
|
9
|
+
decay: 1,
|
|
10
|
+
local: false,
|
|
11
|
+
stride: 0,
|
|
12
|
+
interval: 1
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const shiftLeft = (collection, steps = 1) => {
|
|
16
|
+
collection.set(collection.subarray(steps));
|
|
17
|
+
collection.fill(-Infinity, -steps);
|
|
18
|
+
return collection;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function useTrail(target, settings) {
|
|
22
|
+
const {
|
|
23
|
+
length,
|
|
24
|
+
local,
|
|
25
|
+
decay,
|
|
26
|
+
interval,
|
|
27
|
+
stride
|
|
28
|
+
} = { ...defaults,
|
|
29
|
+
...settings
|
|
30
|
+
};
|
|
31
|
+
const points = React.useRef();
|
|
32
|
+
const [worldPosition] = React.useState(() => new Vector3());
|
|
33
|
+
React.useLayoutEffect(() => {
|
|
34
|
+
if (target) {
|
|
35
|
+
points.current = Float32Array.from({
|
|
36
|
+
length: length * 1000 * 3
|
|
37
|
+
}, (_, i) => target.position.getComponent(i % 3));
|
|
38
|
+
}
|
|
39
|
+
}, [length, target]);
|
|
40
|
+
const prevPosition = React.useRef(new Vector3());
|
|
41
|
+
const frameCount = React.useRef(0);
|
|
42
|
+
useFrame(() => {
|
|
43
|
+
if (!target) return;
|
|
44
|
+
if (!points.current) return;
|
|
45
|
+
|
|
46
|
+
if (frameCount.current === 0) {
|
|
47
|
+
let newPosition;
|
|
48
|
+
|
|
49
|
+
if (local) {
|
|
50
|
+
newPosition = target.position;
|
|
51
|
+
} else {
|
|
52
|
+
target.getWorldPosition(worldPosition);
|
|
53
|
+
newPosition = worldPosition;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const steps = 100 * decay;
|
|
57
|
+
|
|
58
|
+
for (let i = 0; i < steps; i++) {
|
|
59
|
+
if (newPosition.distanceTo(prevPosition.current) < stride) continue;
|
|
60
|
+
shiftLeft(points.current, 3);
|
|
61
|
+
points.current.set(newPosition.toArray(), points.current.length - 3);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
prevPosition.current.copy(newPosition);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
frameCount.current++;
|
|
68
|
+
frameCount.current = frameCount.current % interval;
|
|
69
|
+
});
|
|
70
|
+
return points;
|
|
71
|
+
}
|
|
72
|
+
const Trail = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
73
|
+
const {
|
|
74
|
+
children
|
|
75
|
+
} = props;
|
|
76
|
+
const {
|
|
77
|
+
width,
|
|
78
|
+
length,
|
|
79
|
+
decay,
|
|
80
|
+
local,
|
|
81
|
+
stride,
|
|
82
|
+
interval
|
|
83
|
+
} = { ...defaults,
|
|
84
|
+
...props
|
|
85
|
+
};
|
|
86
|
+
const {
|
|
87
|
+
color = 'hotpink',
|
|
88
|
+
attenuation,
|
|
89
|
+
target
|
|
90
|
+
} = props;
|
|
91
|
+
const size = useThree(s => s.size);
|
|
92
|
+
const ref = React.useRef(null);
|
|
93
|
+
const [anchor, setAnchor] = React.useState(null);
|
|
94
|
+
const points = useTrail(anchor, {
|
|
95
|
+
length,
|
|
96
|
+
decay,
|
|
97
|
+
local,
|
|
98
|
+
stride,
|
|
99
|
+
interval
|
|
100
|
+
});
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
const t = (target == null ? void 0 : target.current) || ref.current.children.find(o => {
|
|
103
|
+
return o instanceof Object3D;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
if (t) {
|
|
107
|
+
setAnchor(t);
|
|
108
|
+
}
|
|
109
|
+
}, [points, target]);
|
|
110
|
+
const geo = React.useMemo(() => new MeshLine(), []);
|
|
111
|
+
const mat = React.useMemo(() => {
|
|
112
|
+
var _matOverride;
|
|
113
|
+
|
|
114
|
+
const m = new MeshLineMaterial({
|
|
115
|
+
lineWidth: 0.1 * width,
|
|
116
|
+
color: color,
|
|
117
|
+
sizeAttenuation: 1,
|
|
118
|
+
resolution: new Vector2(size.width, size.height)
|
|
119
|
+
}); // Get and apply first <meshLineMaterial /> from children
|
|
120
|
+
|
|
121
|
+
let matOverride;
|
|
122
|
+
|
|
123
|
+
if (Array.isArray(children)) {
|
|
124
|
+
matOverride = children.find(child => {
|
|
125
|
+
const c = child;
|
|
126
|
+
return typeof c.type === 'string' && c.type === 'meshLineMaterial';
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
const c = children;
|
|
130
|
+
|
|
131
|
+
if (typeof c.type === 'string' && c.type === 'meshLineMaterial') {
|
|
132
|
+
matOverride = c;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (typeof ((_matOverride = matOverride) == null ? void 0 : _matOverride.props) === 'object') {
|
|
137
|
+
m.setValues(matOverride.props);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return m;
|
|
141
|
+
}, [width, color, size, children]);
|
|
142
|
+
React.useEffect(() => {
|
|
143
|
+
mat.uniforms.resolution.value.set(size.width, size.height);
|
|
144
|
+
}, [size]);
|
|
145
|
+
useFrame(() => {
|
|
146
|
+
if (!points.current) return;
|
|
147
|
+
geo.setPoints(points.current, attenuation);
|
|
148
|
+
});
|
|
149
|
+
return /*#__PURE__*/React.createElement("group", null, /*#__PURE__*/React.createElement("mesh", {
|
|
150
|
+
ref: forwardRef,
|
|
151
|
+
geometry: geo,
|
|
152
|
+
material: mat
|
|
153
|
+
}), /*#__PURE__*/React.createElement("group", {
|
|
154
|
+
ref: ref
|
|
155
|
+
}, children));
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export { Trail, useTrail };
|
package/core/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Billboard.cjs.js"),r=require("./QuadraticBezierLine.cjs.js"),s=require("./CubicBezierLine.cjs.js"),t=require("./Line.cjs.js"),o=require("./PositionalAudio.cjs.js"),i=require("./Text.cjs.js"),u=require("./Effects.cjs.js"),a=require("./GradientTexture.cjs.js"),n=require("./Image.cjs.js"),j=require("./Edges.cjs.js"),c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Billboard.cjs.js"),r=require("./QuadraticBezierLine.cjs.js"),s=require("./CubicBezierLine.cjs.js"),t=require("./Line.cjs.js"),o=require("./PositionalAudio.cjs.js"),i=require("./Text.cjs.js"),u=require("./Effects.cjs.js"),a=require("./GradientTexture.cjs.js"),n=require("./Image.cjs.js"),j=require("./Edges.cjs.js"),c=require("./Trail.cjs.js"),p=require("./OrthographicCamera.cjs.js"),x=require("./PerspectiveCamera.cjs.js"),l=require("./CubeCamera.cjs.js"),q=require("./DeviceOrientationControls.cjs.js"),d=require("./FlyControls.cjs.js"),C=require("./MapControls.cjs.js"),h=require("./OrbitControls.cjs.js"),m=require("./TrackballControls.cjs.js"),B=require("./ArcballControls.cjs.js"),P=require("./TransformControls.cjs.js"),b=require("./PointerLockControls.cjs.js"),M=require("./FirstPersonControls.cjs.js"),T=require("./GizmoHelper.cjs.js"),S=require("./GizmoViewcube.cjs.js"),f=require("./GizmoViewport.cjs.js"),g=require("./useCubeTexture.cjs.js"),v=require("./useFBX.cjs.js"),L=require("./useGLTF.cjs.js"),E=require("./useProgress.cjs.js"),A=require("./useTexture.cjs.js"),G=require("./useKTX2.cjs.js"),k=require("./Stats.cjs.js"),D=require("./useDepthBuffer.cjs.js"),F=require("./useAspect.cjs.js"),w=require("./useCamera.cjs.js"),z=require("./useDetectGPU.cjs.js"),I=require("./useHelper.cjs.js"),O=require("./useBVH.cjs.js"),R=require("./useContextBridge.cjs.js"),y=require("./useAnimations.cjs.js"),H=require("./useFBO.cjs.js"),V=require("./useIntersect.cjs.js"),Q=require("./useBoxProjectedEnv.cjs.js"),X=require("./CurveModifier.cjs.js"),K=require("./MeshDistortMaterial.cjs.js"),W=require("./MeshWobbleMaterial.cjs.js"),N=require("./MeshReflectorMaterial.cjs.js"),U=require("./PointMaterial.cjs.js"),_=require("./shaderMaterial.cjs.js"),J=require("./softShadows.cjs.js"),Y=require("./shapes.cjs.js"),Z=require("./RoundedBox.cjs.js"),$=require("./ScreenQuad.cjs.js"),ee=require("./Center.cjs.js"),re=require("./Bounds.cjs.js"),se=require("./CameraShake.cjs.js"),te=require("./Float.cjs.js"),oe=require("./Stage.cjs.js"),ie=require("./Backdrop.cjs.js"),ue=require("./Shadow.cjs.js"),ae=require("./ContactShadows.cjs.js"),ne=require("./Reflector.cjs.js"),je=require("./SpotLight.cjs.js"),ce=require("./Environment.cjs.js"),pe=require("./Lightformer.cjs.js"),xe=require("./Sky.cjs.js"),le=require("./Stars.cjs.js"),qe=require("./Cloud.cjs.js"),de=require("./useMatcapTexture.cjs.js"),Ce=require("./useNormalTexture.cjs.js"),he=require("./Points.cjs.js"),me=require("./Instances.cjs.js"),Be=require("./Segments.cjs.js"),Pe=require("./Detailed.cjs.js"),be=require("./Preload.cjs.js"),Me=require("./BakeShadows.cjs.js"),Te=require("./meshBounds.cjs.js"),Se=require("./AdaptiveDpr.cjs.js"),fe=require("./AdaptiveEvents.cjs.js");require("@babel/runtime/helpers/extends"),require("react"),require("@react-three/fiber"),require("react-merge-refs"),require("three"),require("three-stdlib"),require("troika-three-text"),require("suspend-react"),require("meshline"),require("lodash.omit"),require("lodash.pick"),require("zustand"),require("stats.js"),require("../helpers/useEffectfulState.cjs.js"),require("detect-gpu"),require("three-mesh-bvh"),require("../materials/BlurPass.cjs.js"),require("../materials/ConvolutionMaterial.cjs.js"),require("../materials/MeshReflectorMaterial.cjs.js"),require("../helpers/environment-assets.cjs.js"),require("../materials/SpotLightMaterial.cjs.js"),require("../helpers/Position.cjs.js"),require("react-composer"),exports.Billboard=e.Billboard,exports.QuadraticBezierLine=r.QuadraticBezierLine,exports.CubicBezierLine=s.CubicBezierLine,exports.Line=t.Line,exports.PositionalAudio=o.PositionalAudio,exports.Text=i.Text,exports.Effects=u.Effects,exports.isWebGL2Available=u.isWebGL2Available,exports.GradientTexture=a.GradientTexture,exports.Image=n.Image,exports.Edges=j.Edges,exports.Trail=c.Trail,exports.useTrail=c.useTrail,exports.OrthographicCamera=p.OrthographicCamera,exports.PerspectiveCamera=x.PerspectiveCamera,exports.CubeCamera=l.CubeCamera,exports.DeviceOrientationControls=q.DeviceOrientationControls,exports.FlyControls=d.FlyControls,exports.MapControls=C.MapControls,exports.OrbitControls=h.OrbitControls,exports.TrackballControls=m.TrackballControls,exports.ArcballControls=B.ArcballControls,exports.TransformControls=P.TransformControls,exports.PointerLockControls=b.PointerLockControls,exports.FirstPersonControls=M.FirstPersonControls,exports.GizmoHelper=T.GizmoHelper,exports.useGizmoContext=T.useGizmoContext,exports.GizmoViewcube=S.GizmoViewcube,exports.GizmoViewport=f.GizmoViewport,exports.useCubeTexture=g.useCubeTexture,exports.useFBX=v.useFBX,exports.useGLTF=L.useGLTF,exports.useProgress=E.useProgress,exports.IsObject=A.IsObject,exports.useTexture=A.useTexture,exports.useKTX2=G.useKTX2,exports.Stats=k.Stats,exports.useDepthBuffer=D.useDepthBuffer,exports.useAspect=F.useAspect,exports.useCamera=w.useCamera,exports.useDetectGPU=z.useDetectGPU,exports.useHelper=I.useHelper,exports.useBVH=O.useBVH,exports.useContextBridge=R.useContextBridge,exports.useAnimations=y.useAnimations,exports.useFBO=H.useFBO,exports.useIntersect=V.useIntersect,exports.useBoxProjectedEnv=Q.useBoxProjectedEnv,exports.CurveModifier=X.CurveModifier,exports.MeshDistortMaterial=K.MeshDistortMaterial,exports.MeshWobbleMaterial=W.MeshWobbleMaterial,exports.MeshReflectorMaterial=N.MeshReflectorMaterial,exports.PointMaterial=U.PointMaterial,exports.PointMaterialImpl=U.PointMaterialImpl,exports.shaderMaterial=_.shaderMaterial,exports.softShadows=J.softShadows,exports.Box=Y.Box,exports.Circle=Y.Circle,exports.Cone=Y.Cone,exports.Cylinder=Y.Cylinder,exports.Dodecahedron=Y.Dodecahedron,exports.Extrude=Y.Extrude,exports.Icosahedron=Y.Icosahedron,exports.Lathe=Y.Lathe,exports.Octahedron=Y.Octahedron,exports.Plane=Y.Plane,exports.Polyhedron=Y.Polyhedron,exports.Ring=Y.Ring,exports.Sphere=Y.Sphere,exports.Tetrahedron=Y.Tetrahedron,exports.Torus=Y.Torus,exports.TorusKnot=Y.TorusKnot,exports.Tube=Y.Tube,exports.RoundedBox=Z.RoundedBox,exports.ScreenQuad=$.ScreenQuad,exports.Center=ee.Center,exports.Bounds=re.Bounds,exports.useBounds=re.useBounds,exports.CameraShake=se.CameraShake,exports.Float=te.Float,exports.Stage=oe.Stage,exports.Backdrop=ie.Backdrop,exports.Shadow=ue.Shadow,exports.ContactShadows=ae.ContactShadows,exports.Reflector=ne.Reflector,exports.SpotLight=je.SpotLight,exports.Environment=ce.Environment,exports.EnvironmentCube=ce.EnvironmentCube,exports.EnvironmentMap=ce.EnvironmentMap,exports.EnvironmentPortal=ce.EnvironmentPortal,exports.Lightformer=pe.Lightformer,exports.Sky=xe.Sky,exports.calcPosFromAngles=xe.calcPosFromAngles,exports.Stars=le.Stars,exports.Cloud=qe.Cloud,exports.useMatcapTexture=de.useMatcapTexture,exports.useNormalTexture=Ce.useNormalTexture,exports.Point=he.Point,exports.Points=he.Points,exports.PointsBuffer=he.PointsBuffer,exports.Instance=me.Instance,exports.Instances=me.Instances,exports.Merged=me.Merged,exports.Segment=Be.Segment,exports.Segments=Be.Segments,exports.Detailed=Pe.Detailed,exports.Preload=be.Preload,exports.BakeShadows=Me.BakeShadows,exports.meshBounds=Te.meshBounds,exports.AdaptiveDpr=Se.AdaptiveDpr,exports.AdaptiveEvents=fe.AdaptiveEvents;
|
package/core/index.d.ts
CHANGED
package/core/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { Effects, isWebGL2Available } from './Effects.js';
|
|
|
8
8
|
export { GradientTexture } from './GradientTexture.js';
|
|
9
9
|
export { Image } from './Image.js';
|
|
10
10
|
export { Edges } from './Edges.js';
|
|
11
|
+
export { Trail, useTrail } from './Trail.js';
|
|
11
12
|
export { OrthographicCamera } from './OrthographicCamera.js';
|
|
12
13
|
export { PerspectiveCamera } from './PerspectiveCamera.js';
|
|
13
14
|
export { CubeCamera } from './CubeCamera.js';
|
|
@@ -85,6 +86,7 @@ import 'three';
|
|
|
85
86
|
import 'three-stdlib';
|
|
86
87
|
import 'troika-three-text';
|
|
87
88
|
import 'suspend-react';
|
|
89
|
+
import 'meshline';
|
|
88
90
|
import 'lodash.omit';
|
|
89
91
|
import 'lodash.pick';
|
|
90
92
|
import 'zustand';
|