Skip to content

Commit 6d83016

Browse files
📝 Add docstrings to codex/add-client-side-logic-to-viewer3d
Docstrings generation was requested by @shayancoin. * #15 (comment) The following files were modified: * `frontend/src/app/components/viewer3d.tsx`
1 parent 538cdef commit 6d83016

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎frontend/src/app/components/viewer3d.tsx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ declare global {
1414
}
1515
}
1616

17+
/**
18+
* Render a GLTF/GLB model and signal when its primary scene becomes visible.
19+
*
20+
* Resolves a provided model URL to an absolute URL when running in a browser, loads the GLTF, and renders its scene as a primitive. After the scene is available, schedules a single animation frame that records the visibility timestamp on `window.__lod0VisibleAt` and dispatches a `CustomEvent` named `"lod0:visible"` with `{ ts }` in `event.detail`.
21+
*
22+
* @param modelUrl - The model file URL (absolute or relative). Relative URLs are resolved against `window.location.origin` when available.
23+
* @returns A JSX element that renders the loaded GLTF scene.
24+
*/
1725
function Model({ modelUrl }: { modelUrl: string }) {
1826
// Resolve absolute URL to avoid base path issues
1927
const src = useMemo(() => {

0 commit comments

Comments
 (0)