@dcl/protocol 1.0.0-21441285601.commit-d8a2d5b → 1.0.0-21456739795.commit-eae3f8b

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.
@@ -25,6 +25,29 @@ export const protobufPackage = "decentraland.sdk.components";
25
25
  *
26
26
  * It also supports simple visual feedback when interactions occur, by showing floating text.
27
27
  * More sophisticated feedback requires the use of other components.
28
+ *
29
+ * Distance rules
30
+ * --------------
31
+ * PointerEvents can enforce interaction range using two independent distance checks:
32
+ *
33
+ * - Camera distance (`max_distance`): distance from the active camera to the target entity.
34
+ * - Player distance (`max_player_distance`): distance from the avatar/player position to the target entity.
35
+ *
36
+ * How the interaction checks are combined:
37
+ *
38
+ * 1) Only `max_distance` is present
39
+ * - The interaction is allowed only if the camera distance is <= `max_distance`.
40
+ *
41
+ * 2) Only `max_player_distance` is present
42
+ * - The interaction is allowed only if the player distance is <= `max_player_distance`.
43
+ *
44
+ * 3) Both `max_distance` and `max_player_distance` are present
45
+ * - The interaction is allowed if ANY of the checks passes (OR logic):
46
+ * (camera distance <= `max_distance`) OR (player distance <= `max_player_distance`).
47
+ *
48
+ * 4) Neither `max_distance` nor `max_player_distance` is present
49
+ * - The system behaves as if `max_distance` were set to its default value (10),
50
+ * i.e., it uses the camera distance check with a threshold of 10.
28
51
  */
29
52
  export interface PBPointerEvents {
30
53
  /** the list of relevant events to detect */
@@ -49,7 +72,11 @@ export interface PBPointerEvents_Info {
49
72
  | boolean
50
73
  | undefined;
51
74
  /** enable or disable hover highlight (default true) */
52
- showHighlight?: boolean | undefined;
75
+ showHighlight?:
76
+ | boolean
77
+ | undefined;
78
+ /** range of interaction from the avatar's position (default 0) */
79
+ maxPlayerDistance?: number | undefined;
53
80
  }
54
81
 
55
82
  export interface PBPointerEvents_Entry {
@@ -130,6 +157,7 @@ function createBasePBPointerEvents_Info(): PBPointerEvents_Info {
130
157
  maxDistance: undefined,
131
158
  showFeedback: undefined,
132
159
  showHighlight: undefined,
160
+ maxPlayerDistance: undefined,
133
161
  };
134
162
  }
135
163
 
@@ -150,6 +178,9 @@ export namespace PBPointerEvents_Info {
150
178
  if (message.showHighlight !== undefined) {
151
179
  writer.uint32(40).bool(message.showHighlight);
152
180
  }
181
+ if (message.maxPlayerDistance !== undefined) {
182
+ writer.uint32(53).float(message.maxPlayerDistance);
183
+ }
153
184
  return writer;
154
185
  }
155
186
 
@@ -195,6 +226,13 @@ export namespace PBPointerEvents_Info {
195
226
 
196
227
  message.showHighlight = reader.bool();
197
228
  continue;
229
+ case 6:
230
+ if (tag !== 53) {
231
+ break;
232
+ }
233
+
234
+ message.maxPlayerDistance = reader.float();
235
+ continue;
198
236
  }
199
237
  if ((tag & 7) === 4 || tag === 0) {
200
238
  break;
@@ -211,6 +249,7 @@ export namespace PBPointerEvents_Info {
211
249
  maxDistance: isSet(object.maxDistance) ? Number(object.maxDistance) : undefined,
212
250
  showFeedback: isSet(object.showFeedback) ? Boolean(object.showFeedback) : undefined,
213
251
  showHighlight: isSet(object.showHighlight) ? Boolean(object.showHighlight) : undefined,
252
+ maxPlayerDistance: isSet(object.maxPlayerDistance) ? Number(object.maxPlayerDistance) : undefined,
214
253
  };
215
254
  }
216
255
 
@@ -222,6 +261,7 @@ export namespace PBPointerEvents_Info {
222
261
  message.maxDistance !== undefined && (obj.maxDistance = message.maxDistance);
223
262
  message.showFeedback !== undefined && (obj.showFeedback = message.showFeedback);
224
263
  message.showHighlight !== undefined && (obj.showHighlight = message.showHighlight);
264
+ message.maxPlayerDistance !== undefined && (obj.maxPlayerDistance = message.maxPlayerDistance);
225
265
  return obj;
226
266
  }
227
267
 
@@ -236,6 +276,7 @@ export namespace PBPointerEvents_Info {
236
276
  message.maxDistance = object.maxDistance ?? undefined;
237
277
  message.showFeedback = object.showFeedback ?? undefined;
238
278
  message.showHighlight = object.showHighlight ?? undefined;
279
+ message.maxPlayerDistance = object.maxPlayerDistance ?? undefined;
239
280
  return message;
240
281
  }
241
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/protocol",
3
- "version": "1.0.0-21441285601.commit-d8a2d5b",
3
+ "version": "1.0.0-21456739795.commit-eae3f8b",
4
4
  "description": "",
5
5
  "repository": "decentraland/protocol.git",
6
6
  "homepage": "https://github.com/decentraland/protocol#readme",
@@ -13,7 +13,7 @@
13
13
  "test": "./scripts/check-proto-compabitility.sh"
14
14
  },
