mx3d 0.1.2 → 0.1.5
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/index.d.ts +86 -71
- package/mx3d.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
@author gzmaijing
|
|
3
3
|
@email mj@gzmaijing.com
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
export class App {
|
|
7
7
|
canvas: HTMLCanvasElement;
|
|
8
|
-
engine:
|
|
9
|
-
scene:
|
|
8
|
+
engine: any;
|
|
9
|
+
scene: any;
|
|
10
10
|
CameraController: CameraController;
|
|
11
|
-
HighlightLayer:
|
|
12
|
-
container:
|
|
11
|
+
HighlightLayer: any;
|
|
12
|
+
container: any;
|
|
13
13
|
fps: HTMLDivElement;
|
|
14
14
|
Resources: Resources;
|
|
15
15
|
Environment: Environment;
|
|
@@ -95,10 +95,10 @@ export class Builder {
|
|
|
95
95
|
|
|
96
96
|
export class Capacity {
|
|
97
97
|
anchor: IObject;
|
|
98
|
-
mesh:
|
|
98
|
+
mesh: any;
|
|
99
99
|
ratio: number;
|
|
100
100
|
color: string;
|
|
101
|
-
textMesh:
|
|
101
|
+
textMesh: any;
|
|
102
102
|
constructor(_object: IObject, _RATIO: number);
|
|
103
103
|
dispose(): void;
|
|
104
104
|
}
|
|
@@ -117,13 +117,13 @@ export enum EffectType {
|
|
|
117
117
|
export class Environment {
|
|
118
118
|
app: App;
|
|
119
119
|
lights: any;
|
|
120
|
-
_color:
|
|
121
|
-
background:
|
|
120
|
+
_color: any;
|
|
121
|
+
background: any;
|
|
122
122
|
reflexEnabled: boolean;
|
|
123
123
|
reflexIntensity: number;
|
|
124
124
|
constructor(_app: App);
|
|
125
125
|
set fogDistance(_value: number);
|
|
126
|
-
set color(_value:
|
|
126
|
+
set color(_value: any);
|
|
127
127
|
reflex(_url: string, _intensity: number): void;
|
|
128
128
|
setBackground(_url: string): void;
|
|
129
129
|
setReflexEnabled(_reflexEnabled: boolean): void;
|
|
@@ -143,28 +143,28 @@ export class Environment {
|
|
|
143
143
|
export class DefaultEvent implements IEvent {
|
|
144
144
|
app: App;
|
|
145
145
|
runRender(): void;
|
|
146
|
-
onPointer(_pointerInfo:
|
|
147
|
-
onKeyboard(_kbInfo:
|
|
146
|
+
onPointer(_pointerInfo: any): void;
|
|
147
|
+
onKeyboard(_kbInfo: any): void;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export class FPSCameraEvent implements IEvent {
|
|
151
151
|
app: App;
|
|
152
152
|
isFPS: boolean;
|
|
153
153
|
angle: number;
|
|
154
|
-
direction:
|
|
154
|
+
direction: any;
|
|
155
155
|
isMoveLeft: boolean;
|
|
156
156
|
isMoveRight: boolean;
|
|
157
157
|
isMoveDown: boolean;
|
|
158
158
|
isMoveUp: boolean;
|
|
159
159
|
runRender(): void;
|
|
160
|
-
onPointer(_pointerInfo:
|
|
161
|
-
onKeyboard(_e:
|
|
160
|
+
onPointer(_pointerInfo: any): void;
|
|
161
|
+
onKeyboard(_e: any): void;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
export interface IEvent {
|
|
165
165
|
runRender(): void;
|
|
166
|
-
onPointer(e:
|
|
167
|
-
onKeyboard(e:
|
|
166
|
+
onPointer(e: any): void;
|
|
167
|
+
onKeyboard(e: any): void;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
export enum EventType {
|
|
@@ -179,9 +179,9 @@ export enum EventType {
|
|
|
179
179
|
export class HeatMap implements BaseNode {
|
|
180
180
|
id: string;
|
|
181
181
|
anchor: IObject;
|
|
182
|
-
mesh:
|
|
182
|
+
mesh: any;
|
|
183
183
|
displayValue: boolean;
|
|
184
|
-
texts: Array<
|
|
184
|
+
texts: Array<any>;
|
|
185
185
|
constructor(_anchor: string);
|
|
186
186
|
isEnabled(_bool: boolean): void;
|
|
187
187
|
set displayValues(_value: boolean);
|
|
@@ -190,17 +190,17 @@ export class HeatMap implements BaseNode {
|
|
|
190
190
|
|
|
191
191
|
export class Icon implements BaseNode {
|
|
192
192
|
id: string;
|
|
193
|
-
scene:
|
|
194
|
-
pint:
|
|
195
|
-
rect:
|
|
193
|
+
scene: any;
|
|
194
|
+
pint: any;
|
|
195
|
+
rect: any;
|
|
196
196
|
onPointerClick: Function;
|
|
197
197
|
size: {
|
|
198
198
|
width: number;
|
|
199
199
|
height: number;
|
|
200
200
|
};
|
|
201
201
|
height: number;
|
|
202
|
-
container:
|
|
203
|
-
constructor(_id: string, _scene:
|
|
202
|
+
container: any;
|
|
203
|
+
constructor(_id: string, _scene: any);
|
|
204
204
|
set background(_url: string);
|
|
205
205
|
addEventListener(_action: Function): void;
|
|
206
206
|
setTexts(_textArr: [{
|
|
@@ -220,11 +220,11 @@ export class Icon implements BaseNode {
|
|
|
220
220
|
|
|
221
221
|
export class IconFromMesh implements BaseNode {
|
|
222
222
|
id: string;
|
|
223
|
-
scene:
|
|
224
|
-
instance:
|
|
223
|
+
scene: any;
|
|
224
|
+
instance: any;
|
|
225
225
|
url: string;
|
|
226
226
|
scaling: number;
|
|
227
|
-
constructor(_id: string, _anchor:
|
|
227
|
+
constructor(_id: string, _anchor: any, _url: string, _scaling: number, _height: number, _scene: any);
|
|
228
228
|
setBackground(): void;
|
|
229
229
|
addEventListener(_action: Function): void;
|
|
230
230
|
setColor(_color: string): void;
|
|
@@ -253,16 +253,32 @@ export class HubService {
|
|
|
253
253
|
static start(): Promise<void>;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
export default class MX3D {
|
|
257
|
+
static accessToken: string;
|
|
258
|
+
static pk: string;
|
|
259
|
+
static sl: string;
|
|
260
|
+
static rl: string;
|
|
261
|
+
static App: typeof App;
|
|
262
|
+
static Tools: typeof Tools;
|
|
263
|
+
static Earth: typeof Earth;
|
|
264
|
+
static EffectMgr: typeof EffectMgr;
|
|
265
|
+
static HubService: typeof HubService;
|
|
266
|
+
static UI: typeof UI;
|
|
267
|
+
static Builder: typeof Builder;
|
|
268
|
+
static EffectType: typeof EffectType;
|
|
269
|
+
static EventType: typeof EventType;
|
|
270
|
+
}
|
|
271
|
+
|
|
256
272
|
export class Directional extends LightObject {
|
|
257
|
-
direction:
|
|
258
|
-
position:
|
|
259
|
-
light:
|
|
273
|
+
direction: any;
|
|
274
|
+
position: any;
|
|
275
|
+
light: any;
|
|
260
276
|
load(): void;
|
|
261
277
|
}
|
|
262
278
|
|
|
263
279
|
export class Hemispheric extends LightObject {
|
|
264
|
-
direction:
|
|
265
|
-
light:
|
|
280
|
+
direction: any;
|
|
281
|
+
light: any;
|
|
266
282
|
load(): void;
|
|
267
283
|
}
|
|
268
284
|
|
|
@@ -270,7 +286,7 @@ export interface ILightObject {
|
|
|
270
286
|
id: string;
|
|
271
287
|
sceneId: string;
|
|
272
288
|
name: string;
|
|
273
|
-
light:
|
|
289
|
+
light: any;
|
|
274
290
|
color: string;
|
|
275
291
|
lightType: string;
|
|
276
292
|
intensity: number;
|
|
@@ -281,7 +297,7 @@ export class LightObject implements ILightObject {
|
|
|
281
297
|
id: string;
|
|
282
298
|
sceneId: string;
|
|
283
299
|
name: string;
|
|
284
|
-
light:
|
|
300
|
+
light: any;
|
|
285
301
|
color: string;
|
|
286
302
|
objectType: string;
|
|
287
303
|
lightType: string;
|
|
@@ -299,19 +315,19 @@ export enum LightType {
|
|
|
299
315
|
}
|
|
300
316
|
|
|
301
317
|
export class Point extends LightObject {
|
|
302
|
-
position:
|
|
303
|
-
light:
|
|
318
|
+
position: any;
|
|
319
|
+
light: any;
|
|
304
320
|
range: number;
|
|
305
321
|
load(): void;
|
|
306
322
|
}
|
|
307
323
|
|
|
308
324
|
export class Spot extends LightObject {
|
|
309
|
-
direction:
|
|
310
|
-
position:
|
|
325
|
+
direction: any;
|
|
326
|
+
position: any;
|
|
311
327
|
angle: number;
|
|
312
328
|
exponent: number;
|
|
313
329
|
range: number;
|
|
314
|
-
light:
|
|
330
|
+
light: any;
|
|
315
331
|
load(): void;
|
|
316
332
|
}
|
|
317
333
|
|
|
@@ -364,10 +380,10 @@ export class DefaultObject implements IObject {
|
|
|
364
380
|
name: string;
|
|
365
381
|
parentId: string;
|
|
366
382
|
modelId: string;
|
|
367
|
-
instance:
|
|
383
|
+
instance: any | any;
|
|
368
384
|
objectType: string;
|
|
369
|
-
action:
|
|
370
|
-
executes: Dictionary<
|
|
385
|
+
action: any;
|
|
386
|
+
executes: Dictionary<any>;
|
|
371
387
|
clickEvents: Dictionary<Function>;
|
|
372
388
|
touchtime: number;
|
|
373
389
|
effectType: EffectType;
|
|
@@ -415,7 +431,7 @@ export interface IObject extends IBase {
|
|
|
415
431
|
customNumber: string;
|
|
416
432
|
customType: string;
|
|
417
433
|
modelId: string;
|
|
418
|
-
instance:
|
|
434
|
+
instance: any | any;
|
|
419
435
|
Sight: Sight;
|
|
420
436
|
effectType: EffectType;
|
|
421
437
|
bind(_m?: any): any;
|
|
@@ -497,7 +513,7 @@ export class VirtualBoxObject extends DefaultObject {
|
|
|
497
513
|
}
|
|
498
514
|
|
|
499
515
|
export class WallObject extends DefaultObject {
|
|
500
|
-
nativeMaterial:
|
|
516
|
+
nativeMaterial: any;
|
|
501
517
|
baseModel: any;
|
|
502
518
|
height: number;
|
|
503
519
|
bind(_w: any): void;
|
|
@@ -520,7 +536,7 @@ export interface BaseNode {
|
|
|
520
536
|
|
|
521
537
|
export class CameraController {
|
|
522
538
|
app: App;
|
|
523
|
-
camera:
|
|
539
|
+
camera: any;
|
|
524
540
|
frustrum: number;
|
|
525
541
|
isOverLook: boolean;
|
|
526
542
|
constructor(_app: App);
|
|
@@ -555,28 +571,28 @@ export class GUID {
|
|
|
555
571
|
|
|
556
572
|
export class Resources {
|
|
557
573
|
app: App;
|
|
558
|
-
walls: Dictionary<
|
|
559
|
-
resources: Dictionary<
|
|
560
|
-
ndoeMats: Dictionary<
|
|
561
|
-
transparentBox:
|
|
562
|
-
BOX:
|
|
563
|
-
FogTex:
|
|
574
|
+
walls: Dictionary<any>;
|
|
575
|
+
resources: Dictionary<any>;
|
|
576
|
+
ndoeMats: Dictionary<any>;
|
|
577
|
+
transparentBox: any;
|
|
578
|
+
BOX: any;
|
|
579
|
+
FogTex: any;
|
|
564
580
|
constructor(_app: App);
|
|
565
581
|
loadModelMesh(_baseModel: any): Promise<void>;
|
|
566
582
|
loadModelMeshAsync(_baseModel: any, _callback: Function): void;
|
|
567
|
-
Materials: Dictionary<
|
|
568
|
-
Textures: Dictionary<
|
|
569
|
-
GetMaterial(_textureData: any, _scene:
|
|
570
|
-
GetTexture(_textureData: any, _scene:
|
|
571
|
-
MergeMaterials: Dictionary<
|
|
572
|
-
GetMergeMaterial(_textureData: any, _scene:
|
|
583
|
+
Materials: Dictionary<any>;
|
|
584
|
+
Textures: Dictionary<any>;
|
|
585
|
+
GetMaterial(_textureData: any, _scene: any): void;
|
|
586
|
+
GetTexture(_textureData: any, _scene: any): void;
|
|
587
|
+
MergeMaterials: Dictionary<any>;
|
|
588
|
+
GetMergeMaterial(_textureData: any, _scene: any): void;
|
|
573
589
|
delete(_isAll?: boolean): void;
|
|
574
590
|
GetWalls(_url: string, _projectId: string): Promise<void>;
|
|
575
591
|
}
|
|
576
592
|
|
|
577
593
|
export class Sight {
|
|
578
594
|
alpha: number;
|
|
579
|
-
focus:
|
|
595
|
+
focus: any;
|
|
580
596
|
radius: number;
|
|
581
597
|
beta: number;
|
|
582
598
|
minimumLimit: number;
|
|
@@ -590,21 +606,21 @@ export class Sight {
|
|
|
590
606
|
}
|
|
591
607
|
|
|
592
608
|
export class Tools {
|
|
593
|
-
static vector3ToJson(_old:
|
|
594
|
-
static vector3ARRToJson(_olds:
|
|
609
|
+
static vector3ToJson(_old: any): any;
|
|
610
|
+
static vector3ARRToJson(_olds: any[]): void;
|
|
595
611
|
static ToVector3(_old: any): void;
|
|
596
612
|
static ToARRVector3(_olds: any[]): void;
|
|
597
|
-
static computeBounds(_mscene:
|
|
598
|
-
static computeBoundsToARR(_meshs: Array<
|
|
599
|
-
static Expand(_polygon: Array<
|
|
613
|
+
static computeBounds(_mscene: any): void;
|
|
614
|
+
static computeBoundsToARR(_meshs: Array<any>): void;
|
|
615
|
+
static Expand(_polygon: Array<any>, _expand: number): void;
|
|
600
616
|
static norm(_x: number, _y: number): void;
|
|
601
|
-
static MergeMeshes(_meshes: Array<
|
|
617
|
+
static MergeMeshes(_meshes: Array<any>, _app: App): void;
|
|
602
618
|
static DeconsTructMesh(_mesh: any, _height: any, _app: App): void;
|
|
603
|
-
static getVisualAngle(_bound:
|
|
604
|
-
static pathTransformation(_oldPath: Array<
|
|
605
|
-
static createTube(_id: string, _paths: Array<
|
|
606
|
-
static getAngleFromVector2(_startV:
|
|
607
|
-
static getAngleFromVector3(_startV:
|
|
619
|
+
static getVisualAngle(_bound: any, _app: App): void;
|
|
620
|
+
static pathTransformation(_oldPath: Array<any>, _radius: number): void;
|
|
621
|
+
static createTube(_id: string, _paths: Array<any>, _radius: number, _app: App): void;
|
|
622
|
+
static getAngleFromVector2(_startV: any, _coreV: any, _endV: any): void;
|
|
623
|
+
static getAngleFromVector3(_startV: any, _coreV: any, _endV: any): void;
|
|
608
624
|
static RandomNumBoth(_Min: any, _Max: any): void;
|
|
609
625
|
}
|
|
610
626
|
|
|
@@ -617,10 +633,9 @@ export class ToolTips {
|
|
|
617
633
|
isOK: boolean;
|
|
618
634
|
_text: string;
|
|
619
635
|
constructor(_parent: HTMLElement, _app: App);
|
|
620
|
-
update(_e:
|
|
636
|
+
update(_e: any): void;
|
|
621
637
|
close(): void;
|
|
622
638
|
setBackground(_url: string): void;
|
|
623
639
|
dispose(): void;
|
|
624
640
|
}
|
|
625
641
|
|
|
626
|
-
}
|
package/mx3d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.MX3D=e():t.MX3D=e()}(window,(function(){return function(t){var e={};function o(r){if(e[r])return e[r].exports;var c=e[r]={i:r,l:!1,exports:{}};return t[r].call(c.exports,c,c.exports,o),c.l=!0,c.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var c in t)o.d(r,c,function(e){return t[e]}.bind(null,c));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,o){"use strict";o.r(e),o.d(e,"default",(function(){return s}));class r{static init(){}}r.colors={};var c,n;!function(t){t[t.Opaque=0]="Opaque",t[t.Flash=1]="Flash",t[t.Transparent=2]="Transparent"}(c||(c={})),function(t){t.leftClick="leftClick",t.rightClick="rightClick",t.doubleClick="doubleClick",t.eover="eover",t.longPress="longPress",t.out="out"}(n||(n={}));class s{}s.sl="https://www.wodashijie.com/",s.rl="https://models.wodashijie.com/",s.App=class{constructor(t){}async load(t){}dispose(){}},s.Tools=class{static vector3ToJson(t){}static vector3ARRToJson(t){}static ToVector3(t){}static ToARRVector3(t){}static computeBounds(t){}static computeBoundsToARR(t){}static Expand(t,e){}static norm(t,e){}static MergeMeshes(t,e){}static DeconsTructMesh(t,e,o){}static getVisualAngle(t,e){}static pathTransformation(t,e){}static createTube(t,e,o=.05,r){}static getAngleFromVector2(t,e,o){}static getAngleFromVector3(t,e,o){}static RandomNumBoth(t,e){}},s.Earth=class{constructor(){this.initialCoordinates=[]}load(t){}laodScene(t,e){}flyTo(t=this.initialCoordinates,e=18,o=130,r=75,c=12e3){}},s.EffectMgr=r,s.HubService=class{static async listener(t){}static async start(){}},s.UI=class{static createIconFromMesh(t,e,o,r,c){}static createIcon(t,e,o,r){}},s.Builder=class{static createCapacity(t,e,o,r="200px"){}static createTextMesh(t,e,o,r="200px",c="white"){}static createMatrixCloud(t){}static createPunctateCloud(t){}createColumnCloud(t){}static create2DLine(t,e,o){}static create3DLine(t,e,o){}},s.EffectType=c,s.EventType=n}]).default}));
|