add and bind file loading + api

This commit is contained in:
Stewart Allen 2022-01-06 17:28:57 -05:00
commit 06194a2415
5 changed files with 39 additions and 12 deletions

View file

@ -211,6 +211,7 @@ let model = {
}
};
// api is augmented in mesh.build
let api = mesh.api = {
clear() {
for (let group of group.list()) {
@ -245,6 +246,11 @@ let api = mesh.api = {
model,
import() {
// binding created in mesh.build
$('import').click();
},
objects() {
// return model objects suitable for finding ray intersections
return group.list().map(o => o.models).flat().map(o => o.object);