@dreamcomposer/engine-types 0.0.82 → 0.0.84

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.
@@ -1,12 +1,16 @@
1
- export type Label = {
1
+ /**
2
+ * Defines a visual object that is attached to the 3D object in the scene with a line.
3
+ * The tag is displayed in the 3D scene and is always facing the camera.
4
+ */
5
+ export type AnnotationTag = {
2
6
  /**
3
- * Unique identifier for the label.
7
+ * Unique identifier for the tag.
4
8
  */
5
9
  id: string;
6
10
  /**
7
11
  * Normalized coordinates within the layer texture. The origin is the top left corner of the texture. The bottom right corner is `(1, 1)`.
8
12
  *
9
- * If the coordinates are outside of the texture, or that part of the texture is not mapped to the geometry, the label will not be displayed.
13
+ * If the coordinates are outside of the texture, or that part of the texture is not mapped to the geometry, the tag will not be displayed.
10
14
  */
11
15
  textureCoordinates: {
12
16
  /** Normalized x-position. `0` represents the left edge of the image. `1` the right edge */
@@ -1,4 +1,4 @@
1
- import { Label } from "../Label";
1
+ import { AnnotationTag } from "../AnnotationTag";
2
2
  import { FromEngineMessage } from "../post-messages";
3
3
 
4
4
  export type AnchorPosition = {
@@ -9,16 +9,16 @@ export type AnchorPosition = {
9
9
  };
10
10
 
11
11
  /**
12
- * Is fired every frame to notify the embedder of the new screen position of the label.
12
+ * Is fired every frame to notify the embedder of the new screen position of the annotation tag.
13
13
  */
14
- export interface LabelPositionChangedMessage
15
- extends FromEngineMessage<"label-position-changed"> {
14
+ export interface AnnotationTagPositionChangedMessage
15
+ extends FromEngineMessage<"annotation-tag-position-changed"> {
16
16
  payload: {
17
- label: Label;
17
+ tag: AnnotationTag;
18
18
  /** The anchor position that is directly attached to the object */
19
19
  objectAnchorPosition: AnchorPosition;
20
20
  /** The floating anchor position where the text label will be displayed */
21
- labelAnchorPosition: AnchorPosition;
21
+ tagAnchorPosition: AnchorPosition;
22
22
  /** Normalized value where `0` is directly in front of the camera and `1` at the far end */
23
23
  depth: number;
24
24
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "0.0.82",
3
+ "version": "0.0.84",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -49,8 +49,8 @@ import { ResetGeometryTransformMessage } from "./to-engine/ResetGeometryTransfor
49
49
  import { PlaceGeometryOnGroundMessage } from "./to-engine/MoveGeometryToGroundMessage";
50
50
  import { MouseEventMessage } from "./to-engine/MouseEventMessage";
51
51
  import { SetBackgroundImageMessage } from "./to-engine/SetBackgroundImageMessage";
52
- import { LabelPositionChangedMessage } from "./from-engine/LabelPositionChangedMessage";
53
- import { SetLabelsMessage } from "./to-engine/SetLabelsMessage";
52
+ import { AnnotationTagPositionChangedMessage } from "./from-engine/AnnotationTagPositionChangedMessage";
53
+ import { SetAnnotationTagsMessage } from "./to-engine/SetAnnotationTagsMessage";
54
54
  import { SetCustomRequestHeaders } from "./to-engine/SetCustomRequestHeaders";
55
55
 
56
56
  /**
@@ -89,7 +89,7 @@ export type FromEnginePostMessage =
89
89
  | CameraPositionChangeMessage
90
90
  | EnvironmentRotationChangedMessage
91
91
  | GeometryTransformChangeMessage
92
- | LabelPositionChangedMessage;
92
+ | AnnotationTagPositionChangedMessage;
93
93
 
94
94
  export type ToEnginePostMessage =
95
95
  | DownloadScreenshotMessage
@@ -129,7 +129,7 @@ export type ToEnginePostMessage =
129
129
  | SetInitialGeometryTransformMessage
130
130
  | ResetGeometryTransformMessage
131
131
  | PlaceGeometryOnGroundMessage
132
- | SetLabelsMessage
132
+ | SetAnnotationTagsMessage
133
133
  | SetCustomRequestHeaders;
134
134
 
135
135
  export type PostMessage = FromEnginePostMessage | ToEnginePostMessage;
@@ -0,0 +1,14 @@
1
+ import { AnnotationTag } from "../AnnotationTag";
2
+ import { ToEngineMessage } from "../post-messages";
3
+
4
+ /**
5
+ * Sets the annotation tags that should be displayed in the scene.
6
+ *
7
+ * The engine only renders the tags connector lines and sends the tags screen positions to the
8
+ * embedder via `annotation-tag-position-changed` message. The embedder is responsible for rendering the
9
+ * tags.
10
+ */
11
+ export interface SetAnnotationTagsMessage
12
+ extends ToEngineMessage<"set-annotation-tags"> {
13
+ payload: AnnotationTag[];
14
+ }
@@ -1,13 +0,0 @@
1
- import { Label } from "../Label";
2
- import { ToEngineMessage } from "../post-messages";
3
-
4
- /**
5
- * Sets the labels that should be displayed in the scene.
6
- *
7
- * The engine only renders the label connector lines and sends the label screen positions to the
8
- * embedder via `label-position-changed` message. The embedder is responsible for rendering the
9
- * labels.
10
- */
11
- export interface SetLabelsMessage extends ToEngineMessage<"set-labels"> {
12
- payload: Label[];
13
- }