@dcl/ecs 7.5.8-10904608781.commit-ddc542d → 7.5.8-10907077327.commit-5bfdcc5

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,10 +1,12 @@
1
1
  import _m0 from "protobufjs/minimal";
2
+ /**
3
+ * Defines the transition used towards the camera that contains the CameraTransition.
4
+ * This structure may be updated in the future to specify from/to entities and to have easing functions.
5
+ */
2
6
  /**
3
7
  * @public
4
8
  */
5
9
  export interface CameraTransition {
6
- fromEntity?: number | undefined;
7
- toEntity?: number | undefined;
8
10
  transitionMode?: {
9
11
  $case: "time";
10
12
  time: number;
@@ -2,7 +2,7 @@
2
2
  import _m0 from "protobufjs/minimal";
3
3
  const protobufPackageSarasa = "decentraland.sdk.components.common";
4
4
  function createBaseCameraTransition() {
5
- return { fromEntity: undefined, toEntity: undefined, transitionMode: undefined };
5
+ return { transitionMode: undefined };
6
6
  }
7
7
  /**
8
8
  * @public
@@ -10,18 +10,12 @@ function createBaseCameraTransition() {
10
10
  export var CameraTransition;
11
11
  (function (CameraTransition) {
12
12
  function encode(message, writer = _m0.Writer.create()) {
13
- if (message.fromEntity !== undefined) {
14
- writer.uint32(8).uint32(message.fromEntity);
15
- }
16
- if (message.toEntity !== undefined) {
17
- writer.uint32(16).uint32(message.toEntity);
18
- }
19
13
  switch (message.transitionMode?.$case) {
20
14
  case "time":
21
- writer.uint32(29).float(message.transitionMode.time);
15
+ writer.uint32(13).float(message.transitionMode.time);
22
16
  break;
23
17
  case "speed":
24
- writer.uint32(37).float(message.transitionMode.speed);
18
+ writer.uint32(21).float(message.transitionMode.speed);
25
19
  break;
26
20
  }
27
21
  return writer;
@@ -35,25 +29,13 @@ export var CameraTransition;
35
29
  const tag = reader.uint32();
36
30
  switch (tag >>> 3) {
37
31
  case 1:
38
- if (tag !== 8) {
39
- break;
40
- }
41
- message.fromEntity = reader.uint32();
42
- continue;
43
- case 2:
44
- if (tag !== 16) {
45
- break;
46
- }
47
- message.toEntity = reader.uint32();
48
- continue;
49
- case 3:
50
- if (tag !== 29) {
32
+ if (tag !== 13) {
51
33
  break;
52
34
  }
53
35
  message.transitionMode = { $case: "time", time: reader.float() };
54
36
  continue;
55
- case 4:
56
- if (tag !== 37) {
37
+ case 2:
38
+ if (tag !== 21) {
57
39
  break;
58
40
  }
59
41
  message.transitionMode = { $case: "speed", speed: reader.float() };
@@ -1,11 +1,14 @@
1
1
  import _m0 from "protobufjs/minimal";
2
- /** PBMainCamera.virtualCameraEntity defines which VirtualCamera entity is active at the moment. 0 means none. */
2
+ /**
3
+ * PBMainCamera.virtualCameraEntity defines which VirtualCamera entity is active at the moment.
4
+ * This component may hold 'repeated common.CameraTransition' transitionOverrides in the future
5
+ */
3
6
  /**
4
7
  * @public
5
8
  */
6
9
  export interface PBMainCamera {
7
- /** currently active virtual camera (default: 0) */
8
- virtualCameraEntity: number;
10
+ /** current active virtual camera */
11
+ virtualCameraEntity?: number | undefined;
9
12
  }
10
13
  /**
11
14
  * @public
@@ -2,7 +2,7 @@
2
2
  import _m0 from "protobufjs/minimal";
3
3
  const protobufPackageSarasa = "decentraland.sdk.components";
4
4
  function createBasePBMainCamera() {
5
- return { virtualCameraEntity: 0 };
5
+ return { virtualCameraEntity: undefined };
6
6
  }
7
7
  /**
8
8
  * @public
@@ -10,7 +10,7 @@ function createBasePBMainCamera() {
10
10
  export var PBMainCamera;
11
11
  (function (PBMainCamera) {
12
12
  function encode(message, writer = _m0.Writer.create()) {
13
- if (message.virtualCameraEntity !== 0) {
13
+ if (message.virtualCameraEntity !== undefined) {
14
14
  writer.uint32(8).uint32(message.virtualCameraEntity);
15
15
  }
16
16
  return writer;
@@ -2,7 +2,8 @@ import _m0 from "protobufjs/minimal";
2
2
  import { CameraTransition } from "./common/camera_transition.gen";
3
3
  /**
4
4
  * PBVirtualCamera represents a camera to be used at some point in time during the scene execution
5
- * * The defaultTransition represents the transition TOWARDS this camera.
5
+ * * The defaultTransition represents the transition TOWARDS this camera. If there is none, it's treated as
6
+ * an 'instant' transition (like using speed/time = 0)
6
7
  * * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
7
8
  * the holding entity transform).
8
9
  */
@@ -10,7 +11,7 @@ import { CameraTransition } from "./common/camera_transition.gen";
10
11
  * @public
11
12
  */
12
13
  export interface PBVirtualCamera {
13
- defaultTransition: CameraTransition | undefined;
14
+ defaultTransition?: CameraTransition | undefined;
14
15
  lookAtEntity?: number | undefined;
15
16
  }
16
17
  /**
@@ -43,20 +43,18 @@ export function localMessageToNetwork(message, network, buffer, destinationBuffe
43
43
  }
44
44
  destinationBuffer.writeBuffer(buffer.buffer().subarray(offset, buffer.currentWriteOffset()), false);
45
45
  }
46
+ const buffer = new ReadWriteByteBuffer();
46
47
  /* istanbul ignore next */
47
48
  export function fixTransformParent(message, transformValue, parent) {
49
+ buffer.resetBuffer();
48
50
  let transform = transformValue;
49
- const buffer = new ReadWriteByteBuffer();
50
51
  if (!transform && 'data' in message) {
51
- buffer.writeBuffer(message.data);
52
- transform = TransformSchema.deserialize(buffer);
53
- buffer.resetBuffer();
52
+ transform = TransformSchema.deserialize(new ReadWriteByteBuffer(message.data));
54
53
  }
55
54
  if (!transform)
56
55
  throw new Error('Invalid parent transform');
57
56
  // Generate new transform raw data with the parent
58
57
  const newTransform = { ...transform, parent };
59
- buffer.resetBuffer();
60
58
  TransformSchema.serialize(newTransform, buffer);
61
59
  return buffer.toBinary();
62
60
  }
@@ -1,10 +1,12 @@
1
1
  import _m0 from "protobufjs/minimal";
2
+ /**
3
+ * Defines the transition used towards the camera that contains the CameraTransition.
4
+ * This structure may be updated in the future to specify from/to entities and to have easing functions.
5
+ */
2
6
  /**
3
7
  * @public
4
8
  */
5
9
  export interface CameraTransition {
6
- fromEntity?: number | undefined;
7
- toEntity?: number | undefined;
8
10
  transitionMode?: {
9
11
  $case: "time";
10
12
  time: number;
@@ -8,7 +8,7 @@ exports.CameraTransition = void 0;
8
8
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
9
9
  const protobufPackageSarasa = "decentraland.sdk.components.common";
10
10
  function createBaseCameraTransition() {
11
- return { fromEntity: undefined, toEntity: undefined, transitionMode: undefined };
11
+ return { transitionMode: undefined };
12
12
  }
13
13
  /**
14
14
  * @public
@@ -16,18 +16,12 @@ function createBaseCameraTransition() {
16
16
  var CameraTransition;
17
17
  (function (CameraTransition) {
18
18
  function encode(message, writer = minimal_1.default.Writer.create()) {
19
- if (message.fromEntity !== undefined) {
20
- writer.uint32(8).uint32(message.fromEntity);
21
- }
22
- if (message.toEntity !== undefined) {
23
- writer.uint32(16).uint32(message.toEntity);
24
- }
25
19
  switch (message.transitionMode?.$case) {
26
20
  case "time":
27
- writer.uint32(29).float(message.transitionMode.time);
21
+ writer.uint32(13).float(message.transitionMode.time);
28
22
  break;
29
23
  case "speed":
30
- writer.uint32(37).float(message.transitionMode.speed);
24
+ writer.uint32(21).float(message.transitionMode.speed);
31
25
  break;
32
26
  }
33
27
  return writer;
@@ -41,25 +35,13 @@ var CameraTransition;
41
35
  const tag = reader.uint32();
42
36
  switch (tag >>> 3) {
43
37
  case 1:
44
- if (tag !== 8) {
45
- break;
46
- }
47
- message.fromEntity = reader.uint32();
48
- continue;
49
- case 2:
50
- if (tag !== 16) {
51
- break;
52
- }
53
- message.toEntity = reader.uint32();
54
- continue;
55
- case 3:
56
- if (tag !== 29) {
38
+ if (tag !== 13) {
57
39
  break;
58
40
  }
59
41
  message.transitionMode = { $case: "time", time: reader.float() };
60
42
  continue;
61
- case 4:
62
- if (tag !== 37) {
43
+ case 2:
44
+ if (tag !== 21) {
63
45
  break;
64
46
  }
65
47
  message.transitionMode = { $case: "speed", speed: reader.float() };
@@ -1,11 +1,14 @@
1
1
  import _m0 from "protobufjs/minimal";
2
- /** PBMainCamera.virtualCameraEntity defines which VirtualCamera entity is active at the moment. 0 means none. */
2
+ /**
3
+ * PBMainCamera.virtualCameraEntity defines which VirtualCamera entity is active at the moment.
4
+ * This component may hold 'repeated common.CameraTransition' transitionOverrides in the future
5
+ */
3
6
  /**
4
7
  * @public
5
8
  */
6
9
  export interface PBMainCamera {
7
- /** currently active virtual camera (default: 0) */
8
- virtualCameraEntity: number;
10
+ /** current active virtual camera */
11
+ virtualCameraEntity?: number | undefined;
9
12
  }
10
13
  /**
11
14
  * @public
@@ -8,7 +8,7 @@ exports.PBMainCamera = void 0;
8
8
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
9
9
  const protobufPackageSarasa = "decentraland.sdk.components";
10
10
  function createBasePBMainCamera() {
11
- return { virtualCameraEntity: 0 };
11
+ return { virtualCameraEntity: undefined };
12
12
  }
13
13
  /**
14
14
  * @public
@@ -16,7 +16,7 @@ function createBasePBMainCamera() {
16
16
  var PBMainCamera;
17
17
  (function (PBMainCamera) {
18
18
  function encode(message, writer = minimal_1.default.Writer.create()) {
19
- if (message.virtualCameraEntity !== 0) {
19
+ if (message.virtualCameraEntity !== undefined) {
20
20
  writer.uint32(8).uint32(message.virtualCameraEntity);
21
21
  }
22
22
  return writer;
@@ -2,7 +2,8 @@ import _m0 from "protobufjs/minimal";
2
2
  import { CameraTransition } from "./common/camera_transition.gen";
3
3
  /**
4
4
  * PBVirtualCamera represents a camera to be used at some point in time during the scene execution
5
- * * The defaultTransition represents the transition TOWARDS this camera.
5
+ * * The defaultTransition represents the transition TOWARDS this camera. If there is none, it's treated as
6
+ * an 'instant' transition (like using speed/time = 0)
6
7
  * * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
7
8
  * the holding entity transform).
8
9
  */
@@ -10,7 +11,7 @@ import { CameraTransition } from "./common/camera_transition.gen";
10
11
  * @public
11
12
  */
12
13
  export interface PBVirtualCamera {
13
- defaultTransition: CameraTransition | undefined;
14
+ defaultTransition?: CameraTransition | undefined;
14
15
  lookAtEntity?: number | undefined;
15
16
  }
16
17
  /**
@@ -49,20 +49,18 @@ function localMessageToNetwork(message, network, buffer, destinationBuffer) {
49
49
  destinationBuffer.writeBuffer(buffer.buffer().subarray(offset, buffer.currentWriteOffset()), false);
50
50
  }
51
51
  exports.localMessageToNetwork = localMessageToNetwork;
52
+ const buffer = new ByteBuffer_1.ReadWriteByteBuffer();
52
53
  /* istanbul ignore next */
53
54
  function fixTransformParent(message, transformValue, parent) {
55
+ buffer.resetBuffer();
54
56
  let transform = transformValue;
55
- const buffer = new ByteBuffer_1.ReadWriteByteBuffer();
56
57
  if (!transform && 'data' in message) {
57
- buffer.writeBuffer(message.data);
58
- transform = Transform_1.TransformSchema.deserialize(buffer);
59
- buffer.resetBuffer();
58
+ transform = Transform_1.TransformSchema.deserialize(new ByteBuffer_1.ReadWriteByteBuffer(message.data));
60
59
  }
61
60
  if (!transform)
62
61
  throw new Error('Invalid parent transform');
63
62
  // Generate new transform raw data with the parent
64
63
  const newTransform = { ...transform, parent };
65
- buffer.resetBuffer();
66
64
  Transform_1.TransformSchema.serialize(newTransform, buffer);
67
65
  return buffer.toBinary();
68
66
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcl/ecs",
3
3
  "description": "Decentraland ECS",
4
- "version": "7.5.8-10904608781.commit-ddc542d",
4
+ "version": "7.5.8-10907077327.commit-5bfdcc5",
5
5
  "author": "DCL",
6
6
  "bugs": "https://github.com/decentraland/ecs/issues",
7
7
  "files": [
@@ -33,5 +33,5 @@
33
33
  },
34
34
  "types": "./dist/index.d.ts",
35
35
  "typings": "./dist/index.d.ts",
36
- "commit": "ddc542de4ef0245a9a2b2542b4e5283151cab346"
36
+ "commit": "5bfdcc551dc6ac2aeb8eda376eb076bed72723f5"
37
37
  }