2026-08-06 16:43:17 +02:00
|
|
|
{if true then
|
|
|
|
|
showfediportals = app.opts.plugin_federation_strategy == 'always' or
|
|
|
|
|
(app.opts.plugin_federation_strategy == 'homepage' and urlpath == '/')
|
|
|
|
|
end}
|
|
|
|
|
|
|
|
|
|
|
2026-08-04 12:17:33 +02:00
|
|
|
<fireboxroom>
|
|
|
|
|
<assets>
|
|
|
|
|
<assetshader id="xrforgeportal" src="${opts.baseurl}shader/xrforgeportal.shadertoy.frag" shadertype="shadertoy"></assetshader>
|
|
|
|
|
{if items and #items > 0 then
|
|
|
|
|
for i,v in pairs(items) do
|
2026-08-11 17:47:40 +02:00
|
|
|
if #v.thumbnail > 0 then
|
|
|
|
|
print('\t<assetimage src="' .. v.thumbnail .. '" id="img' .. i .. '"/>')
|
|
|
|
|
end
|
2026-08-04 12:17:33 +02:00
|
|
|
end
|
|
|
|
|
end}
|
2026-08-06 16:43:17 +02:00
|
|
|
{if showfediportals then
|
|
|
|
|
for i=1,5 do
|
|
|
|
|
local urls = app.opts[ 'plugin_federation_url_' .. i]
|
|
|
|
|
if #urls > 0 then
|
|
|
|
|
local fediurl = urls:gsub(' .*','')
|
|
|
|
|
local thumburl = urls:gsub('.* ','')
|
|
|
|
|
print('\t<assetimage src="' .. thumburl .. '" id="federated' .. i .. '"/>')
|
|
|
|
|
end
|
2026-08-04 12:17:33 +02:00
|
|
|
end
|
|
|
|
|
end}
|
|
|
|
|
</assets>
|
|
|
|
|
{if item then
|
|
|
|
|
print([[
|
|
|
|
|
<room pos="0 0 0" skybox="true" showavatar="false">
|
|
|
|
|
<object id="${url}"/>
|
|
|
|
|
]])
|
|
|
|
|
else
|
|
|
|
|
local room = app.opts.plugin_janusxr_portalroom
|
2026-08-11 17:47:40 +02:00
|
|
|
if item and item.janusxr and item.janusxr.room then
|
|
|
|
|
room = item.janusxr.room
|
|
|
|
|
end
|
2026-08-04 12:17:33 +02:00
|
|
|
if room == 'random' then room = app.plugin.janusxr.getRandomRoom() end
|
2026-08-11 17:47:40 +02:00
|
|
|
print(' <room skybox="true" showavatar="false" use_local_asset="' .. room .. '">')
|
2026-08-04 12:17:33 +02:00
|
|
|
end}
|
|
|
|
|
<light js_id="dan9-janus:light/light_cone_angle=0-6" pos="0 3 2" collision_trigger="false" />
|
|
|
|
|
{if true then
|
2026-08-11 17:47:40 +02:00
|
|
|
function addPortal(id,x,v,url,i,z,thumb,rotation,scale)
|
|
|
|
|
print('\t<object js_id="' .. id .. '_' .. i .. '" pos="' .. x .. ' 0 ' .. z .. '" rotation="' .. rotation .. '">')
|
|
|
|
|
print('\t <link url="' .. url .. '" ' .. thumb .. ' title_col="0.4 0.37 0.4" pos="0 0 0.001" draw_glow="true" scale="3 3 0.1" />')
|
|
|
|
|
print('\t <link url="' .. url .. '" shader_id="xrforgeportal" pos="0 0 0.003" draw_glow="false" scale="3 3 0.1" />')
|
|
|
|
|
print('\t <text text="' .. v.title .. '" pos="0 3.4 0" col="1 1 1" font_scale="false" scale="' .. scale .. '" />')
|
|
|
|
|
print('\t</object>')
|
2026-08-04 12:17:33 +02:00
|
|
|
end
|
|
|
|
|
end}
|
|
|
|
|
<text js_id="location" pos="0 6 -5" billboard="y" col="#BBFFFF" scale="10 10 1" text="${url}" emissive="0 0 0" roughness="0.3" metalness="0" />
|
2026-08-04 14:09:17 +02:00
|
|
|
{if not item and items and #items > 0 then
|
2026-08-04 12:17:33 +02:00
|
|
|
local portals = {}
|
|
|
|
|
for i,v in pairs(items) do table.insert(portals, v) end
|
|
|
|
|
if parent then table.insert(portals, p) end
|
|
|
|
|
for i,v in pairs(items) do
|
|
|
|
|
local width = 3.2
|
|
|
|
|
local center = -((#items*width)/1.3) + (i*width)
|
|
|
|
|
local url = v.url
|
2026-08-11 17:47:40 +02:00
|
|
|
local thumb = ' shader_id="defaultportal"'
|
|
|
|
|
if v.thumbnail then
|
|
|
|
|
thumb = ' thumb_id="img' .. i .. '" '
|
|
|
|
|
end
|
2026-08-04 12:17:33 +02:00
|
|
|
if v.dir then url = url .. "/" end
|
2026-08-05 10:24:11 +02:00
|
|
|
if v.redirect then url = v.redirect end -- dont wrap standalone glb's in janusxr
|
2026-08-11 17:47:40 +02:00
|
|
|
addPortal('dir',center, v, url,i, -4, thumb, '0 0 0', '0.2 0.2 0.2')
|
2026-08-04 12:17:33 +02:00
|
|
|
end
|
|
|
|
|
end}
|
2026-08-06 16:43:17 +02:00
|
|
|
{if showfediportals and not item then
|
2026-08-04 12:17:33 +02:00
|
|
|
local portals = {}
|
|
|
|
|
for i=1,5 do
|
|
|
|
|
local urls = app.opts[ 'plugin_federation_url_' .. i]
|
|
|
|
|
if #urls > 0 then
|
|
|
|
|
local fediurl = urls:gsub(' .*','')
|
|
|
|
|
table.insert(portals, fediurl )
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if #portals > 0 then
|
|
|
|
|
print([[
|
|
|
|
|
<text js_id="location" pos="0 6 5" billboard="y" col="#BBFFFF" scale="10 10 1" text="${opts.plugin_federation_title}" emissive="0 0 0" roughness="0.3" metalness="0" />
|
|
|
|
|
]])
|
|
|
|
|
end
|
|
|
|
|
for i,fediurl in pairs(portals) do
|
|
|
|
|
local width = 3.2
|
|
|
|
|
local center = -((#portals*width)/1.3) + (i*width)
|
2026-08-11 17:47:40 +02:00
|
|
|
local thumb = ' image_id="federated' .. i .. '"'
|
|
|
|
|
addPortal('federated',center, {title=fediurl}, fediurl,i, 4, thumb, '0 180 0', '0.1 0.1 0.1')
|
2026-08-04 12:17:33 +02:00
|
|
|
end
|
|
|
|
|
end}
|
2026-08-04 14:09:17 +02:00
|
|
|
<object id="cube" rotation="0 0 0" position="0 0 0" scale="2 0.1 2"/> <!-- something to stand on -->
|
|
|
|
|
${opts.plugin_janusxr_jml}
|
2026-08-04 12:17:33 +02:00
|
|
|
</room>
|
|
|
|
|
</fireboxroom>
|