@vived/app 2.46.1 → 2.47.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.
|
@@ -6,6 +6,21 @@ export interface ScenePick {
|
|
|
6
6
|
worldPickPoint?: Vector3;
|
|
7
7
|
objectPickMeta?: object;
|
|
8
8
|
}
|
|
9
|
+
export interface IScreenshotSize {
|
|
10
|
+
/**
|
|
11
|
+
* number in pixels for canvas height
|
|
12
|
+
*/
|
|
13
|
+
height?: number;
|
|
14
|
+
/**
|
|
15
|
+
* multiplier allowing render at a higher or lower resolution
|
|
16
|
+
* If value is defined then height and width will be ignored and taken from camera
|
|
17
|
+
*/
|
|
18
|
+
precision?: number;
|
|
19
|
+
/**
|
|
20
|
+
* number in pixels for canvas width
|
|
21
|
+
*/
|
|
22
|
+
width?: number;
|
|
23
|
+
}
|
|
9
24
|
export interface Babylon {
|
|
10
25
|
engine: unknown;
|
|
11
26
|
scene: unknown;
|
|
@@ -18,6 +33,7 @@ export interface Babylon {
|
|
|
18
33
|
scenePixelPick: (pixelPos: Vector2) => ScenePick | undefined;
|
|
19
34
|
sceneObjectRayPick: (ray: ParametricLine) => string | undefined;
|
|
20
35
|
sceneObjectPixelPick: (pixelPos: Vector2) => string | undefined;
|
|
36
|
+
captureScreenshot: (size: IScreenshotSize | number) => Promise<Blob>;
|
|
21
37
|
makeSceneObjectMeta: (id: string) => object;
|
|
22
38
|
updateCanvasSize: () => void;
|
|
23
39
|
submitRenderCanvas: (canvas: HTMLCanvasElement) => void;
|
package/lib/Entities/Babylon.js
CHANGED
|
@@ -80,6 +80,9 @@ class BabylonImp {
|
|
|
80
80
|
this.sceneRayPick = (ray) => {
|
|
81
81
|
throw new Error("Scene ray pick has not been injected");
|
|
82
82
|
};
|
|
83
|
+
this.captureScreenshot = (size = 512) => {
|
|
84
|
+
throw new Error("CaptureScreenshot has not been injected");
|
|
85
|
+
};
|
|
83
86
|
this.sceneObjectRayPick = (ray) => {
|
|
84
87
|
try {
|
|
85
88
|
const pick = this.sceneRayPick(ray);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Angle } from "./Angle";
|
|
2
2
|
import { Matrix } from "./Matrix";
|
|
3
3
|
import { Vector3 } from "./Vector3";
|
|
4
|
-
export interface
|
|
4
|
+
export interface QuaternionDTO {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
7
|
z: number;
|
|
@@ -41,7 +41,7 @@ export declare class Quaternion {
|
|
|
41
41
|
* @param dto The Data Transfer Object
|
|
42
42
|
* @returns The Quaternion
|
|
43
43
|
*/
|
|
44
|
-
static FromDTO(dto:
|
|
44
|
+
static FromDTO(dto: QuaternionDTO): Quaternion;
|
|
45
45
|
/**
|
|
46
46
|
* Creates an Identity Quaternion
|
|
47
47
|
* @returns An Identity Quaternion
|
|
@@ -101,7 +101,7 @@ export declare class Quaternion {
|
|
|
101
101
|
/**
|
|
102
102
|
* Get the quaternion as a Data Transfer Object
|
|
103
103
|
*/
|
|
104
|
-
get dto():
|
|
104
|
+
get dto(): QuaternionDTO;
|
|
105
105
|
readonly x: number;
|
|
106
106
|
readonly y: number;
|
|
107
107
|
readonly z: number;
|