@dreamcomposer/engine-types 0.0.29 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -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
- * Sets the default scale of the geometry.
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
- defaultScale: [number, number, number];
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
- * The name of the stage is the key.
15
+ * Sets the default scale of the geometry.
32
16
  */
33
- [stageName: string]: {
34
- /**
35
- * The display name of the stage. Does not need to match the name of the
36
- * key.
37
- */
38
- // TODO: Maybe better call it displayName to make this distinction clear?
39
- name: string;
40
- /**
41
- * The normal vector of the stage. This can for example be used to
42
- * automatically rotate the geometry to face this stage.
43
- *
44
- * Example: `[0, 0, 1]`
45
- */
46
- // TODO: Remove.
47
- normalVector: [number, number, number];
48
- /**
49
- * Not neccessary anymore must must still be send.
50
- */
51
- // TODO: Remove
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
- * Maps the 2 axes of the 2D stage to the axes of the 3D geometry.
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
- axes?: [number, number];
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
- }