add engine api example page
This commit is contained in:
parent
6ad3968ec8
commit
08da61e793
2 changed files with 152 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ class Engine {
|
|||
return new Promise((accept, reject) => {
|
||||
try {
|
||||
new moto.STL().load(url, vertices => {
|
||||
this.listener({loaded: url, vertices});
|
||||
this.widget.loadVertices(vertices)
|
||||
accept(this);
|
||||
});
|
||||
|
|
@ -39,6 +40,7 @@ class Engine {
|
|||
return new Promise((accept, reject) => {
|
||||
try {
|
||||
new moto.STL().parse(data, vertices => {
|
||||
this.listener({parsed: data, vertices});
|
||||
this.widget.loadVertices(vertices)
|
||||
accept(this);
|
||||
});
|
||||
|
|
@ -50,6 +52,7 @@ class Engine {
|
|||
|
||||
setListener(listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
setRender(bool) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue