@dreamcomposer/engine-types 0.0.28-next.3 → 0.0.30
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/Layer.d.ts
CHANGED
|
@@ -24,11 +24,9 @@ export interface Layer {
|
|
|
24
24
|
/**
|
|
25
25
|
* The texture of the layer, either a url or a blob.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
* - in the URL itself
|
|
29
|
-
* - via a TextureUrl and TextureUrlCollection object
|
|
27
|
+
* Must be in the PNG format.
|
|
30
28
|
*/
|
|
31
|
-
texture: string |
|
|
29
|
+
texture: string | Blob;
|
|
32
30
|
/**
|
|
33
31
|
* Whether or not the layer is overprinted with the texture.
|
|
34
32
|
*
|
|
@@ -73,16 +71,6 @@ export interface PatternEmbossingConfiguration {
|
|
|
73
71
|
* I don't know.
|
|
74
72
|
*/
|
|
75
73
|
overrides?: TextureOverride<unknown>[];
|
|
76
|
-
/**
|
|
77
|
-
* Size of the main texture in pixels
|
|
78
|
-
*/
|
|
79
|
-
sizePx: [number, number];
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* PPI of the texture
|
|
83
|
-
*/
|
|
84
|
-
ppi: number;
|
|
85
|
-
|
|
86
74
|
/**
|
|
87
75
|
* The offset of the embossing.
|
|
88
76
|
*/
|
|
@@ -93,31 +81,6 @@ export interface PatternEmbossingConfiguration {
|
|
|
93
81
|
rotation?: number;
|
|
94
82
|
}
|
|
95
83
|
|
|
96
|
-
export interface TextureUrl {
|
|
97
|
-
/**
|
|
98
|
-
* The public url of the texture
|
|
99
|
-
*/
|
|
100
|
-
url: string;
|
|
101
|
-
/**
|
|
102
|
-
* Define the file extension of the texture. (e.g. ".png", ".jpg", ".basis")
|
|
103
|
-
*
|
|
104
|
-
* This is only necessary, if the url does not contain the extension itself
|
|
105
|
-
*/
|
|
106
|
-
fileExtension?: string;
|
|
107
|
-
}
|
|
108
|
-
export interface TextureBlob {
|
|
109
|
-
/**
|
|
110
|
-
* The texture itself as an Blob
|
|
111
|
-
*/
|
|
112
|
-
blob: Blob;
|
|
113
|
-
/**
|
|
114
|
-
* Define the file extension of the texture (e.g. ".png", ".jpg", ".basis")
|
|
115
|
-
*
|
|
116
|
-
* This is only necessary, if the blob is not a common image file (.png, .jpg)
|
|
117
|
-
*/
|
|
118
|
-
fileExtension?: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
84
|
export type TextureOverride<T> = Record<
|
|
122
85
|
string,
|
|
123
86
|
Partial<T> | Record<string, Partial<T>>
|
package/package.json
CHANGED
package/post-messages.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ import { SetEmbossingHeightTextureMessage } from "./to-engine/SetEmbossingHeight
|
|
|
17
17
|
import { SetEnvironmentMessage } from "./to-engine/SetEnvironmentMessage";
|
|
18
18
|
import { SetEnvironmentVisibleMessage } from "./to-engine/SetEnvironmentVisibleMessage";
|
|
19
19
|
import { SetFullscreenMessage } from "./to-engine/SetFullscreenMessage";
|
|
20
|
-
import { SetGeometryBlobMessage } from "./to-engine/SetGeometryBlobMessage";
|
|
21
20
|
import { SetGeometryMessage } from "./to-engine/SetGeometryMessage";
|
|
22
21
|
import { SetGridVisibilityMessage } from "./to-engine/SetGridVisibilityMessage";
|
|
23
22
|
import { SetHardwareScalingLevelMessage } from "./to-engine/SetHardwareScalingLevelMessage";
|
|
@@ -29,7 +28,6 @@ import { SetSurfaceMaterialMessage } from "./to-engine/SetSurfaceMaterialMessage
|
|
|
29
28
|
import { ToggleFullscreenMessage } from "./to-engine/ToggleFullscreenMessage";
|
|
30
29
|
import { ToggleInspectorMessage } from "./to-engine/ToggleInspectorMessage";
|
|
31
30
|
import { UnhighlightLayerMessage } from "./to-engine/UnhighlightLayerMessage";
|
|
32
|
-
import { SetGeometryUrlMessage } from "./to-engine/SetGeometryUrlMessage";
|
|
33
31
|
import { ToggleVrMessage } from "./to-engine/ToggleVrMessage";
|
|
34
32
|
import { PointerEventMessage } from "./from-engine/PointerEventMessage";
|
|
35
33
|
import { HideGuiMessage } from "./from-engine/HideGuiMessage";
|
|
@@ -87,9 +85,7 @@ export type ToEnginePostMessage =
|
|
|
87
85
|
| SetEnvironmentMessage
|
|
88
86
|
| SetEnvironmentVisibleMessage
|
|
89
87
|
| SetFullscreenMessage
|
|
90
|
-
| SetGeometryBlobMessage
|
|
91
88
|
| SetGeometryMessage
|
|
92
|
-
| SetGeometryUrlMessage
|
|
93
89
|
| SetGridVisibilityMessage
|
|
94
90
|
| SetHardwareScalingLevelMessage
|
|
95
91
|
| SetLayersMessage
|
|
@@ -6,73 +6,80 @@ import { ToEngineMessage } from "../post-messages";
|
|
|
6
6
|
export interface SetGeometryMessage extends ToEngineMessage<"set-geometry"> {
|
|
7
7
|
payload: {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The BLOB or URL of the geometry (i.e., the 3D model, for example a box or a
|
|
10
|
+
* bottle) in the GLTF/GLB format.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* Whether or not the geometry should automatically scale with the mappings
|
|
14
|
-
* defined by the SetStageMappingsMessage.
|
|
15
|
-
*
|
|
16
|
-
* When `true`, the `axes` field of the stages should be set.
|
|
17
|
-
*/
|
|
18
|
-
scaleWithMapping: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether or not the cutout texture from SetCutoutTextureMessage should be
|
|
21
|
-
* used.
|
|
22
|
-
*/
|
|
23
|
-
useCutoutTexture?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* A list with stages.
|
|
26
|
-
*
|
|
27
|
-
* A stage is an area on the geometry that a texture can be drawn on.
|
|
28
|
-
*/
|
|
29
|
-
stages: {
|
|
12
|
+
model: string | Blob;
|
|
13
|
+
config: {
|
|
30
14
|
/**
|
|
31
|
-
*
|
|
15
|
+
* Sets the default scale of the geometry.
|
|
32
16
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
tris: [];
|
|
53
|
-
/**
|
|
54
|
-
* The UV color of the stage.
|
|
55
|
-
*
|
|
56
|
-
* The UV color marks the area on the texture that the stage is drawn
|
|
57
|
-
* on. The array are normalized RGB colors (i.e., in the range from 0 to
|
|
58
|
-
* 1).
|
|
59
|
-
*
|
|
60
|
-
* Example: `[0.21586, 1, 0.21586]`
|
|
61
|
-
*/
|
|
62
|
-
uvColor: [number, number, number];
|
|
17
|
+
defaultScale: [number, number, number];
|
|
18
|
+
/**
|
|
19
|
+
* Whether or not the geometry should automatically scale with the mappings
|
|
20
|
+
* defined by the SetStageMappingsMessage.
|
|
21
|
+
*
|
|
22
|
+
* When `true`, the `axes` field of the stages should be set.
|
|
23
|
+
*/
|
|
24
|
+
scaleWithMapping: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether or not the cutout texture from SetCutoutTextureMessage should be
|
|
27
|
+
* used.
|
|
28
|
+
*/
|
|
29
|
+
useCutoutTexture?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* A list with stages.
|
|
32
|
+
*
|
|
33
|
+
* A stage is an area on the geometry that a texture can be drawn on.
|
|
34
|
+
*/
|
|
35
|
+
stages: {
|
|
63
36
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* Only relevant when `scaleWithMapping` is `true`.
|
|
67
|
-
*
|
|
68
|
-
* The number is the number of the axis (i.e., `0` for the x-axis, `1`
|
|
69
|
-
* for the y-axis, and `2` for the z-axis).
|
|
70
|
-
*
|
|
71
|
-
* Example: `[0, 1]` maps the width and height of the stage to the x and
|
|
72
|
-
* y-axis of the geometry.
|
|
73
|
-
*
|
|
37
|
+
* The name of the stage is the key.
|
|
74
38
|
*/
|
|
75
|
-
|
|
39
|
+
[stageName: string]: {
|
|
40
|
+
/**
|
|
41
|
+
* The display name of the stage. Does not need to match the name of the
|
|
42
|
+
* key.
|
|
43
|
+
*/
|
|
44
|
+
// TODO: Maybe better call it displayName to make this distinction clear?
|
|
45
|
+
name: string;
|
|
46
|
+
/**
|
|
47
|
+
* The normal vector of the stage. This can for example be used to
|
|
48
|
+
* automatically rotate the geometry to face this stage.
|
|
49
|
+
*
|
|
50
|
+
* Example: `[0, 0, 1]`
|
|
51
|
+
*/
|
|
52
|
+
// TODO: Remove.
|
|
53
|
+
normalVector: [number, number, number];
|
|
54
|
+
/**
|
|
55
|
+
* Not neccessary anymore must must still be send.
|
|
56
|
+
*/
|
|
57
|
+
// TODO: Remove
|
|
58
|
+
tris: [];
|
|
59
|
+
/**
|
|
60
|
+
* The UV color of the stage.
|
|
61
|
+
*
|
|
62
|
+
* The UV color marks the area on the texture that the stage is drawn
|
|
63
|
+
* on. The array are normalized RGB colors (i.e., in the range from 0 to
|
|
64
|
+
* 1).
|
|
65
|
+
*
|
|
66
|
+
* Example: `[0.21586, 1, 0.21586]`
|
|
67
|
+
*/
|
|
68
|
+
uvColor: [number, number, number];
|
|
69
|
+
/**
|
|
70
|
+
* Maps the 2 axes of the 2D stage to the axes of the 3D geometry.
|
|
71
|
+
*
|
|
72
|
+
* Only relevant when `scaleWithMapping` is `true`.
|
|
73
|
+
*
|
|
74
|
+
* The number is the number of the axis (i.e., `0` for the x-axis, `1`
|
|
75
|
+
* for the y-axis, and `2` for the z-axis).
|
|
76
|
+
*
|
|
77
|
+
* Example: `[0, 1]` maps the width and height of the stage to the x and
|
|
78
|
+
* y-axis of the geometry.
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
axes?: [number, number];
|
|
82
|
+
};
|
|
76
83
|
};
|
|
77
84
|
};
|
|
78
85
|
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ToEngineMessage } from "../post-messages";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Set the scene's geometry's model as a blob.
|
|
5
|
-
*/
|
|
6
|
-
export interface SetGeometryBlobMessage
|
|
7
|
-
extends ToEngineMessage<"set-geometry-blob"> {
|
|
8
|
-
/**
|
|
9
|
-
* The data of the geometry (i.e., the 3D model, for example a box or a
|
|
10
|
-
* bottle) in the GLTF format.
|
|
11
|
-
*/
|
|
12
|
-
payload: Blob;
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ToEngineMessage } from "../post-messages";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Set the url of the scene's geometry's model.
|
|
5
|
-
*/
|
|
6
|
-
export interface SetGeometryUrlMessage
|
|
7
|
-
extends ToEngineMessage<"set-geometry-url"> {
|
|
8
|
-
/**
|
|
9
|
-
* A url to the geometry (i.e., the 3D model, for example a box or a bottle)
|
|
10
|
-
* in the GLTF format.
|
|
11
|
-
*/
|
|
12
|
-
payload: string;
|
|
13
|
-
}
|