1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 09:09:30 +00:00
ubiquitousse/gltf/gltf.can
2022-09-16 20:04:46 +09:00

23 lines
577 B
Text

-- TODO: documentation
let loader = require((...):gsub("gltf$", "loader"))
let draw = require((...):gsub("gltf$", "draw"))
-- glTF object methods
let gltf_mt = {
-- loaded glTF data; see loader.can for details on its structure
gltf = nil,
-- draw the glTF object; if shader is not given, will use the current shader
-- see draw.can for the uniforms passed to the shader
draw = :(shader)
draw(@gltf, shader)
end
}
gltf_mt.__index = gltf_mt
--- create new glTF object from a filepath
return function(path)
return setmetatable({
gltf = loader(path)
}, gltf_mt)
end