Skip to content

Commit b431387

Browse files
marklundinCopilot
andauthored
Update packages/blocks/src/splat-viewer/hooks/use-render-on-camera-change.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 225c75a commit b431387

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/blocks/src/splat-viewer/hooks/use-render-on-camera-change.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ const nearlyEquals = (a: Float32Array, b: Float32Array, epsilon = 1e-4): boolean
99
return true;
1010
};
1111

12+
/**
13+
* A custom React hook that triggers rendering when the camera's transform or projection matrix changes.
14+
*
15+
* @param {Entity | null} entity - The PlayCanvas entity representing the camera. If null, the hook does nothing.
16+
* @returns {void} This hook does not return a value but updates the rendering state of the application.
17+
*/
1218
export const useRenderOnCameraChange = (entity: Entity | null) => {
1319
const app = useApp();
1420
const prevWorld = useRef<Float32Array>(new Float32Array(16));

0 commit comments

Comments
 (0)