@mml-io/3d-web-client-core 0.19.0 → 0.21.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 +7 -0
- package/build/character/CanvasText.d.ts +12 -10
- package/build/character/Character.d.ts +12 -7
- package/build/character/CharacterManager.d.ts +4 -1
- package/build/character/CharacterModel.d.ts +1 -0
- package/build/character/CharacterTooltip.d.ts +11 -10
- 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 +726 -342
- package/build/index.js.map +4 -4
- package/build/input/KeyInputManager.d.ts +11 -0
- package/build/loading-screen/LoadingScreen.d.ts +24 -3
- package/build/mml/MMLCompositionScene.d.ts +3 -2
- package/build/rendering/composer.d.ts +5 -4
- package/package.json +6 -5
@@ -5,6 +5,9 @@ export declare class CameraManager {
|
|
5
5
|
private targetElement;
|
6
6
|
private collisionsManager;
|
7
7
|
readonly camera: PerspectiveCamera;
|
8
|
+
private flyCamera;
|
9
|
+
private orbitControls;
|
10
|
+
private isMainCameraActive;
|
8
11
|
initialDistance: number;
|
9
12
|
minDistance: number;
|
10
13
|
maxDistance: number;
|
@@ -37,6 +40,8 @@ export declare class CameraManager {
|
|
37
40
|
private lerpDuration;
|
38
41
|
private activePointers;
|
39
42
|
constructor(targetElement: HTMLElement, collisionsManager: CollisionsManager, initialPhi?: number, initialTheta?: number);
|
43
|
+
private createEventHandlers;
|
44
|
+
private disposeEventHandlers;
|
40
45
|
private preventDefaultAndStopPropagation;
|
41
46
|
setupTweakPane(tweakPane: TweakPane): void;
|
42
47
|
private onPointerDown;
|
@@ -54,6 +59,8 @@ export declare class CameraManager {
|
|
54
59
|
private easeOutExpo;
|
55
60
|
updateAspect(aspect: number): void;
|
56
61
|
recomputeFoV(immediately?: boolean): void;
|
62
|
+
toggleFlyCamera(): void;
|
63
|
+
get activeCamera(): PerspectiveCamera;
|
57
64
|
update(): void;
|
58
65
|
hasActiveInput(): boolean;
|
59
66
|
}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { Texture
|
2
|
-
type RGBA = {
|
1
|
+
import { Texture } from "three";
|
2
|
+
export type RGBA = {
|
3
3
|
r: number;
|
4
4
|
g: number;
|
5
5
|
b: number;
|
6
6
|
a: number;
|
7
7
|
};
|
8
|
-
type CanvasTextOptions = {
|
8
|
+
export type CanvasTextOptions = {
|
9
9
|
fontSize: number;
|
10
10
|
textColorRGB255A1: RGBA;
|
11
11
|
backgroundColorRGB255A1?: RGBA;
|
@@ -14,19 +14,21 @@ type CanvasTextOptions = {
|
|
14
14
|
paddingPx?: number;
|
15
15
|
alignment?: string;
|
16
16
|
dimensions?: {
|
17
|
+
maxWidth?: undefined;
|
17
18
|
width: number;
|
18
19
|
height: number;
|
20
|
+
} | {
|
21
|
+
maxWidth: number;
|
19
22
|
};
|
20
23
|
};
|
21
|
-
export declare
|
24
|
+
export declare class CanvasText {
|
25
|
+
private canvas;
|
26
|
+
private context;
|
27
|
+
constructor();
|
28
|
+
renderText(message: string, options: CanvasTextOptions): HTMLCanvasElement;
|
29
|
+
}
|
22
30
|
export declare function THREECanvasTextTexture(text: string, options: CanvasTextOptions): {
|
23
31
|
texture: Texture;
|
24
32
|
width: number;
|
25
33
|
height: number;
|
26
34
|
};
|
27
|
-
export declare function THREECanvasTextMaterial(text: string, options: CanvasTextOptions): {
|
28
|
-
material: MeshBasicMaterial;
|
29
|
-
width: number;
|
30
|
-
height: number;
|
31
|
-
};
|
32
|
-
export {};
|
@@ -13,16 +13,18 @@ export type AnimationConfig = {
|
|
13
13
|
doubleJumpAnimationFileUrl: string;
|
14
14
|
};
|
15
15
|
export type CharacterDescription = {
|
16
|
-
meshFileUrl?: string;
|
17
|
-
mmlCharacterUrl?: string;
|
18
|
-
mmlCharacterString?: string;
|
19
|
-
} & ({
|
20
16
|
meshFileUrl: string;
|
17
|
+
mmlCharacterString?: null;
|
18
|
+
mmlCharacterUrl?: null;
|
21
19
|
} | {
|
22
|
-
|
23
|
-
} | {
|
20
|
+
meshFileUrl?: null;
|
24
21
|
mmlCharacterString: string;
|
25
|
-
|
22
|
+
mmlCharacterUrl?: null;
|
23
|
+
} | {
|
24
|
+
meshFileUrl?: null;
|
25
|
+
mmlCharacterString?: null;
|
26
|
+
mmlCharacterUrl: string;
|
27
|
+
};
|
26
28
|
export type CharacterConfig = {
|
27
29
|
username: string;
|
28
30
|
characterDescription: CharacterDescription;
|
@@ -40,10 +42,13 @@ export declare class Character extends Group {
|
|
40
42
|
color: Color;
|
41
43
|
tooltip: CharacterTooltip;
|
42
44
|
speakingIndicator: CharacterSpeakingIndicator | null;
|
45
|
+
chatTooltips: CharacterTooltip[];
|
43
46
|
constructor(config: CharacterConfig);
|
44
47
|
updateCharacter(username: string, characterDescription: CharacterDescription): void;
|
48
|
+
private setTooltipHeights;
|
45
49
|
private load;
|
46
50
|
updateAnimation(targetAnimation: AnimationState): void;
|
47
51
|
update(time: number, deltaTime: number): void;
|
48
52
|
getCurrentAnimation(): AnimationState;
|
53
|
+
addChatBubble(message: string): void;
|
49
54
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PositionAndRotation } from "mml-web";
|
1
|
+
import { PositionAndRotation } from "@mml-io/mml-web";
|
2
2
|
import { Euler, Group, Vector3 } from "three";
|
3
3
|
import { CameraManager } from "../camera/CameraManager";
|
4
4
|
import { CollisionsManager } from "../collisions/CollisionsManager";
|
@@ -40,6 +40,7 @@ export declare class CharacterManager {
|
|
40
40
|
localCharacter: Character | null;
|
41
41
|
private speakingCharacters;
|
42
42
|
readonly group: Group;
|
43
|
+
private lastUpdateSentTime;
|
43
44
|
constructor(config: CharacterManagerConfig);
|
44
45
|
spawnLocalCharacter(id: number, username: string, characterDescription: CharacterDescription, spawnPosition?: Vector3, spawnRotation?: Euler): void;
|
45
46
|
setupTweakPane(tweakPane: TweakPane): void;
|
@@ -47,6 +48,8 @@ export declare class CharacterManager {
|
|
47
48
|
getLocalCharacterPositionAndRotation(): PositionAndRotation;
|
48
49
|
clear(): void;
|
49
50
|
setSpeakingCharacter(id: number, value: boolean): void;
|
51
|
+
addSelfChatBubble(message: string): void;
|
52
|
+
addChatBubble(id: number, message: string): void;
|
50
53
|
respawnIfPresent(id: number): void;
|
51
54
|
update(): void;
|
52
55
|
}
|
@@ -18,6 +18,7 @@ export declare class CharacterModel {
|
|
18
18
|
static ModelLoader: ModelLoader;
|
19
19
|
mesh: Object3D | null;
|
20
20
|
headBone: Bone | null;
|
21
|
+
characterHeight: number | null;
|
21
22
|
private materials;
|
22
23
|
animations: Record<string, AnimationAction>;
|
23
24
|
animationMixer: AnimationMixer | null;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { Color, Sprite } from "three";
|
2
2
|
declare enum LabelAlignment {
|
3
3
|
left = "left",
|
4
4
|
center = "center",
|
@@ -6,25 +6,26 @@ declare enum LabelAlignment {
|
|
6
6
|
}
|
7
7
|
export type CharacterTooltipConfig = {
|
8
8
|
alignment: LabelAlignment;
|
9
|
-
width: number;
|
10
|
-
height: number;
|
11
9
|
fontSize: number;
|
12
10
|
padding: number;
|
13
11
|
color: Color;
|
14
12
|
fontColor: Color;
|
15
|
-
|
13
|
+
visibleOpacity: number;
|
14
|
+
maxWidth?: number;
|
15
|
+
secondsToFadeOut: number | null;
|
16
16
|
};
|
17
|
-
export declare class CharacterTooltip extends
|
18
|
-
private tooltipMaterial;
|
19
|
-
private visibleOpacity;
|
17
|
+
export declare class CharacterTooltip extends Sprite {
|
20
18
|
private targetOpacity;
|
21
19
|
private fadingSpeed;
|
22
|
-
private secondsToFadeOut;
|
23
20
|
private config;
|
21
|
+
private content;
|
22
|
+
private hideTimeout;
|
24
23
|
constructor(configArg?: Partial<CharacterTooltipConfig>);
|
24
|
+
setHeightOffset(height: number): void;
|
25
25
|
private redrawText;
|
26
|
-
setText(text: string,
|
26
|
+
setText(text: string, onRemove?: () => void): void;
|
27
27
|
hide(): void;
|
28
|
-
|
28
|
+
show(): void;
|
29
|
+
update(): void;
|
29
30
|
}
|
30
31
|
export {};
|
package/build/index.d.ts
CHANGED
@@ -5,7 +5,7 @@ export * from "./character/url-position";
|
|
5
5
|
export * from "./helpers/math-helpers";
|
6
6
|
export { CharacterModelLoader } from "./character/CharacterModelLoader";
|
7
7
|
export { CharacterState, AnimationState } from "./character/CharacterState";
|
8
|
-
export { KeyInputManager } from "./input/KeyInputManager";
|
8
|
+
export { Key, KeyInputManager } from "./input/KeyInputManager";
|
9
9
|
export { VirtualJoystick } from "./input/VirtualJoystick";
|
10
10
|
export { MMLCompositionScene } from "./mml/MMLCompositionScene";
|
11
11
|
export { TweakPane } from "./tweakpane/TweakPane";
|
@@ -14,6 +14,6 @@ export { TimeManager } from "./time/TimeManager";
|
|
14
14
|
export { CollisionsManager } from "./collisions/CollisionsManager";
|
15
15
|
export { Sun } from "./sun/Sun";
|
16
16
|
export { GroundPlane } from "./ground-plane/GroundPlane";
|
17
|
-
export { LoadingScreen } from "./loading-screen/LoadingScreen";
|
17
|
+
export { LoadingScreenConfig, LoadingScreen } from "./loading-screen/LoadingScreen";
|
18
18
|
export { ErrorScreen } from "./error-screen/ErrorScreen";
|
19
19
|
export { EnvironmentConfiguration } from "./rendering/composer";
|