@vived/app 2.46.2 → 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.
- package/lib/Entities/Babylon.d.ts +16 -0
- package/lib/Entities/Babylon.js +3 -0
- package/package.json +1 -1
|
@@ -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);
|