@dcl/protocol 1.0.0-4468031496.commit-eace17b → 1.0.0-4543854409.commit-89f5875

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.
Files changed (129) hide show
  1. package/out-js/decentraland/bff/authentication_service.gen.d.ts +2 -6
  2. package/out-js/decentraland/bff/authentication_service.gen.js +2 -2
  3. package/out-js/decentraland/bff/authentication_service.gen.js.map +1 -1
  4. package/out-js/decentraland/bff/comms_director_service.gen.d.ts +2 -6
  5. package/out-js/decentraland/bff/comms_director_service.gen.js +2 -2
  6. package/out-js/decentraland/bff/comms_director_service.gen.js.map +1 -1
  7. package/out-js/decentraland/bff/comms_service.gen.d.ts +7 -21
  8. package/out-js/decentraland/bff/comms_service.gen.js +7 -7
  9. package/out-js/decentraland/bff/comms_service.gen.js.map +1 -1
  10. package/out-js/decentraland/bff/http_endpoints.gen.d.ts +1 -3
  11. package/out-js/decentraland/bff/http_endpoints.gen.js +1 -1
  12. package/out-js/decentraland/bff/http_endpoints.gen.js.map +1 -1
  13. package/out-js/decentraland/bff/topics_service.gen.d.ts +3 -9
  14. package/out-js/decentraland/bff/topics_service.gen.js +3 -3
  15. package/out-js/decentraland/bff/topics_service.gen.js.map +1 -1
  16. package/out-js/decentraland/kernel/apis/communications_controller.gen.d.ts +1 -3
  17. package/out-js/decentraland/kernel/apis/communications_controller.gen.js +1 -1
  18. package/out-js/decentraland/kernel/apis/communications_controller.gen.js.map +1 -1
  19. package/out-js/decentraland/kernel/apis/dev_tools.gen.d.ts +1 -3
  20. package/out-js/decentraland/kernel/apis/dev_tools.gen.js +1 -1
  21. package/out-js/decentraland/kernel/apis/dev_tools.gen.js.map +1 -1
  22. package/out-js/decentraland/kernel/apis/engine_api.gen.d.ts +6 -18
  23. package/out-js/decentraland/kernel/apis/engine_api.gen.js +6 -6
  24. package/out-js/decentraland/kernel/apis/engine_api.gen.js.map +1 -1
  25. package/out-js/decentraland/kernel/apis/environment_api.gen.d.ts +7 -21
  26. package/out-js/decentraland/kernel/apis/environment_api.gen.js +7 -7
  27. package/out-js/decentraland/kernel/apis/environment_api.gen.js.map +1 -1
  28. package/out-js/decentraland/kernel/apis/ethereum_controller.gen.d.ts +5 -15
  29. package/out-js/decentraland/kernel/apis/ethereum_controller.gen.js +5 -5
  30. package/out-js/decentraland/kernel/apis/ethereum_controller.gen.js.map +1 -1
  31. package/out-js/decentraland/kernel/apis/parcel_identity.gen.d.ts +3 -9
  32. package/out-js/decentraland/kernel/apis/parcel_identity.gen.js +3 -3
  33. package/out-js/decentraland/kernel/apis/parcel_identity.gen.js.map +1 -1
  34. package/out-js/decentraland/kernel/apis/permissions.gen.d.ts +2 -6
  35. package/out-js/decentraland/kernel/apis/permissions.gen.js +2 -2
  36. package/out-js/decentraland/kernel/apis/permissions.gen.js.map +1 -1
  37. package/out-js/decentraland/kernel/apis/players.gen.d.ts +3 -9
  38. package/out-js/decentraland/kernel/apis/players.gen.js +3 -3
  39. package/out-js/decentraland/kernel/apis/players.gen.js.map +1 -1
  40. package/out-js/decentraland/kernel/apis/portable_experiences.gen.d.ts +4 -12
  41. package/out-js/decentraland/kernel/apis/portable_experiences.gen.js +4 -4
  42. package/out-js/decentraland/kernel/apis/portable_experiences.gen.js.map +1 -1
  43. package/out-js/decentraland/kernel/apis/restricted_actions.gen.d.ts +7 -21
  44. package/out-js/decentraland/kernel/apis/restricted_actions.gen.js +7 -7
  45. package/out-js/decentraland/kernel/apis/restricted_actions.gen.js.map +1 -1
  46. package/out-js/decentraland/kernel/apis/runtime.gen.d.ts +2 -6
  47. package/out-js/decentraland/kernel/apis/runtime.gen.js +2 -2
  48. package/out-js/decentraland/kernel/apis/runtime.gen.js.map +1 -1
  49. package/out-js/decentraland/kernel/apis/scene.gen.d.ts +1 -3
  50. package/out-js/decentraland/kernel/apis/scene.gen.js +1 -1
  51. package/out-js/decentraland/kernel/apis/scene.gen.js.map +1 -1
  52. package/out-js/decentraland/kernel/apis/signed_fetch.gen.d.ts +1 -3
  53. package/out-js/decentraland/kernel/apis/signed_fetch.gen.js +1 -1
  54. package/out-js/decentraland/kernel/apis/signed_fetch.gen.js.map +1 -1
  55. package/out-js/decentraland/kernel/apis/social_controller.gen.d.ts +1 -3
  56. package/out-js/decentraland/kernel/apis/social_controller.gen.js +1 -1
  57. package/out-js/decentraland/kernel/apis/social_controller.gen.js.map +1 -1
  58. package/out-js/decentraland/kernel/apis/user_action_module.gen.d.ts +1 -3
  59. package/out-js/decentraland/kernel/apis/user_action_module.gen.js +1 -1
  60. package/out-js/decentraland/kernel/apis/user_action_module.gen.js.map +1 -1
  61. package/out-js/decentraland/kernel/apis/user_identity.gen.d.ts +2 -6
  62. package/out-js/decentraland/kernel/apis/user_identity.gen.js +2 -2
  63. package/out-js/decentraland/kernel/apis/user_identity.gen.js.map +1 -1
  64. package/out-js/decentraland/sdk/components/common/camera_type.gen.d.ts +2 -0
  65. package/out-js/decentraland/sdk/components/common/camera_type.gen.js +7 -0
  66. package/out-js/decentraland/sdk/components/common/camera_type.gen.js.map +1 -1
  67. package/out-js/decentraland/sdk/components/common/input_action.gen.d.ts +10 -0
  68. package/out-js/decentraland/sdk/components/common/input_action.gen.js +47 -1
  69. package/out-js/decentraland/sdk/components/common/input_action.gen.js.map +1 -1
  70. package/out-js/decentraland/sdk/components/common/raycast_hit.gen.d.ts +173 -0
  71. package/out-js/decentraland/sdk/components/common/raycast_hit.gen.js +156 -0
  72. package/out-js/decentraland/sdk/components/common/raycast_hit.gen.js.map +1 -0
  73. package/out-js/decentraland/sdk/components/mesh_collider.gen.d.ts +15 -1
  74. package/out-js/decentraland/sdk/components/mesh_collider.gen.js +85 -1
  75. package/out-js/decentraland/sdk/components/mesh_collider.gen.js.map +1 -1
  76. package/out-js/decentraland/sdk/components/pointer_events.gen.d.ts +1 -11
  77. package/out-js/decentraland/sdk/components/pointer_events.gen.js +3 -49
  78. package/out-js/decentraland/sdk/components/pointer_events.gen.js.map +1 -1
  79. package/out-js/decentraland/sdk/components/pointer_events_result.gen.d.ts +10 -11
  80. package/out-js/decentraland/sdk/components/pointer_events_result.gen.js +10 -11
  81. package/out-js/decentraland/sdk/components/pointer_events_result.gen.js.map +1 -1
  82. package/out-js/decentraland/sdk/components/raycast.gen.d.ts +239 -38
  83. package/out-js/decentraland/sdk/components/raycast.gen.js +145 -20
  84. package/out-js/decentraland/sdk/components/raycast.gen.js.map +1 -1
  85. package/out-js/decentraland/sdk/components/raycast_result.gen.d.ts +26 -176
  86. package/out-js/decentraland/sdk/components/raycast_result.gen.js +21 -186
  87. package/out-js/decentraland/sdk/components/raycast_result.gen.js.map +1 -1
  88. package/out-js/decentraland/social/friendships/friendships.gen.d.ts +4 -12
  89. package/out-js/decentraland/social/friendships/friendships.gen.js +4 -4
  90. package/out-js/decentraland/social/friendships/friendships.gen.js.map +1 -1
  91. package/out-ts/decentraland/bff/authentication_service.gen.ts +2 -2
  92. package/out-ts/decentraland/bff/comms_director_service.gen.ts +2 -2
  93. package/out-ts/decentraland/bff/comms_service.gen.ts +7 -7
  94. package/out-ts/decentraland/bff/http_endpoints.gen.ts +1 -1
  95. package/out-ts/decentraland/bff/topics_service.gen.ts +3 -3
  96. package/out-ts/decentraland/kernel/apis/communications_controller.gen.ts +1 -1
  97. package/out-ts/decentraland/kernel/apis/dev_tools.gen.ts +1 -1
  98. package/out-ts/decentraland/kernel/apis/engine_api.gen.ts +6 -6
  99. package/out-ts/decentraland/kernel/apis/environment_api.gen.ts +7 -7
  100. package/out-ts/decentraland/kernel/apis/ethereum_controller.gen.ts +5 -5
  101. package/out-ts/decentraland/kernel/apis/parcel_identity.gen.ts +3 -3
  102. package/out-ts/decentraland/kernel/apis/permissions.gen.ts +2 -2
  103. package/out-ts/decentraland/kernel/apis/players.gen.ts +3 -3
  104. package/out-ts/decentraland/kernel/apis/portable_experiences.gen.ts +4 -4
  105. package/out-ts/decentraland/kernel/apis/restricted_actions.gen.ts +7 -7
  106. package/out-ts/decentraland/kernel/apis/runtime.gen.ts +2 -2
  107. package/out-ts/decentraland/kernel/apis/scene.gen.ts +1 -1
  108. package/out-ts/decentraland/kernel/apis/signed_fetch.gen.ts +1 -1
  109. package/out-ts/decentraland/kernel/apis/social_controller.gen.ts +1 -1
  110. package/out-ts/decentraland/kernel/apis/user_action_module.gen.ts +1 -1
  111. package/out-ts/decentraland/kernel/apis/user_identity.gen.ts +2 -2
  112. package/out-ts/decentraland/sdk/components/common/camera_type.gen.ts +7 -0
  113. package/out-ts/decentraland/sdk/components/common/input_action.gen.ts +46 -0
  114. package/out-ts/decentraland/sdk/components/common/raycast_hit.gen.ts +204 -0
  115. package/out-ts/decentraland/sdk/components/mesh_collider.gen.ts +85 -1
  116. package/out-ts/decentraland/sdk/components/pointer_events.gen.ts +8 -47
  117. package/out-ts/decentraland/sdk/components/pointer_events_result.gen.ts +11 -5
  118. package/out-ts/decentraland/sdk/components/raycast.gen.ts +180 -26
  119. package/out-ts/decentraland/sdk/components/raycast_result.gen.ts +24 -232
  120. package/out-ts/decentraland/social/friendships/friendships.gen.ts +4 -4
  121. package/package.json +2 -2
  122. package/proto/decentraland/sdk/components/common/camera_type.proto +1 -0
  123. package/proto/decentraland/sdk/components/common/input_action.proto +8 -0
  124. package/proto/decentraland/sdk/components/common/raycast_hit.proto +16 -0
  125. package/proto/decentraland/sdk/components/mesh_collider.proto +17 -3
  126. package/proto/decentraland/sdk/components/pointer_events.proto +1 -9
  127. package/proto/decentraland/sdk/components/pointer_events_result.proto +5 -6
  128. package/proto/decentraland/sdk/components/raycast.proto +39 -4
  129. package/proto/decentraland/sdk/components/raycast_result.proto +9 -19
