Orillusion/orillusion

[BUG]: The LoaderFunctions.OnUrl doesn't seem to be called

sadunkit opened this issue · 3 comments

Hi, I loved my experience learning about this engine for the past few days...

But I've been using SvelteKit to bootstrap my games and I have been facing some issues while loading GLTF files.
I'm using svelte-kit 4.2.7 with export const ssr = false for the page

        let glb = await Engine3D.res.loadGltf('models/space_station.glb', {
            onUrl: (/** @type {string} */ url) => {
                console.log('hello url')
                console.log(url)
                return '/models/space_station.glb'
            }
        })

The logs never actually get logged and the redirect never happens.
Expected behaviour for me was to change the URL before the request was sent.

Also a weird little side issue

when I come to the page from a link from the home page to my engine page /ori, the loadGltf will first send a request to domain.com/ori/models/space_station.glb
but after refreshing it will send a request to domain.com/models/space_station.glb (Which happens to be the correct location for SvelteKit 🤣 )

Thanks for all the amazing work you are doing; much love

Thanks for your feedback! May I know first whether or not the GLTF model is loaded normally in your game?

thanks for the bug report, the onUrl callback will be fixed in next release

It does get loaded in the 2nd request after refresh, but not the initial link click + load