@mml-io/3d-web-client-core 0.18.0 → 0.20.0
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/build/camera/CameraManager.d.ts +23 -18
- package/build/character/CharacterManager.d.ts +1 -1
- package/build/character/LocalController.d.ts +1 -9
- package/build/collisions/CollisionsManager.d.ts +1 -1
- package/build/collisions/getRelativePositionAndRotationRelativeToObject.d.ts +3 -0
- package/build/index.d.ts +2 -2
- package/build/index.js +819 -521
- package/build/index.js.map +4 -4
- package/build/input/KeyInputManager.d.ts +22 -8
- package/build/input/VirtualJoystick.d.ts +28 -36
- package/build/loading-screen/LoadingScreen.d.ts +24 -3
- package/build/mml/MMLCompositionScene.d.ts +4 -2
- package/build/rendering/composer.d.ts +16 -7
- package/build/tweakpane/TweakPane.d.ts +1 -1
- package/build/tweakpane/blades/cameraFolder.d.ts +0 -6
- package/package.json +6 -5
@@ -1,20 +1,34 @@
|
|
1
|
+
export declare enum Key {
|
2
|
+
W = "w",
|
3
|
+
A = "a",
|
4
|
+
S = "s",
|
5
|
+
D = "d",
|
6
|
+
SHIFT = "shift",
|
7
|
+
SPACE = " ",
|
8
|
+
C = "c"
|
9
|
+
}
|
1
10
|
export declare class KeyInputManager {
|
2
11
|
private shouldCaptureKeyPress;
|
3
12
|
private keys;
|
4
13
|
private eventHandlerCollection;
|
14
|
+
private bindings;
|
5
15
|
constructor(shouldCaptureKeyPress?: () => boolean);
|
6
16
|
private handleUnfocus;
|
7
17
|
private onKeyDown;
|
8
18
|
private onKeyUp;
|
9
19
|
isKeyPressed(key: string): boolean;
|
20
|
+
createKeyBinding(key: Key, callback: () => void): void;
|
10
21
|
isMovementKeyPressed(): boolean;
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
22
|
+
private getForward;
|
23
|
+
private getBackward;
|
24
|
+
private getLeft;
|
25
|
+
private getRight;
|
26
|
+
private getRun;
|
27
|
+
private getJump;
|
28
|
+
getOutput(): {
|
29
|
+
direction: number | null;
|
30
|
+
isSprinting: boolean;
|
31
|
+
jump: boolean;
|
32
|
+
} | null;
|
19
33
|
dispose(): void;
|
20
34
|
}
|
@@ -1,47 +1,39 @@
|
|
1
|
-
interface
|
1
|
+
interface VirtualJoyStickConfig {
|
2
2
|
radius?: number;
|
3
|
-
|
4
|
-
|
5
|
-
y?: number;
|
6
|
-
width?: number;
|
7
|
-
height?: number;
|
8
|
-
mouse_support?: boolean;
|
9
|
-
visible?: boolean;
|
10
|
-
anchor?: "left" | "right";
|
3
|
+
innerRadius?: number;
|
4
|
+
mouseSupport?: boolean;
|
11
5
|
}
|
12
6
|
export declare class VirtualJoystick {
|
13
7
|
private holderElement;
|
8
|
+
private config;
|
14
9
|
private radius;
|
15
|
-
private
|
16
|
-
private
|
17
|
-
private
|
18
|
-
private
|
19
|
-
private
|
20
|
-
private
|
21
|
-
private
|
22
|
-
private
|
23
|
-
private
|
24
|
-
|
25
|
-
left: boolean;
|
26
|
-
right: boolean;
|
27
|
-
up: boolean;
|
28
|
-
down: boolean;
|
29
|
-
hasDirection: boolean;
|
30
|
-
constructor(holderElement: HTMLElement, attrs: JoyStickAttributes);
|
10
|
+
private innerRadius;
|
11
|
+
private mouseSupport;
|
12
|
+
private element;
|
13
|
+
private joystickBaseElement;
|
14
|
+
private joystickCenterElement;
|
15
|
+
private joystickPointerId;
|
16
|
+
private joystickOutput;
|
17
|
+
private jumpButton;
|
18
|
+
private jumpPointerId;
|
19
|
+
constructor(holderElement: HTMLElement, config: VirtualJoyStickConfig);
|
31
20
|
static checkForTouch(): boolean;
|
32
21
|
private checkTouch;
|
33
|
-
private
|
22
|
+
private createBase;
|
23
|
+
private createCenter;
|
24
|
+
private createJumpButton;
|
34
25
|
private bindEvents;
|
35
|
-
private
|
36
|
-
private
|
37
|
-
private
|
38
|
-
private
|
39
|
-
private
|
40
|
-
private
|
26
|
+
private preventDefaultAndStopPropagation;
|
27
|
+
private onJumpPointerDown;
|
28
|
+
private onJoystickPointerDown;
|
29
|
+
private onPointerMove;
|
30
|
+
private onPointerUp;
|
31
|
+
private clearJoystickState;
|
41
32
|
private updateControlAndDirection;
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
33
|
+
getOutput(): {
|
34
|
+
direction: number | null;
|
35
|
+
isSprinting: boolean;
|
36
|
+
jump: boolean;
|
37
|
+
} | null;
|
46
38
|
}
|
47
39
|
export {};
|
@@ -1,8 +1,29 @@
|
|
1
|
-
import { LoadingProgressManager } from "mml-web";
|
1
|
+
import { LoadingProgressManager } from "@mml-io/mml-web";
|
2
|
+
export type LoadingScreenConfig = {
|
3
|
+
background?: string;
|
4
|
+
backgroundImageUrl?: string;
|
5
|
+
backgroundBlurAmount?: number;
|
6
|
+
overlayLayers?: Array<{
|
7
|
+
overlayImageUrl: string;
|
8
|
+
overlayAnchor: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
9
|
+
overlayOffset?: {
|
10
|
+
x: number;
|
11
|
+
y: number;
|
12
|
+
};
|
13
|
+
}>;
|
14
|
+
title?: string;
|
15
|
+
subtitle?: string;
|
16
|
+
color?: string;
|
17
|
+
};
|
2
18
|
export declare class LoadingScreen {
|
3
19
|
private loadingProgressManager;
|
20
|
+
private config?;
|
4
21
|
readonly element: HTMLDivElement;
|
5
|
-
private
|
22
|
+
private readonly backgroundBlur;
|
23
|
+
private overlayLayers;
|
24
|
+
private loadingBanner;
|
25
|
+
private loadingBannerTitle;
|
26
|
+
private loadingBannerSubtitle;
|
6
27
|
private progressBarBackground;
|
7
28
|
private progressBarHolder;
|
8
29
|
private progressBar;
|
@@ -15,6 +36,6 @@ export declare class LoadingScreen {
|
|
15
36
|
private hasCompleted;
|
16
37
|
private loadingCallback;
|
17
38
|
private disposed;
|
18
|
-
constructor(loadingProgressManager: LoadingProgressManager);
|
39
|
+
constructor(loadingProgressManager: LoadingProgressManager, config?: LoadingScreenConfig | undefined);
|
19
40
|
dispose(): void;
|
20
41
|
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { IMMLScene, PositionAndRotation } from "mml-web";
|
1
|
+
import { IMMLScene, MMLDocumentTimeManager, PositionAndRotation } from "@mml-io/mml-web";
|
2
|
+
import { ThreeJSGraphicsAdapter } from "@mml-io/mml-web-threejs";
|
2
3
|
import { AudioListener, Group, PerspectiveCamera, Scene, WebGLRenderer } from "three";
|
3
4
|
import { CollisionsManager } from "../collisions/CollisionsManager";
|
4
5
|
type MMLCompositionSceneConfig = {
|
@@ -13,7 +14,8 @@ type MMLCompositionSceneConfig = {
|
|
13
14
|
export declare class MMLCompositionScene {
|
14
15
|
private config;
|
15
16
|
group: Group;
|
16
|
-
readonly mmlScene: IMMLScene
|
17
|
+
readonly mmlScene: IMMLScene<ThreeJSGraphicsAdapter>;
|
18
|
+
readonly documentTimeManager: MMLDocumentTimeManager;
|
17
19
|
private readonly promptManager;
|
18
20
|
private readonly interactionManager;
|
19
21
|
private readonly interactionListener;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { EffectComposer } from "postprocessing";
|
2
|
-
import {
|
2
|
+
import { Scene, Vector2, WebGLRenderer } from "three";
|
3
|
+
import { CameraManager } from "../camera/CameraManager";
|
3
4
|
import { Sun } from "../sun/Sun";
|
4
5
|
import { TimeManager } from "../time/TimeManager";
|
5
6
|
import { TweakPane } from "../tweakpane/TweakPane";
|
6
7
|
type ComposerContructorArgs = {
|
7
8
|
scene: Scene;
|
8
|
-
|
9
|
+
cameraManager: CameraManager;
|
9
10
|
spawnSun: boolean;
|
10
11
|
environmentConfiguration?: EnvironmentConfiguration;
|
11
12
|
};
|
@@ -16,7 +17,11 @@ export type EnvironmentConfiguration = {
|
|
16
17
|
blurriness?: number;
|
17
18
|
azimuthalAngle?: number;
|
18
19
|
polarAngle?: number;
|
19
|
-
}
|
20
|
+
} & ({
|
21
|
+
hdrJpgUrl: string;
|
22
|
+
} | {
|
23
|
+
hdrUrl: string;
|
24
|
+
});
|
20
25
|
envMap?: {
|
21
26
|
intensity?: number;
|
22
27
|
};
|
@@ -37,10 +42,9 @@ export declare class Composer {
|
|
37
42
|
private height;
|
38
43
|
private resizeListener;
|
39
44
|
resolution: Vector2;
|
40
|
-
private isEnvHDRI;
|
41
45
|
private readonly scene;
|
42
46
|
postPostScene: Scene;
|
43
|
-
private readonly
|
47
|
+
private readonly cameraManager;
|
44
48
|
readonly renderer: WebGLRenderer;
|
45
49
|
readonly effectComposer: EffectComposer;
|
46
50
|
private readonly renderPass;
|
@@ -63,21 +67,26 @@ export declare class Composer {
|
|
63
67
|
private readonly gaussGrainPass;
|
64
68
|
private ambientLight;
|
65
69
|
private environmentConfiguration?;
|
70
|
+
private skyboxState;
|
66
71
|
sun: Sun | null;
|
67
72
|
spawnSun: boolean;
|
68
|
-
constructor({ scene,
|
73
|
+
constructor({ scene, cameraManager, spawnSun, environmentConfiguration, }: ComposerContructorArgs);
|
74
|
+
updateEnvironmentConfiguration(environmentConfiguration: EnvironmentConfiguration): void;
|
69
75
|
setupTweakPane(tweakPane: TweakPane): void;
|
70
76
|
dispose(): void;
|
71
77
|
fitContainer(): void;
|
72
78
|
render(timeManager: TimeManager): void;
|
73
79
|
updateSkyboxRotation(): void;
|
80
|
+
private loadHDRJPG;
|
81
|
+
private loadHDRi;
|
74
82
|
useHDRJPG(url: string, fromFile?: boolean): void;
|
75
|
-
useHDRI(url: string
|
83
|
+
useHDRI(url: string): void;
|
76
84
|
setHDRIFromFile(): void;
|
77
85
|
setFog(): void;
|
78
86
|
setAmbientLight(): void;
|
79
87
|
private updateSunValues;
|
80
88
|
private updateSkyboxAndEnvValues;
|
81
89
|
private updateAmbientLightValues;
|
90
|
+
private applyEnvMap;
|
82
91
|
}
|
83
92
|
export {};
|
@@ -26,8 +26,8 @@ export declare class TweakPane {
|
|
26
26
|
private saveVisibilityInLocalStorage;
|
27
27
|
guiVisible: boolean;
|
28
28
|
private tweakPaneWrapper;
|
29
|
+
private eventHandlerCollection;
|
29
30
|
constructor(holderElement: HTMLElement, renderer: WebGLRenderer, scene: Scene, composer: EffectComposer);
|
30
|
-
private setupGUIListeners;
|
31
31
|
private processKey;
|
32
32
|
setupRenderPane(composer: EffectComposer, normalPass: NormalPass, ppssaoEffect: SSAOEffect, ppssaoPass: EffectPass, n8aopass: any, toneMappingEffect: ToneMappingEffect, toneMappingPass: EffectPass, brightnessContrastSaturation: typeof BrightnessContrastSaturation, bloomEffect: BloomEffect, gaussGrainEffect: typeof GaussGrainEffect, hasLighting: boolean, sun: Sun | null, setHDR: () => void, setSkyboxAzimuthalAngle: (azimuthalAngle: number) => void, setSkyboxPolarAngle: (azimuthalAngle: number) => void, setAmbientLight: () => void, setFog: () => void): void;
|
33
33
|
dispose(): void;
|
@@ -9,7 +9,6 @@ export declare const camValues: {
|
|
9
9
|
minFOV: number;
|
10
10
|
invertFOVMapping: boolean;
|
11
11
|
damping: number;
|
12
|
-
dampingScale: number;
|
13
12
|
zoomScale: number;
|
14
13
|
zoomDamping: number;
|
15
14
|
};
|
@@ -49,11 +48,6 @@ export declare const camOptions: {
|
|
49
48
|
max: number;
|
50
49
|
step: number;
|
51
50
|
};
|
52
|
-
dampingScale: {
|
53
|
-
min: number;
|
54
|
-
max: number;
|
55
|
-
step: number;
|
56
|
-
};
|
57
51
|
zoomScale: {
|
58
52
|
min: number;
|
59
53
|
max: number;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mml-io/3d-web-client-core",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.20.0",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -18,12 +18,13 @@
|
|
18
18
|
"lint-fix": "eslint \"./{src,test}/**/*.{js,jsx,ts,tsx}\" --fix"
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
|
-
"@mml-io/3d-web-avatar": "^0.
|
22
|
-
"@mml-io/
|
21
|
+
"@mml-io/3d-web-avatar": "^0.20.0",
|
22
|
+
"@mml-io/mml-web": "0.19.0",
|
23
|
+
"@mml-io/mml-web-threejs": "0.19.0",
|
24
|
+
"@mml-io/model-loader": "0.19.0",
|
23
25
|
"@monogrid/gainmap-js": "^3.0.5",
|
24
26
|
"@tweakpane/core": "2.0.4",
|
25
27
|
"@tweakpane/plugin-essentials": "0.2.1",
|
26
|
-
"mml-web": "0.16.1",
|
27
28
|
"postprocessing": "6.35.6",
|
28
29
|
"three-mesh-bvh": "0.7.6",
|
29
30
|
"tweakpane": "4.0.4"
|
@@ -34,5 +35,5 @@
|
|
34
35
|
"devDependencies": {
|
35
36
|
"@types/three": "0.163.0"
|
36
37
|
},
|
37
|
-
"gitHead": "
|
38
|
+
"gitHead": "8dada83f0324f46a9078f21de64fa58b90bb238d"
|
38
39
|
}
|