@dcl/protocol 1.0.0-34848312390.commit-ca008c2 → 1.0.0-34875307214.commit-1ca8fa7
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/out-js/decentraland/common/texture.gen.d.ts +18 -0
- package/out-js/decentraland/common/texture.gen.js +104 -4
- package/out-js/decentraland/common/texture.gen.js.map +1 -1
- package/out-js/decentraland/kernel/apis/restricted_actions.gen.d.ts +115 -24
- package/out-js/decentraland/kernel/apis/restricted_actions.gen.js +392 -112
- package/out-js/decentraland/kernel/apis/restricted_actions.gen.js.map +1 -1
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.d.ts +0 -21
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js +4 -124
- package/out-js/decentraland/kernel/comms/rfc4/comms.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/avatar_equipped_data.gen.d.ts +2 -0
- package/out-js/decentraland/sdk/components/avatar_equipped_data.gen.js +19 -2
- package/out-js/decentraland/sdk/components/avatar_equipped_data.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/avatar_locomotion_settings.gen.d.ts +51 -0
- package/out-js/decentraland/sdk/components/avatar_locomotion_settings.gen.js +177 -0
- package/out-js/decentraland/sdk/components/avatar_locomotion_settings.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/avatar_modifier_area.gen.d.ts +2 -0
- package/out-js/decentraland/sdk/components/avatar_modifier_area.gen.js +14 -2
- package/out-js/decentraland/sdk/components/avatar_modifier_area.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/avatar_movement.gen.d.ts +71 -0
- package/out-js/decentraland/sdk/components/avatar_movement.gen.js +303 -0
- package/out-js/decentraland/sdk/components/avatar_movement.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/avatar_movement_info.gen.d.ts +79 -0
- package/out-js/decentraland/sdk/components/avatar_movement_info.gen.js +357 -0
- package/out-js/decentraland/sdk/components/avatar_movement_info.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/avatar_shape.gen.d.ts +2 -8
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js +20 -36
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/camera_layer.gen.d.ts +46 -0
- package/out-js/decentraland/sdk/components/camera_layer.gen.js +162 -0
- package/out-js/decentraland/sdk/components/camera_layer.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/camera_layers.gen.d.ts +30 -0
- package/out-js/decentraland/sdk/components/camera_layers.gen.js +80 -0
- package/out-js/decentraland/sdk/components/camera_layers.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/camera_mode_area.gen.d.ts +2 -0
- package/out-js/decentraland/sdk/components/camera_mode_area.gen.js +14 -2
- package/out-js/decentraland/sdk/components/camera_mode_area.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/common/explorer_ui.gen.d.ts +1 -3
- package/out-js/decentraland/sdk/components/common/explorer_ui.gen.js +1 -8
- package/out-js/decentraland/sdk/components/common/explorer_ui.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/common/input_action.gen.d.ts +3 -0
- package/out-js/decentraland/sdk/components/common/input_action.gen.js +18 -0
- package/out-js/decentraland/sdk/components/common/input_action.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/explorer_ui_events_result.gen.d.ts +3 -8
- package/out-js/decentraland/sdk/components/explorer_ui_events_result.gen.js +4 -16
- package/out-js/decentraland/sdk/components/explorer_ui_events_result.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/global_light.gen.d.ts +50 -0
- package/out-js/decentraland/sdk/components/global_light.gen.js +103 -0
- package/out-js/decentraland/sdk/components/global_light.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/gltf_container_loading_state.gen.d.ts +19 -0
- package/out-js/decentraland/sdk/components/gltf_container_loading_state.gen.js +90 -3
- package/out-js/decentraland/sdk/components/gltf_container_loading_state.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/gltf_node.gen.d.ts +66 -0
- package/out-js/decentraland/sdk/components/gltf_node.gen.js +69 -0
- package/out-js/decentraland/sdk/components/gltf_node.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/gltf_node_state.gen.d.ts +43 -0
- package/out-js/decentraland/sdk/components/gltf_node_state.gen.js +122 -0
- package/out-js/decentraland/sdk/components/gltf_node_state.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/input_modifier.gen.d.ts +52 -0
- package/out-js/decentraland/sdk/components/input_modifier.gen.js +233 -0
- package/out-js/decentraland/sdk/components/input_modifier.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/material.gen.d.ts +20 -0
- package/out-js/decentraland/sdk/components/material.gen.js +86 -2
- package/out-js/decentraland/sdk/components/material.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/mesh_collider.gen.d.ts +18 -0
- package/out-js/decentraland/sdk/components/mesh_collider.gen.js +90 -4
- package/out-js/decentraland/sdk/components/mesh_collider.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/mesh_renderer.gen.d.ts +19 -3
- package/out-js/decentraland/sdk/components/mesh_renderer.gen.js +90 -4
- package/out-js/decentraland/sdk/components/mesh_renderer.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/raycast.gen.d.ts +13 -0
- package/out-js/decentraland/sdk/components/raycast.gen.js +64 -2
- package/out-js/decentraland/sdk/components/raycast.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/text_shape.gen.d.ts +2 -0
- package/out-js/decentraland/sdk/components/text_shape.gen.js +14 -1
- package/out-js/decentraland/sdk/components/text_shape.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/texture_camera.gen.d.ts +86 -0
- package/out-js/decentraland/sdk/components/texture_camera.gen.js +296 -0
- package/out-js/decentraland/sdk/components/texture_camera.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/ui_canvas.gen.d.ts +35 -0
- package/out-js/decentraland/sdk/components/ui_canvas.gen.js +98 -0
- package/out-js/decentraland/sdk/components/ui_canvas.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/ui_dropdown.gen.d.ts +2 -0
- package/out-js/decentraland/sdk/components/ui_dropdown.gen.js +14 -1
- package/out-js/decentraland/sdk/components/ui_dropdown.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/ui_input.gen.d.ts +6 -0
- package/out-js/decentraland/sdk/components/ui_input.gen.js +40 -1
- package/out-js/decentraland/sdk/components/ui_input.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/ui_scroll_result.gen.d.ts +31 -0
- package/out-js/decentraland/sdk/components/ui_scroll_result.gen.js +71 -0
- package/out-js/decentraland/sdk/components/ui_scroll_result.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/ui_text.gen.d.ts +2 -0
- package/out-js/decentraland/sdk/components/ui_text.gen.js +14 -1
- package/out-js/decentraland/sdk/components/ui_text.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/ui_transform.gen.d.ts +33 -0
- package/out-js/decentraland/sdk/components/ui_transform.gen.js +176 -3
- package/out-js/decentraland/sdk/components/ui_transform.gen.js.map +1 -1
- package/out-ts/decentraland/common/texture.gen.ts +119 -4
- package/out-ts/decentraland/kernel/apis/restricted_actions.gen.ts +418 -129
- package/out-ts/decentraland/kernel/comms/rfc4/comms.gen.ts +2 -166
- package/out-ts/decentraland/sdk/components/avatar_equipped_data.gen.ts +20 -1
- package/out-ts/decentraland/sdk/components/avatar_locomotion_settings.gen.ts +237 -0
- package/out-ts/decentraland/sdk/components/avatar_modifier_area.gen.ts +16 -1
- package/out-ts/decentraland/sdk/components/avatar_movement.gen.ts +372 -0
- package/out-ts/decentraland/sdk/components/avatar_movement_info.gen.ts +432 -0
- package/out-ts/decentraland/sdk/components/avatar_shape.gen.ts +23 -35
- package/out-ts/decentraland/sdk/components/camera_layer.gen.ts +202 -0
- package/out-ts/decentraland/sdk/components/camera_layers.gen.ts +92 -0
- package/out-ts/decentraland/sdk/components/camera_mode_area.gen.ts +16 -1
- package/out-ts/decentraland/sdk/components/common/explorer_ui.gen.ts +1 -8
- package/out-ts/decentraland/sdk/components/common/input_action.gen.ts +18 -0
- package/out-ts/decentraland/sdk/components/explorer_ui_events_result.gen.ts +4 -22
- package/out-ts/decentraland/sdk/components/global_light.gen.ts +138 -0
- package/out-ts/decentraland/sdk/components/gltf_container_loading_state.gen.ts +108 -2
- package/out-ts/decentraland/sdk/components/gltf_node.gen.ts +116 -0
- package/out-ts/decentraland/sdk/components/gltf_node_state.gen.ts +139 -0
- package/out-ts/decentraland/sdk/components/input_modifier.gen.ts +265 -0
- package/out-ts/decentraland/sdk/components/material.gen.ts +102 -1
- package/out-ts/decentraland/sdk/components/mesh_collider.gen.ts +99 -0
- package/out-ts/decentraland/sdk/components/mesh_renderer.gen.ts +100 -3
- package/out-ts/decentraland/sdk/components/raycast.gen.ts +73 -1
- package/out-ts/decentraland/sdk/components/text_shape.gen.ts +19 -1
- package/out-ts/decentraland/sdk/components/texture_camera.gen.ts +362 -0
- package/out-ts/decentraland/sdk/components/ui_canvas.gen.ts +115 -0
- package/out-ts/decentraland/sdk/components/ui_dropdown.gen.ts +19 -1
- package/out-ts/decentraland/sdk/components/ui_input.gen.ts +55 -1
- package/out-ts/decentraland/sdk/components/ui_scroll_result.gen.ts +83 -0
- package/out-ts/decentraland/sdk/components/ui_text.gen.ts +19 -1
- package/out-ts/decentraland/sdk/components/ui_transform.gen.ts +193 -0
- package/package.json +3 -3
- package/proto/decentraland/common/texture.proto +8 -1
- package/proto/decentraland/kernel/apis/restricted_actions.proto +44 -12
- package/proto/decentraland/kernel/comms/rfc4/comms.proto +0 -11
- package/proto/decentraland/sdk/components/avatar_equipped_data.proto +2 -1
- package/proto/decentraland/sdk/components/avatar_modifier_area.proto +1 -0
- package/proto/decentraland/sdk/components/avatar_movement.proto +62 -0
- package/proto/decentraland/sdk/components/avatar_movement_info.proto +36 -0
- package/proto/decentraland/sdk/components/avatar_shape.proto +1 -5
- package/proto/decentraland/sdk/components/camera_layer.proto +30 -0
- package/proto/decentraland/sdk/components/camera_layers.proto +11 -0
- package/proto/decentraland/sdk/components/camera_mode_area.proto +1 -0
- package/proto/decentraland/sdk/components/common/explorer_ui.proto +1 -2
- package/proto/decentraland/sdk/components/common/input_action.proto +3 -0
- package/proto/decentraland/sdk/components/explorer_ui_events_result.proto +3 -5
- package/proto/decentraland/sdk/components/global_light.proto +22 -0
- package/proto/decentraland/sdk/components/gltf_container_loading_state.proto +13 -0
- package/proto/decentraland/sdk/components/gltf_node.proto +42 -0
- package/proto/decentraland/sdk/components/gltf_node_state.proto +20 -0
- package/proto/decentraland/sdk/components/light_source.proto +1 -1
- package/proto/decentraland/sdk/components/material.proto +13 -1
- package/proto/decentraland/sdk/components/mesh_collider.proto +7 -0
- package/proto/decentraland/sdk/components/mesh_renderer.proto +8 -3
- package/proto/decentraland/sdk/components/primary_pointer_info.proto +5 -0
- package/proto/decentraland/sdk/components/raycast.proto +13 -0
- package/proto/decentraland/sdk/components/text_shape.proto +1 -0
- package/proto/decentraland/sdk/components/texture_camera.proto +46 -0
- package/proto/decentraland/sdk/components/ui_canvas.proto +16 -0
- package/proto/decentraland/sdk/components/ui_dropdown.proto +1 -0
- package/proto/decentraland/sdk/components/ui_input.proto +3 -0
- package/proto/decentraland/sdk/components/ui_scroll_result.proto +12 -0
- package/proto/decentraland/sdk/components/ui_text.proto +1 -0
- package/proto/decentraland/sdk/components/ui_transform.proto +20 -0
- package/public/sdk-components.proto +10 -1
- package/out-js/decentraland/sdk/components/explorer_item_purchase_result.gen.d.ts +0 -78
- package/out-js/decentraland/sdk/components/explorer_item_purchase_result.gen.js +0 -308
- package/out-js/decentraland/sdk/components/explorer_item_purchase_result.gen.js.map +0 -1
- package/out-ts/decentraland/sdk/components/explorer_item_purchase_result.gen.ts +0 -370
- package/proto/decentraland/sdk/components/explorer_item_purchase_result.proto +0 -24
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Vector2 } from "../../common/vectors.gen";
|
|
4
|
+
|
|
5
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
6
|
+
|
|
7
|
+
export interface PBUiScrollResult {
|
|
8
|
+
value: Vector2 | undefined;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function createBasePBUiScrollResult(): PBUiScrollResult {
|
|
12
|
+
return { value: undefined };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export namespace PBUiScrollResult {
|
|
16
|
+
export function encode(message: PBUiScrollResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
17
|
+
if (message.value !== undefined) {
|
|
18
|
+
Vector2.encode(message.value, writer.uint32(10).fork()).ldelim();
|
|
19
|
+
}
|
|
20
|
+
return writer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBUiScrollResult {
|
|
24
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
25
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
26
|
+
const message = createBasePBUiScrollResult();
|
|
27
|
+
while (reader.pos < end) {
|
|
28
|
+
const tag = reader.uint32();
|
|
29
|
+
switch (tag >>> 3) {
|
|
30
|
+
case 1:
|
|
31
|
+
if (tag !== 10) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message.value = Vector2.decode(reader, reader.uint32());
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
reader.skipType(tag & 7);
|
|
42
|
+
}
|
|
43
|
+
return message;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function fromJSON(object: any): PBUiScrollResult {
|
|
47
|
+
return { value: isSet(object.value) ? Vector2.fromJSON(object.value) : undefined };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function toJSON(message: PBUiScrollResult): unknown {
|
|
51
|
+
const obj: any = {};
|
|
52
|
+
message.value !== undefined && (obj.value = message.value ? Vector2.toJSON(message.value) : undefined);
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function create<I extends Exact<DeepPartial<PBUiScrollResult>, I>>(base?: I): PBUiScrollResult {
|
|
57
|
+
return PBUiScrollResult.fromPartial(base ?? {});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function fromPartial<I extends Exact<DeepPartial<PBUiScrollResult>, I>>(object: I): PBUiScrollResult {
|
|
61
|
+
const message = createBasePBUiScrollResult();
|
|
62
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
63
|
+
? Vector2.fromPartial(object.value)
|
|
64
|
+
: undefined;
|
|
65
|
+
return message;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
70
|
+
|
|
71
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
72
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
73
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
74
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
75
|
+
: Partial<T>;
|
|
76
|
+
|
|
77
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
78
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
79
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
80
|
+
|
|
81
|
+
function isSet(value: any): boolean {
|
|
82
|
+
return value !== null && value !== undefined;
|
|
83
|
+
}
|
|
@@ -65,7 +65,11 @@ export interface PBUiText {
|
|
|
65
65
|
| number
|
|
66
66
|
| undefined;
|
|
67
67
|
/** wrap text when the border is reached (default: TW_WRAP) */
|
|
68
|
-
textWrap?:
|
|
68
|
+
textWrap?:
|
|
69
|
+
| TextWrap
|
|
70
|
+
| undefined;
|
|
71
|
+
/** a font file in the scene, or a Google Fonts family name; `font` is the fallback (default: unset) */
|
|
72
|
+
fontSrc?: string | undefined;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
function createBasePBUiText(): PBUiText {
|
|
@@ -76,6 +80,7 @@ function createBasePBUiText(): PBUiText {
|
|
|
76
80
|
font: undefined,
|
|
77
81
|
fontSize: undefined,
|
|
78
82
|
textWrap: undefined,
|
|
83
|
+
fontSrc: undefined,
|
|
79
84
|
};
|
|
80
85
|
}
|
|
81
86
|
|
|
@@ -99,6 +104,9 @@ export namespace PBUiText {
|
|
|
99
104
|
if (message.textWrap !== undefined) {
|
|
100
105
|
writer.uint32(48).int32(message.textWrap);
|
|
101
106
|
}
|
|
107
|
+
if (message.fontSrc !== undefined) {
|
|
108
|
+
writer.uint32(74).string(message.fontSrc);
|
|
109
|
+
}
|
|
102
110
|
return writer;
|
|
103
111
|
}
|
|
104
112
|
|
|
@@ -151,6 +159,13 @@ export namespace PBUiText {
|
|
|
151
159
|
|
|
152
160
|
message.textWrap = reader.int32() as any;
|
|
153
161
|
continue;
|
|
162
|
+
case 9:
|
|
163
|
+
if (tag !== 74) {
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
message.fontSrc = reader.string();
|
|
168
|
+
continue;
|
|
154
169
|
}
|
|
155
170
|
if ((tag & 7) === 4 || tag === 0) {
|
|
156
171
|
break;
|
|
@@ -168,6 +183,7 @@ export namespace PBUiText {
|
|
|
168
183
|
font: isSet(object.font) ? fontFromJSON(object.font) : undefined,
|
|
169
184
|
fontSize: isSet(object.fontSize) ? Number(object.fontSize) : undefined,
|
|
170
185
|
textWrap: isSet(object.textWrap) ? textWrapFromJSON(object.textWrap) : undefined,
|
|
186
|
+
fontSrc: isSet(object.fontSrc) ? String(object.fontSrc) : undefined,
|
|
171
187
|
};
|
|
172
188
|
}
|
|
173
189
|
|
|
@@ -181,6 +197,7 @@ export namespace PBUiText {
|
|
|
181
197
|
message.fontSize !== undefined && (obj.fontSize = Math.round(message.fontSize));
|
|
182
198
|
message.textWrap !== undefined &&
|
|
183
199
|
(obj.textWrap = message.textWrap !== undefined ? textWrapToJSON(message.textWrap) : undefined);
|
|
200
|
+
message.fontSrc !== undefined && (obj.fontSrc = message.fontSrc);
|
|
184
201
|
return obj;
|
|
185
202
|
}
|
|
186
203
|
|
|
@@ -198,6 +215,7 @@ export namespace PBUiText {
|
|
|
198
215
|
message.font = object.font ?? undefined;
|
|
199
216
|
message.fontSize = object.fontSize ?? undefined;
|
|
200
217
|
message.textWrap = object.textWrap ?? undefined;
|
|
218
|
+
message.fontSrc = object.fontSrc ?? undefined;
|
|
201
219
|
return message;
|
|
202
220
|
}
|
|
203
221
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { Color4 } from "../../common/colors.gen";
|
|
4
|
+
import { Vector2 } from "../../common/vectors.gen";
|
|
4
5
|
|
|
5
6
|
export const protobufPackage = "decentraland.sdk.components";
|
|
6
7
|
|
|
@@ -472,6 +473,55 @@ export function pointerFilterModeToJSON(object: PointerFilterMode): string {
|
|
|
472
473
|
}
|
|
473
474
|
}
|
|
474
475
|
|
|
476
|
+
export enum ShowScrollBar {
|
|
477
|
+
SSB_BOTH = 0,
|
|
478
|
+
SSB_ONLY_VERTICAL = 1,
|
|
479
|
+
SSB_ONLY_HORIZONTAL = 2,
|
|
480
|
+
SSB_HIDDEN = 3,
|
|
481
|
+
UNRECOGNIZED = -1,
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export function showScrollBarFromJSON(object: any): ShowScrollBar {
|
|
485
|
+
switch (object) {
|
|
486
|
+
case 0:
|
|
487
|
+
case "SSB_BOTH":
|
|
488
|
+
return ShowScrollBar.SSB_BOTH;
|
|
489
|
+
case 1:
|
|
490
|
+
case "SSB_ONLY_VERTICAL":
|
|
491
|
+
return ShowScrollBar.SSB_ONLY_VERTICAL;
|
|
492
|
+
case 2:
|
|
493
|
+
case "SSB_ONLY_HORIZONTAL":
|
|
494
|
+
return ShowScrollBar.SSB_ONLY_HORIZONTAL;
|
|
495
|
+
case 3:
|
|
496
|
+
case "SSB_HIDDEN":
|
|
497
|
+
return ShowScrollBar.SSB_HIDDEN;
|
|
498
|
+
case -1:
|
|
499
|
+
case "UNRECOGNIZED":
|
|
500
|
+
default:
|
|
501
|
+
return ShowScrollBar.UNRECOGNIZED;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export function showScrollBarToJSON(object: ShowScrollBar): string {
|
|
506
|
+
switch (object) {
|
|
507
|
+
case ShowScrollBar.SSB_BOTH:
|
|
508
|
+
return "SSB_BOTH";
|
|
509
|
+
case ShowScrollBar.SSB_ONLY_VERTICAL:
|
|
510
|
+
return "SSB_ONLY_VERTICAL";
|
|
511
|
+
case ShowScrollBar.SSB_ONLY_HORIZONTAL:
|
|
512
|
+
return "SSB_ONLY_HORIZONTAL";
|
|
513
|
+
case ShowScrollBar.SSB_HIDDEN:
|
|
514
|
+
return "SSB_HIDDEN";
|
|
515
|
+
case ShowScrollBar.UNRECOGNIZED:
|
|
516
|
+
default:
|
|
517
|
+
return "UNRECOGNIZED";
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export interface ScrollPositionValue {
|
|
522
|
+
value?: { $case: "position"; position: Vector2 } | { $case: "reference"; reference: string } | undefined;
|
|
523
|
+
}
|
|
524
|
+
|
|
475
525
|
export interface PBUiTransform {
|
|
476
526
|
parent: number;
|
|
477
527
|
rightOf: number;
|
|
@@ -616,10 +666,105 @@ export interface PBUiTransform {
|
|
|
616
666
|
opacity?:
|
|
617
667
|
| number
|
|
618
668
|
| undefined;
|
|
669
|
+
/** reference for scroll_position. default empty */
|
|
670
|
+
elementId?:
|
|
671
|
+
| string
|
|
672
|
+
| undefined;
|
|
673
|
+
/** default position=(0,0) */
|
|
674
|
+
scrollPosition?:
|
|
675
|
+
| ScrollPositionValue
|
|
676
|
+
| undefined;
|
|
677
|
+
/** default ShowScrollBar.SSB_BOTH */
|
|
678
|
+
scrollVisible?:
|
|
679
|
+
| ShowScrollBar
|
|
680
|
+
| undefined;
|
|
619
681
|
/** default: 0 — controls render stacking order. Higher values appear in front of lower values. */
|
|
620
682
|
zIndex?: number | undefined;
|
|
621
683
|
}
|
|
622
684
|
|
|
685
|
+
function createBaseScrollPositionValue(): ScrollPositionValue {
|
|
686
|
+
return { value: undefined };
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export namespace ScrollPositionValue {
|
|
690
|
+
export function encode(message: ScrollPositionValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
691
|
+
switch (message.value?.$case) {
|
|
692
|
+
case "position":
|
|
693
|
+
Vector2.encode(message.value.position, writer.uint32(10).fork()).ldelim();
|
|
694
|
+
break;
|
|
695
|
+
case "reference":
|
|
696
|
+
writer.uint32(18).string(message.value.reference);
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
return writer;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): ScrollPositionValue {
|
|
703
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
704
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
705
|
+
const message = createBaseScrollPositionValue();
|
|
706
|
+
while (reader.pos < end) {
|
|
707
|
+
const tag = reader.uint32();
|
|
708
|
+
switch (tag >>> 3) {
|
|
709
|
+
case 1:
|
|
710
|
+
if (tag !== 10) {
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
message.value = { $case: "position", position: Vector2.decode(reader, reader.uint32()) };
|
|
715
|
+
continue;
|
|
716
|
+
case 2:
|
|
717
|
+
if (tag !== 18) {
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
message.value = { $case: "reference", reference: reader.string() };
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
reader.skipType(tag & 7);
|
|
728
|
+
}
|
|
729
|
+
return message;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export function fromJSON(object: any): ScrollPositionValue {
|
|
733
|
+
return {
|
|
734
|
+
value: isSet(object.position)
|
|
735
|
+
? { $case: "position", position: Vector2.fromJSON(object.position) }
|
|
736
|
+
: isSet(object.reference)
|
|
737
|
+
? { $case: "reference", reference: String(object.reference) }
|
|
738
|
+
: undefined,
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export function toJSON(message: ScrollPositionValue): unknown {
|
|
743
|
+
const obj: any = {};
|
|
744
|
+
message.value?.$case === "position" &&
|
|
745
|
+
(obj.position = message.value?.position ? Vector2.toJSON(message.value?.position) : undefined);
|
|
746
|
+
message.value?.$case === "reference" && (obj.reference = message.value?.reference);
|
|
747
|
+
return obj;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
export function create<I extends Exact<DeepPartial<ScrollPositionValue>, I>>(base?: I): ScrollPositionValue {
|
|
751
|
+
return ScrollPositionValue.fromPartial(base ?? {});
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export function fromPartial<I extends Exact<DeepPartial<ScrollPositionValue>, I>>(object: I): ScrollPositionValue {
|
|
755
|
+
const message = createBaseScrollPositionValue();
|
|
756
|
+
if (object.value?.$case === "position" && object.value?.position !== undefined && object.value?.position !== null) {
|
|
757
|
+
message.value = { $case: "position", position: Vector2.fromPartial(object.value.position) };
|
|
758
|
+
}
|
|
759
|
+
if (
|
|
760
|
+
object.value?.$case === "reference" && object.value?.reference !== undefined && object.value?.reference !== null
|
|
761
|
+
) {
|
|
762
|
+
message.value = { $case: "reference", reference: object.value.reference };
|
|
763
|
+
}
|
|
764
|
+
return message;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
623
768
|
function createBasePBUiTransform(): PBUiTransform {
|
|
624
769
|
return {
|
|
625
770
|
parent: 0,
|
|
@@ -695,6 +840,9 @@ function createBasePBUiTransform(): PBUiTransform {
|
|
|
695
840
|
borderLeftColor: undefined,
|
|
696
841
|
borderRightColor: undefined,
|
|
697
842
|
opacity: undefined,
|
|
843
|
+
elementId: undefined,
|
|
844
|
+
scrollPosition: undefined,
|
|
845
|
+
scrollVisible: undefined,
|
|
698
846
|
zIndex: undefined,
|
|
699
847
|
};
|
|
700
848
|
}
|
|
@@ -920,6 +1068,15 @@ export namespace PBUiTransform {
|
|
|
920
1068
|
if (message.opacity !== undefined) {
|
|
921
1069
|
writer.uint32(589).float(message.opacity);
|
|
922
1070
|
}
|
|
1071
|
+
if (message.elementId !== undefined) {
|
|
1072
|
+
writer.uint32(594).string(message.elementId);
|
|
1073
|
+
}
|
|
1074
|
+
if (message.scrollPosition !== undefined) {
|
|
1075
|
+
ScrollPositionValue.encode(message.scrollPosition, writer.uint32(602).fork()).ldelim();
|
|
1076
|
+
}
|
|
1077
|
+
if (message.scrollVisible !== undefined) {
|
|
1078
|
+
writer.uint32(608).int32(message.scrollVisible);
|
|
1079
|
+
}
|
|
923
1080
|
if (message.zIndex !== undefined) {
|
|
924
1081
|
writer.uint32(616).int32(message.zIndex);
|
|
925
1082
|
}
|
|
@@ -1444,6 +1601,27 @@ export namespace PBUiTransform {
|
|
|
1444
1601
|
|
|
1445
1602
|
message.opacity = reader.float();
|
|
1446
1603
|
continue;
|
|
1604
|
+
case 74:
|
|
1605
|
+
if (tag !== 594) {
|
|
1606
|
+
break;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
message.elementId = reader.string();
|
|
1610
|
+
continue;
|
|
1611
|
+
case 75:
|
|
1612
|
+
if (tag !== 602) {
|
|
1613
|
+
break;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
message.scrollPosition = ScrollPositionValue.decode(reader, reader.uint32());
|
|
1617
|
+
continue;
|
|
1618
|
+
case 76:
|
|
1619
|
+
if (tag !== 608) {
|
|
1620
|
+
break;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
message.scrollVisible = reader.int32() as any;
|
|
1624
|
+
continue;
|
|
1447
1625
|
case 77:
|
|
1448
1626
|
if (tag !== 616) {
|
|
1449
1627
|
break;
|
|
@@ -1549,6 +1727,9 @@ export namespace PBUiTransform {
|
|
|
1549
1727
|
borderLeftColor: isSet(object.borderLeftColor) ? Color4.fromJSON(object.borderLeftColor) : undefined,
|
|
1550
1728
|
borderRightColor: isSet(object.borderRightColor) ? Color4.fromJSON(object.borderRightColor) : undefined,
|
|
1551
1729
|
opacity: isSet(object.opacity) ? Number(object.opacity) : undefined,
|
|
1730
|
+
elementId: isSet(object.elementId) ? String(object.elementId) : undefined,
|
|
1731
|
+
scrollPosition: isSet(object.scrollPosition) ? ScrollPositionValue.fromJSON(object.scrollPosition) : undefined,
|
|
1732
|
+
scrollVisible: isSet(object.scrollVisible) ? showScrollBarFromJSON(object.scrollVisible) : undefined,
|
|
1552
1733
|
zIndex: isSet(object.zIndex) ? Number(object.zIndex) : undefined,
|
|
1553
1734
|
};
|
|
1554
1735
|
}
|
|
@@ -1662,6 +1843,13 @@ export namespace PBUiTransform {
|
|
|
1662
1843
|
message.borderRightColor !== undefined &&
|
|
1663
1844
|
(obj.borderRightColor = message.borderRightColor ? Color4.toJSON(message.borderRightColor) : undefined);
|
|
1664
1845
|
message.opacity !== undefined && (obj.opacity = message.opacity);
|
|
1846
|
+
message.elementId !== undefined && (obj.elementId = message.elementId);
|
|
1847
|
+
message.scrollPosition !== undefined &&
|
|
1848
|
+
(obj.scrollPosition = message.scrollPosition ? ScrollPositionValue.toJSON(message.scrollPosition) : undefined);
|
|
1849
|
+
message.scrollVisible !== undefined &&
|
|
1850
|
+
(obj.scrollVisible = message.scrollVisible !== undefined
|
|
1851
|
+
? showScrollBarToJSON(message.scrollVisible)
|
|
1852
|
+
: undefined);
|
|
1665
1853
|
message.zIndex !== undefined && (obj.zIndex = Math.round(message.zIndex));
|
|
1666
1854
|
return obj;
|
|
1667
1855
|
}
|
|
@@ -1753,6 +1941,11 @@ export namespace PBUiTransform {
|
|
|
1753
1941
|
? Color4.fromPartial(object.borderRightColor)
|
|
1754
1942
|
: undefined;
|
|
1755
1943
|
message.opacity = object.opacity ?? undefined;
|
|
1944
|
+
message.elementId = object.elementId ?? undefined;
|
|
1945
|
+
message.scrollPosition = (object.scrollPosition !== undefined && object.scrollPosition !== null)
|
|
1946
|
+
? ScrollPositionValue.fromPartial(object.scrollPosition)
|
|
1947
|
+
: undefined;
|
|
1948
|
+
message.scrollVisible = object.scrollVisible ?? undefined;
|
|
1756
1949
|
message.zIndex = object.zIndex ?? undefined;
|
|
1757
1950
|
return message;
|
|
1758
1951
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/protocol",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-34875307214.commit-1ca8fa7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"gen:test": "node protoc-gen-bitwise/test/generator.test.js"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@protobuf-ts/protoc": "^2.
|
|
20
|
+
"@protobuf-ts/protoc": "^2.8.1",
|
|
21
21
|
"proto-compatibility-tool": "^1.1.2-20220925163655.commit-25bd040",
|
|
22
22
|
"typescript": "^5.0.4"
|
|
23
23
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"protoc-gen-bitwise/*.js",
|
|
37
37
|
"protoc-gen-bitwise/runtime"
|
|
38
38
|
],
|
|
39
|
-
"commit": "
|
|
39
|
+
"commit": "1ca8fa7b4ec3342df3ef12421ec61558f86bf76f"
|
|
40
40
|
}
|
|
@@ -36,10 +36,17 @@ message VideoTexture {
|
|
|
36
36
|
optional TextureFilterMode filter_mode = 3; // default = FilterMode.Bilinear
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
message UiCanvasTexture {
|
|
40
|
+
uint32 ui_canvas_entity = 1;
|
|
41
|
+
optional TextureWrapMode wrap_mode = 2; // default = TextureWrapMode.Clamp
|
|
42
|
+
optional TextureFilterMode filter_mode = 3; // default = FilterMode.Bilinear
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
message TextureUnion {
|
|
40
46
|
oneof tex {
|
|
41
47
|
Texture texture = 1; // default = null
|
|
42
48
|
AvatarTexture avatar_texture = 2; // default = null
|
|
43
49
|
VideoTexture video_texture = 3; // default = null
|
|
50
|
+
UiCanvasTexture ui_texture = 4;
|
|
44
51
|
}
|
|
45
|
-
}
|
|
52
|
+
}
|
|
@@ -61,8 +61,31 @@ message MovePlayerToResponse {
|
|
|
61
61
|
bool success = 1;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
message WalkPlayerToRequest {
|
|
65
|
+
decentraland.common.Vector3 new_relative_position = 1;
|
|
66
|
+
float stop_threshold = 2;
|
|
67
|
+
optional float timeout = 3; // max seconds before the request is failed; not passed to the movement scene
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message WalkPlayerToResponse {
|
|
71
|
+
bool success = 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
64
74
|
message TeleportToResponse { }
|
|
65
75
|
|
|
76
|
+
message SetUiFocusRequest {
|
|
77
|
+
string element_id = 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message ClearUiFocusRequest { }
|
|
81
|
+
|
|
82
|
+
message GetUiFocusRequest { }
|
|
83
|
+
|
|
84
|
+
message UiFocusResponse {
|
|
85
|
+
// the element that is/was focussed
|
|
86
|
+
optional string element_id = 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
66
89
|
message CopyToClipboardRequest {
|
|
67
90
|
string text = 1;
|
|
68
91
|
}
|
|
@@ -75,7 +98,7 @@ message StopEmoteRequest { }
|
|
|
75
98
|
enum OpenExplorerUiResult {
|
|
76
99
|
UNSPECIFIED = 0;
|
|
77
100
|
OPENED = 1;
|
|
78
|
-
WAS_ALREADY_OPEN = 2; //
|
|
101
|
+
WAS_ALREADY_OPEN = 2; // a fullscreen panel is already open
|
|
79
102
|
REJECTED_NOT_CURRENT_SCENE = 3; // the standard restricted-actions current-scene gate rejected the call
|
|
80
103
|
REJECTED_FEATURE_DISABLED = 4; // the requested section is hidden by feature flags or client doesn't have that feature
|
|
81
104
|
REJECTED_NO_USER_GESTURE = 5; // rejected: the call did not originate from a user gesture
|
|
@@ -83,17 +106,11 @@ enum OpenExplorerUiResult {
|
|
|
83
106
|
|
|
84
107
|
message OpenExplorerUiRequest {
|
|
85
108
|
decentraland.sdk.components.common.ExplorerUi ui = 1;
|
|
86
|
-
// Echoed back in the events this request produces, so they can be matched to their call.
|
|
87
|
-
// Unset means no correlation, and 0 is reserved for the same meaning on the result, so ids start at 1.
|
|
88
|
-
optional uint32 request_id = 2;
|
|
89
|
-
|
|
90
|
-
message ItemPurchaseParams {
|
|
91
|
-
string urn = 1;
|
|
92
|
-
}
|
|
93
109
|
|
|
94
|
-
oneof
|
|
95
|
-
|
|
96
|
-
}
|
|
110
|
+
// Extension point for future per-panel parameters, as a oneof so each panel gets its
|
|
111
|
+
// own optional param message without touching existing fields.
|
|
112
|
+
// message MapParams { int32 focus_x = 1; int32 focus_y = 2; }
|
|
113
|
+
// oneof params { MapParams map = 10; }
|
|
97
114
|
}
|
|
98
115
|
|
|
99
116
|
message OpenExplorerUiResponse {
|
|
@@ -108,6 +125,12 @@ service RestrictedActionsService {
|
|
|
108
125
|
rpc MovePlayerTo(MovePlayerToRequest) returns (MovePlayerToResponse) {}
|
|
109
126
|
|
|
110
127
|
// TeleportTo will move the user to the specified world LAND parcel coordinates
|
|
128
|
+
// WalkPlayerTo will walk the player to a position relative to the current scene,
|
|
129
|
+
// managed by the movement controller scene. Returns success when the player reaches
|
|
130
|
+
// within stop_threshold distance, or false if the path is blocked, the player gets
|
|
131
|
+
// stuck, the player interrupts the walk with manual input, or the optional timeout expires.
|
|
132
|
+
rpc WalkPlayerTo(WalkPlayerToRequest) returns (WalkPlayerToResponse) {}
|
|
133
|
+
|
|
111
134
|
rpc TeleportTo(TeleportToRequest) returns (TeleportToResponse) {}
|
|
112
135
|
|
|
113
136
|
// TriggerEmote will trigger an emote in this current user
|
|
@@ -131,11 +154,20 @@ service RestrictedActionsService {
|
|
|
131
154
|
rpc TriggerSceneEmote(TriggerSceneEmoteRequest) returns (SuccessResponse) {}
|
|
132
155
|
|
|
133
156
|
// CopyToClipboard copies the provided text into the clipboard
|
|
157
|
+
// Sets the focus to a specific UI element
|
|
158
|
+
rpc SetUiFocus(SetUiFocusRequest) returns (UiFocusResponse) {}
|
|
159
|
+
|
|
160
|
+
// Clears the focus from any currently focused textentry or dropdown
|
|
161
|
+
rpc ClearUiFocus(ClearUiFocusRequest) returns (UiFocusResponse) {}
|
|
162
|
+
|
|
163
|
+
// Returns the element_id of any currently focused textentry or dropdown
|
|
164
|
+
rpc GetUiFocus(GetUiFocusRequest) returns (UiFocusResponse) {}
|
|
165
|
+
|
|
134
166
|
rpc CopyToClipboard(CopyToClipboardRequest) returns (EmptyResponse) {}
|
|
135
167
|
|
|
136
168
|
// StopEmote will stop the current emote
|
|
137
169
|
rpc StopEmote(StopEmoteRequest) returns (SuccessResponse) {}
|
|
138
170
|
|
|
139
|
-
// OpenExplorerUi opens
|
|
171
|
+
// OpenExplorerUi opens a specific fullscreen explorer panel and returns the open verdict.
|
|
140
172
|
rpc OpenExplorerUi(OpenExplorerUiRequest) returns (OpenExplorerUiResponse) {}
|
|
141
173
|
}
|
|
@@ -94,14 +94,6 @@ message PlayerEmote {
|
|
|
94
94
|
uint32 incremental_id = 1;
|
|
95
95
|
string urn = 2;
|
|
96
96
|
float timestamp = 3;
|
|
97
|
-
optional bool is_stopping = 4; // true means the emote has been stopped in the sender's client
|
|
98
|
-
optional bool is_repeating = 5; // true when it is not the first time the looping animation plays
|
|
99
|
-
optional int32 interaction_id = 6; // identifies an interaction univocaly, established when the start animation is triggered
|
|
100
|
-
optional int32 social_emote_outcome = 7; // -1 means it does not use an outcome animation
|
|
101
|
-
optional bool is_reacting = 8; // to a social emote started by other user
|
|
102
|
-
optional string social_emote_initiator = 9; // wallet address of the user that initiated social emote
|
|
103
|
-
optional string target_avatar = 10; // wallet address of the user whose avatar is the target of a directed emote
|
|
104
|
-
optional uint32 mask = 11; // mask for which bones an animation applies to.
|
|
105
97
|
}
|
|
106
98
|
|
|
107
99
|
message SceneEmote {
|
|
@@ -134,9 +126,6 @@ message ProfileResponse {
|
|
|
134
126
|
message Chat {
|
|
135
127
|
string message = 1;
|
|
136
128
|
double timestamp = 2;
|
|
137
|
-
// Extension: optional forwarded_from to identify the original sender when
|
|
138
|
-
// messages are forwarded through an SFU
|
|
139
|
-
optional string forwarded_from = 3;
|
|
140
129
|
}
|
|
141
130
|
|
|
142
131
|
message Scene {
|
|
@@ -23,6 +23,7 @@ message PBAvatarModifierArea {
|
|
|
23
23
|
decentraland.common.Vector3 area = 1; // the 3D size of the region
|
|
24
24
|
repeated string exclude_ids = 2; // user IDs that can enter and remain unaffected
|
|
25
25
|
repeated AvatarModifierType modifiers = 3; // list of modifiers to apply
|
|
26
|
+
optional bool use_collider_range = 5; // if true, the player will be considered inside the area when they are within 0.3m of the area. default true
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
// AvatarModifierType is an effect that should be applied to avatars inside the region.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package decentraland.sdk.components;
|
|
4
|
+
|
|
5
|
+
import "decentraland/sdk/components/common/id.proto";
|
|
6
|
+
import "decentraland/common/vectors.proto";
|
|
7
|
+
|
|
8
|
+
option (common.ecs_component_id) = 1501;
|
|
9
|
+
|
|
10
|
+
message PBAvatarMovement {
|
|
11
|
+
decentraland.common.Vector3 velocity = 1;
|
|
12
|
+
float orientation = 2; // 0-360, yaw only; this is the authoritative facing (other clients read it, and physics treats the avatar as upright). Lean is expressed separately via tilt_pitch/tilt_roll.
|
|
13
|
+
optional decentraland.common.Vector3 ground_direction = 3;
|
|
14
|
+
optional bool walk_success = 4; // set for one frame when a walk_target ends: true = reached target, false = failed; absent = in progress or no walk
|
|
15
|
+
optional MovementAnimation animation = 5; // if set, the engine plays this animation instead of selecting one from velocity heuristics
|
|
16
|
+
optional float tilt_pitch = 6; // render-only forward/back lean in degrees, applied on top of `orientation` (rotation about the avatar's local X axis). Does not affect the physics capsule (stays upright) or the facing other clients read. Defaults to 0.
|
|
17
|
+
optional float tilt_roll = 7; // render-only sideways lean in degrees, applied on top of `orientation` (rotation about the avatar's local Z axis). Same constraints as tilt_pitch. Useful e.g. for glider banking. Defaults to 0.
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Describes the animation the movement scene wants the avatar to play.
|
|
21
|
+
// One GLB = one clip (following the scene-emote convention: single clip, or a clip named with `_Avatar` suffix).
|
|
22
|
+
// When absent the engine falls back to its built-in velocity-based selection (walk/run/jump/idle).
|
|
23
|
+
message MovementAnimation {
|
|
24
|
+
string src = 1; // scene-relative path to the gltf/glb asset (resolved via the scene content map)
|
|
25
|
+
bool loop = 2; // whether the clip repeats once it reaches the end
|
|
26
|
+
float speed = 3; // playback speed multiplier (1.0 = clip's native rate)
|
|
27
|
+
bool idle = 4; // true: a triggerSceneEmote may take over; false: emotes are suppressed while this animation plays
|
|
28
|
+
optional float transition_seconds = 5; // cross-fade duration when `src` changes; defaults to 0.2 when unset. Not applied to loop/speed/idle changes.
|
|
29
|
+
optional float playback_time = 6; // if set, the engine seeks to this position (in seconds) this frame. Clear on subsequent frames to allow normal playback. The scene can read `AvatarAnimationState.playback_time` first to decide.
|
|
30
|
+
repeated string sounds = 7; // scene-relative paths to audio clips (.mp3/.ogg) to play this frame on the avatar audio bus. Fire-and-forget: each listed clip plays once per frame it appears; leaving a clip set for multiple frames re-triggers it. No stop mechanism. Use `AvatarAnimationState.playback_time` to trigger sounds at the right point in the clip (e.g. foot plants).
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// engine behaviour (uses only capsule shapecasts and GJK closest point for portability):
|
|
34
|
+
// 1: set avatar orientation from movement info -> P1
|
|
35
|
+
// 2: record "ground collider" - nearest collider within threshold distance in ground_direction using avatar collider shapecast
|
|
36
|
+
// 3: update all colliders, record previous transform and new transform.
|
|
37
|
+
// 4: apply ground collider movement: take collider closest point, modify P1 translation and rotation by closest point translation and rotation change -> P2
|
|
38
|
+
// 5: resolve collisions using position-based constraints
|
|
39
|
+
// initialize constraints to -inf, +inf
|
|
40
|
+
// repeat
|
|
41
|
+
// for each collider[i] that collides with the P3+N player:
|
|
42
|
+
// if closest point = capsule middle (i.e. collider collides with P3 collider but with radius 0),
|
|
43
|
+
// ignore / continue
|
|
44
|
+
// else
|
|
45
|
+
// update constraints based on minimum movement to escape collision
|
|
46
|
+
// e.g. if avatar is 1cm into the floor, constraint_min = max(constraint_min, vec3(0, 0.01, 0))
|
|
47
|
+
// reposition player to satisfy constraints for each axis:
|
|
48
|
+
// y: satsify floor before ceiling: new position = max(constraint_min, min(constraint_max, current position))
|
|
49
|
+
// x and z: if squashed, take average, else satisfy the required constraint
|
|
50
|
+
// if constraint_min > constraint_max then new position = average(constraint_min, constraint_max)
|
|
51
|
+
// else new position = clamp(current position, constraint_min, constraint_max)
|
|
52
|
+
// while position !~= previous position
|
|
53
|
+
// 6: apply velocity (collide and slide)
|
|
54
|
+
// disable anything we are initially colliding with
|
|
55
|
+
// shapecast avatar from position to position + velocity * timestep
|
|
56
|
+
// on impact:
|
|
57
|
+
// project velocity onto slide plane (standard "Collide & Slide")
|
|
58
|
+
// velocity = old velocity - (normal * dot(velocity, normal))
|
|
59
|
+
// repeat continue with residual velocity and residual time
|
|
60
|
+
// 7: provide AvatarMovementInfo values
|
|
61
|
+
// actual velocity = (final - P3+N) / timestep
|
|
62
|
+
// external_velocity = (P3+N - P1) / timestep
|