mx3d 0.0.47 → 0.0.50

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/README.md CHANGED
@@ -10,7 +10,7 @@ mx3djs 可以快速将我搭世界场景嵌入自定义web程序中。并提供
10
10
 
11
11
  ## 特性
12
12
 
13
- - 简单 针对行业话功能化制定 API,只需提供 JSON 数据即可生成对应功能效果
13
+ - 简单 针对特定行业功能化制定 API,只需提供 JSON 数据即可生成对应功能效果
14
14
  - 高效 底层采用最高效、高兼容性 WEBGL 引擎,为用户提供流畅、酷炫3D项目
15
15
 
16
16
  ## 示例
package/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export class App {
7
7
  canvas: HTMLCanvasElement;
8
8
  engine: BABYLON.Engine;
9
9
  scene: BABYLON.Scene;
10
- Camera: Camera;
10
+ CameraController: CameraController;
11
11
  HighlightLayer: BABYLON.HighlightLayer;
12
12
  container: BABYLON.GUI.AdvancedDynamicTexture;
13
13
  fps: HTMLDivElement;
@@ -28,7 +28,7 @@ export class App {
28
28
  dispose(): void;
29
29
  }
30
30
 
31
- export class Capacity {
31
+ export class Capacity {
32
32
  anchor: IObject;
33
33
  mesh: BABYLON.Mesh;
34
34
  ratio: number;
@@ -169,6 +169,7 @@ export class Icon implements BaseNode {
169
169
  container: BABYLON.GUI.AdvancedDynamicTexture;
170
170
  constructor(_id: string, _scene: BABYLON.Scene);
171
171
  set background(_url: string);
172
+ addEventListener(_action: Function): void;
172
173
  setTexts(_textArr: [{
173
174
  text: string;
174
175
  fontSize: string;
@@ -211,6 +212,21 @@ export class UI {
211
212
  width: number;
212
213
  height: number;
213
214
  }, _height: number): void;
215
+ static create2DLine(_id: string, _objs: Array<IObject>, _options?: {
216
+ _width: number;
217
+ _color: string;
218
+ isDotted: boolean;
219
+ }): void;
220
+ static create3DLine(_id: string, _objs: Array<IObject>, _options?: {
221
+ _width: number;
222
+ _color: string;
223
+ }): void;
224
+ }
225
+
226
+ export class HubService {
227
+ static connection: any;
228
+ static listener(_Url: string): Promise<void>;
229
+ static start(): Promise<void>;
214
230
  }
215
231
 
216
232
  export class Directional extends LightObject {
@@ -257,6 +273,7 @@ export enum LightType {
257
273
  Directional = "Directional",
258
274
  Hemispheric = "Hemispheric"
259
275
  }
276
+
260
277
  export class Point extends LightObject {
261
278
  position: BABYLON.Vector3;
262
279
  light: BABYLON.PointLight;
@@ -454,7 +471,7 @@ export interface BaseNode {
454
471
  isEnabled(bool: boolean): any;
455
472
  }
456
473
 
457
- export class Camera {
474
+ export class CameraController {
458
475
  app: App;
459
476
  camera: BABYLON.ArcRotateCamera;
460
477
  frustrum: number;
@@ -556,4 +573,5 @@ export class ToolTips {
556
573
  setBackground(_url: string): void;
557
574
  dispose(): void;
558
575
  }
559
- }
576
+
577
+ }
package/mx3d.js CHANGED
@@ -1,311 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("BABYLON"), require("babylonjs-materials"), require("BABYLON.GUI"), require("BABYLON.SceneLoader"), require("babylonjs-serializers"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["BABYLON", "babylonjs-materials", "BABYLON.GUI", "BABYLON.SceneLoader", "babylonjs-serializers"], factory);
6
- else if(typeof exports === 'object')
7
- exports["MX3D"] = factory(require("BABYLON"), require("babylonjs-materials"), require("BABYLON.GUI"), require("BABYLON.SceneLoader"), require("babylonjs-serializers"));
8
- else
9
- root["MX3D"] = factory(root["BABYLON"], root["babylonjs-materials"], root["BABYLON.GUI"], root["BABYLON.SceneLoader"], root["babylonjs-serializers"]);
10
- })(window, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__4__) {
11
- return /******/ (function(modules) { // webpackBootstrap
12
- /******/ // The module cache
13
- /******/ var installedModules = {};
14
- /******/
15
- /******/ // The require function
16
- /******/ function __webpack_require__(moduleId) {
17
- /******/
18
- /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId]) {
20
- /******/ return installedModules[moduleId].exports;
21
- /******/ }
22
- /******/ // Create a new module (and put it into the cache)
23
- /******/ var module = installedModules[moduleId] = {
24
- /******/ i: moduleId,
25
- /******/ l: false,
26
- /******/ exports: {}
27
- /******/ };
28
- /******/
29
- /******/ // Execute the module function
30
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
- /******/
32
- /******/ // Flag the module as loaded
33
- /******/ module.l = true;
34
- /******/
35
- /******/ // Return the exports of the module
36
- /******/ return module.exports;
37
- /******/ }
38
- /******/
39
- /******/
40
- /******/ // expose the modules object (__webpack_modules__)
41
- /******/ __webpack_require__.m = modules;
42
- /******/
43
- /******/ // expose the module cache
44
- /******/ __webpack_require__.c = installedModules;
45
- /******/
46
- /******/ // define getter function for harmony exports
47
- /******/ __webpack_require__.d = function(exports, name, getter) {
48
- /******/ if(!__webpack_require__.o(exports, name)) {
49
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
- /******/ }
51
- /******/ };
52
- /******/
53
- /******/ // define __esModule on exports
54
- /******/ __webpack_require__.r = function(exports) {
55
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
- /******/ }
58
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
- /******/ };
60
- /******/
61
- /******/ // create a fake namespace object
62
- /******/ // mode & 1: value is a module id, require it
63
- /******/ // mode & 2: merge all properties of value into the ns
64
- /******/ // mode & 4: return value when already ns object
65
- /******/ // mode & 8|1: behave like require
66
- /******/ __webpack_require__.t = function(value, mode) {
67
- /******/ if(mode & 1) value = __webpack_require__(value);
68
- /******/ if(mode & 8) return value;
69
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
- /******/ var ns = Object.create(null);
71
- /******/ __webpack_require__.r(ns);
72
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
- /******/ return ns;
75
- /******/ };
76
- /******/
77
- /******/ // getDefaultExport function for compatibility with non-harmony modules
78
- /******/ __webpack_require__.n = function(module) {
79
- /******/ var getter = module && module.__esModule ?
80
- /******/ function getDefault() { return module['default']; } :
81
- /******/ function getModuleExports() { return module; };
82
- /******/ __webpack_require__.d(getter, 'a', getter);
83
- /******/ return getter;
84
- /******/ };
85
- /******/
86
- /******/ // Object.prototype.hasOwnProperty.call
87
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
- /******/
89
- /******/ // __webpack_public_path__
90
- /******/ __webpack_require__.p = "";
91
- /******/
92
- /******/
93
- /******/ // Load entry module and return exports
94
- /******/ return __webpack_require__(__webpack_require__.s = 5);
95
- /******/ })
96
- /************************************************************************/
97
- /******/ ([
98
- /* 0 */
99
- /***/ (function(module, exports) {
100
-
101
- module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
102
-
103
- /***/ }),
104
- /* 1 */
105
- /***/ (function(module, exports) {
106
-
107
- module.exports = __WEBPACK_EXTERNAL_MODULE__1__;
108
-
109
- /***/ }),
110
- /* 2 */
111
- /***/ (function(module, exports) {
112
-
113
- module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
114
-
115
- /***/ }),
116
- /* 3 */
117
- /***/ (function(module, exports) {
118
-
119
- module.exports = __WEBPACK_EXTERNAL_MODULE__3__;
120
-
121
- /***/ }),
122
- /* 4 */
123
- /***/ (function(module, exports) {
124
-
125
- module.exports = __WEBPACK_EXTERNAL_MODULE__4__;
126
-
127
- /***/ }),
128
- /* 5 */
129
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
130
-
131
- "use strict";
132
- // ESM COMPAT FLAG
133
- __webpack_require__.r(__webpack_exports__);
134
-
135
- // EXPORTS
136
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* binding */ MX3D; });
137
-
138
- // EXTERNAL MODULE: external "BABYLON"
139
- var external_BABYLON_ = __webpack_require__(0);
140
-
141
- // EXTERNAL MODULE: external "babylonjs-materials"
142
- var external_babylonjs_materials_ = __webpack_require__(1);
143
-
144
- // EXTERNAL MODULE: external "BABYLON.GUI"
145
- var external_BABYLON_GUI_ = __webpack_require__(2);
146
-
147
- // EXTERNAL MODULE: external "BABYLON.SceneLoader"
148
- var external_BABYLON_SceneLoader_ = __webpack_require__(3);
149
-
150
- // EXTERNAL MODULE: external "babylonjs-serializers"
151
- var external_babylonjs_serializers_ = __webpack_require__(4);
152
-
153
- // CONCATENATED MODULE: ./src/public/App.ts
154
- class App {
155
- constructor(_config) { }
156
- async load(_config) { }
157
- //销毁整个场景
158
- dispose() { }
159
- }
160
-
161
- // CONCATENATED MODULE: ./src/public/components/EffectMgr.ts
162
- class EffectMgr {
163
- static init() { }
164
- }
165
- EffectMgr.colors = {};
166
-
167
- // CONCATENATED MODULE: ./src/public/tools/Tools.ts
168
- class Tools {
169
- //字符串转为Vector3;
170
- static vector3ToJson(_old) { }
171
- static vector3ARRToJson(_olds) { }
172
- static ToVector3(_old) { }
173
- static ToARRVector3(_olds) { }
174
- static computeBounds(_mscene) { }
175
- static computeBoundsToARR(_meshs) { }
176
- /// <summary>
177
- /// 扩展或收缩
178
- /// </summary>
179
- /// <param name="polygon">多边形顶点</param>
180
- /// <param name="expand">扩展大小,为负则收缩</param>
181
- /// <returns>扩展或收缩后的多边形</returns>
182
- static Expand(_polygon, _expand) { }
183
- static norm(_x, _y) { }
184
- //合并网格
185
- static MergeMeshes(_meshes, _app) { }
186
- //拆分网格
187
- static DeconsTructMesh(_mesh, _height, _app) { }
188
- static getVisualAngle(_bound, _app) { }
189
- static pathTransformation(_oldPath, _radius) { }
190
- static createTube(_id, _paths, _radius = 0.05, _app) { }
191
- static getAngleFromVector2(_startV, _coreV, _endV) { }
192
- static getAngleFromVector3(_startV, _coreV, _endV) { }
193
- static RandomNumBoth(_Min, _Max) { }
194
- }
195
-
196
- // CONCATENATED MODULE: ./src/public/components/EffectType.ts
197
- var EffectType;
198
- (function (EffectType) {
199
- EffectType[EffectType["Opaque"] = 0] = "Opaque";
200
- EffectType[EffectType["Flash"] = 1] = "Flash";
201
- EffectType[EffectType["Transparent"] = 2] = "Transparent";
202
- })(EffectType || (EffectType = {}));
203
-
204
- // CONCATENATED MODULE: ./src/public/components/EventType.ts
205
- var EventType;
206
- (function (EventType) {
207
- /// <summary>
208
- /// 左键单击
209
- /// </summary>
210
- EventType["leftClick"] = "leftClick";
211
- /// <summary>
212
- /// 右键单击
213
- /// </summary>
214
- EventType["rightClick"] = "rightClick";
215
- /// <summary>
216
- /// 双击
217
- /// </summary>
218
- EventType["doubleClick"] = "doubleClick";
219
- /// <summary>
220
- /// 移入
221
- /// </summary>
222
- EventType["eover"] = "eover";
223
- /// <summary>
224
- /// 长按
225
- /// </summary>
226
- EventType["longPress"] = "longPress";
227
- /// <summary>
228
- /// 移出
229
- /// </summary>
230
- EventType["out"] = "out";
231
- })(EventType || (EventType = {}));
232
-
233
- // CONCATENATED MODULE: ./src/public/components/UI.ts
234
- class UI {
235
- /// <summary>
236
- /// 创建3dUI
237
- /// </summary>
238
- /// <param name="_anchor">挂载的物体标识</param>
239
- /// <param name="url">图片地址</param>
240
- /// <param name="_scaling">大小</param>
241
- /// <param name="_height">相对于物体高度</param>
242
- /// <param name="_app">场景实例</param>
243
- static createIconFromMesh(_id, _anchor, _url, _scaling, _height) { }
244
- /// <summary>
245
- /// 创建2d跟随UI
246
- /// </summary>
247
- static createIcon(_id, _anchor, _size, _height) { }
248
- }
249
-
250
- // CONCATENATED MODULE: ./src/public/components/HeatMapBuilder.ts
251
- class HeatMapBuilder {
252
- /// <summary>
253
- /// 创建矩阵温度云图
254
- /// </summary>
255
- /// <param name="_anchorId">挂载的物体id</param>
256
- /// <param name="_config">云图原数据
257
- ////// <param name="column">云图总行</param>
258
- ////// <param name="row">云图总列</param>
259
- ////// <param name="data">云图点位值</param>
260
- /// </param>
261
- /// <param name="_app">场景实例</param>
262
- /// <param name="_height">距离挂载物体高度</param>
263
- /// <param name="_isAlpha">云图是否透明;默认为true</param>
264
- /// <param name="_isParticle">是否生成粒子体积云图;默认为true</param>
265
- /// <param name="_radius">云图辐射半径</param>
266
- /// <param name="_range">云图范围</param>
267
- static createMatrixCloud(_data) { }
268
- static createPunctateCloud(_data) { }
269
- ;
270
- /// <summary>
271
- /// 创建柱状温度云图
272
- /// </summary>
273
- /// <param name="_anchorId">挂载的物体id</param>
274
- /// <param name="_config">云图原数据></param>
275
- /// <param name="_app">场景实例</param>
276
- /// <param name="_isAlpha">云图是否透明;默认为true</param>
277
- /// <param name="_isParticle">是否生成粒子体积云图;默认为true</param>
278
- /// <param name="_radius">云图辐射半径</param>
279
- /// <param name="_range">云图范围</param>
280
- createColumnCloud(_data) { }
281
- }
282
-
283
- // CONCATENATED MODULE: ./src/public/index.ts
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
- class MX3D {
297
- }
298
- MX3D.sl = "https://www.wodashijie.com/"; //服务地址
299
- MX3D.rl = "https://models.wodashijie.com/"; //资源地址
300
- MX3D.App = App;
301
- MX3D.Tools = Tools;
302
- MX3D.EffectMgr = EffectMgr;
303
- MX3D.UI = UI;
304
- MX3D.HeatMapBuilder = HeatMapBuilder;
305
- MX3D.EffectType = EffectType;
306
- MX3D.EventType = EventType;
307
-
308
-
309
- /***/ })
310
- /******/ ])["default"];
311
- });
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define(["BABYLON","babylonjs-materials","BABYLON.GUI","BABYLON.SceneLoader","babylonjs-serializers"],t):"object"==typeof exports?exports.MX3D=t(require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):e.MX3D=t(e.BABYLON,e["babylonjs-materials"],e["BABYLON.GUI"],e["BABYLON.SceneLoader"],e["babylonjs-serializers"])}(window,(function(e,t,r,o,n){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=n},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return a}));var o,n;r(0),r(1),r(2),r(3),r(4);class s{static init(){}}s.colors={};!function(e){e[e.Opaque=0]="Opaque",e[e.Flash=1]="Flash",e[e.Transparent=2]="Transparent"}(o||(o={})),function(e){e.leftClick="leftClick",e.rightClick="rightClick",e.doubleClick="doubleClick",e.eover="eover",e.longPress="longPress",e.out="out"}(n||(n={}));class a{}a.sl="https://www.wodashijie.com/",a.rl="https://models.wodashijie.com/",a.App=class{constructor(e){}async load(e){}dispose(){}},a.Tools=class{static vector3ToJson(e){}static vector3ARRToJson(e){}static ToVector3(e){}static ToARRVector3(e){}static computeBounds(e){}static computeBoundsToARR(e){}static Expand(e,t){}static norm(e,t){}static MergeMeshes(e,t){}static DeconsTructMesh(e,t,r){}static getVisualAngle(e,t){}static pathTransformation(e,t){}static createTube(e,t,r=.05,o){}static getAngleFromVector2(e,t,r){}static getAngleFromVector3(e,t,r){}static RandomNumBoth(e,t){}},a.EffectMgr=s,a.HubService=class{static async listener(e){}static async start(){}},a.UI=class{static createIconFromMesh(e,t,r,o,n){}static createIcon(e,t,r,o){}static create2DLine(e,t,r){}static create3DLine(e,t,r){}},a.HeatMapBuilder=class{static createMatrixCloud(e){}static createPunctateCloud(e){}createColumnCloud(e){}},a.EffectType=o,a.EventType=n}]).default}));