15
15
  "devDependencies": {
16
- "@protobuf-ts/protoc": "^2.11.0",
16
+ "@protobuf-ts/protoc": "^2.8.1",
17
17
  "proto-compatibility-tool": "^1.1.2-20220925163655.commit-25bd040",
18
18
  "typescript": "^5.0.4"
19
19
  },
@@ -30,5 +30,5 @@
30
30
  "out-js",
31
31
  "public"
32
32
  ],
33
- "commit": "d8a2d5b681d7a9799cbc0d1d92305452f74c9ea7"
33
+ "commit": "eae3f8bdca1cca51c2af5ff5a66c72e2e2a0cfbb"
34
34
  }
@@ -18,7 +18,6 @@ message Packet {
18
18
  PlayerEmote player_emote = 9;
19
19
  SceneEmote scene_emote = 10;
20
20
  MovementCompressed movement_compressed = 12;
21
- LookAtPosition look_at_position = 13;
22
21
  }
23
22
  uint32 protocol_version = 11;
24
23
  }
@@ -56,46 +55,20 @@ message Movement {
56
55
  bool is_long_jump = 12;
57
56
  bool is_long_fall = 13;
58
57
  bool is_falling = 14;
58
+
59
59
  bool is_stunned = 15;
60
+
60
61
  float rotation_y = 16;
61
- // interpolation
62
- bool is_instant = 17;
63
- bool is_emoting = 18;
64
- // head-sync (enabled flags + world-space yaw and pitch angles, in degrees)
65
- bool head_ik_yaw_enabled = 19;
66
- bool head_ik_pitch_enabled = 20;
67
- float head_yaw = 21;
68
- float head_pitch = 22;
69
62
  }
70
63
 
71
64
  message MovementCompressed {
72
65
  int32 temporal_data = 1; // bit-compressed: timestamp + animations
73
66
  int64 movement_data = 2; // bit-compressed: position + velocity
74
- int32 head_sync_data = 3; // bit-compressed: enabled flags + yaw + pitch
75
67
  }
76
68
 
77
69
  message PlayerEmote {
78
70
  uint32 incremental_id = 1;
79
71
  string urn = 2;
80
- float timestamp = 3;
81
- optional bool is_stopping = 4; // true means the emote has been stopped in the sender's client
82
- optional bool is_repeating = 5; // true when it is not the first time the looping animation plays
83
- optional int32 interaction_id = 6; // identifies an interaction univocaly, established when the start animation is triggered
84
- optional int32 social_emote_outcome = 7; // -1 means it does not use an outcome animation
85
- optional bool is_reacting = 8; // to a social emote started by other user
86
- optional string social_emote_initiator = 9; // wallet address of the user that initiated social emote
87
- optional string target_avatar = 10; // wallet address of the user whose avatar is the target of a directed emote
88
- }
89
-
90
- // Message sent to force an avatar to look at a position
91
- message LookAtPosition
92
- {
93
- float timestamp = 1;
94
- // world position
95
- float position_x = 2;
96
- float position_y = 3;
97
- float position_z = 4;
98
- string target_avatar_wallet_address = 5;
99
72
  }
100
73
 
