@soonspacejs/plugin-sbmz-loader 2.13.17 → 2.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import SoonSpace from 'soonspacejs';
2
- import type { Model } from 'soonspacejs';
1
+ import { default as SoonSpace, Model } from 'soonspacejs';
3
2
  export interface SbmzModelData {
4
3
  matrix: number[];
5
4
  name: string;
package/dist/index.esm.js CHANGED
@@ -1 +1,40 @@
1
- class t{constructor(t){this.modelData=[],this.modelList=[],this.ssp=t}async load(t){const{fetchFile:s}=this.ssp.utils,a=await s(`${t}/metadata.json`,"json");this.modelData=a.items;const o=`${t}_group`;this.ssp.createGroup({id:o});const i=await this.ssp.addModelForGroup(o,this.modelData.map(({name:s,position:a,rotation:o,scale:i,path:e},l)=>({id:`${l}${e}`,name:s,url:`${t}/${e}`,position:{x:a[0],y:a[1],z:a[2]},rotation:{x:o[0],y:o[1],z:o[2]},scale:{x:i[0],y:i[1],z:i[2]}})));this.modelList=null==i?void 0:i.children}}export{t as default};
1
+ class m {
2
+ ssp;
3
+ modelData = [];
4
+ modelList = [];
5
+ constructor(s) {
6
+ this.ssp = s;
7
+ }
8
+ async load(s) {
9
+ const { fetchFile: i } = this.ssp.utils, r = await i(`${s}/metadata.json`, "json");
10
+ this.modelData = r.items;
11
+ const d = `${s}_group`;
12
+ this.ssp.createGroup({
13
+ id: d
14
+ });
15
+ const l = await this.ssp.addModelForGroup(d, this.modelData.map(({ name: c, position: t, rotation: a, scale: o, path: e }, p) => ({
16
+ id: `${p}${e}`,
17
+ name: c,
18
+ url: `${s}/${e}`,
19
+ position: {
20
+ x: t[0],
21
+ y: t[1],
22
+ z: t[2]
23
+ },
24
+ rotation: {
25
+ x: a[0],
26
+ y: a[1],
27
+ z: a[2]
28
+ },
29
+ scale: {
30
+ x: o[0],
31
+ y: o[1],
32
+ z: o[2]
33
+ }
34
+ })));
35
+ this.modelList = l?.children;
36
+ }
37
+ }
38
+ export {
39
+ m as default
40
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soonspacejs/plugin-sbmz-loader",
3
3
  "pluginName": "SbmzLoaderPlugin",
4
- "version": "2.13.17",
4
+ "version": "2.14.1",
5
5
  "description": "Sbmz-loader plugin for SoonSpace.js",
6
6
  "main": "dist/index.esm.js",
7
7
  "module": "dist/index.esm.js",
@@ -13,8 +13,8 @@
13
13
  ],
14
14
  "author": "xunwei",
15
15
  "license": "UNLICENSED",
16
- "gitHead": "8afa5fda9a0ef2c080060e7d8e71a8bf168fd4d2",
16
+ "gitHead": "27d5e0bcd79ff71c8e2943a8420c39624ae6f8e6",
17
17
  "peerDependencies": {
18
- "soonspacejs": "2.13.17"
18
+ "soonspacejs": "2.14.1"
19
19
  }
20
20
  }