This commit is contained in:
Leon van Kammen 2026-09-24 18:17:25 +02:00
parent dd12979ae8
commit 78ec717551
3 changed files with 11 additions and 7 deletions

View file

@ -101,7 +101,7 @@ return {
data.janusurl = (v.janusxr and v.janusxr.wrap) and app.opts.baseurl .. util.stripPath(v.url) data.janusurl = (v.janusxr and v.janusxr.wrap) and app.opts.baseurl .. util.stripPath(v.url)
-- if parent has redirect to item set, use parent url -- if parent has redirect to item set, use parent url
if not data.janusurl or v.parent.redirect == v.url then if not data.janusurl or v.parent.redirect == v.url then
data.janusurl = app.opts.baseurl .. util.stripPath(v.parent.url) data.janusurl = app.opts.baseurl .. util.stripPath(v.parent.redirect)
end end
if v.janusxr and v.janusxr.wrap and v.janusxr.wrap.file then if v.janusxr and v.janusxr.wrap and v.janusxr.wrap.file then
-- what to do here? no generated portals? -- what to do here? no generated portals?

View file

@ -48,10 +48,10 @@ end}
room = app.opts.plugin_janusxr_portalroom room = app.opts.plugin_janusxr_portalroom
end end
function initRoom(i) function initRoom(r)
if i.janusxr and i.janusxr.room then if r.janusxr and r.janusxr.room then
pos = '0 0 1' -- todo make startup location configurable pos = '0 0 1' -- todo make startup location configurable
room = i.janusxr.room room = r.janusxr.room
end end
end end
initRoom(item or {}) initRoom(item or {})

View file

@ -33,10 +33,14 @@ app.on('scan_experience_file', function(exp)
exp.janusxr = exp.janusxr or {} exp.janusxr = exp.janusxr or {}
exp.janusxr.wrap = nil -- erase previous 3D models exp.janusxr.wrap = nil -- erase previous 3D models
print("✅ └─ plugin/janusxr: " .. exp.file.name) print("✅ └─ plugin/janusxr: " .. exp.file.name)
if data:match(pattern_aframe) and app.opts.plugin_janusxr_wrap_aframe == 'enabled' then if data:match(pattern_aframe) and app.opts.plugin_janusxr_wrap_aframe ~= '' then
exp.janusxr.wrap = {file = true } if not data:match("<a-sky") then
exp.janusxr.room = 'room_plane'
exp.janusxr.wrap = {redirect = true } -- redirect to file verbatim
else
exp.janusxr.wrap = {file = true } -- include markup in footer
end
app.markViewable(exp,50) app.markViewable(exp,50)
-- *TODO* assign room if no sky or equirect
print("✅ └─ plugin/janusxr: AFRAME markup detected") print("✅ └─ plugin/janusxr: AFRAME markup detected")
else else
exp.janusxr.wrap = {redirect = true} exp.janusxr.wrap = {redirect = true}