Spaces:
Sleeping
Sleeping
Download app/src/modules/interaction/pointerGuards.ts from Junyueeeeee/SparkSplat-Viewer: direct link, hf CLI and curl.
- Browser
- Download file 296 Bytes
-
https://huggingface.co/spaces/Junyueeeeee/SparkSplat-Viewer/resolve/main/app/src/modules/interaction/pointerGuards.ts
- Command line
-
hf download hf://spaces/Junyueeeeee/SparkSplat-Viewer/app/src/modules/interaction/pointerGuards.ts
-
curl -L -o pointerGuards.ts https://huggingface.co/spaces/Junyueeeeee/SparkSplat-Viewer/resolve/main/app/src/modules/interaction/pointerGuards.ts
296 Bytes
| const POINTER_LOCK_SUPPRESSION_MS = 300 | |
| let lastObjectInteractionAt = 0 | |
| export function markObjectInteraction() { | |
| lastObjectInteractionAt = performance.now() | |
| } | |
| export function shouldSuppressPointerLock() { | |
| return performance.now() - lastObjectInteractionAt < POINTER_LOCK_SUPPRESSION_MS | |
| } | |