add visibility toggle

This commit is contained in:
Stewart Allen 2022-01-12 00:28:33 -05:00
commit 885bda5c65
5 changed files with 34 additions and 1 deletions

View file

@ -71,6 +71,18 @@ mesh.object = class MeshObject {
return this;
}
visible(opt) {
if (opt === undefined) {
return this.object.visible;
}
if (opt.toggle) {
this.visible(!this.visible());
} else {
this.object.visible = opt;
}
return this;
}
floor(clazz) {
if (!clazz || this instanceof clazz) {
let b = this.bounds;