@expofp/renderer 3.52.1 → 3.53.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/dist/controls/hooks.d.ts +13 -0
- package/dist/controls/hooks.js +18 -0
- package/dist/controls/index.d.ts +1 -1
- package/dist/controls/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -4
- package/package.json +2 -2
package/dist/controls/hooks.d.ts
CHANGED
|
@@ -36,6 +36,19 @@ export declare function useCameraControls(): CameraControlsImpl | undefined;
|
|
|
36
36
|
* @param effect - What to do with the controls; may return a cleanup, as any effect may.
|
|
37
37
|
*/
|
|
38
38
|
export declare function useControlsEffect(effect: (controls: CameraControlsImpl) => (() => void) | void): void;
|
|
39
|
+
/**
|
|
40
|
+
* Runs a handler as the camera starts to move — one call per movement rather than one per frame,
|
|
41
|
+
* whether a gesture or a command drove it. The same movement's end is {@link useCameraMoveEnd}, so
|
|
42
|
+
* between the two calls the camera is in motion: what a caller about to move the plan itself asks,
|
|
43
|
+
* to leave a flight to land or a drag to finish first.
|
|
44
|
+
*
|
|
45
|
+
* `wake` rather than `transitionstart`, which a drag and a jump never dispatch: `wake` is the one
|
|
46
|
+
* event `sleep` always answers. It comes with the first frame the movement is drawn in, so a
|
|
47
|
+
* command is reported a frame after it was given.
|
|
48
|
+
* @param handler - Called as each movement starts. Re-subscribed when its identity changes, so pass
|
|
49
|
+
* a stable function — under the React Compiler an inline closure over stable values is one.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useCameraMoveStart(handler: () => void): void;
|
|
39
52
|
/**
|
|
40
53
|
* Runs a handler once the camera has come to rest after moving — one call per movement rather than
|
|
41
54
|
* one per frame, whether a gesture or a command drove it. The event the imperative renderer
|
package/dist/controls/hooks.js
CHANGED
|
@@ -55,6 +55,24 @@ export function useControlsEffect(effect) {
|
|
|
55
55
|
return effect(controls) ?? undefined;
|
|
56
56
|
}, [effect, get, mounted]);
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Runs a handler as the camera starts to move — one call per movement rather than one per frame,
|
|
60
|
+
* whether a gesture or a command drove it. The same movement's end is {@link useCameraMoveEnd}, so
|
|
61
|
+
* between the two calls the camera is in motion: what a caller about to move the plan itself asks,
|
|
62
|
+
* to leave a flight to land or a drag to finish first.
|
|
63
|
+
*
|
|
64
|
+
* `wake` rather than `transitionstart`, which a drag and a jump never dispatch: `wake` is the one
|
|
65
|
+
* event `sleep` always answers. It comes with the first frame the movement is drawn in, so a
|
|
66
|
+
* command is reported a frame after it was given.
|
|
67
|
+
* @param handler - Called as each movement starts. Re-subscribed when its identity changes, so pass
|
|
68
|
+
* a stable function — under the React Compiler an inline closure over stable values is one.
|
|
69
|
+
*/
|
|
70
|
+
export function useCameraMoveStart(handler) {
|
|
71
|
+
useControlsEffect((controls) => {
|
|
72
|
+
controls.addEventListener('wake', handler);
|
|
73
|
+
return () => controls.removeEventListener('wake', handler);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
58
76
|
/**
|
|
59
77
|
* Runs a handler once the camera has come to rest after moving — one call per movement rather than
|
|
60
78
|
* one per frame, whether a gesture or a command drove it. The event the imperative renderer
|
package/dist/controls/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export type { InertiaConfig } from './handlers/Inertia';
|
|
|
5
5
|
export type { PanConfig } from './handlers/Pan';
|
|
6
6
|
export type { RollConfig } from './handlers/Roll';
|
|
7
7
|
export type { ZoomConfig } from './handlers/Zoom';
|
|
8
|
-
export { type CameraState, useCameraAPI, useCameraControls, useCameraGesture, useCameraMoveEnd, useCameraState, useControlsEffect, } from './hooks';
|
|
8
|
+
export { type CameraState, useCameraAPI, useCameraControls, useCameraGesture, useCameraMoveEnd, useCameraMoveStart, useCameraState, useControlsEffect, } from './hooks';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/controls/index.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
export { bearing, CameraCommands, } from './camera-api';
|
|
5
5
|
export { CameraControls, CameraControlsAction } from './CameraControls';
|
|
6
6
|
export { Controls } from './Controls';
|
|
7
|
-
export { useCameraAPI, useCameraControls, useCameraGesture, useCameraMoveEnd, useCameraState, useControlsEffect, } from './hooks';
|
|
7
|
+
export { useCameraAPI, useCameraControls, useCameraGesture, useCameraMoveEnd, useCameraMoveStart, useCameraState, useControlsEffect, } from './hooks';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type CameraAPI, type CameraAxes, type CameraState, type ControlsConfig, type InertiaConfig, type PanConfig, type RollConfig, type TransitionOptions, useCameraAPI, useCameraGesture, useCameraMoveEnd, useCameraState, type ZoomConfig, type ZoomToOptions, } from './controls';
|
|
1
|
+
export { type CameraAPI, type CameraAxes, type CameraState, type ControlsConfig, type InertiaConfig, type PanConfig, type RollConfig, type TransitionOptions, useCameraAPI, useCameraGesture, useCameraMoveEnd, useCameraMoveStart, useCameraState, type ZoomConfig, type ZoomToOptions, } from './controls';
|
|
2
2
|
export { prepareDebug } from './debug/debug-chunk';
|
|
3
3
|
export { useDebugPanel, useGui } from './debug/debug-context';
|
|
4
4
|
export { type AmbientOcclusionProps, type ContactShadowProps, type EnvironmentProps, type LightingProps, type SunShadowProps, } from './objects/lighting';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
// The camera's public surface: commands, a state reader, and the
|
|
2
|
-
// own hand on the camera, and any movement coming to rest. Deliberately not
|
|
3
|
-
// the controls themselves — those hand out `camera-controls`, which is this
|
|
4
|
-
|
|
1
|
+
// The camera's public surface: commands, a state reader, and the three movement events — the user's
|
|
2
|
+
// own hand on the camera, and any movement starting and coming to rest. Deliberately not
|
|
3
|
+
// `useControlsEffect` or the controls themselves — those hand out `camera-controls`, which is this
|
|
4
|
+
// renderer's internals.
|
|
5
|
+
export { useCameraAPI, useCameraGesture, useCameraMoveEnd, useCameraMoveStart, useCameraState, } from './controls';
|
|
5
6
|
// The debug chunk's preload, for an external host that must create its context instrumented.
|
|
6
7
|
export { prepareDebug } from './debug/debug-chunk';
|
|
7
8
|
// Adding a host's own folders and values to the debug panel.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/renderer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.53.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"troika-three-text": "^0.52.5",
|
|
43
43
|
"tslib": "^2.3.0",
|
|
44
44
|
"webgl-memory": "^1.1.3",
|
|
45
|
-
"@expofp/geometry": "3.
|
|
45
|
+
"@expofp/geometry": "3.53.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@react-three/test-renderer": "^9.1.0",
|