@dreamcomposer/engine-types 0.0.42-next.1 → 0.0.43

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/Camera.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ export interface CameraPosition {
2
+ /**
3
+ * 3D world position where the camera is focused on.
4
+ *
5
+ * Fallback is [0,0,0]
6
+ */
7
+ target: [number, number, number];
8
+ /**
9
+ * The camera pitch angle in degree.
10
+ *
11
+ * The value defines the rotation around the local x-axis of the camera.
12
+ *
13
+ * Example:
14
+ * -90° = top view |
15
+ * 0° = frontal view |
16
+ * 90° = bottom view
17
+ */
18
+ pitch: number;
19
+ /**
20
+ * The camera yaw angle in degree.
21
+ *
22
+ * The value defines the rotation around the world y-axis at the target position.
23
+ *
24
+ * Example:
25
+ * 0° = front view |
26
+ * 90° = right view |
27
+ * 180° = back view |
28
+ * 270° = left view
29
+ *
30
+ */
31
+ yaw: number;
32
+ /**
33
+ * Defines the distance of the camera to the target position in meters
34
+ */
35
+ distance: number;
36
+ }
@@ -0,0 +1,10 @@
1
+ import { CameraPosition } from "../Camera";
2
+ import { FromEngineMessage } from "../post-messages";
3
+
4
+ /**
5
+ * Rotates the camera to a given vector.
6
+ */
7
+ export interface CameraPositionChangeMessage
8
+ extends FromEngineMessage<"camera-position-change"> {
9
+ payload: CameraPosition;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "0.0.42-next.1",
3
+ "version": "0.0.43",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -38,6 +38,8 @@ import { DisplayLoadingUiMessage } from "./from-engine/DisplayLoadingUiMessage";
38
38
  import { HideLoadingUiMessage } from "./from-engine/HideLoadingUiMessage";
39
39
  import { KeyDownEventMessage } from "./from-engine/KeyDownEventMessage";
40
40
  import { KeyUpEventMessage } from "./from-engine/KeyUpEventMessage";
41
+ import { UpdateCameraPositionMessage } from "./to-engine/UpdateCameraPositionMessage";
42
+ import { CameraPositionChangeMessage } from "./from-engine/CameraPositionChangeMessage";
41
43
 
42
44
  /**
43
45
  * A message sent from the engine to the embedder.
@@ -71,13 +73,15 @@ export type FromEnginePostMessage =
71
73
  | KeyDownEventMessage
72
74
  | KeyUpEventMessage
73
75
  | PointerEventMessage
74
- | SetLoadingProgressMessage;
76
+ | SetLoadingProgressMessage
77
+ | CameraPositionChangeMessage;
75
78
 
76
79
  export type ToEnginePostMessage =
77
80
  | DownloadScreenshotMessage
78
81
  | HighlightLayerMessage
79
82
  | ResetCameraPositionMessage
80
83
  | RotateToVectorMessage
84
+ | UpdateCameraPositionMessage
81
85
  | SelectedEdgesMessage
82
86
  | SetClearColorMessage
83
87
  | SetConnectionInfosMessage
@@ -0,0 +1,12 @@
1
+ import { CameraPosition } from "../Camera";
2
+ import { ToEngineMessage } from "../post-messages";
3
+
4
+ /**
5
+ * Rotates the camera to a given position.
6
+ *
7
+ * The position can be partial information. In that case the other position values are kept as is.
8
+ */
9
+ export interface UpdateCameraPositionMessage
10
+ extends ToEngineMessage<"update-camera-position"> {
11
+ payload: { changes: Partial<CameraPosition>; transitionDuration?: number };
12
+ }