@3driseai/3drise-viewer 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +9 -15
- package/dist/components/ModelBoundary.d.ts +28 -0
- package/dist/components/ModelBoundary.d.ts.map +1 -0
- package/dist/components/ModelBoundary.js +25 -0
- package/dist/components/ModelPrimitive.d.ts +38 -0
- package/dist/components/ModelPrimitive.d.ts.map +1 -0
- package/dist/components/ModelPrimitive.js +52 -0
- package/dist/components/ObjectNodeApi.d.ts.map +1 -1
- package/dist/components/ObjectNodeApi.js +6 -1
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +5 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +6 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useLiveTransitionEvents.d.ts +18 -0
- package/dist/hooks/useLiveTransitionEvents.d.ts.map +1 -0
- package/dist/hooks/useLiveTransitionEvents.js +57 -0
- package/dist/hooks/useModelObject.d.ts +25 -0
- package/dist/hooks/useModelObject.d.ts.map +1 -0
- package/dist/hooks/useModelObject.js +73 -0
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +5 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAOtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,aAAa,EAAE,qBAAqB,CAAC;IACrC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoElD,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, memo
|
|
3
|
-
import { ObjectManager, } from "@3driseai/3drise-core";
|
|
2
|
+
import { useRef, memo } from "react";
|
|
4
3
|
import { Vector3 } from "three";
|
|
5
4
|
import MaterialLibrary from "./MaterialLibrary.js";
|
|
5
|
+
import ModelBoundary from "./ModelBoundary.js";
|
|
6
|
+
import ModelPrimitive from "./ModelPrimitive.js";
|
|
6
7
|
import { useWaterReflections } from "../hooks/useWaterReflections.js";
|
|
7
8
|
import { GeometryMesh } from "./GeometryShape.js";
|
|
8
9
|
import { useObjectReady } from "../hooks/useObjectReady.js";
|
|
@@ -10,15 +11,6 @@ const CustomPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, h
|
|
|
10
11
|
const meshRef = useRef(null);
|
|
11
12
|
// CustomPrimitive accepted onObjectReady but never fired it; this is the fix.
|
|
12
13
|
useObjectReady(meshRef, createdObject, onObjectReady, onObjectDispose);
|
|
13
|
-
const resolvedObject = useMemo(() => {
|
|
14
|
-
if (!createdObject)
|
|
15
|
-
return null;
|
|
16
|
-
const obj = ObjectManager.getObject(createdObject.id);
|
|
17
|
-
if (!obj) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
return obj.object;
|
|
21
|
-
}, [createdObject.id]);
|
|
22
14
|
// const objectRef = useRef<Mesh>(resolvedObject as Mesh);
|
|
23
15
|
// useEffect(() => {
|
|
24
16
|
// if (createdObject.type !== 'mesh' || !objectRef.current) return;
|
|
@@ -77,10 +69,12 @@ const CustomPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, h
|
|
|
77
69
|
// }
|
|
78
70
|
if (createdObject.type === 'mesh')
|
|
79
71
|
return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, onObjectReady: (_object, ref) => onObjectReady && onObjectReady(createdObject, ref), onObjectDispose: (_object, ref) => onObjectDispose && onObjectDispose(createdObject, ref), modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 }, children: useDreiMaterials && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }) }, createdObject.id);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
// Models resolve asynchronously: ModelPrimitive suspends while its GLTF loads, so it
|
|
73
|
+
// needs its own boundary rather than rendering null forever when nothing preloaded it.
|
|
74
|
+
// ModelPrimitive owns its own ref and reports readiness: the meshRef above stays null
|
|
75
|
+
// for a model, so the useObjectReady call at the top of this component is a no-op here
|
|
76
|
+
// and cannot double-report alongside it.
|
|
77
|
+
return _jsx(ModelBoundary, { label: `${createdObject.name} (${createdObject.id})`, children: _jsx(ModelPrimitive, { createdObject: createdObject, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose, children: useDreiMaterials && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }) });
|
|
84
78
|
});
|
|
85
79
|
CustomPrimitive.displayName = 'CustomPrimitive';
|
|
86
80
|
export default CustomPrimitive;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { ErrorInfo, ReactNode } from 'react';
|
|
3
|
+
interface ModelBoundaryProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Rendered while the model's GLTF is in flight. Null keeps the scene from jumping. */
|
|
6
|
+
fallback?: ReactNode;
|
|
7
|
+
/** Identifies the offending object in the console when a load fails. */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ModelBoundaryState {
|
|
11
|
+
failed: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Suspense + error boundary around a single model leaf.
|
|
15
|
+
*
|
|
16
|
+
* Both halves are required. The cache re-throws a rejected load on every subsequent read,
|
|
17
|
+
* and a throw that reaches a bare `<Suspense>` unmounts everything under it — one model
|
|
18
|
+
* behind a dead URL would blank the rest of the scene. Here a failed model renders nothing
|
|
19
|
+
* and its siblings carry on.
|
|
20
|
+
*/
|
|
21
|
+
declare class ModelBoundary extends Component<ModelBoundaryProps, ModelBoundaryState> {
|
|
22
|
+
state: ModelBoundaryState;
|
|
23
|
+
static getDerivedStateFromError(): ModelBoundaryState;
|
|
24
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
25
|
+
render(): ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export default ModelBoundary;
|
|
28
|
+
//# sourceMappingURL=ModelBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ModelBoundary.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,UAAU,kBAAkB;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,kBAAkB;IACxB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,cAAM,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACzE,KAAK,EAAE,kBAAkB,CAAqB;IAE9C,MAAM,CAAC,wBAAwB,IAAI,kBAAkB;IAIrD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAQtD,MAAM,IAAI,SAAS;CAItB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Component, Suspense } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Suspense + error boundary around a single model leaf.
|
|
5
|
+
*
|
|
6
|
+
* Both halves are required. The cache re-throws a rejected load on every subsequent read,
|
|
7
|
+
* and a throw that reaches a bare `<Suspense>` unmounts everything under it — one model
|
|
8
|
+
* behind a dead URL would blank the rest of the scene. Here a failed model renders nothing
|
|
9
|
+
* and its siblings carry on.
|
|
10
|
+
*/
|
|
11
|
+
class ModelBoundary extends Component {
|
|
12
|
+
state = { failed: false };
|
|
13
|
+
static getDerivedStateFromError() {
|
|
14
|
+
return { failed: true };
|
|
15
|
+
}
|
|
16
|
+
componentDidCatch(error, info) {
|
|
17
|
+
console.error(`[ModelBoundary] Model failed to load${this.props.label ? `: ${this.props.label}` : ''}`, error, info.componentStack);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
if (this.state.failed)
|
|
21
|
+
return null;
|
|
22
|
+
return _jsx(Suspense, { fallback: this.props.fallback ?? null, children: this.props.children });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export default ModelBoundary;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
4
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
5
|
+
interface ModelPrimitiveProps extends ObjectReadyProps {
|
|
6
|
+
createdObject: CreatedObjectSettings;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Mounts the Object3D behind a `type: 'model'` scene object, and hands it to the host
|
|
11
|
+
* application.
|
|
12
|
+
*
|
|
13
|
+
* Split out of CustomPrimitive because this is the component that suspends: it must sit
|
|
14
|
+
* under its own boundary so one slow or broken model does not hold up its siblings.
|
|
15
|
+
*
|
|
16
|
+
* ## Readiness
|
|
17
|
+
*
|
|
18
|
+
* `onObjectReady` fires here, with the loaded model root - that Object3D is the whole point
|
|
19
|
+
* of the object API, so it has to arrive on both paths: preloaded (mounts in the same
|
|
20
|
+
* commit as its parent) and suspended (mounts whenever the GLTF lands, which may be several
|
|
21
|
+
* frames later).
|
|
22
|
+
*
|
|
23
|
+
* CustomPrimitive cannot report it any more. When this component suspends, CustomPrimitive
|
|
24
|
+
* commits first with its ref still empty, its layout effect finds nothing to report, and it
|
|
25
|
+
* never re-renders once the asset resolves. Its `meshRef` now stays null for a model, so its
|
|
26
|
+
* own call is a no-op rather than a second, conflicting report.
|
|
27
|
+
*
|
|
28
|
+
* The report is driven by a callback ref rather than a layout effect: R3F runs it the moment
|
|
29
|
+
* it attaches the object and again with null when it detaches, so the pair fires exactly on
|
|
30
|
+
* attach/detach no matter how many renders the suspension cost.
|
|
31
|
+
*
|
|
32
|
+
* `dispose={null}` is not optional. Geometry and textures here are shared with the cache
|
|
33
|
+
* master and every other instance of the same URL; letting R3F free them on unmount breaks
|
|
34
|
+
* all of them.
|
|
35
|
+
*/
|
|
36
|
+
declare const ModelPrimitive: React.FC<ModelPrimitiveProps>;
|
|
37
|
+
export default ModelPrimitive;
|
|
38
|
+
//# sourceMappingURL=ModelPrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/ModelPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,mBAAoB,SAAQ,gBAAgB;IAClD,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8BhD,CAAC;AAIH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useCallback, useRef } from 'react';
|
|
3
|
+
import { useModelObject } from '../hooks/useModelObject.js';
|
|
4
|
+
import { useObjectReadyReporter } from '../hooks/useObjectReady.js';
|
|
5
|
+
/**
|
|
6
|
+
* Mounts the Object3D behind a `type: 'model'` scene object, and hands it to the host
|
|
7
|
+
* application.
|
|
8
|
+
*
|
|
9
|
+
* Split out of CustomPrimitive because this is the component that suspends: it must sit
|
|
10
|
+
* under its own boundary so one slow or broken model does not hold up its siblings.
|
|
11
|
+
*
|
|
12
|
+
* ## Readiness
|
|
13
|
+
*
|
|
14
|
+
* `onObjectReady` fires here, with the loaded model root - that Object3D is the whole point
|
|
15
|
+
* of the object API, so it has to arrive on both paths: preloaded (mounts in the same
|
|
16
|
+
* commit as its parent) and suspended (mounts whenever the GLTF lands, which may be several
|
|
17
|
+
* frames later).
|
|
18
|
+
*
|
|
19
|
+
* CustomPrimitive cannot report it any more. When this component suspends, CustomPrimitive
|
|
20
|
+
* commits first with its ref still empty, its layout effect finds nothing to report, and it
|
|
21
|
+
* never re-renders once the asset resolves. Its `meshRef` now stays null for a model, so its
|
|
22
|
+
* own call is a no-op rather than a second, conflicting report.
|
|
23
|
+
*
|
|
24
|
+
* The report is driven by a callback ref rather than a layout effect: R3F runs it the moment
|
|
25
|
+
* it attaches the object and again with null when it detaches, so the pair fires exactly on
|
|
26
|
+
* attach/detach no matter how many renders the suspension cost.
|
|
27
|
+
*
|
|
28
|
+
* `dispose={null}` is not optional. Geometry and textures here are shared with the cache
|
|
29
|
+
* master and every other instance of the same URL; letting R3F free them on unmount breaks
|
|
30
|
+
* all of them.
|
|
31
|
+
*/
|
|
32
|
+
const ModelPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, children }) => {
|
|
33
|
+
const attachedRef = useRef(null);
|
|
34
|
+
const object = useModelObject(createdObject);
|
|
35
|
+
const { report, reportDisposed } = useObjectReadyReporter(createdObject, onObjectReady, onObjectDispose);
|
|
36
|
+
const setObjectRef = useCallback((instance) => {
|
|
37
|
+
if (instance) {
|
|
38
|
+
attachedRef.current = instance;
|
|
39
|
+
report(instance);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (attachedRef.current) {
|
|
43
|
+
reportDisposed(attachedRef.current);
|
|
44
|
+
attachedRef.current = null;
|
|
45
|
+
}
|
|
46
|
+
}, [report, reportDisposed]);
|
|
47
|
+
if (!object)
|
|
48
|
+
return null;
|
|
49
|
+
return (_jsx("primitive", { ref: setObjectRef, name: createdObject.name, object: object, dispose: null, children: children }, createdObject.id));
|
|
50
|
+
});
|
|
51
|
+
ModelPrimitive.displayName = 'ModelPrimitive';
|
|
52
|
+
export default ModelPrimitive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectNodeApi.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNodeApi.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAe,qBAAqB,EAAkB,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,KAAK,kBAAkB,GAAG,gBAAgB,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AAGF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ObjectNodeApi.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNodeApi.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAe,qBAAqB,EAAkB,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,KAAK,kBAAkB,GAAG,gBAAgB,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AAGF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmB/C,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -9,11 +9,16 @@ const ObjectNodeApi = ({ objectId, onObjectReady, onObjectDispose, handleObjectC
|
|
|
9
9
|
// too — SceneBuilder is not in this tree to do it.
|
|
10
10
|
useRegisterScene();
|
|
11
11
|
const [node, setNode] = useState(null);
|
|
12
|
+
// No asset pre-pass here on purpose. Every model leaf under this tree loads itself
|
|
13
|
+
// through the shared URL cache under its own Suspense boundary (see useModelObject),
|
|
14
|
+
// however deeply it is nested, so this component only has to fetch the tree.
|
|
12
15
|
useEffect(() => {
|
|
13
16
|
fetch(`${dataCenterServer}scene-objects/${objectId}/tree`)
|
|
14
17
|
.then(res => res.ok ? res.json() : Promise.reject(res.status))
|
|
15
18
|
.then(({ tree }) => setNode(tree))
|
|
16
|
-
.catch(
|
|
19
|
+
.catch(error => {
|
|
20
|
+
console.error(`[ObjectNodeApi] Failed to load object tree ${objectId}:`, error);
|
|
21
|
+
});
|
|
17
22
|
}, [objectId]);
|
|
18
23
|
if (!node)
|
|
19
24
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectLoader.d.ts","sourceRoot":"","sources":["../../src/components/ProjectLoader.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGhF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,KAAK,YAAY,GAAG,gBAAgB,GAAG;IACn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,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC,CAAC;AAGF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAsDzC,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -95,6 +95,8 @@ export { QuasiGrid, defaultQuasiGridConfig } from './QuasiGrid';
|
|
|
95
95
|
export { HexGrid, defaultHexGridConfig } from './HexGrid';
|
|
96
96
|
export { RadarGrid, defaultRadarGridConfig } from './RadarGrid';
|
|
97
97
|
export { VoronoiGrid, defaultVoronoiGridConfig } from './VoronoiGrid';
|
|
98
|
+
export { default as ModelBoundary } from './ModelBoundary';
|
|
99
|
+
export { default as ModelPrimitive } from './ModelPrimitive';
|
|
98
100
|
export { default as ObjectNode } from './ObjectNode';
|
|
99
101
|
export { default as ObjectNodeApi } from './ObjectNodeApi';
|
|
100
102
|
export { default as ObjectsRenderer } from './ObjectsRenderer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,YAAY,EAAE,mBAAmB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B,EAChB,gBAAgB,IAAI,gBAAgB,EACpC,UAAU,EACV,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGtD,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAI1B,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,cAAc,aAAa,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -42,6 +42,8 @@ export { QuasiGrid, defaultQuasiGridConfig } from './QuasiGrid.js';
|
|
|
42
42
|
export { HexGrid, defaultHexGridConfig } from './HexGrid.js';
|
|
43
43
|
export { RadarGrid, defaultRadarGridConfig } from './RadarGrid.js';
|
|
44
44
|
export { VoronoiGrid, defaultVoronoiGridConfig } from './VoronoiGrid.js';
|
|
45
|
+
export { default as ModelBoundary } from './ModelBoundary.js';
|
|
46
|
+
export { default as ModelPrimitive } from './ModelPrimitive.js';
|
|
45
47
|
export { default as ObjectNode } from './ObjectNode.js';
|
|
46
48
|
export { default as ObjectNodeApi } from './ObjectNodeApi.js';
|
|
47
49
|
export { default as ObjectsRenderer } from './ObjectsRenderer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainSurface.d.ts","sourceRoot":"","sources":["../../../src/components/terrain/TerrainSurface.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TerrainSurface.d.ts","sourceRoot":"","sources":["../../../src/components/terrain/TerrainSurface.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAW1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqG/C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { useFrame } from '@react-three/fiber';
|
|
|
4
4
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
5
5
|
import { useTerrainClipmap } from '../../hooks/useTerrainClipmap.js';
|
|
6
6
|
import { useCloudSun } from '../../hooks/useCloudSun.js';
|
|
7
|
+
import { useLiveTransitionEvents } from '../../hooks/useLiveTransitionEvents.js';
|
|
7
8
|
import { TERRAIN_LIVE_KEY } from '../../hooks/useTerrainLive.js';
|
|
8
9
|
import { TerrainMaterial } from '../../shaders/terrain/TerrainMaterial.js';
|
|
9
10
|
import { applySunUniforms } from '../../utils/cloudUniforms.js';
|
|
@@ -58,6 +59,10 @@ const TerrainSurface = ({ id = '3drise-terrain', config, quality, skySettings, t
|
|
|
58
59
|
return () => { delete root.userData[TERRAIN_LIVE_KEY]; };
|
|
59
60
|
}, [id, liveHandle]);
|
|
60
61
|
useObjectReady(rootRef, { id, type: 'terrain', config, quality }, onObjectReady, onObjectDispose);
|
|
62
|
+
// Sequence-authored transitions (`transition.state === 'terrain'`) — liveConfig
|
|
63
|
+
// is the same ref a controller's live handle writes into, merged last over
|
|
64
|
+
// the config each frame below.
|
|
65
|
+
useLiveTransitionEvents('terrain', liveConfig, config, rootRef);
|
|
61
66
|
useFrame((state) => {
|
|
62
67
|
const camera = state.camera;
|
|
63
68
|
updateSun();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumetricCloudsPass.d.ts","sourceRoot":"","sources":["../../../src/components/volumetricClouds/VolumetricCloudsPass.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"VolumetricCloudsPass.d.ts","sourceRoot":"","sources":["../../../src/components/volumetricClouds/VolumetricCloudsPass.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAMvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEvH,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAErF;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAC/D,6EAA6E;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,mBAAmB,CAAC;IAC7B;oDACgD;IAChD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAkBD,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAyW7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { useFrame, useThree } from '@react-three/fiber';
|
|
|
5
5
|
import { useFrameRenderer } from '../../hooks/useFrameRenderer.js';
|
|
6
6
|
import { useThunder } from '../../hooks/useThunder.js';
|
|
7
7
|
import { useObjectReady } from '../../hooks/useObjectReady.js';
|
|
8
|
+
import { useLiveTransitionEvents } from '../../hooks/useLiveTransitionEvents.js';
|
|
8
9
|
import { CLOUD_LIVE_KEY } from '../../hooks/useCloudLive.js';
|
|
9
10
|
import { useCloudNoise } from '../../hooks/useCloudNoise.js';
|
|
10
11
|
import { useCloudSun } from '../../hooks/useCloudSun.js';
|
|
@@ -154,6 +155,11 @@ const VolumetricCloudsPass = ({ id = '3drise-clouds', deck, cirrus, quality, thu
|
|
|
154
155
|
// ObjectReadySource's union is widened by Record<string, any>, but spelling the
|
|
155
156
|
// cast out keeps the intent: this reports the layer's settings, not a mesh's.
|
|
156
157
|
useObjectReady(rootRef, { id, type: 'clouds', deck, cirrus, quality }, onObjectReady, onObjectDispose);
|
|
158
|
+
// Sequence-authored transitions (`transition.state === 'clouds'`), on top of
|
|
159
|
+
// whatever the deck's own keyframe/mouse-move animations are already doing —
|
|
160
|
+
// liveDeck is the same ref a controller's live handle writes into, and it is
|
|
161
|
+
// already merged last, over both, each frame.
|
|
162
|
+
useLiveTransitionEvents('clouds', liveDeck, deck, rootRef);
|
|
157
163
|
// Only a resolution change genuinely invalidates the history — the buffers are
|
|
158
164
|
// reallocated and nothing in them maps to the new grid.
|
|
159
165
|
//
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export { useObjectAnimation } from './useObjectAnimation';
|
|
|
54
54
|
export { useObjectEdges } from './useObjectEdges';
|
|
55
55
|
export type { ObjectEffectsFunctions, ObjectEffectsState, UseObjectEffectsReturn } from './useObjectEffects';
|
|
56
56
|
export { useObjectEffects } from './useObjectEffects';
|
|
57
|
+
export { useModelObject } from './useModelObject';
|
|
57
58
|
export { useObjectReady, useObjectReadyReporter } from './useObjectReady';
|
|
58
59
|
export type { GridSurfaceOptions, GridSurfaceUniforms } from './useGridSurface';
|
|
59
60
|
export { useGrid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oB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -38,6 +38,7 @@ export { useNumericAnimation } from './useNumericAnimation.js';
|
|
|
38
38
|
export { useObjectAnimation } from './useObjectAnimation.js';
|
|
39
39
|
export { useObjectEdges } from './useObjectEdges.js';
|
|
40
40
|
export { useObjectEffects } from './useObjectEffects.js';
|
|
41
|
+
export { useModelObject } from './useModelObject.js';
|
|
41
42
|
export { useObjectReady, useObjectReadyReporter } from './useObjectReady.js';
|
|
42
43
|
export { useGridSurface } from './useGridSurface.js';
|
|
43
44
|
export { useOrbitControls } from './useOrbitControls.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { Object3D } from 'three';
|
|
3
|
+
/**
|
|
4
|
+
* Drives sequence-step transitions (see `useAnimationEvents`) into a
|
|
5
|
+
* renderer's existing live-override ref — the same ref a controller's live
|
|
6
|
+
* handle (`useCloudLive`/`useTerrainLive`/`useOceanLive`) already writes into
|
|
7
|
+
* on every slider drag, and which the renderer already merges over its config
|
|
8
|
+
* each frame. That merge order is what makes a transition win over whatever
|
|
9
|
+
* the settings currently say, with no extra "is animating" flag needed.
|
|
10
|
+
*
|
|
11
|
+
* Matches `SkyController`'s pattern (capture current value, lerp to target
|
|
12
|
+
* over the step's duration) but generically: any `to` key that is a number or
|
|
13
|
+
* number[] animates smoothly via `useNumericAnimation`; anything else
|
|
14
|
+
* (booleans, strings) switches immediately, the same way `visible` does.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useLiveTransitionEvents(stateName: string, liveRef: React.MutableRefObject<Record<string, any>>, currentConfig?: Record<string, any> | null, rootRef?: RefObject<Object3D | null>): void;
|
|
17
|
+
export default useLiveTransitionEvents;
|
|
18
|
+
//# sourceMappingURL=useLiveTransitionEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLiveTransitionEvents.d.ts","sourceRoot":"","sources":["../../src/hooks/useLiveTransitionEvents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EACpD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAC1C,OAAO,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,GACrC,IAAI,CAwCN;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useAnimationEvents } from './useAnimationEvents.js';
|
|
2
|
+
import { useNumericAnimation } from './useNumericAnimation.js';
|
|
3
|
+
/**
|
|
4
|
+
* Drives sequence-step transitions (see `useAnimationEvents`) into a
|
|
5
|
+
* renderer's existing live-override ref — the same ref a controller's live
|
|
6
|
+
* handle (`useCloudLive`/`useTerrainLive`/`useOceanLive`) already writes into
|
|
7
|
+
* on every slider drag, and which the renderer already merges over its config
|
|
8
|
+
* each frame. That merge order is what makes a transition win over whatever
|
|
9
|
+
* the settings currently say, with no extra "is animating" flag needed.
|
|
10
|
+
*
|
|
11
|
+
* Matches `SkyController`'s pattern (capture current value, lerp to target
|
|
12
|
+
* over the step's duration) but generically: any `to` key that is a number or
|
|
13
|
+
* number[] animates smoothly via `useNumericAnimation`; anything else
|
|
14
|
+
* (booleans, strings) switches immediately, the same way `visible` does.
|
|
15
|
+
*/
|
|
16
|
+
export function useLiveTransitionEvents(stateName, liveRef, currentConfig, rootRef) {
|
|
17
|
+
const { animateNumeric } = useNumericAnimation();
|
|
18
|
+
useAnimationEvents({
|
|
19
|
+
onStepStart: (event) => {
|
|
20
|
+
if (!event.step?.transitions)
|
|
21
|
+
return;
|
|
22
|
+
for (const transition of event.step.transitions) {
|
|
23
|
+
if (transition.state !== stateName)
|
|
24
|
+
continue;
|
|
25
|
+
const toProps = transition.properties.to || {};
|
|
26
|
+
const fromProps = transition.properties.from || {};
|
|
27
|
+
// Immediate boolean switch, not animated — mirrors SkyController's `visible`.
|
|
28
|
+
if (toProps.visible !== undefined && rootRef?.current) {
|
|
29
|
+
rootRef.current.visible = toProps.visible;
|
|
30
|
+
}
|
|
31
|
+
const from = {};
|
|
32
|
+
const to = {};
|
|
33
|
+
for (const key of Object.keys(toProps)) {
|
|
34
|
+
if (key === 'visible')
|
|
35
|
+
continue;
|
|
36
|
+
const toVal = toProps[key];
|
|
37
|
+
if (toVal === undefined)
|
|
38
|
+
continue;
|
|
39
|
+
if (typeof toVal === 'number' || Array.isArray(toVal)) {
|
|
40
|
+
to[key] = toVal;
|
|
41
|
+
from[key] = fromProps[key] ?? liveRef.current[key] ?? currentConfig?.[key] ?? toVal;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Nothing to interpolate for a string/boolean — apply straight away.
|
|
45
|
+
liveRef.current[key] = toVal;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (Object.keys(to).length > 0) {
|
|
49
|
+
animateNumeric(from, to, (updated) => {
|
|
50
|
+
Object.assign(liveRef.current, updated);
|
|
51
|
+
}, () => { }, event.step?.duration);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export default useLiveTransitionEvents;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the Object3D for a `type: 'model'` scene object.
|
|
5
|
+
*
|
|
6
|
+
* Two ways in:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Already registered** — a project loader ran `loadAssets` and put an instance in
|
|
9
|
+
* `ObjectManager` under this id. Used as-is, which is exactly what happened before this
|
|
10
|
+
* hook existed.
|
|
11
|
+
* 2. **Not registered** — the model loads itself through the URL cache. `readModelAsset`
|
|
12
|
+
* throws the in-flight promise, the nearest `<Suspense>` holds this leaf, and the render
|
|
13
|
+
* resumes with the asset in hand. This is the path an `ObjectNodeApi` import takes, and
|
|
14
|
+
* any model nested under one.
|
|
15
|
+
*
|
|
16
|
+
* Either way there is no ordering requirement between loading and rendering: a leaf that
|
|
17
|
+
* mounts before anything preloaded it simply fetches its own.
|
|
18
|
+
*
|
|
19
|
+
* Instances the hook creates are its own — registered on mount, unregistered and disposed
|
|
20
|
+
* on unmount. An instance it merely found belongs to whoever preloaded it and is left
|
|
21
|
+
* alone.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useModelObject(createdObject: CreatedObjectSettings): Object3D | null;
|
|
24
|
+
export default useModelObject;
|
|
25
|
+
//# sourceMappingURL=useModelObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModelObject.d.ts","sourceRoot":"","sources":["../../src/hooks/useModelObject.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,qBAAqB,GAAG,QAAQ,GAAG,IAAI,CAuDpF;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef } from 'react';
|
|
2
|
+
import { ObjectManager, cloneModelAsset, readModelAsset, releaseModelInstance, retainModelInstance, } from '@3driseai/3drise-core';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the Object3D for a `type: 'model'` scene object.
|
|
5
|
+
*
|
|
6
|
+
* Two ways in:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Already registered** — a project loader ran `loadAssets` and put an instance in
|
|
9
|
+
* `ObjectManager` under this id. Used as-is, which is exactly what happened before this
|
|
10
|
+
* hook existed.
|
|
11
|
+
* 2. **Not registered** — the model loads itself through the URL cache. `readModelAsset`
|
|
12
|
+
* throws the in-flight promise, the nearest `<Suspense>` holds this leaf, and the render
|
|
13
|
+
* resumes with the asset in hand. This is the path an `ObjectNodeApi` import takes, and
|
|
14
|
+
* any model nested under one.
|
|
15
|
+
*
|
|
16
|
+
* Either way there is no ordering requirement between loading and rendering: a leaf that
|
|
17
|
+
* mounts before anything preloaded it simply fetches its own.
|
|
18
|
+
*
|
|
19
|
+
* Instances the hook creates are its own — registered on mount, unregistered and disposed
|
|
20
|
+
* on unmount. An instance it merely found belongs to whoever preloaded it and is left
|
|
21
|
+
* alone.
|
|
22
|
+
*/
|
|
23
|
+
export function useModelObject(createdObject) {
|
|
24
|
+
const id = createdObject.id;
|
|
25
|
+
const url = createdObject.userData?.url;
|
|
26
|
+
const registered = ObjectManager.getObject(id)?.object ?? null;
|
|
27
|
+
// Suspension point. Nothing above this line may be a hook: the throw discards the
|
|
28
|
+
// render entirely, and only committed renders need a consistent hook order.
|
|
29
|
+
const asset = !registered && url ? readModelAsset(url) : null;
|
|
30
|
+
const instanceRef = useRef(null);
|
|
31
|
+
if (instanceRef.current === null) {
|
|
32
|
+
if (registered) {
|
|
33
|
+
instanceRef.current = { object: registered, owned: false };
|
|
34
|
+
}
|
|
35
|
+
else if (asset) {
|
|
36
|
+
const { object } = cloneModelAsset(asset);
|
|
37
|
+
object.name = createdObject.name || object.name || `model-${id}`;
|
|
38
|
+
instanceRef.current = { object, owned: true };
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
instanceRef.current = { object: null, owned: false };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const { object, owned } = instanceRef.current;
|
|
45
|
+
// Layout, not passive: the registry entry has to be in place by the time the host
|
|
46
|
+
// application reacts to onObjectReady and looks the object up by id.
|
|
47
|
+
useLayoutEffect(() => {
|
|
48
|
+
if (!object)
|
|
49
|
+
return;
|
|
50
|
+
// Refcounted in the cache rather than here, because the component that mounts an
|
|
51
|
+
// instance next is often not this one: adopting a saved object's real id in place of
|
|
52
|
+
// its temp id changes the React key, so one leaf unmounts and another mounts around
|
|
53
|
+
// the same Object3D in the same commit. A dispose owned by this component would free
|
|
54
|
+
// materials that the replacement is about to render.
|
|
55
|
+
retainModelInstance(object);
|
|
56
|
+
if (owned && !ObjectManager.getObject(id)) {
|
|
57
|
+
ObjectManager.addObject({ id, name: object.name, object });
|
|
58
|
+
}
|
|
59
|
+
return () => {
|
|
60
|
+
if (owned) {
|
|
61
|
+
const current = ObjectManager.getObject(id);
|
|
62
|
+
// After an id remap this lookup misses, which is the answer we want: the
|
|
63
|
+
// entry now lives under the real id and belongs to the leaf that replaced us.
|
|
64
|
+
if (current?.object === object) {
|
|
65
|
+
ObjectManager.removeObject(id);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
releaseModelInstance(object);
|
|
69
|
+
};
|
|
70
|
+
}, [id, object, owned]);
|
|
71
|
+
return object;
|
|
72
|
+
}
|
|
73
|
+
export default useModelObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOceanMaterial.d.ts","sourceRoot":"","sources":["../../src/hooks/useOceanMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useOceanMaterial.d.ts","sourceRoot":"","sources":["../../src/hooks/useOceanMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAI7E,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;gFAE4E;IAC5E,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACtF;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B;0DACsD;IACtD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;CAChD;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,EAAE,EACF,MAAM,EACN,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAgB,EAChB,OAAO,GACV,EAAE,uBAAuB,GAAG,mBAAmB,CAuE/C;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { useFrame } from '@react-three/fiber';
|
|
3
3
|
import { useCloudSun } from './useCloudSun.js';
|
|
4
|
+
import { useLiveTransitionEvents } from './useLiveTransitionEvents.js';
|
|
4
5
|
import { OCEAN_LIVE_KEY } from './useOceanLive.js';
|
|
5
6
|
import { OceanSurfaceMaterial } from '../shaders/ocean/OceanSurfaceMaterial.js';
|
|
6
7
|
import { applySunUniforms } from '../utils/cloudUniforms.js';
|
|
@@ -35,6 +36,10 @@ export function useOceanMaterial({ id, config, quality, skySettings, timeSetting
|
|
|
35
36
|
root.userData[OCEAN_LIVE_KEY] = liveHandle;
|
|
36
37
|
return () => { delete root.userData[OCEAN_LIVE_KEY]; };
|
|
37
38
|
}, [id, liveHandle]);
|
|
39
|
+
// Sequence-authored transitions (`transition.state === 'ocean'`) — shared by
|
|
40
|
+
// both hosts (OceanSurface, WaterBody), the same way the material and the
|
|
41
|
+
// live handle already are.
|
|
42
|
+
useLiveTransitionEvents('ocean', liveConfig, config, rootRef);
|
|
38
43
|
useFrame((state) => {
|
|
39
44
|
const shader = material;
|
|
40
45
|
updateSun();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3driseai/3drise-viewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@3driseai/3drise-common": "^1.0.1",
|
|
42
|
-
"@3driseai/3drise-core": "^1.0.
|
|
42
|
+
"@3driseai/3drise-core": "^1.0.10"
|
|
43
43
|
}
|
|
44
44
|
}
|