Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,18 @@ export function elementKey(modelId: string, el: THREE.Object3D): string {
|
|||||||
return `${modelId}:${id}`;
|
return `${modelId}:${id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Globally accessible ref to the active R3F scene (set by SceneRefCapture). */
|
||||||
|
export const sceneRef: { current: THREE.Scene | null } = { current: null };
|
||||||
|
|
||||||
|
function SceneRefCapture() {
|
||||||
|
const { scene } = useThree();
|
||||||
|
useEffect(() => {
|
||||||
|
sceneRef.current = scene;
|
||||||
|
return () => { if (sceneRef.current === scene) sceneRef.current = null; };
|
||||||
|
}, [scene]);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function LoadingFallback() {
|
function LoadingFallback() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user