xrforge/manyfold/root/hook.d/experience_updated/300-package_janusxr.sh

30 lines
646 B
Bash
Executable file

#!/bin/sh
dir="$(dirname $1)"
cd "$dir"
echo "[package_janusxr.sh] packing janusxr.html"
glb=$(ls *.glb | head -n1) # todo: check datapackage.json instead of first match
jml='
<!DOCTYPE html>
<html>
<head>
<title>janusxr room</title>
</head>
<body>
<script src="https://web.janusvr.com/janusweb.js"></script>
<janus-viewer>
<FireBoxRoom>
<Assets>
<assetobject id="experience" src="'${FEDERATE_DRIVE_HOST}/$1'"/>
</Assets>
<Room>
<object pos="0 0 0" collision_id="experience" id="experience" />
</Room>
</FireBoxRoom>
</janus-viewer>
</body>
</html>
'
echo "$jml" > .xrforge/janusxr.html