101
74
  message SceneEmote {
@@ -128,10 +101,6 @@ message ProfileResponse {
128
101
  message Chat {
129
102
  string message = 1;
130
103
  double timestamp = 2;
131
-
132
- // Extension: optional forwarded_from to identify the original sender when
133
- // messages are forwarded through an SFU
134
- optional string forwarded_from = 3;
135
104
  }
136
105
 
137
106
  message Scene {
@@ -17,7 +17,6 @@ enum InputAction {
17
17
  IA_ACTION_4 = 11;
18
18
  IA_ACTION_5 = 12;
19
19
  IA_ACTION_6 = 13;
20
- IA_MODIFIER = 14;
21
20
  }
22
21
 
23
22
  // PointerEventType is a kind of interaction that can be detected.
@@ -25,4 +25,4 @@ message PBLightSource {
25
25
  optional float inner_angle = 9; // default = 21.8. Inner angle can't be higher than outer angle, otherwise will default to same value. Min value is 0. Max value is 179.
26
26
  optional float outer_angle = 10; // default = 30. Outer angle can't be lower than inner angle, otherwise will inner angle will be set to same value. Max value is 179.
27
27
  }
28
- }
28
+ }
@@ -20,6 +20,29 @@ option (common.ecs_component_id) = 1062;
20
20
  //
21
21
  // It also supports simple visual feedback when interactions occur, by showing floating text.
22
22
  // More sophisticated feedback requires the use of other components.
23
+ //
24
+ // Distance rules
25
+ // --------------
26
+ // PointerEvents can enforce interaction range using two independent distance checks:
27
+ //
28
+ // - Camera distance (`max_distance`): distance from the active camera to the target entity.
29
+ // - Player distance (`max_player_distance`): distance from the avatar/player position to the target entity.
30
+ //
31
+ // How the interaction checks are combined:
32
+ //
33
+ // 1) Only `max_distance` is present
34
+ // - The interaction is allowed only if the camera distance is <= `max_distance`.
35
+ //
36
+ // 2) Only `max_player_distance` is present
37
+ // - The interaction is allowed only if the player distance is <= `max_player_distance`.
38
+ //
39
+ // 3) Both `max_distance` and `max_player_distance` are present
40
+ // - The interaction is allowed if ANY of the checks passes (OR logic):
41
+ // (camera distance <= `max_distance`) OR (player distance <= `max_player_distance`).
42
+ //
43
+ // 4) Neither `max_distance` nor `max_player_distance` is present
44
+ // - The system behaves as if `max_distance` were set to its default value (10),
45
+ // i.e., it uses the camera distance check with a threshold of 10.
23
46
  message PBPointerEvents {
24
47
  message Info {
25
48
  optional common.InputAction button = 1; // key/button in use (default IA_ANY)
@@ -27,6 +50,7 @@ message PBPointerEvents {
27
50
  optional float max_distance = 3; // range of interaction (default 10)
28
51
  optional bool show_feedback = 4; // enable or disable hover text and highlight (default true)
29
52
  optional bool show_highlight = 5; // enable or disable hover highlight (default true)
53
+ optional float max_player_distance = 6; // range of interaction from the avatar's position (default 0)
30
54
  }
31
55
 
32
56
  message Entry {
@@ -10,9 +10,7 @@ option (common.ecs_component_id) = 1076;
10
10
  // an 'instant' transition (like using speed/time = 0)
11
11
  // * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
12
12
  // the holding entity transform).
13
- // * The fov defines the Field of View of the virtual camera
14
13
  message PBVirtualCamera {
15
14
  optional common.CameraTransition default_transition = 1;
16
15
  optional uint32 look_at_entity = 2;
17
- optional float fov = 3; // default: 60
18
16
  }
@@ -1,44 +0,0 @@
1
- syntax = "proto3";
2
- package decentraland.sdk.components;
3
-
4
- import "decentraland/sdk/components/common/id.proto";
5
- option (common.ecs_component_id) = 1212;
6
-
7
- enum PBAudioAnalysisMode {
8
- MODE_RAW = 0;
9
- MODE_LOGARITHMIC = 1;
10
- }
11
-
12
- message PBAudioAnalysis {
13
-
14
- // Parameters section
15
- PBAudioAnalysisMode mode = 1;
16
-
17
- // Used only when mode == MODE_LOGARITHMIC
18
- optional float amplitude_gain = 100;
19
- optional float bands_gain = 101;
20
- // End when mode == MODE_LOGARITHMIC
21
-
22
- // End Parameters section
23
-
24
- // Result section
25
- float amplitude = 200;
26
-
27
- // Protobuf doesn't support fixed arrays -> 8 band fields
28
- float band_0 = 201;
29
- float band_1 = 202;
30
- float band_2 = 203;
31
- float band_3 = 204;
32
- float band_4 = 205;
33
- float band_5 = 206;
34
- float band_6 = 207;
35
- float band_7 = 208;
36
-
37
- // End Result section
38
-
39
- // Future fields
40
- // float spectral_centroid = 13;
41
- // float spectral_flux = 14;
42
- // bool onset = 15;
43
- // float bpm = 16;
44
- }
@@ -1,18 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package decentraland.sdk.components;
4
-
5
- import "decentraland/sdk/components/common/id.proto";
6
-
7
- option (common.ecs_component_id) = 1211;
8
-
9
- // The PBAvatarLocomotionSettings component allows scenes to modify locomotion settings defining things such
10
- // as the avatar movement speed, jump height etc.
11
- message PBAvatarLocomotionSettings {
12
- optional float walk_speed = 1; // Maximum speed when walking (in meters per second)
13
- optional float jog_speed = 2; // Maximum speed when jogging (in meters per second)
14
- optional float run_speed = 3; // Maximum speed when running (in meters per second)
15
- optional float jump_height = 4; // Height of a regular jump (in meters)
16
- optional float run_jump_height = 5; // Height of a jump while running (in meters)
17
- optional float hard_landing_cooldown = 6; // Cooldown time after a hard landing before the avatar can move again (in seconds)
18
- }