@3driseai/3drise-viewer 0.1.25 → 0.1.26
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/animationsV2/ClipPlayer.d.ts +13 -0
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -0
- package/dist/animationsV2/ClipPlayer.js +140 -0
- package/dist/animationsV2/ClipsRuntime.d.ts +111 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -0
- package/dist/animationsV2/ClipsRuntime.js +476 -0
- package/dist/animationsV2/appliers.d.ts +16 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -0
- package/dist/animationsV2/appliers.js +204 -0
- package/dist/animationsV2/clipUtils.d.ts +33 -0
- package/dist/animationsV2/clipUtils.d.ts.map +1 -0
- package/dist/animationsV2/clipUtils.js +164 -0
- package/dist/animationsV2/elementSettings.d.ts +15 -0
- package/dist/animationsV2/elementSettings.d.ts.map +1 -0
- package/dist/animationsV2/elementSettings.js +16 -0
- package/dist/animationsV2/index.d.ts +16 -0
- package/dist/animationsV2/index.d.ts.map +1 -0
- package/dist/animationsV2/index.js +12 -0
- package/dist/animationsV2/nodeTracks.d.ts +13 -0
- package/dist/animationsV2/nodeTracks.d.ts.map +1 -0
- package/dist/animationsV2/nodeTracks.js +165 -0
- package/dist/animationsV2/normalize.d.ts +4 -0
- package/dist/animationsV2/normalize.d.ts.map +1 -0
- package/dist/animationsV2/normalize.js +49 -0
- package/dist/animationsV2/sequenceUtils.d.ts +57 -0
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -0
- package/dist/animationsV2/sequenceUtils.js +120 -0
- package/dist/animationsV2/types.d.ts +95 -0
- package/dist/animationsV2/types.d.ts.map +1 -0
- package/dist/animationsV2/types.js +8 -0
- package/dist/api/sceneHandle.d.ts +56 -17
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +154 -77
- package/dist/components/CameraController.d.ts.map +1 -1
- package/dist/components/CameraController.js +0 -44
- package/dist/components/Clouds.d.ts.map +1 -1
- package/dist/components/Clouds.js +0 -34
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +19 -1
- package/dist/components/EnvironmentManager.js +1 -1
- package/dist/components/ObjectsRenderer.d.ts +4 -1
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +23 -3
- package/dist/components/Ocean.d.ts.map +1 -1
- package/dist/components/Ocean.js +0 -63
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +19 -4
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +0 -39
- package/dist/components/Stars.d.ts.map +1 -1
- package/dist/components/Stars.js +3 -47
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +0 -5
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +0 -6
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -2
- package/dist/hooks/useInteraction.d.ts +6 -7
- package/dist/hooks/useInteraction.d.ts.map +1 -1
- package/dist/hooks/useInteraction.js +87 -268
- package/dist/hooks/useObjectAnimation.d.ts.map +1 -1
- package/dist/hooks/useObjectAnimation.js +0 -2
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +0 -5
- package/dist/hooks/useRuntimeSettings.d.ts +1 -1
- package/dist/hooks/useRuntimeSettings.js +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/interactions/index.d.ts +3 -0
- package/dist/interactions/index.d.ts.map +1 -0
- package/dist/interactions/index.js +1 -0
- package/dist/interactions/runner.d.ts +9 -0
- package/dist/interactions/runner.d.ts.map +1 -0
- package/dist/interactions/runner.js +23 -0
- package/dist/operations/catalogue/displayImage.d.ts +3 -0
- package/dist/operations/catalogue/displayImage.d.ts.map +1 -0
- package/dist/operations/catalogue/displayImage.js +39 -0
- package/dist/operations/catalogue/fade.d.ts +3 -0
- package/dist/operations/catalogue/fade.d.ts.map +1 -0
- package/dist/operations/catalogue/fade.js +44 -0
- package/dist/operations/catalogue/focus.d.ts +3 -0
- package/dist/operations/catalogue/focus.d.ts.map +1 -0
- package/dist/operations/catalogue/focus.js +22 -0
- package/dist/operations/catalogue/glow.d.ts +3 -0
- package/dist/operations/catalogue/glow.d.ts.map +1 -0
- package/dist/operations/catalogue/glow.js +49 -0
- package/dist/operations/catalogue/materialFx.d.ts +6 -0
- package/dist/operations/catalogue/materialFx.d.ts.map +1 -0
- package/dist/operations/catalogue/materialFx.js +13 -0
- package/dist/operations/catalogue/moveToFront.d.ts +3 -0
- package/dist/operations/catalogue/moveToFront.d.ts.map +1 -0
- package/dist/operations/catalogue/moveToFront.js +25 -0
- package/dist/operations/catalogue/visibility.d.ts +3 -0
- package/dist/operations/catalogue/visibility.d.ts.map +1 -0
- package/dist/operations/catalogue/visibility.js +24 -0
- package/dist/operations/catalogue/zoom.d.ts +3 -0
- package/dist/operations/catalogue/zoom.d.ts.map +1 -0
- package/dist/operations/catalogue/zoom.js +32 -0
- package/dist/operations/index.d.ts +5 -0
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +4 -0
- package/dist/operations/registry.d.ts +11 -0
- package/dist/operations/registry.d.ts.map +1 -0
- package/dist/operations/registry.js +21 -0
- package/dist/operations/runtime.d.ts +22 -0
- package/dist/operations/runtime.d.ts.map +1 -0
- package/dist/operations/runtime.js +161 -0
- package/dist/operations/types.d.ts +96 -0
- package/dist/operations/types.d.ts.map +1 -0
- package/dist/operations/types.js +3 -0
- package/dist/operations/useOperationsRuntime.d.ts +3 -0
- package/dist/operations/useOperationsRuntime.d.ts.map +1 -0
- package/dist/operations/useOperationsRuntime.js +31 -0
- package/package.json +2 -2
|
@@ -9,6 +9,9 @@ import EnvironmentManager from "./EnvironmentManager.js";
|
|
|
9
9
|
import CameraController from "./CameraController.js";
|
|
10
10
|
import ObjectsRenderer from "./ObjectsRenderer.js";
|
|
11
11
|
import CursorController from "./cursor/CursorController.js";
|
|
12
|
+
import ClipPlayer from "../animationsV2/ClipPlayer.js";
|
|
13
|
+
import { normalizeClip, normalizeSequence } from "../animationsV2/normalize.js";
|
|
14
|
+
import { resolveElementSettings } from "../animationsV2/elementSettings.js";
|
|
12
15
|
import { Physics } from "@react-three/rapier";
|
|
13
16
|
const SceneBuilder = forwardRef(({ project, width = "100%", height = "100vh", style = {}, className = "", onSceneInitialized, onSceneReady, onUiElementClick, onObjectClick, onObjectReady, onObjectDispose, }, ref) => {
|
|
14
17
|
const sceneSettings = (project.sceneSettingsData || {});
|
|
@@ -41,12 +44,17 @@ const SceneBuilder = forwardRef(({ project, width = "100%", height = "100vh", st
|
|
|
41
44
|
maxAzimuthAngle: Infinity,
|
|
42
45
|
}
|
|
43
46
|
});
|
|
44
|
-
|
|
47
|
+
// Animations V2: rows from data-center, normalised to the runtime shapes.
|
|
48
|
+
const rawClips = project.animationClips;
|
|
49
|
+
const rawSequences = project.animationSequences;
|
|
50
|
+
const animationClips = useMemo(() => (rawClips || []).map(normalizeClip), [rawClips]);
|
|
51
|
+
const animationSequences = useMemo(() => (rawSequences || []).map(normalizeSequence), [rawSequences]);
|
|
45
52
|
const actionSequences = project.actionSequences || [];
|
|
53
|
+
const clipAutoplay = useMemo(() => ({ sequences: animationSequences, clips: animationClips }), [animationSequences, animationClips]);
|
|
46
54
|
// The external control handle (see api/sceneHandle). Built once; reads the
|
|
47
55
|
// current project lists through a ref, so it never goes stale.
|
|
48
|
-
const handleSource = useRef({ actions: actionSequences,
|
|
49
|
-
handleSource.current = { actions: actionSequences,
|
|
56
|
+
const handleSource = useRef({ actions: actionSequences, clips: animationClips, sequences: animationSequences });
|
|
57
|
+
handleSource.current = { actions: actionSequences, clips: animationClips, sequences: animationSequences };
|
|
50
58
|
const sceneHandle = useMemo(() => createSceneHandle(() => handleSource.current), []);
|
|
51
59
|
useImperativeHandle(ref, () => sceneHandle, [sceneHandle]);
|
|
52
60
|
const sceneObjects = project.sceneObjects || sceneSettings.scene?.objectSettings || [];
|
|
@@ -140,7 +148,14 @@ const SceneBuilder = forwardRef(({ project, width = "100%", height = "100vh", st
|
|
|
140
148
|
onSceneInitialized();
|
|
141
149
|
}
|
|
142
150
|
onSceneReady?.(sceneHandle);
|
|
143
|
-
}, children: _jsxs(Physics, { gravity: physicsSettings.gravity, paused: !physicsSettings.enabled, debug: physicsSettings.debug, children: [_jsx(LightsManager, { config: lighting[0], onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), environment && _jsx(EnvironmentManager, { environment: environment, timeSettings: timeSettings, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(CameraController, { settings: camera, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(ObjectsRenderer, { cameraSettings: camera, generalObjectSettings: generalObjectSettings, createdObjects: sceneObjects, onObjectsReady: undefined, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose, sequences: animationSequences, actionSequences: actionSequences, handleObjectClick: onObjectClick ? (object, ref, event) => onObjectClick(object, ref, event) : undefined }), _jsx(
|
|
151
|
+
}, children: _jsxs(Physics, { gravity: physicsSettings.gravity, paused: !physicsSettings.enabled, debug: physicsSettings.debug, children: [_jsx(LightsManager, { config: lighting[0], onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), environment && _jsx(EnvironmentManager, { environment: environment, timeSettings: timeSettings, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(CameraController, { settings: camera, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }), _jsx(ObjectsRenderer, { cameraSettings: camera, generalObjectSettings: generalObjectSettings, createdObjects: sceneObjects, onObjectsReady: undefined, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose, sequences: animationSequences, clips: animationClips, actionSequences: actionSequences, handleObjectClick: onObjectClick ? (object, ref, event) => onObjectClick(object, ref, event) : undefined }), _jsx(ClipPlayer, { autoplay: clipAutoplay, getSettings: (state) => resolveElementSettings(state, {
|
|
152
|
+
objects: sceneObjects,
|
|
153
|
+
camera,
|
|
154
|
+
sky: environment?.sky,
|
|
155
|
+
clouds: environment?.clouds,
|
|
156
|
+
ocean: environment?.ocean,
|
|
157
|
+
terrain: environment?.terrain,
|
|
158
|
+
}) }), _jsx(CursorController, { effects: project.cursor?.effects, clickActions: project.cursor?.clickActions, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }) }) }));
|
|
144
159
|
});
|
|
145
160
|
SceneBuilder.displayName = 'SceneBuilder';
|
|
146
161
|
export default SceneBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkyController.d.ts","sourceRoot":"","sources":["../../src/components/SkyController.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"SkyController.d.ts","sourceRoot":"","sources":["../../src/components/SkyController.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,QAAQ,EAAE,WAAW,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CACtD;AAED,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,GAAG,EAAE,kBAAkB,GA+I8H,GAAG,CACtQ;AA6BD,eAAe,aAAa,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
3
3
|
import { useRef, useEffect, useCallback } from 'react';
|
|
4
4
|
import { useFrame } from '@react-three/fiber';
|
|
5
|
-
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
6
5
|
import { useSkyUniforms } from '../hooks/useSkyUniforms.js';
|
|
7
6
|
import { useSkyAnimation } from '../hooks/useSkyAnimation.js';
|
|
8
7
|
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
@@ -27,44 +26,6 @@ function SkyController({ settings, timeSettings, scale = 1000, onSettingsChange,
|
|
|
27
26
|
useEffect(() => {
|
|
28
27
|
handleSettings(settings);
|
|
29
28
|
}, [settings]);
|
|
30
|
-
useAnimationEvents({
|
|
31
|
-
onStepStart: (event) => {
|
|
32
|
-
if (!event.step?.transitions)
|
|
33
|
-
return;
|
|
34
|
-
event.step.transitions.forEach((transition) => {
|
|
35
|
-
if (transition.state === 'sky' && skyRef.current) {
|
|
36
|
-
const toProps = transition.properties.to || {};
|
|
37
|
-
const fromProps = transition.properties.from || {};
|
|
38
|
-
// Handle `visible` as an immediate boolean switch — not animated
|
|
39
|
-
if (toProps.visible !== undefined) {
|
|
40
|
-
toggleSky(toProps.visible);
|
|
41
|
-
}
|
|
42
|
-
else if (fromProps.visible !== undefined) {
|
|
43
|
-
toggleSky(fromProps.visible);
|
|
44
|
-
}
|
|
45
|
-
if (!skyRef.current.visible)
|
|
46
|
-
return;
|
|
47
|
-
// Only animate numeric sky uniform properties
|
|
48
|
-
const SKY_KEYS = ['turbidity', 'rayleigh', 'mieCoefficient', 'mieDirectionalG', 'elevation', 'azimuth'];
|
|
49
|
-
const hasNumericTarget = SKY_KEYS.some((k) => toProps[k] !== undefined);
|
|
50
|
-
if (!hasNumericTarget)
|
|
51
|
-
return;
|
|
52
|
-
// Build `from`: current live values as baseline, overridden by explicit fromProps
|
|
53
|
-
const liveValues = getCurrentValues() || {};
|
|
54
|
-
const from = {};
|
|
55
|
-
const to = {};
|
|
56
|
-
for (const key of SKY_KEYS) {
|
|
57
|
-
if (toProps[key] === undefined)
|
|
58
|
-
continue;
|
|
59
|
-
to[key] = toProps[key];
|
|
60
|
-
from[key] = fromProps[key] ?? liveValues[key] ?? toProps[key];
|
|
61
|
-
}
|
|
62
|
-
isAnimatingRef.current = true;
|
|
63
|
-
animateSkyTransition(from, to, updateUniforms, handleCompletedUniforms, event.step?.duration);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
29
|
const handleTimeUpdate = useCallback((state) => {
|
|
69
30
|
const { sunAzimuth, sunElevation, timeInHours } = state;
|
|
70
31
|
const atmosphericParams = calculateSkyParamsForTime(timeInHours);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stars.d.ts","sourceRoot":"","sources":["../../src/components/Stars.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAA4C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Stars.d.ts","sourceRoot":"","sources":["../../src/components/Stars.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAA4C,MAAM,OAAO,CAAC;AAOjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAChD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAOD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAuDnE;AAYD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAiI/B,CAAC;AACF,eAAe,KAAK,CAAC"}
|
package/dist/components/Stars.js
CHANGED
|
@@ -5,7 +5,6 @@ import { BufferGeometry, BufferAttribute, AdditiveBlending, Color } from 'three'
|
|
|
5
5
|
import { useFrame } from '@react-three/fiber';
|
|
6
6
|
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
7
7
|
import { useParticlesColors } from '../hooks/useParticlesColors.js';
|
|
8
|
-
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
9
8
|
import { useNumericAnimation } from '../hooks/useNumericAnimation.js';
|
|
10
9
|
import { useMouseHandlers } from '../hooks/useMouseHandlers.js';
|
|
11
10
|
const STARS_SHADER_UNIFORM_MAP = {
|
|
@@ -120,51 +119,6 @@ const Stars = ({ settings, timeSettings, sunSystemEnabled = false, onObjectReady
|
|
|
120
119
|
}
|
|
121
120
|
}, [sunSystemEnabled]);
|
|
122
121
|
const { animateNumeric } = useNumericAnimation();
|
|
123
|
-
useAnimationEvents({
|
|
124
|
-
onStepStart: (event) => {
|
|
125
|
-
if (!event.step?.transitions)
|
|
126
|
-
return;
|
|
127
|
-
for (const transition of event.step.transitions) {
|
|
128
|
-
if (transition.state !== 'stars' && !pointsRef.current)
|
|
129
|
-
continue;
|
|
130
|
-
const toProps = transition.properties.to || {};
|
|
131
|
-
const fromProps = transition.properties.from || {};
|
|
132
|
-
// visible — immediate boolean switch
|
|
133
|
-
if (toProps.visible !== undefined && pointsRef.current) {
|
|
134
|
-
// setVisibleOverride(toProps.visible);
|
|
135
|
-
pointsRef.current.visible = toProps.visible;
|
|
136
|
-
}
|
|
137
|
-
// color — existing path
|
|
138
|
-
// speed = 1 / duration below; keep an instant (0) step finite.
|
|
139
|
-
setDuration(Math.max(event.step.duration ?? 1, 0.001));
|
|
140
|
-
if (toProps.color !== undefined) {
|
|
141
|
-
setColors({
|
|
142
|
-
baseColor: fromProps.color,
|
|
143
|
-
targetColor: toProps.color,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
// numeric: rotateSpeed, size
|
|
147
|
-
const STARS_NUMERIC_KEYS = ['rotateSpeed', 'size'];
|
|
148
|
-
const from = {};
|
|
149
|
-
const to = {};
|
|
150
|
-
for (const key of STARS_NUMERIC_KEYS) {
|
|
151
|
-
const toVal = toProps[key];
|
|
152
|
-
if (toVal === undefined)
|
|
153
|
-
continue;
|
|
154
|
-
to[key] = toVal;
|
|
155
|
-
from[key] = fromProps[key] ?? settings[key] ?? toVal;
|
|
156
|
-
}
|
|
157
|
-
if (Object.keys(to).length > 0) {
|
|
158
|
-
animateNumeric(from, to, (updated) => {
|
|
159
|
-
numericOverrideRef.current = { ...numericOverrideRef.current, ...updated };
|
|
160
|
-
}, () => {
|
|
161
|
-
numericOverrideRef.current = null;
|
|
162
|
-
// setVisibleOverride(null);
|
|
163
|
-
}, event.step?.duration);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
});
|
|
168
122
|
const handleTimeUpdate = useCallback((state) => {
|
|
169
123
|
// Not gated on autoAnimate any more: scrubbing the time slider to
|
|
170
124
|
// midnight has to bring the stars up the same way playing into midnight
|
|
@@ -250,6 +204,8 @@ const Stars = ({ settings, timeSettings, sunSystemEnabled = false, onObjectReady
|
|
|
250
204
|
handleMouseMove(state.pointer);
|
|
251
205
|
});
|
|
252
206
|
// if (!(visibleOverride ?? visible) || !isVisible) return null;
|
|
253
|
-
|
|
207
|
+
// No scale on <points>: the CreatedObject wrapper applies meshSettings.scale. Applying it
|
|
208
|
+
// here too squared the size, and animations (which drive the wrapper) moved only one factor.
|
|
209
|
+
return (_jsx("points", { ref: pointsRef, geometry: geometry, renderOrder: -1, frustumCulled: false, userData: { id: '3drise-stars' }, visible: visible, children: _jsx("starsMaterial", { ref: materialRef, transparent: true, depthWrite: false, depthTest: true, blending: AdditiveBlending, uColor: new Color(color), uOpacity: opacity, targetColor: new Color(colors.targetColor), colorMix: 0 }) }));
|
|
254
210
|
};
|
|
255
211
|
export default Stars;
|
|
@@ -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;AAU1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgG/C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -4,7 +4,6 @@ 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';
|
|
8
7
|
import { TERRAIN_LIVE_KEY } from '../../hooks/useTerrainLive.js';
|
|
9
8
|
import { TerrainMaterial } from '../../shaders/terrain/TerrainMaterial.js';
|
|
10
9
|
import { applySunUniforms } from '../../utils/cloudUniforms.js';
|
|
@@ -59,10 +58,6 @@ const TerrainSurface = ({ id = '3drise-terrain', config, quality, skySettings, t
|
|
|
59
58
|
return () => { delete root.userData[TERRAIN_LIVE_KEY]; };
|
|
60
59
|
}, [id, liveHandle]);
|
|
61
60
|
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);
|
|
66
61
|
useFrame((state) => {
|
|
67
62
|
const camera = state.camera;
|
|
68
63
|
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;AAKvE,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,CAmW7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -5,7 +5,6 @@ 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';
|
|
9
8
|
import { CLOUD_LIVE_KEY } from '../../hooks/useCloudLive.js';
|
|
10
9
|
import { useCloudNoise } from '../../hooks/useCloudNoise.js';
|
|
11
10
|
import { useCloudSun } from '../../hooks/useCloudSun.js';
|
|
@@ -155,11 +154,6 @@ const VolumetricCloudsPass = ({ id = '3drise-clouds', deck, cirrus, quality, thu
|
|
|
155
154
|
// ObjectReadySource's union is widened by Record<string, any>, but spelling the
|
|
156
155
|
// cast out keeps the intent: this reports the layer's settings, not a mesh's.
|
|
157
156
|
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);
|
|
163
157
|
// Only a resolution change genuinely invalidates the history — the buffers are
|
|
164
158
|
// reallocated and nothing in them maps to the new grid.
|
|
165
159
|
//
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export type { Update3driseShaderOptions } from './use3driseShader';
|
|
2
2
|
export { update3driseShaderUniforms, use3driseShader } from './use3driseShader';
|
|
3
|
-
export { useAnimationEvents } from './useAnimationEvents';
|
|
4
3
|
export { useCameraAnimation } from './useCameraAnimation';
|
|
5
4
|
export type { CloudNoise } from './useCloudNoise';
|
|
6
5
|
export { bakeCloudNoise, useCloudNoise } from './useCloudNoise';
|
|
@@ -73,7 +72,6 @@ export { useParticlesTextures } from './useParticlesTextures';
|
|
|
73
72
|
export type { PathAnimationOptions } from './usePathAnimation';
|
|
74
73
|
export { usePathAnimation } from './usePathAnimation';
|
|
75
74
|
export { useRegisterScene } from './useRegisterScene';
|
|
76
|
-
export { useSequenceAnimation } from './useSequenceAnimation';
|
|
77
75
|
export { applyShadowFlags, useShadowApplication } from './useShadowApplication';
|
|
78
76
|
export { useShapeGeometry } from './useShapeGeometry';
|
|
79
77
|
export type { SkyAnimValues } from './useSkyAnimation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAA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,sBAAsB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// Default exports are omitted throughout: every hook that has one also exports
|
|
4
4
|
// the same function by name.
|
|
5
5
|
export { update3driseShaderUniforms, use3driseShader } from './use3driseShader.js';
|
|
6
|
-
export { useAnimationEvents } from './useAnimationEvents.js';
|
|
7
6
|
export { useCameraAnimation } from './useCameraAnimation.js';
|
|
8
7
|
export { bakeCloudNoise, useCloudNoise } from './useCloudNoise.js';
|
|
9
8
|
export { computeCloudSun, useCloudSun } from './useCloudSun.js';
|
|
@@ -53,7 +52,6 @@ export { useParticlesColors } from './useParticlesColors.js';
|
|
|
53
52
|
export { useParticlesTextures } from './useParticlesTextures.js';
|
|
54
53
|
export { usePathAnimation } from './usePathAnimation.js';
|
|
55
54
|
export { useRegisterScene } from './useRegisterScene.js';
|
|
56
|
-
export { useSequenceAnimation } from './useSequenceAnimation.js';
|
|
57
55
|
export { applyShadowFlags, useShadowApplication } from './useShadowApplication.js';
|
|
58
56
|
export { useShapeGeometry } from './useShapeGeometry.js';
|
|
59
57
|
export { useSkyAnimation } from './useSkyAnimation.js';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { ActionSequence,
|
|
2
|
-
|
|
1
|
+
import type { ActionSequence, CameraState, ExecuteInteractionParams } from '@3driseai/3drise-core';
|
|
2
|
+
import type { AnimationClip, AnimationSequence } from '../animationsV2/types';
|
|
3
|
+
export declare function useInteraction({ cameraSettings, sequences, clips, actionSequences, }: {
|
|
3
4
|
cameraSettings: CameraState;
|
|
4
|
-
sequences
|
|
5
|
+
sequences?: AnimationSequence[];
|
|
6
|
+
clips?: AnimationClip[];
|
|
5
7
|
actionSequences?: ActionSequence[];
|
|
6
8
|
}): {
|
|
7
|
-
executeInteraction: (params:
|
|
8
|
-
currentAnimatedRef: import("react").RefObject<any>;
|
|
9
|
-
glowingObjects: import("react").MutableRefObject<Set<string>>;
|
|
10
|
-
vanishedObjects: import("react").MutableRefObject<Set<string>>;
|
|
9
|
+
executeInteraction: (params: ExecuteInteractionParams) => void;
|
|
11
10
|
};
|
|
12
11
|
export default useInteraction;
|
|
13
12
|
//# sourceMappingURL=useInteraction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAGnG,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI9E,wBAAgB,cAAc,CAAC,EAC3B,cAAc,EAAE,SAAc,EAAE,KAAU,EAAE,eAAoB,GACnE,EAAE;IACC,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACtC;iCAkBmD,wBAAwB;EA8C3E;AACD,eAAe,cAAc,CAAC"}
|