@@ -6,8 +6,12 @@ export const protobufPackage = "decentraland.sdk.components";
6
6
 
7
7
  /** RaycastQueryType indicates whether the ray should stop on the first collition, or continue. */
8
8
  export enum RaycastQueryType {
9
+ /** RQT_HIT_FIRST - Pick the first (not necessarily the closest) hit within the range */
9
10
  RQT_HIT_FIRST = 0,
11
+ /** RQT_QUERY_ALL - Pick all hits within the range */
10
12
  RQT_QUERY_ALL = 1,
13
+ /** RQT_NONE - Do not perform the raycast, only set the raycast result with empty hits */
14
+ RQT_NONE = 2,
11
15
  UNRECOGNIZED = -1,
12
16
  }
13
17
 
@@ -19,6 +23,9 @@ export function raycastQueryTypeFromJSON(object: any): RaycastQueryType {
19
23
  case 1:
20
24
  case "RQT_QUERY_ALL":
21
25
  return RaycastQueryType.RQT_QUERY_ALL;
26
+ case 2:
27
+ case "RQT_NONE":
28
+ return RaycastQueryType.RQT_NONE;
22
29
  case -1:
23
30
  case "UNRECOGNIZED":
24
31
  default:
@@ -32,6 +39,8 @@ export function raycastQueryTypeToJSON(object: RaycastQueryType): string {
32
39
  return "RQT_HIT_FIRST";
33
40
  case RaycastQueryType.RQT_QUERY_ALL:
34
41
  return "RQT_QUERY_ALL";
42
+ case RaycastQueryType.RQT_NONE:
43
+ return "RQT_NONE";
35
44
  case RaycastQueryType.UNRECOGNIZED:
36
45
  default:
37
46
  return "UNRECOGNIZED";
@@ -39,35 +48,74 @@ export function raycastQueryTypeToJSON(object: RaycastQueryType): string {
39
48
  }
40
49
 
41
50
  /**
51
+ * The PBRaycast component and PBRaycastResult are defined in https://adr.decentraland.org/adr/ADR-200
52
+ *
42
53
  * The Raycast component allows scenes to request raycasting from the game engine. The results will
43
54
  * be available in a RaycastResult component set later on the same Entity.
44
55
  */
45
56
  export interface PBRaycast {
46
- /** the starting point of the ray in 3D space */
47
- origin:
48
- | Vector3
57
+ /** Correlation ID, defined by the scene and used internally by the scene */
58
+ timestamp?:
59
+ | number
49
60
  | undefined;
50
- /** the direction of the ray in 3D space */
51
- direction:
52
- | Vector3
53
- | undefined;
54
- /** the maximum length of the ray */
61
+ /**
62
+ * How much to offset the starting point of the ray, relative to the entity's transform.
63
+ * Defaults to vec3(0,0,0)
64
+ */
65
+ originOffset?: Vector3 | undefined;
66
+ direction?:
67
+ | { $case: "localDirection"; localDirection: Vector3 }
68
+ | { $case: "globalDirection"; globalDirection: Vector3 }
69
+ | { $case: "globalTarget"; globalTarget: Vector3 }
70
+ | { $case: "targetEntity"; targetEntity: number };
71
+ /** Maximum length of the ray in virtual meters (global space) */
55
72
  maxDistance: number;
56
- /** the RaycastQueryType behavior (see above) */
73
+ /** the RaycastQueryType behavior */
57
74
  queryType: RaycastQueryType;
75
+ /**
76
+ * Indicates the renderer to perform the raycast on every scene tick (ADR-148),
77
+ * otherwise it will be performed only once, defaults to false
78
+ */
79
+ continuous?:
80
+ | boolean
81
+ | undefined;
82
+ /** Collision mask, by default all bits are 1 (0xFFFF_FFFF) */
83
+ collisionMask?: number | undefined;
58
84
  }
59
85
 
60
86
  function createBasePBRaycast(): PBRaycast {
61
- return { origin: undefined, direction: undefined, maxDistance: 0, queryType: 0 };
87
+ return {
88
+ timestamp: undefined,
89
+ originOffset: undefined,
90
+ direction: undefined,
91
+ maxDistance: 0,
92
+ queryType: 0,
93
+ continuous: undefined,
94
+ collisionMask: undefined,
95
+ };
62
96
  }
63
97
 
64
98
  export const PBRaycast = {
65
99
  encode(message: PBRaycast, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
66
- if (message.origin !== undefined) {
67
- Vector3.encode(message.origin, writer.uint32(18).fork()).ldelim();
100
+ if (message.timestamp !== undefined) {
101
+ writer.uint32(8).uint32(message.timestamp);
102
+ }
103
+ if (message.originOffset !== undefined) {
104
+ Vector3.encode(message.originOffset, writer.uint32(18).fork()).ldelim();
68
105
  }
69
- if (message.direction !== undefined) {
70
- Vector3.encode(message.direction, writer.uint32(26).fork()).ldelim();
106
+ switch (message.direction?.$case) {
107
+ case "localDirection":
108
+ Vector3.encode(message.direction.localDirection, writer.uint32(50).fork()).ldelim();
109
+ break;
110
+ case "globalDirection":
111
+ Vector3.encode(message.direction.globalDirection, writer.uint32(26).fork()).ldelim();
112
+ break;
113
+ case "globalTarget":
114
+ Vector3.encode(message.direction.globalTarget, writer.uint32(58).fork()).ldelim();
115
+ break;
116
+ case "targetEntity":
117
+ writer.uint32(80).uint32(message.direction.targetEntity);
118
+ break;
71
119
  }
72
120
  if (message.maxDistance !== 0) {
73
121
  writer.uint32(37).float(message.maxDistance);
@@ -75,6 +123,12 @@ export const PBRaycast = {
75
123
  if (message.queryType !== 0) {
76
124
  writer.uint32(40).int32(message.queryType);
77
125
  }
126
+ if (message.continuous !== undefined) {
127
+ writer.uint32(64).bool(message.continuous);
128
+ }
129
+ if (message.collisionMask !== undefined) {
130
+ writer.uint32(72).uint32(message.collisionMask);
131
+ }
78
132
  return writer;
79
133
  },
80
134
 
@@ -85,19 +139,47 @@ export const PBRaycast = {
85
139
  while (reader.pos < end) {
86
140
  const tag = reader.uint32();
87
141
  switch (tag >>> 3) {
142
+ case 1:
143
+ if (tag != 8) {
144
+ break;
145
+ }
146
+
147
+ message.timestamp = reader.uint32();
148
+ continue;
88
149
  case 2:
89
150
  if (tag != 18) {
90
151
  break;
91
152
  }
92
153
 
93
- message.origin = Vector3.decode(reader, reader.uint32());
154
+ message.originOffset = Vector3.decode(reader, reader.uint32());
155
+ continue;
156
+ case 6:
157
+ if (tag != 50) {
158
+ break;
159
+ }
160
+
161
+ message.direction = { $case: "localDirection", localDirection: Vector3.decode(reader, reader.uint32()) };
94
162
  continue;
95
163
  case 3:
96
164
  if (tag != 26) {
97
165
  break;
98
166
  }
99
167
 
100
- message.direction = Vector3.decode(reader, reader.uint32());
168
+ message.direction = { $case: "globalDirection", globalDirection: Vector3.decode(reader, reader.uint32()) };
169
+ continue;
170
+ case 7:
171
+ if (tag != 58) {
172
+ break;
173
+ }
174
+
175
+ message.direction = { $case: "globalTarget", globalTarget: Vector3.decode(reader, reader.uint32()) };
176
+ continue;
177
+ case 10:
178
+ if (tag != 80) {
179
+ break;
180
+ }
181
+
182
+ message.direction = { $case: "targetEntity", targetEntity: reader.uint32() };
101
183
  continue;
102
184
  case 4:
103
185
  if (tag != 37) {
@@ -113,6 +195,20 @@ export const PBRaycast = {
113
195
 
114
196
  message.queryType = reader.int32() as any;
115
197
  continue;
198
+ case 8:
199
+ if (tag != 64) {
200
+ break;
201
+ }
202
+
203
+ message.continuous = reader.bool();
204
+ continue;
205
+ case 9:
206
+ if (tag != 72) {
207
+ break;
208
+ }
209
+
210
+ message.collisionMask = reader.uint32();
211
+ continue;
116
212
  }
117
213
  if ((tag & 7) == 4 || tag == 0) {
118
214
  break;
@@ -124,20 +220,44 @@ export const PBRaycast = {
124
220
 
125
221
  fromJSON(object: any): PBRaycast {
126
222
  return {
127
- origin: isSet(object.origin) ? Vector3.fromJSON(object.origin) : undefined,
128
- direction: isSet(object.direction) ? Vector3.fromJSON(object.direction) : undefined,
223
+ timestamp: isSet(object.timestamp) ? Number(object.timestamp) : undefined,
224
+ originOffset: isSet(object.originOffset) ? Vector3.fromJSON(object.originOffset) : undefined,
225
+ direction: isSet(object.localDirection)
226
+ ? { $case: "localDirection", localDirection: Vector3.fromJSON(object.localDirection) }
227
+ : isSet(object.globalDirection)
228
+ ? { $case: "globalDirection", globalDirection: Vector3.fromJSON(object.globalDirection) }
229
+ : isSet(object.globalTarget)
230
+ ? { $case: "globalTarget", globalTarget: Vector3.fromJSON(object.globalTarget) }
231
+ : isSet(object.targetEntity)
232
+ ? { $case: "targetEntity", targetEntity: Number(object.targetEntity) }
233
+ : undefined,
129
234
  maxDistance: isSet(object.maxDistance) ? Number(object.maxDistance) : 0,
130
235
  queryType: isSet(object.queryType) ? raycastQueryTypeFromJSON(object.queryType) : 0,
236
+ continuous: isSet(object.continuous) ? Boolean(object.continuous) : undefined,
237
+ collisionMask: isSet(object.collisionMask) ? Number(object.collisionMask) : undefined,
131
238
  };
132
239
  },
133
240
 
134
241
  toJSON(message: PBRaycast): unknown {
135
242
  const obj: any = {};
136
- message.origin !== undefined && (obj.origin = message.origin ? Vector3.toJSON(message.origin) : undefined);
137
- message.direction !== undefined &&
138
- (obj.direction = message.direction ? Vector3.toJSON(message.direction) : undefined);
243
+ message.timestamp !== undefined && (obj.timestamp = Math.round(message.timestamp));
244
+ message.originOffset !== undefined &&
245
+ (obj.originOffset = message.originOffset ? Vector3.toJSON(message.originOffset) : undefined);
246
+ message.direction?.$case === "localDirection" && (obj.localDirection = message.direction?.localDirection
247
+ ? Vector3.toJSON(message.direction?.localDirection)
248
+ : undefined);
249
+ message.direction?.$case === "globalDirection" && (obj.globalDirection = message.direction?.globalDirection
250
+ ? Vector3.toJSON(message.direction?.globalDirection)
251
+ : undefined);
252
+ message.direction?.$case === "globalTarget" &&
253
+ (obj.globalTarget = message.direction?.globalTarget
254
+ ? Vector3.toJSON(message.direction?.globalTarget)
255
+ : undefined);
256
+ message.direction?.$case === "targetEntity" && (obj.targetEntity = Math.round(message.direction?.targetEntity));
139
257
  message.maxDistance !== undefined && (obj.maxDistance = message.maxDistance);
140
258
  message.queryType !== undefined && (obj.queryType = raycastQueryTypeToJSON(message.queryType));
259
+ message.continuous !== undefined && (obj.continuous = message.continuous);
260
+ message.collisionMask !== undefined && (obj.collisionMask = Math.round(message.collisionMask));
141
261
  return obj;
142
262
  },
143
263
 
@@ -147,14 +267,48 @@ export const PBRaycast = {
147
267
 
148
268
  fromPartial<I extends Exact<DeepPartial<PBRaycast>, I>>(object: I): PBRaycast {
149
269
  const message = createBasePBRaycast();
150
- message.origin = (object.origin !== undefined && object.origin !== null)
151
- ? Vector3.fromPartial(object.origin)
152
- : undefined;
153
- message.direction = (object.direction !== undefined && object.direction !== null)
154
- ? Vector3.fromPartial(object.direction)
270
+ message.timestamp = object.timestamp ?? undefined;
271
+ message.originOffset = (object.originOffset !== undefined && object.originOffset !== null)
272
+ ? Vector3.fromPartial(object.originOffset)
155
273
  : undefined;
274
+ if (
275
+ object.direction?.$case === "localDirection" &&
276
+ object.direction?.localDirection !== undefined &&
277
+ object.direction?.localDirection !== null
278
+ ) {
279
+ message.direction = {
280
+ $case: "localDirection",
281
+ localDirection: Vector3.fromPartial(object.direction.localDirection),
282
+ };
283
+ }
284
+ if (
285
+ object.direction?.$case === "globalDirection" &&
286
+ object.direction?.globalDirection !== undefined &&
287
+ object.direction?.globalDirection !== null
288
+ ) {
289
+ message.direction = {
290
+ $case: "globalDirection",
291
+ globalDirection: Vector3.fromPartial(object.direction.globalDirection),
292
+ };
293
+ }
294
+ if (
295
+ object.direction?.$case === "globalTarget" &&
296
+ object.direction?.globalTarget !== undefined &&
297
+ object.direction?.globalTarget !== null
298
+ ) {
299
+ message.direction = { $case: "globalTarget", globalTarget: Vector3.fromPartial(object.direction.globalTarget) };
300
+ }
301
+ if (
302
+ object.direction?.$case === "targetEntity" &&
303
+ object.direction?.targetEntity !== undefined &&
304
+ object.direction?.targetEntity !== null
305
+ ) {
306
+ message.direction = { $case: "targetEntity", targetEntity: object.direction.targetEntity };
307
+ }
156
308
  message.maxDistance = object.maxDistance ?? 0;
157
309
  message.queryType = object.queryType ?? 0;
310
+ message.continuous = object.continuous ?? undefined;
311
+ message.collisionMask = object.collisionMask ?? undefined;
158
312
  return message;
159
313
  },
160
314
  };
@@ -1,23 +1,27 @@
1
1
  /* eslint-disable */
2
- import Long from "long";
3
2
  import _m0 from "protobufjs/minimal";
4
3
  import { Vector3 } from "../../common/vectors.gen";
4
+ import { RaycastHit } from "./common/raycast_hit.gen";
5
5
 
6
6
  export const protobufPackage = "decentraland.sdk.components";
7
7
 
8
8
  /**
9
+ * The PBRaycast component and PBRaycastResult are defined in https://adr.decentraland.org/adr/ADR-200
10
+ *
9
11
  * The RaycastResult component is added to an Entity when the results of a previously attached
10
12
  * Raycast component are available. It contains information about the ray and any objects it
11
13
  * collided with.
12
14
  */
13
15
  export interface PBRaycastResult {
14
- /** the timestamp of the Raycast component addition */
15
- timestamp: number;
16
- /** the starting point of the ray */
17
- origin:
16
+ /** timestamp is a correlation id, copied from the PBRaycast */
17
+ timestamp?:
18
+ | number
19
+ | undefined;
20
+ /** the starting point of the ray in global coordinates */
21
+ globalOrigin:
18
22
  | Vector3
19
23
  | undefined;
20
- /** the direction vector of the ray */
24
+ /** the direction vector of the ray in global coordinates */
21
25
  direction:
22
26
  | Vector3
23
27
  | undefined;
@@ -25,45 +29,17 @@ export interface PBRaycastResult {
25
29
  hits: RaycastHit[];
26
30
  }
27
31
 
28
- /** RaycastHit contains information about the intersection of a ray with a mesh. */
29
- export interface RaycastHit {
30
- /** Position will be relative to the scene */
31
- position:
32
- | Vector3
33
- | undefined;
34
- /** the starting point of the ray */
35
- origin:
36
- | Vector3
37
- | undefined;
38
- /** the direction vector of the ray */
39
- direction:
40
- | Vector3
41
- | undefined;
42
- /** the entry vector of the ray into the collision mesh */
43
- normalHit:
44
- | Vector3
45
- | undefined;
46
- /** the distance between the ray origin and the hit position */
47
- length: number;
48
- /** (unused) mesh ID if collision happened inside a GltfContainer */
49
- meshName?:
50
- | string
51
- | undefined;
52
- /** the ID of the Entity that has the impacted mesh attached */
53
- entityId?: number | undefined;
54
- }
55
-
56
32
  function createBasePBRaycastResult(): PBRaycastResult {
57
- return { timestamp: 0, origin: undefined, direction: undefined, hits: [] };
33
+ return { timestamp: undefined, globalOrigin: undefined, direction: undefined, hits: [] };
58
34
  }
59
35
 
60
36
  export const PBRaycastResult = {
61
37
  encode(message: PBRaycastResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
62
- if (message.timestamp !== 0) {
63
- writer.uint32(8).int32(message.timestamp);
38
+ if (message.timestamp !== undefined) {
39
+ writer.uint32(8).uint32(message.timestamp);
64
40
  }
65
- if (message.origin !== undefined) {
66
- Vector3.encode(message.origin, writer.uint32(18).fork()).ldelim();
41
+ if (message.globalOrigin !== undefined) {
42
+ Vector3.encode(message.globalOrigin, writer.uint32(18).fork()).ldelim();
67
43
  }
68
44
  if (message.direction !== undefined) {
69
45
  Vector3.encode(message.direction, writer.uint32(26).fork()).ldelim();
@@ -86,14 +62,14 @@ export const PBRaycastResult = {
86
62
  break;
87
63
  }
88
64
 
89
- message.timestamp = reader.int32();
65
+ message.timestamp = reader.uint32();
90
66
  continue;
91
67
  case 2:
92
68
  if (tag != 18) {
93
69
  break;
94
70
  }
95
71
 
96
- message.origin = Vector3.decode(reader, reader.uint32());
72
+ message.globalOrigin = Vector3.decode(reader, reader.uint32());
97
73
  continue;
98
74
  case 3:
99
75
  if (tag != 26) {
@@ -120,8 +96,8 @@ export const PBRaycastResult = {
120
96
 
121
97
  fromJSON(object: any): PBRaycastResult {
122
98
  return {
123
- timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0,
124
- origin: isSet(object.origin) ? Vector3.fromJSON(object.origin) : undefined,
99
+ timestamp: isSet(object.timestamp) ? Number(object.timestamp) : undefined,
100
+ globalOrigin: isSet(object.globalOrigin) ? Vector3.fromJSON(object.globalOrigin) : undefined,
125
101
  direction: isSet(object.direction) ? Vector3.fromJSON(object.direction) : undefined,
126
102
  hits: Array.isArray(object?.hits) ? object.hits.map((e: any) => RaycastHit.fromJSON(e)) : [],
127
103
  };
@@ -130,7 +106,8 @@ export const PBRaycastResult = {
130
106
  toJSON(message: PBRaycastResult): unknown {
131
107
  const obj: any = {};
132
108
  message.timestamp !== undefined && (obj.timestamp = Math.round(message.timestamp));
133
- message.origin !== undefined && (obj.origin = message.origin ? Vector3.toJSON(message.origin) : undefined);
109
+ message.globalOrigin !== undefined &&
110
+ (obj.globalOrigin = message.globalOrigin ? Vector3.toJSON(message.globalOrigin) : undefined);
134
111
  message.direction !== undefined &&
135
112
  (obj.direction = message.direction ? Vector3.toJSON(message.direction) : undefined);
136
113
  if (message.hits) {
@@ -147,9 +124,9 @@ export const PBRaycastResult = {
147
124
 
148
125
  fromPartial<I extends Exact<DeepPartial<PBRaycastResult>, I>>(object: I): PBRaycastResult {
149
126
  const message = createBasePBRaycastResult();
150
- message.timestamp = object.timestamp ?? 0;
151
- message.origin = (object.origin !== undefined && object.origin !== null)
152
- ? Vector3.fromPartial(object.origin)
127
+ message.timestamp = object.timestamp ?? undefined;
128
+ message.globalOrigin = (object.globalOrigin !== undefined && object.globalOrigin !== null)
129
+ ? Vector3.fromPartial(object.globalOrigin)
153
130
  : undefined;
154
131
  message.direction = (object.direction !== undefined && object.direction !== null)
155
132
  ? Vector3.fromPartial(object.direction)
@@ -159,179 +136,6 @@ export const PBRaycastResult = {
159
136
  },
160
137
  };
161
138
 
162
- function createBaseRaycastHit(): RaycastHit {
163
- return {
164
- position: undefined,
165
- origin: undefined,
166
- direction: undefined,
167
- normalHit: undefined,
168
- length: 0,
169
- meshName: undefined,
170
- entityId: undefined,
171
- };
172
- }
173
-
174
- export const RaycastHit = {
175
- encode(message: RaycastHit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
176
- if (message.position !== undefined) {
177
- Vector3.encode(message.position, writer.uint32(10).fork()).ldelim();
178
- }
179
- if (message.origin !== undefined) {
180
- Vector3.encode(message.origin, writer.uint32(18).fork()).ldelim();
181
- }
182
- if (message.direction !== undefined) {
183
- Vector3.encode(message.direction, writer.uint32(26).fork()).ldelim();
184
- }
185
- if (message.normalHit !== undefined) {
186
- Vector3.encode(message.normalHit, writer.uint32(34).fork()).ldelim();
187
- }
188
- if (message.length !== 0) {
189
- writer.uint32(45).float(message.length);
190
- }
191
- if (message.meshName !== undefined) {
192
- writer.uint32(50).string(message.meshName);
193
- }
194
- if (message.entityId !== undefined) {
195
- writer.uint32(56).int64(message.entityId);
196
- }
197
- return writer;
198
- },
199
-
200
- decode(input: _m0.Reader | Uint8Array, length?: number): RaycastHit {
201
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
202
- let end = length === undefined ? reader.len : reader.pos + length;
203
- const message = createBaseRaycastHit();
204
- while (reader.pos < end) {
205
- const tag = reader.uint32();
206
- switch (tag >>> 3) {
207
- case 1:
208
- if (tag != 10) {
209
- break;
210
- }
211
-
212
- message.position = Vector3.decode(reader, reader.uint32());
213
- continue;
214
- case 2:
215
- if (tag != 18) {
216
- break;
217
- }
218
-
219
- message.origin = Vector3.decode(reader, reader.uint32());
220
- continue;
221
- case 3:
222
- if (tag != 26) {
223
- break;
224
- }
225
-
226
- message.direction = Vector3.decode(reader, reader.uint32());
227
- continue;
228
- case 4:
229
- if (tag != 34) {
230
- break;
231
- }
232
-
233
- message.normalHit = Vector3.decode(reader, reader.uint32());
234
- continue;
235
- case 5:
236
- if (tag != 45) {
237
- break;
238
- }
239
-
240
- message.length = reader.float();
241
- continue;
242
- case 6:
243
- if (tag != 50) {
244
- break;
245
- }
246
-
247
- message.meshName = reader.string();
248
- continue;
249
- case 7:
250
- if (tag != 56) {
251
- break;
252
- }
253
-
254
- message.entityId = longToNumber(reader.int64() as Long);
255
- continue;
256
- }
257
- if ((tag & 7) == 4 || tag == 0) {
258
- break;
259
- }
260
- reader.skipType(tag & 7);
261
- }
262
- return message;
263
- },
264
-
265
- fromJSON(object: any): RaycastHit {
266
- return {
267
- position: isSet(object.position) ? Vector3.fromJSON(object.position) : undefined,
268
- origin: isSet(object.origin) ? Vector3.fromJSON(object.origin) : undefined,
269
- direction: isSet(object.direction) ? Vector3.fromJSON(object.direction) : undefined,
270
- normalHit: isSet(object.normalHit) ? Vector3.fromJSON(object.normalHit) : undefined,
271
- length: isSet(object.length) ? Number(object.length) : 0,
272
- meshName: isSet(object.meshName) ? String(object.meshName) : undefined,
273
- entityId: isSet(object.entityId) ? Number(object.entityId) : undefined,
274
- };
275
- },
276
-
277
- toJSON(message: RaycastHit): unknown {
278
- const obj: any = {};
279
- message.position !== undefined && (obj.position = message.position ? Vector3.toJSON(message.position) : undefined);
280
- message.origin !== undefined && (obj.origin = message.origin ? Vector3.toJSON(message.origin) : undefined);
281
- message.direction !== undefined &&
282
- (obj.direction = message.direction ? Vector3.toJSON(message.direction) : undefined);
283
- message.normalHit !== undefined &&
284
- (obj.normalHit = message.normalHit ? Vector3.toJSON(message.normalHit) : undefined);
285
- message.length !== undefined && (obj.length = message.length);
286
- message.meshName !== undefined && (obj.meshName = message.meshName);
287
- message.entityId !== undefined && (obj.entityId = Math.round(message.entityId));
288
- return obj;
289
- },
290
-
291
- create<I extends Exact<DeepPartial<RaycastHit>, I>>(base?: I): RaycastHit {
292
- return RaycastHit.fromPartial(base ?? {});
293
- },
294
-
295
- fromPartial<I extends Exact<DeepPartial<RaycastHit>, I>>(object: I): RaycastHit {
296
- const message = createBaseRaycastHit();
297
- message.position = (object.position !== undefined && object.position !== null)
298
- ? Vector3.fromPartial(object.position)
299
- : undefined;
300
- message.origin = (object.origin !== undefined && object.origin !== null)
301
- ? Vector3.fromPartial(object.origin)
302
- : undefined;
303
- message.direction = (object.direction !== undefined && object.direction !== null)
304
- ? Vector3.fromPartial(object.direction)
305
- : undefined;
306
- message.normalHit = (object.normalHit !== undefined && object.normalHit !== null)
307
- ? Vector3.fromPartial(object.normalHit)
308
- : undefined;
309
- message.length = object.length ?? 0;
310
- message.meshName = object.meshName ?? undefined;
311
- message.entityId = object.entityId ?? undefined;
312
- return message;
313
- },
314
- };
315
-
316
- declare var self: any | undefined;
317
- declare var window: any | undefined;
318
- declare var global: any | undefined;
319
- var tsProtoGlobalThis: any = (() => {
320
- if (typeof globalThis !== "undefined") {
321
- return globalThis;
322
- }
323
- if (typeof self !== "undefined") {
324
- return self;
325
- }
326
- if (typeof window !== "undefined") {
327
- return window;
328
- }
329
- if (typeof global !== "undefined") {
330
- return global;
331
- }
332
- throw "Unable to locate global object";
333
- })();
334
-
335
139
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
336
140
 
337
141
  export type DeepPartial<T> = T extends Builtin ? T
@@ -344,18 +148,6 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
344
148
  export type Exact<P, I extends P> = P extends Builtin ? P
345
149
  : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
346
150
 
347
- function longToNumber(long: Long): number {
348
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
349
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
350
- }
351
- return long.toNumber();
352
- }
353
-
354
- if (_m0.util.Long !== Long) {
355
- _m0.util.Long = Long as any;
356
- _m0.configure();
357
- }
358
-
359
151
  function isSet(value: any): boolean {
360
152
  return value !== null && value !== undefined;
361
153
  }
@@ -1515,7 +1515,7 @@ export const FriendshipsServiceDefinition = {
1515
1515
  requestStream: false,
1516
1516
  responseType: Users,
1517
1517
  responseStream: true,
1518
- options: { _unknownFields: {} },
1518
+ options: {},
1519
1519
  },
1520
1520
  /** Get the list of request events for the authenticated user */
1521
1521
  getRequestEvents: {
@@ -1524,7 +1524,7 @@ export const FriendshipsServiceDefinition = {
1524
1524
  requestStream: false,
1525
1525
  responseType: RequestEvents,
1526
1526
  responseStream: false,
1527
- options: { _unknownFields: {} },
1527
+ options: {},
1528
1528
  },
1529
1529
  /** Update friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE */
1530
1530
  updateFriendshipEvent: {
@@ -1533,7 +1533,7 @@ export const FriendshipsServiceDefinition = {
1533
1533
  requestStream: false,
1534
1534
  responseType: UpdateFriendshipResponse,
1535
1535
  responseStream: false,
1536
- options: { _unknownFields: {} },
1536
+ options: {},
1537
1537
  },
1538
1538
  /**
1539
1539
  * Subscribe to updates of friendship status: REQUEST, ACCEPT, REJECT, CANCEL,
@@ -1545,7 +1545,7 @@ export const FriendshipsServiceDefinition = {
1545
1545
  requestStream: false,
1546
1546
  responseType: SubscribeFriendshipEventsUpdatesResponse,
1547
1547
  responseStream: true,
1548
- options: { _unknownFields: {} },
1548
+ options: {},
1549
1549
  },
1550
1550
  },
1551
1551
  } as const;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/protocol",
3
- "version": "1.0.0-4468031496.commit-eace17b",
3
+ "version": "1.0.0-4543854409.commit-89f5875",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "out-js",
27
27
  "public"
28
28
  ],
29
- "commit": "eace17b886d8c1b4c64486111197130eae05f68a"
29
+ "commit": "89f5875c5f1203f033ac203746ac45491db0da3c"
30
30
  }