@dcl/protocol 1.0.0-33861349213.commit-76445a6 → 1.0.0-34100371654.commit-2ed0bdc
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 +125 -4
- package/out-js/decentraland/kernel/apis/restricted_actions.gen.js +408 -6
- package/out-js/decentraland/kernel/apis/restricted_actions.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 -0
- package/out-js/decentraland/sdk/components/avatar_shape.gen.js +19 -1
- 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/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/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/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_input.gen.d.ts +4 -0
- package/out-js/decentraland/sdk/components/ui_input.gen.js +27 -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_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 +445 -6
- 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 -1
- 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/input_action.gen.ts +18 -0
- 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/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_input.gen.ts +37 -1
- package/out-ts/decentraland/sdk/components/ui_scroll_result.gen.ts +83 -0
- package/out-ts/decentraland/sdk/components/ui_transform.gen.ts +193 -0
- package/package.json +2 -2
- package/proto/decentraland/common/texture.proto +8 -1
- package/proto/decentraland/kernel/apis/restricted_actions.proto +45 -1
- 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 -0
- 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/input_action.proto +3 -0
- 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/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/texture_camera.proto +46 -0
- package/proto/decentraland/sdk/components/ui_canvas.proto +16 -0
- package/proto/decentraland/sdk/components/ui_input.proto +2 -0
- package/proto/decentraland/sdk/components/ui_scroll_result.proto +12 -0
- package/proto/decentraland/sdk/components/ui_transform.proto +20 -0
- package/public/sdk-components.proto +10 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
|
|
4
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
5
|
+
|
|
6
|
+
export interface PBCameraLayers {
|
|
7
|
+
layers: number[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function createBasePBCameraLayers(): PBCameraLayers {
|
|
11
|
+
return { layers: [] };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export namespace PBCameraLayers {
|
|
15
|
+
export function encode(message: PBCameraLayers, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
16
|
+
writer.uint32(10).fork();
|
|
17
|
+
for (const v of message.layers) {
|
|
18
|
+
writer.uint32(v);
|
|
19
|
+
}
|
|
20
|
+
writer.ldelim();
|
|
21
|
+
return writer;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBCameraLayers {
|
|
25
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
26
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
27
|
+
const message = createBasePBCameraLayers();
|
|
28
|
+
while (reader.pos < end) {
|
|
29
|
+
const tag = reader.uint32();
|
|
30
|
+
switch (tag >>> 3) {
|
|
31
|
+
case 1:
|
|
32
|
+
if (tag === 8) {
|
|
33
|
+
message.layers.push(reader.uint32());
|
|
34
|
+
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (tag === 10) {
|
|
39
|
+
const end2 = reader.uint32() + reader.pos;
|
|
40
|
+
while (reader.pos < end2) {
|
|
41
|
+
message.layers.push(reader.uint32());
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
reader.skipType(tag & 7);
|
|
53
|
+
}
|
|
54
|
+
return message;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function fromJSON(object: any): PBCameraLayers {
|
|
58
|
+
return { layers: Array.isArray(object?.layers) ? object.layers.map((e: any) => Number(e)) : [] };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function toJSON(message: PBCameraLayers): unknown {
|
|
62
|
+
const obj: any = {};
|
|
63
|
+
if (message.layers) {
|
|
64
|
+
obj.layers = message.layers.map((e) => Math.round(e));
|
|
65
|
+
} else {
|
|
66
|
+
obj.layers = [];
|
|
67
|
+
}
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function create<I extends Exact<DeepPartial<PBCameraLayers>, I>>(base?: I): PBCameraLayers {
|
|
72
|
+
return PBCameraLayers.fromPartial(base ?? {});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function fromPartial<I extends Exact<DeepPartial<PBCameraLayers>, I>>(object: I): PBCameraLayers {
|
|
76
|
+
const message = createBasePBCameraLayers();
|
|
77
|
+
message.layers = object.layers?.map((e) => e) || [];
|
|
78
|
+
return message;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
83
|
+
|
|
84
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
85
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
86
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
87
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
88
|
+
: Partial<T>;
|
|
89
|
+
|
|
90
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
91
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
92
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
@@ -25,10 +25,12 @@ export interface PBCameraModeArea {
|
|
|
25
25
|
| undefined;
|
|
26
26
|
/** the camera mode to enforce */
|
|
27
27
|
mode: CameraType;
|
|
28
|
+
/** if true, the player will be considered inside the area when they are within 0.3m of the area. default true */
|
|
29
|
+
useColliderRange?: boolean | undefined;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
function createBasePBCameraModeArea(): PBCameraModeArea {
|
|
31
|
-
return { area: undefined, mode: 0 };
|
|
33
|
+
return { area: undefined, mode: 0, useColliderRange: undefined };
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export namespace PBCameraModeArea {
|
|
@@ -39,6 +41,9 @@ export namespace PBCameraModeArea {
|
|
|
39
41
|
if (message.mode !== 0) {
|
|
40
42
|
writer.uint32(16).int32(message.mode);
|
|
41
43
|
}
|
|
44
|
+
if (message.useColliderRange !== undefined) {
|
|
45
|
+
writer.uint32(32).bool(message.useColliderRange);
|
|
46
|
+
}
|
|
42
47
|
return writer;
|
|
43
48
|
}
|
|
44
49
|
|
|
@@ -63,6 +68,13 @@ export namespace PBCameraModeArea {
|
|
|
63
68
|
|
|
64
69
|
message.mode = reader.int32() as any;
|
|
65
70
|
continue;
|
|
71
|
+
case 4:
|
|
72
|
+
if (tag !== 32) {
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message.useColliderRange = reader.bool();
|
|
77
|
+
continue;
|
|
66
78
|
}
|
|
67
79
|
if ((tag & 7) === 4 || tag === 0) {
|
|
68
80
|
break;
|
|
@@ -76,6 +88,7 @@ export namespace PBCameraModeArea {
|
|
|
76
88
|
return {
|
|
77
89
|
area: isSet(object.area) ? Vector3.fromJSON(object.area) : undefined,
|
|
78
90
|
mode: isSet(object.mode) ? cameraTypeFromJSON(object.mode) : 0,
|
|
91
|
+
useColliderRange: isSet(object.useColliderRange) ? Boolean(object.useColliderRange) : undefined,
|
|
79
92
|
};
|
|
80
93
|
}
|
|
81
94
|
|
|
@@ -83,6 +96,7 @@ export namespace PBCameraModeArea {
|
|
|
83
96
|
const obj: any = {};
|
|
84
97
|
message.area !== undefined && (obj.area = message.area ? Vector3.toJSON(message.area) : undefined);
|
|
85
98
|
message.mode !== undefined && (obj.mode = cameraTypeToJSON(message.mode));
|
|
99
|
+
message.useColliderRange !== undefined && (obj.useColliderRange = message.useColliderRange);
|
|
86
100
|
return obj;
|
|
87
101
|
}
|
|
88
102
|
|
|
@@ -94,6 +108,7 @@ export namespace PBCameraModeArea {
|
|
|
94
108
|
const message = createBasePBCameraModeArea();
|
|
95
109
|
message.area = (object.area !== undefined && object.area !== null) ? Vector3.fromPartial(object.area) : undefined;
|
|
96
110
|
message.mode = object.mode ?? 0;
|
|
111
|
+
message.useColliderRange = object.useColliderRange ?? undefined;
|
|
97
112
|
return message;
|
|
98
113
|
}
|
|
99
114
|
}
|
|
@@ -122,6 +122,9 @@ export enum PointerEventType {
|
|
|
122
122
|
PET_HOVER_LEAVE = 3,
|
|
123
123
|
PET_PROXIMITY_ENTER = 4,
|
|
124
124
|
PET_PROXIMITY_LEAVE = 5,
|
|
125
|
+
PET_DRAG_LOCKED = 6,
|
|
126
|
+
PET_DRAG = 7,
|
|
127
|
+
PET_DRAG_END = 8,
|
|
125
128
|
UNRECOGNIZED = -1,
|
|
126
129
|
}
|
|
127
130
|
|
|
@@ -145,6 +148,15 @@ export function pointerEventTypeFromJSON(object: any): PointerEventType {
|
|
|
145
148
|
case 5:
|
|
146
149
|
case "PET_PROXIMITY_LEAVE":
|
|
147
150
|
return PointerEventType.PET_PROXIMITY_LEAVE;
|
|
151
|
+
case 6:
|
|
152
|
+
case "PET_DRAG_LOCKED":
|
|
153
|
+
return PointerEventType.PET_DRAG_LOCKED;
|
|
154
|
+
case 7:
|
|
155
|
+
case "PET_DRAG":
|
|
156
|
+
return PointerEventType.PET_DRAG;
|
|
157
|
+
case 8:
|
|
158
|
+
case "PET_DRAG_END":
|
|
159
|
+
return PointerEventType.PET_DRAG_END;
|
|
148
160
|
case -1:
|
|
149
161
|
case "UNRECOGNIZED":
|
|
150
162
|
default:
|
|
@@ -166,6 +178,12 @@ export function pointerEventTypeToJSON(object: PointerEventType): string {
|
|
|
166
178
|
return "PET_PROXIMITY_ENTER";
|
|
167
179
|
case PointerEventType.PET_PROXIMITY_LEAVE:
|
|
168
180
|
return "PET_PROXIMITY_LEAVE";
|
|
181
|
+
case PointerEventType.PET_DRAG_LOCKED:
|
|
182
|
+
return "PET_DRAG_LOCKED";
|
|
183
|
+
case PointerEventType.PET_DRAG:
|
|
184
|
+
return "PET_DRAG";
|
|
185
|
+
case PointerEventType.PET_DRAG_END:
|
|
186
|
+
return "PET_DRAG_END";
|
|
169
187
|
case PointerEventType.UNRECOGNIZED:
|
|
170
188
|
default:
|
|
171
189
|
return "UNRECOGNIZED";
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Color3 } from "../../common/colors.gen";
|
|
4
|
+
import { Vector3 } from "../../common/vectors.gen";
|
|
5
|
+
|
|
6
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* defines the global scene light settings. must be added to the scene root.
|
|
10
|
+
* to control sunlight color, intensity, shadows etc, you can also add a PBLight to the scene root.
|
|
11
|
+
*/
|
|
12
|
+
export interface PBGlobalLight {
|
|
13
|
+
/**
|
|
14
|
+
* the direction the directional light shines in.
|
|
15
|
+
* default depends on time of day and explorer implementation
|
|
16
|
+
*/
|
|
17
|
+
direction?:
|
|
18
|
+
| Vector3
|
|
19
|
+
| undefined;
|
|
20
|
+
/**
|
|
21
|
+
* ambient light color
|
|
22
|
+
* default: White
|
|
23
|
+
*/
|
|
24
|
+
ambientColor?:
|
|
25
|
+
| Color3
|
|
26
|
+
| undefined;
|
|
27
|
+
/**
|
|
28
|
+
* ambient light intensity. the explorer default ambient brightness is multiplied by this non-physical quantity.
|
|
29
|
+
* default 1
|
|
30
|
+
*/
|
|
31
|
+
ambientBrightness?: number | undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function createBasePBGlobalLight(): PBGlobalLight {
|
|
35
|
+
return { direction: undefined, ambientColor: undefined, ambientBrightness: undefined };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export namespace PBGlobalLight {
|
|
39
|
+
export function encode(message: PBGlobalLight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
40
|
+
if (message.direction !== undefined) {
|
|
41
|
+
Vector3.encode(message.direction, writer.uint32(10).fork()).ldelim();
|
|
42
|
+
}
|
|
43
|
+
if (message.ambientColor !== undefined) {
|
|
44
|
+
Color3.encode(message.ambientColor, writer.uint32(18).fork()).ldelim();
|
|
45
|
+
}
|
|
46
|
+
if (message.ambientBrightness !== undefined) {
|
|
47
|
+
writer.uint32(29).float(message.ambientBrightness);
|
|
48
|
+
}
|
|
49
|
+
return writer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBGlobalLight {
|
|
53
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
54
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
55
|
+
const message = createBasePBGlobalLight();
|
|
56
|
+
while (reader.pos < end) {
|
|
57
|
+
const tag = reader.uint32();
|
|
58
|
+
switch (tag >>> 3) {
|
|
59
|
+
case 1:
|
|
60
|
+
if (tag !== 10) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message.direction = Vector3.decode(reader, reader.uint32());
|
|
65
|
+
continue;
|
|
66
|
+
case 2:
|
|
67
|
+
if (tag !== 18) {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message.ambientColor = Color3.decode(reader, reader.uint32());
|
|
72
|
+
continue;
|
|
73
|
+
case 3:
|
|
74
|
+
if (tag !== 29) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message.ambientBrightness = reader.float();
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
reader.skipType(tag & 7);
|
|
85
|
+
}
|
|
86
|
+
return message;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function fromJSON(object: any): PBGlobalLight {
|
|
90
|
+
return {
|
|
91
|
+
direction: isSet(object.direction) ? Vector3.fromJSON(object.direction) : undefined,
|
|
92
|
+
ambientColor: isSet(object.ambientColor) ? Color3.fromJSON(object.ambientColor) : undefined,
|
|
93
|
+
ambientBrightness: isSet(object.ambientBrightness) ? Number(object.ambientBrightness) : undefined,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function toJSON(message: PBGlobalLight): unknown {
|
|
98
|
+
const obj: any = {};
|
|
99
|
+
message.direction !== undefined &&
|
|
100
|
+
(obj.direction = message.direction ? Vector3.toJSON(message.direction) : undefined);
|
|
101
|
+
message.ambientColor !== undefined &&
|
|
102
|
+
(obj.ambientColor = message.ambientColor ? Color3.toJSON(message.ambientColor) : undefined);
|
|
103
|
+
message.ambientBrightness !== undefined && (obj.ambientBrightness = message.ambientBrightness);
|
|
104
|
+
return obj;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function create<I extends Exact<DeepPartial<PBGlobalLight>, I>>(base?: I): PBGlobalLight {
|
|
108
|
+
return PBGlobalLight.fromPartial(base ?? {});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function fromPartial<I extends Exact<DeepPartial<PBGlobalLight>, I>>(object: I): PBGlobalLight {
|
|
112
|
+
const message = createBasePBGlobalLight();
|
|
113
|
+
message.direction = (object.direction !== undefined && object.direction !== null)
|
|
114
|
+
? Vector3.fromPartial(object.direction)
|
|
115
|
+
: undefined;
|
|
116
|
+
message.ambientColor = (object.ambientColor !== undefined && object.ambientColor !== null)
|
|
117
|
+
? Color3.fromPartial(object.ambientColor)
|
|
118
|
+
: undefined;
|
|
119
|
+
message.ambientBrightness = object.ambientBrightness ?? undefined;
|
|
120
|
+
return message;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
125
|
+
|
|
126
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
127
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
128
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
129
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
130
|
+
: Partial<T>;
|
|
131
|
+
|
|
132
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
133
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
134
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
135
|
+
|
|
136
|
+
function isSet(value: any): boolean {
|
|
137
|
+
return value !== null && value !== undefined;
|
|
138
|
+
}
|
|
@@ -10,10 +10,29 @@ export const protobufPackage = "decentraland.sdk.components";
|
|
|
10
10
|
*/
|
|
11
11
|
export interface PBGltfContainerLoadingState {
|
|
12
12
|
currentState: LoadingState;
|
|
13
|
+
/** all node paths in the gltf, which can be used with a GltfNode to inspect and modify the gltf contents */
|
|
14
|
+
nodePaths: string[];
|
|
15
|
+
/** all meshes in the gltf. unnamed meshes will be auto-assigned a name of the form `MeshX` or `MeshX/PrimitiveY` */
|
|
16
|
+
meshNames: string[];
|
|
17
|
+
/**
|
|
18
|
+
* where X is the mesh index and Y is the primitive index (and there is more than 1 primitive). note this may
|
|
19
|
+
* conflict with manually named meshes - to avoid any issues make sure all your meshes are explicitly named.
|
|
20
|
+
*/
|
|
21
|
+
materialNames: string[];
|
|
22
|
+
/**
|
|
23
|
+
* X is the material index. note this may conflict with manually named materials - to avoid any issues make
|
|
24
|
+
* sure all your materials are explicitly named.
|
|
25
|
+
*/
|
|
26
|
+
skinNames: string[];
|
|
27
|
+
/**
|
|
28
|
+
* X is the skin index. note this may conflict with manually named skins - to avoid any issues make sure all
|
|
29
|
+
* your skins are explicitly named.
|
|
30
|
+
*/
|
|
31
|
+
animationNames: string[];
|
|
13
32
|
}
|
|
14
33
|
|
|
15
34
|
function createBasePBGltfContainerLoadingState(): PBGltfContainerLoadingState {
|
|
16
|
-
return { currentState: 0 };
|
|
35
|
+
return { currentState: 0, nodePaths: [], meshNames: [], materialNames: [], skinNames: [], animationNames: [] };
|
|
17
36
|
}
|
|
18
37
|
|
|
19
38
|
export namespace PBGltfContainerLoadingState {
|
|
@@ -21,6 +40,21 @@ export namespace PBGltfContainerLoadingState {
|
|
|
21
40
|
if (message.currentState !== 0) {
|
|
22
41
|
writer.uint32(8).int32(message.currentState);
|
|
23
42
|
}
|
|
43
|
+
for (const v of message.nodePaths) {
|
|
44
|
+
writer.uint32(18).string(v!);
|
|
45
|
+
}
|
|
46
|
+
for (const v of message.meshNames) {
|
|
47
|
+
writer.uint32(26).string(v!);
|
|
48
|
+
}
|
|
49
|
+
for (const v of message.materialNames) {
|
|
50
|
+
writer.uint32(34).string(v!);
|
|
51
|
+
}
|
|
52
|
+
for (const v of message.skinNames) {
|
|
53
|
+
writer.uint32(42).string(v!);
|
|
54
|
+
}
|
|
55
|
+
for (const v of message.animationNames) {
|
|
56
|
+
writer.uint32(50).string(v!);
|
|
57
|
+
}
|
|
24
58
|
return writer;
|
|
25
59
|
}
|
|
26
60
|
|
|
@@ -38,6 +72,41 @@ export namespace PBGltfContainerLoadingState {
|
|
|
38
72
|
|
|
39
73
|
message.currentState = reader.int32() as any;
|
|
40
74
|
continue;
|
|
75
|
+
case 2:
|
|
76
|
+
if (tag !== 18) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message.nodePaths.push(reader.string());
|
|
81
|
+
continue;
|
|
82
|
+
case 3:
|
|
83
|
+
if (tag !== 26) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message.meshNames.push(reader.string());
|
|
88
|
+
continue;
|
|
89
|
+
case 4:
|
|
90
|
+
if (tag !== 34) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message.materialNames.push(reader.string());
|
|
95
|
+
continue;
|
|
96
|
+
case 5:
|
|
97
|
+
if (tag !== 42) {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message.skinNames.push(reader.string());
|
|
102
|
+
continue;
|
|
103
|
+
case 6:
|
|
104
|
+
if (tag !== 50) {
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message.animationNames.push(reader.string());
|
|
109
|
+
continue;
|
|
41
110
|
}
|
|
42
111
|
if ((tag & 7) === 4 || tag === 0) {
|
|
43
112
|
break;
|
|
@@ -48,12 +117,44 @@ export namespace PBGltfContainerLoadingState {
|
|
|
48
117
|
}
|
|
49
118
|
|
|
50
119
|
export function fromJSON(object: any): PBGltfContainerLoadingState {
|
|
51
|
-
return {
|
|
120
|
+
return {
|
|
121
|
+
currentState: isSet(object.currentState) ? loadingStateFromJSON(object.currentState) : 0,
|
|
122
|
+
nodePaths: Array.isArray(object?.nodePaths) ? object.nodePaths.map((e: any) => String(e)) : [],
|
|
123
|
+
meshNames: Array.isArray(object?.meshNames) ? object.meshNames.map((e: any) => String(e)) : [],
|
|
124
|
+
materialNames: Array.isArray(object?.materialNames) ? object.materialNames.map((e: any) => String(e)) : [],
|
|
125
|
+
skinNames: Array.isArray(object?.skinNames) ? object.skinNames.map((e: any) => String(e)) : [],
|
|
126
|
+
animationNames: Array.isArray(object?.animationNames) ? object.animationNames.map((e: any) => String(e)) : [],
|
|
127
|
+
};
|
|
52
128
|
}
|
|
53
129
|
|
|
54
130
|
export function toJSON(message: PBGltfContainerLoadingState): unknown {
|
|
55
131
|
const obj: any = {};
|
|
56
132
|
message.currentState !== undefined && (obj.currentState = loadingStateToJSON(message.currentState));
|
|
133
|
+
if (message.nodePaths) {
|
|
134
|
+
obj.nodePaths = message.nodePaths.map((e) => e);
|
|
135
|
+
} else {
|
|
136
|
+
obj.nodePaths = [];
|
|
137
|
+
}
|
|
138
|
+
if (message.meshNames) {
|
|
139
|
+
obj.meshNames = message.meshNames.map((e) => e);
|
|
140
|
+
} else {
|
|
141
|
+
obj.meshNames = [];
|
|
142
|
+
}
|
|
143
|
+
if (message.materialNames) {
|
|
144
|
+
obj.materialNames = message.materialNames.map((e) => e);
|
|
145
|
+
} else {
|
|
146
|
+
obj.materialNames = [];
|
|
147
|
+
}
|
|
148
|
+
if (message.skinNames) {
|
|
149
|
+
obj.skinNames = message.skinNames.map((e) => e);
|
|
150
|
+
} else {
|
|
151
|
+
obj.skinNames = [];
|
|
152
|
+
}
|
|
153
|
+
if (message.animationNames) {
|
|
154
|
+
obj.animationNames = message.animationNames.map((e) => e);
|
|
155
|
+
} else {
|
|
156
|
+
obj.animationNames = [];
|
|
157
|
+
}
|
|
57
158
|
return obj;
|
|
58
159
|
}
|
|
59
160
|
|
|
@@ -68,6 +169,11 @@ export namespace PBGltfContainerLoadingState {
|
|
|
68
169
|
): PBGltfContainerLoadingState {
|
|
69
170
|
const message = createBasePBGltfContainerLoadingState();
|
|
70
171
|
message.currentState = object.currentState ?? 0;
|
|
172
|
+
message.nodePaths = object.nodePaths?.map((e) => e) || [];
|
|
173
|
+
message.meshNames = object.meshNames?.map((e) => e) || [];
|
|
174
|
+
message.materialNames = object.materialNames?.map((e) => e) || [];
|
|
175
|
+
message.skinNames = object.skinNames?.map((e) => e) || [];
|
|
176
|
+
message.animationNames = object.animationNames?.map((e) => e) || [];
|
|
71
177
|
return message;
|
|
72
178
|
}
|
|
73
179
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
|
|
4
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* a GltfNode links a scene entity with a node from within a gltf, allowing the scene to inspect it or modify it.
|
|
8
|
+
* This component must be added to a direct child of an entity with a PBGltfContainer component, or
|
|
9
|
+
* to a direct child of another entity with a GltfNode component, and the referenced gltf node must be a descendent of the gltf node
|
|
10
|
+
* in the parent.
|
|
11
|
+
* The name must match the path of one of the nodes within the Gltf. These are available on the GltfContainerLoadingState component.
|
|
12
|
+
*
|
|
13
|
+
* The renderer will attach a PBGltfNodeState to the entity describing the state. Once the state is `GNS_READY`,
|
|
14
|
+
* - the `Transform` will be updated to match the position of the node within the gltf (relative to the gltf root, or the parent node),
|
|
15
|
+
* - a `MeshRenderer` with a GltfMesh mesh type will be added (if the gltf node has a mesh).
|
|
16
|
+
* - a `MeshCollider` with a GltfMesh mesh type will be added (if the gltf node has a collider).
|
|
17
|
+
* - a `Material` component including a GltfMaterial reference will be added (if the gltf node has a material).
|
|
18
|
+
*
|
|
19
|
+
* After creation, if an animation moves the node, the `Transform` will be updated.
|
|
20
|
+
*
|
|
21
|
+
* From the scene, you can modify various components to alter the gltf node:
|
|
22
|
+
* - modifying the `Transform` position/rotation/scale will move the node. The position is interpreted relative to the gltf root (or parent node),
|
|
23
|
+
* regardless of any intermediate gltf node hierarchy.
|
|
24
|
+
* If an animation is playing, the animation takes priority and the scene entity's position will be updated to match the animation.
|
|
25
|
+
* - `Visibility` can be added to hide or show the node and it's children in the gltf hierarchy.
|
|
26
|
+
* - `MeshRenderer` can be added/modified/removed to create/modify/remove a mesh on the node.
|
|
27
|
+
* - `MeshCollider` can be added/modified/removed to create/modify/remove a collider on the node.
|
|
28
|
+
* - `Material` can be added or modified to change the material properties. If the gltf node has a material, the original material will be
|
|
29
|
+
* used as a base, and any gltf features (e.g. occlusion maps) from the gtlf spec that the renderer supports but that are not exposed in the
|
|
30
|
+
* PBMaterial will be maintained.
|
|
31
|
+
*
|
|
32
|
+
* The scene can add additional entities as children to the gltf node, but structural modifications of the gltf are not possible:
|
|
33
|
+
* - changing the scene hierarchy will not change the gltf node hierarchy. Moving the entity out of the gltf will sever the link and
|
|
34
|
+
* change the state to `GNS_FAILED`.
|
|
35
|
+
* - deleting the scene entity will not delete the gltf node.
|
|
36
|
+
*
|
|
37
|
+
* Removing the GltfNode will revert any changes to the original gltf. If the GltfNode component is removed and the mesh/collider/material
|
|
38
|
+
* are not removed, this will result in a duplication of these components as the previously-linked entity will retain it's components and
|
|
39
|
+
* the gltf node will also be displayed.
|
|
40
|
+
*/
|
|
41
|
+
export interface PBGltfNode {
|
|
42
|
+
/** the path of the target node in the Gltf. */
|
|
43
|
+
path: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function createBasePBGltfNode(): PBGltfNode {
|
|
47
|
+
return { path: "" };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export namespace PBGltfNode {
|
|
51
|
+
export function encode(message: PBGltfNode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
52
|
+
if (message.path !== "") {
|
|
53
|
+
writer.uint32(10).string(message.path);
|
|
54
|
+
}
|
|
55
|
+
return writer;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBGltfNode {
|
|
59
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
60
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
61
|
+
const message = createBasePBGltfNode();
|
|
62
|
+
while (reader.pos < end) {
|
|
63
|
+
const tag = reader.uint32();
|
|
64
|
+
switch (tag >>> 3) {
|
|
65
|
+
case 1:
|
|
66
|
+
if (tag !== 10) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message.path = reader.string();
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
reader.skipType(tag & 7);
|
|
77
|
+
}
|
|
78
|
+
return message;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function fromJSON(object: any): PBGltfNode {
|
|
82
|
+
return { path: isSet(object.path) ? String(object.path) : "" };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function toJSON(message: PBGltfNode): unknown {
|
|
86
|
+
const obj: any = {};
|
|
87
|
+
message.path !== undefined && (obj.path = message.path);
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function create<I extends Exact<DeepPartial<PBGltfNode>, I>>(base?: I): PBGltfNode {
|
|
92
|
+
return PBGltfNode.fromPartial(base ?? {});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function fromPartial<I extends Exact<DeepPartial<PBGltfNode>, I>>(object: I): PBGltfNode {
|
|
96
|
+
const message = createBasePBGltfNode();
|
|
97
|
+
message.path = object.path ?? "";
|
|
98
|
+
return message;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
103
|
+
|
|
104
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
105
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
106
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
107
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
108
|
+
: Partial<T>;
|
|
109
|
+
|
|
110
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
111
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
112
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
113
|
+
|
|
114
|
+
function isSet(value: any): boolean {
|
|
115
|
+
return value !== null && value !== undefined;
|
|
116
|
+
}
|