mx3d 0.2.8 → 0.2.9
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/components/AlarmFlashing.d.ts +11 -0
- package/components/Environment.d.ts +2 -0
- package/components/StatusType.d.ts +5 -0
- package/effects/Cloud.d.ts +42 -0
- package/effects/Effect.d.ts +13 -0
- package/effects/IEffect.d.ts +4 -0
- package/effects/Rain.d.ts +34 -0
- package/effects/Thunder.d.ts +31 -0
- package/index.d.ts +4 -3
- package/models/CornerObject.d.ts +2 -2
- package/models/DefaultObject.d.ts +2 -2
- package/models/IObject.d.ts +2 -2
- package/mx3d.min.js +4 -4
- package/package.json +1 -1
- package/tools/Tools.d.ts +1 -0
|
@@ -9,6 +9,8 @@ export default class Environment {
|
|
|
9
9
|
reflexEnabled: boolean;
|
|
10
10
|
reflexIntensity: number;
|
|
11
11
|
constructor(_app: App);
|
|
12
|
+
setTransparent(_visibility?: number): void;
|
|
13
|
+
default(): void;
|
|
12
14
|
set fogDistance(_value: number);
|
|
13
15
|
set color(_value: BABYLON.Color4);
|
|
14
16
|
reflex(url: string, intensity: number): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import App from "../App";
|
|
2
|
+
import IEffect from "./IEffect";
|
|
3
|
+
export default class CloudEffect implements IEffect {
|
|
4
|
+
app: App;
|
|
5
|
+
cloudNum: number;
|
|
6
|
+
canvas: HTMLCanvasElement;
|
|
7
|
+
canvasCloudCtx: CanvasRenderingContext2D;
|
|
8
|
+
clouds: Array<Cloud>;
|
|
9
|
+
X: number;
|
|
10
|
+
Y: number;
|
|
11
|
+
constructor(_app: App);
|
|
12
|
+
start(): void;
|
|
13
|
+
close(): void;
|
|
14
|
+
render(): void;
|
|
15
|
+
clearCanvasCloud(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class Cloud {
|
|
18
|
+
rainSpeed: number;
|
|
19
|
+
ctx: CanvasRenderingContext2D;
|
|
20
|
+
c: string;
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
r: number;
|
|
24
|
+
v: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
color: {
|
|
29
|
+
r: number;
|
|
30
|
+
g: number;
|
|
31
|
+
b: number;
|
|
32
|
+
a: number;
|
|
33
|
+
};
|
|
34
|
+
X: number;
|
|
35
|
+
constructor(ctx: any, x: any, y: any, _X: any);
|
|
36
|
+
init(x: number, y: number): void;
|
|
37
|
+
draw(): void;
|
|
38
|
+
gradient(): CanvasGradient;
|
|
39
|
+
updatePosition(): void;
|
|
40
|
+
wrapPosition(): void;
|
|
41
|
+
render(): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Dictionary from "../tools/Dictionary";
|
|
2
|
+
import App from "../App";
|
|
3
|
+
import IEffect from "./IEffect";
|
|
4
|
+
export declare enum EffectType {
|
|
5
|
+
Thunder = "Thunder",
|
|
6
|
+
Rain = "Rain",
|
|
7
|
+
Cloud = "Cloud"
|
|
8
|
+
}
|
|
9
|
+
export default class Effect {
|
|
10
|
+
static effects: Dictionary<IEffect>;
|
|
11
|
+
static add(_effectType: EffectType, _app: App): void;
|
|
12
|
+
static remove(_effectType: EffectType): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import App from "../App";
|
|
2
|
+
import IEffect from "./IEffect";
|
|
3
|
+
export default class RainEffect implements IEffect {
|
|
4
|
+
app: App;
|
|
5
|
+
rainNum: number;
|
|
6
|
+
canvas: HTMLCanvasElement;
|
|
7
|
+
canvasRainCtx: CanvasRenderingContext2D;
|
|
8
|
+
rains: Array<Rain>;
|
|
9
|
+
X: number;
|
|
10
|
+
Y: number;
|
|
11
|
+
constructor(_app: App);
|
|
12
|
+
start(): void;
|
|
13
|
+
close(): void;
|
|
14
|
+
render(): void;
|
|
15
|
+
clearCanvasRain(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class Rain {
|
|
18
|
+
rainSpeed: number;
|
|
19
|
+
ctx: CanvasRenderingContext2D;
|
|
20
|
+
Y: number;
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
r: number;
|
|
24
|
+
c: string;
|
|
25
|
+
v: {
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
constructor(ctx: any, x: any, y: any, r: any, _Y: any);
|
|
29
|
+
init(x: number, y: number, r: number): void;
|
|
30
|
+
draw(): void;
|
|
31
|
+
updatePosition(): void;
|
|
32
|
+
wrapPosition(): void;
|
|
33
|
+
render(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import App from "../App";
|
|
2
|
+
import IEffect from "./IEffect";
|
|
3
|
+
export default class ThunderEffect implements IEffect {
|
|
4
|
+
app: App;
|
|
5
|
+
thunderNum: number;
|
|
6
|
+
canvas: HTMLCanvasElement;
|
|
7
|
+
canvasThunderCtx: CanvasRenderingContext2D;
|
|
8
|
+
thunders: Array<Thunder>;
|
|
9
|
+
X: number;
|
|
10
|
+
Y: number;
|
|
11
|
+
constructor(_app: App);
|
|
12
|
+
start(): void;
|
|
13
|
+
close(): void;
|
|
14
|
+
render(): void;
|
|
15
|
+
clearCanvasThunder(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class Thunder {
|
|
18
|
+
ctx: CanvasRenderingContext2D;
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
r: number;
|
|
22
|
+
l: any;
|
|
23
|
+
c: string;
|
|
24
|
+
Y: number;
|
|
25
|
+
X: number;
|
|
26
|
+
constructor(ctx: any, x: any, y: any, r: any, _X: any, _Y: any);
|
|
27
|
+
init(x: number, y: number, r: number): void;
|
|
28
|
+
draw(): void;
|
|
29
|
+
updateParams(): void;
|
|
30
|
+
render(): void;
|
|
31
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import "babylonjs-gui";
|
|
|
4
4
|
import "babylonjs-loaders";
|
|
5
5
|
import "babylonjs-serializers";
|
|
6
6
|
import App from "./App";
|
|
7
|
-
import
|
|
7
|
+
import AlarmFlashing from "./components/AlarmFlashing";
|
|
8
8
|
import Tools from "./tools/Tools";
|
|
9
|
-
import { EffectType } from "./components/EffectType";
|
|
10
9
|
import { EventType } from "./components/EventType";
|
|
11
10
|
import UI from "./components/UI";
|
|
12
11
|
import Builder from "./components/Builder";
|
|
13
12
|
import Earth from "./mapboxgl/Earth";
|
|
14
13
|
import ThunderAndRain from "./ThunderAndRain";
|
|
14
|
+
import Effect, { EffectType } from "./effects/Effect";
|
|
15
15
|
export default class MX3D {
|
|
16
16
|
static accessToken: string;
|
|
17
17
|
static pk: string;
|
|
@@ -20,10 +20,11 @@ export default class MX3D {
|
|
|
20
20
|
static App: typeof App;
|
|
21
21
|
static Earth: typeof Earth;
|
|
22
22
|
static Tools: typeof Tools;
|
|
23
|
-
static
|
|
23
|
+
static AlarmFlashing: typeof AlarmFlashing;
|
|
24
24
|
static UI: typeof UI;
|
|
25
25
|
static Builder: typeof Builder;
|
|
26
26
|
static EffectType: typeof EffectType;
|
|
27
27
|
static EventType: typeof EventType;
|
|
28
28
|
static ThunderAndRain: typeof ThunderAndRain;
|
|
29
|
+
static Effect: typeof Effect;
|
|
29
30
|
}
|
package/models/CornerObject.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import IObject from "./IObject";
|
|
2
2
|
import App from "src/App";
|
|
3
|
-
import {
|
|
3
|
+
import { StatusType } from "src/components/StatusType";
|
|
4
4
|
import Sight from "src/tools/Sight";
|
|
5
5
|
import baseModel from "./baseModel";
|
|
6
6
|
export default class CornerObject implements IObject {
|
|
@@ -14,7 +14,7 @@ export default class CornerObject implements IObject {
|
|
|
14
14
|
customType: string;
|
|
15
15
|
instance: BABYLON.Mesh | BABYLON.InstancedMesh;
|
|
16
16
|
Sight: Sight;
|
|
17
|
-
|
|
17
|
+
statusType: StatusType;
|
|
18
18
|
showBoundingBox: boolean;
|
|
19
19
|
pints: any;
|
|
20
20
|
constructor(_app: App);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import App from "../App";
|
|
2
2
|
import Dictionary from "../tools/Dictionary";
|
|
3
|
-
import {
|
|
3
|
+
import { StatusType } from "../components/StatusType";
|
|
4
4
|
import { EventType } from "../components/EventType";
|
|
5
5
|
import IObject from "./IObject";
|
|
6
6
|
import Sight from "../tools/Sight";
|
|
@@ -19,7 +19,7 @@ export default class DefaultObject implements IObject {
|
|
|
19
19
|
executes: Dictionary<BABYLON.ExecuteCodeAction>;
|
|
20
20
|
clickEvents: Dictionary<Function>;
|
|
21
21
|
touchtime: number;
|
|
22
|
-
|
|
22
|
+
statusType: StatusType;
|
|
23
23
|
Sight: Sight;
|
|
24
24
|
animation: boolean;
|
|
25
25
|
isLoop: boolean;
|
package/models/IObject.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StatusType } from "../components/StatusType";
|
|
2
2
|
import IBase from "./IBase";
|
|
3
3
|
import { EventType } from "../components/EventType";
|
|
4
4
|
export default interface IObject extends IBase {
|
|
5
|
-
|
|
5
|
+
statusType: StatusType;
|
|
6
6
|
showBoundingBox: boolean;
|
|
7
7
|
optimization(isOptimization: boolean): any;
|
|
8
8
|
setFlash(level: number): any;
|