Compare commits
No commits in common. "72baae1d3718fb21e47626e95df222ac6f034c64" and "6ab344d3c3e3c6fa2a3351bd95e28c7107216192" have entirely different histories.
72baae1d37
...
6ab344d3c3
13
README.md
|
|
@ -4,13 +4,10 @@ Download/run the binaries for your platform in the releases section.<br>
|
||||||
Developers can run it via [LÖVR](https://lovr.org) or [LÖVE2D](https://love2d.org)
|
Developers can run it via [LÖVR](https://lovr.org) or [LÖVE2D](https://love2d.org)
|
||||||
|
|
||||||
```
|
```
|
||||||
-- ./lovr xurfer https://snips.sh/f/_U5-XctEVE?r=1' -- cube, monkey, scene
|
$ love src # if you have LÖVE2D installed (>v12)
|
||||||
$ love xurfer <url> # if you have LÖVE2D installed (>v12)
|
$ lovr src # if you have LÖVR installed
|
||||||
$ lovr xurfer <url> # if you have LÖVR installed
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example**: lovr xurfer <a href="https://snips.sh/f/_U5-XctEVE?r=1">https://snips.sh/f/_U5-XctEVE?r=1</a>
|
|
||||||
|
|
||||||
## Multiplatform Multimodal XR Browser
|
## Multiplatform Multimodal XR Browser
|
||||||
|
|
||||||
The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.isvery.ninja) codebase** which gracefully degrades to handheld/embedded/braille devices:
|
The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.isvery.ninja) codebase** which gracefully degrades to handheld/embedded/braille devices:
|
||||||
|
|
@ -31,9 +28,9 @@ The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.
|
||||||
So you can strip/bloat however you want, or build one yourself:
|
So you can strip/bloat however you want, or build one yourself:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cp xurfer/ext/skeleton xurfer/ext/myextension
|
$ cp src/ext/skeleton src/ext/myextension
|
||||||
$ sed 's|skeleton|myextension|g' xurfer/ext/myextension/*
|
$ sed 's|skeleton|myextension|g' src/ext/myextension/*
|
||||||
$ ./lovr xurfer
|
$ ./lovr src
|
||||||
[i] loading 'myextension'
|
[i] loading 'myextension'
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
|
||||||
6
api.md
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="">api</a>
|
<a href="">api</a>
|
||||||
<a href="xurfer/lib/json.lua">api.parser.json</a>
|
<a href="src/lib/json.lua">api.parser.json</a>
|
||||||
<a href="#api-parser-xml">api.parser.xml</a>
|
<a href="#api-parser-xml">api.parser.xml</a>
|
||||||
<a href="xurfer/lib/url.lua">api.url</a>
|
<a href="src/lib/url.lua">api.url</a>
|
||||||
<a href="xurfer/util.lua">api.util</a>
|
<a href="src/util.lua">api.util</a>
|
||||||
<a href="">api.protocol</a>
|
<a href="">api.protocol</a>
|
||||||
<a href="#api-ext">api.ext.*</a>
|
<a href="#api-ext">api.ext.*</a>
|
||||||
<a href="#api-ext-exec">api.ext.exec(fn, ,..)</a>
|
<a href="#api-ext-exec">api.ext.exec(fn, ,..)</a>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
local api = ...
|
local api = ...
|
||||||
|
|
||||||
local sample
|
local sample = require "sample"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name = "kitchensink",
|
name = "kitchensink",
|
||||||
enabled = (lover ~= nil),
|
enabled = false,
|
||||||
|
|
||||||
init = function()
|
init = function() end,
|
||||||
sample = require "sample"
|
|
||||||
end,
|
|
||||||
|
|
||||||
update = function()
|
update = function()
|
||||||
local iui = api.iui
|
local iui = api.iui
|
||||||
|
Before Width: | Height: | Size: 638 KiB After Width: | Height: | Size: 638 KiB |
|
Before Width: | Height: | Size: 310 KiB After Width: | Height: | Size: 310 KiB |
|
Before Width: | Height: | Size: 684 KiB After Width: | Height: | Size: 684 KiB |
|
Before Width: | Height: | Size: 663 KiB After Width: | Height: | Size: 663 KiB |
|
Before Width: | Height: | Size: 782 KiB After Width: | Height: | Size: 782 KiB |
|
Before Width: | Height: | Size: 708 KiB After Width: | Height: | Size: 708 KiB |
|
|
@ -39,7 +39,7 @@ xrf.traverseNodesContaining = function(key,obj,cb)
|
||||||
xrf.traverse( tree, function(node)
|
xrf.traverse( tree, function(node)
|
||||||
if node['extras'] ~= nil then
|
if node['extras'] ~= nil then
|
||||||
if node['extras'][key] ~= nil then
|
if node['extras'][key] ~= nil then
|
||||||
cb(node,obj, i, metadata)
|
cb(node,obj['model'], i, metadata)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
|
@ -82,8 +82,7 @@ xrf.calcScale = function(node)
|
||||||
end
|
end
|
||||||
|
|
||||||
xrf.makeClickable = function( physicsWorld, cb)
|
xrf.makeClickable = function( physicsWorld, cb)
|
||||||
return function(node_or_mesh, obj, i, metadata)
|
return function(node_or_mesh,model, i, metadata)
|
||||||
local model = obj['model']
|
|
||||||
local node = node_or_mesh
|
local node = node_or_mesh
|
||||||
if node['mesh'] == nil then node = xrf.getNodeFromMesh(node_or_mesh, metadata, i) end
|
if node['mesh'] == nil then node = xrf.getNodeFromMesh(node_or_mesh, metadata, i) end
|
||||||
print("making node " .. node['name'] .. " clickable")
|
print("making node " .. node['name'] .. " clickable")
|
||||||
|
|
@ -96,9 +95,7 @@ xrf.makeClickable = function( physicsWorld, cb)
|
||||||
local scale = xrf.calcScale(node)
|
local scale = xrf.calcScale(node)
|
||||||
-- we cannot use newMeshCollider because storage type of modelmesh is not cpu
|
-- we cannot use newMeshCollider because storage type of modelmesh is not cpu
|
||||||
local collider = physicsWorld:newBoxCollider(
|
local collider = physicsWorld:newBoxCollider(
|
||||||
x + (obj.x or 0),
|
x, y, z,
|
||||||
y + (obj.y or 0),
|
|
||||||
z + (obj.z or 0),
|
|
||||||
scale[1] * (w + 0.01), -- add 0.01 to avoid 0
|
scale[1] * (w + 0.01), -- add 0.01 to avoid 0
|
||||||
scale[2] * (h + 0.01), -- in case of
|
scale[2] * (h + 0.01), -- in case of
|
||||||
scale[3] * (d + 0.01) -- planes e.g.
|
scale[3] * (d + 0.01) -- planes e.g.
|
||||||
|
|
@ -13,8 +13,8 @@ return {
|
||||||
xrf.traverseNodesContaining('href', obj,
|
xrf.traverseNodesContaining('href', obj,
|
||||||
xrf.makeClickable( api.ecs.worldPhysics,
|
xrf.makeClickable( api.ecs.worldPhysics,
|
||||||
function(obj, collider)
|
function(obj, collider)
|
||||||
print("\nhref was clicked: " .. obj.node.extras.href)
|
print(obj['name'] .. ".href => " .. obj['extras']['href'] )
|
||||||
print_r(obj)
|
api.world.add({collider = collider})
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -1,9 +1,3 @@
|
||||||
api.protocol.http = {
|
|
||||||
request = function(url,opts)
|
|
||||||
print("[!] todo: love2D/lua api.protocol.http needs curl/wget fallback")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Load some default values for our rectangle.
|
-- Load some default values for our rectangle.
|
||||||
function love.load()
|
function love.load()
|
||||||
x, y, w, h = 20, 20, 60, 20
|
x, y, w, h = 20, 20, 60, 20
|
||||||
0
xurfer/lovr/.gitignore → src/lovr/.gitignore
vendored
|
Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
|
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 617 B After Width: | Height: | Size: 617 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |