@dcl/ecs 7.1.4-4492843881.commit-442dfb1 → 7.1.4-4502579506.commit-4147243

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 (39) hide show
  1. package/dist/components/generated/pb/decentraland/sdk/components/animator.gen.d.ts +17 -3
  2. package/dist/components/generated/pb/decentraland/sdk/components/audio_source.gen.d.ts +16 -2
  3. package/dist/components/generated/pb/decentraland/sdk/components/audio_stream.gen.d.ts +8 -1
  4. package/dist/components/generated/pb/decentraland/sdk/components/avatar_attach.gen.d.ts +13 -1
  5. package/dist/components/generated/pb/decentraland/sdk/components/avatar_attach.gen.js +1 -0
  6. package/dist/components/generated/pb/decentraland/sdk/components/avatar_modifier_area.gen.d.ts +20 -0
  7. package/dist/components/generated/pb/decentraland/sdk/components/avatar_modifier_area.gen.js +3 -0
  8. package/dist/components/generated/pb/decentraland/sdk/components/avatar_shape.gen.d.ts +29 -14
  9. package/dist/components/generated/pb/decentraland/sdk/components/billboard.gen.d.ts +11 -1
  10. package/dist/components/generated/pb/decentraland/sdk/components/billboard.gen.js +2 -0
  11. package/dist/components/generated/pb/decentraland/sdk/components/camera_mode.gen.d.ts +5 -0
  12. package/dist/components/generated/pb/decentraland/sdk/components/camera_mode_area.gen.d.ts +15 -0
  13. package/dist/components/generated/pb/decentraland/sdk/components/common/camera_type.gen.d.ts +3 -1
  14. package/dist/components/generated/pb/decentraland/sdk/components/common/camera_type.gen.js +2 -0
  15. package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.d.ts +10 -0
  16. package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.js +11 -0
  17. package/dist/components/generated/pb/decentraland/sdk/components/common/raycast_hit.gen.d.ts +21 -0
  18. package/dist/components/generated/pb/decentraland/sdk/components/common/raycast_hit.gen.js +82 -0
  19. package/dist/components/generated/pb/decentraland/sdk/components/gltf_container.gen.d.ts +7 -1
  20. package/dist/components/generated/pb/decentraland/sdk/components/mesh_collider.gen.d.ts +37 -4
  21. package/dist/components/generated/pb/decentraland/sdk/components/mesh_collider.gen.js +19 -0
  22. package/dist/components/generated/pb/decentraland/sdk/components/mesh_renderer.gen.d.ts +18 -2
  23. package/dist/components/generated/pb/decentraland/sdk/components/nft_shape.gen.d.ts +13 -2
  24. package/dist/components/generated/pb/decentraland/sdk/components/nft_shape.gen.js +1 -0
  25. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.d.ts +21 -12
  26. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.js +0 -10
  27. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events_result.gen.d.ts +2 -3
  28. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events_result.gen.js +3 -3
  29. package/dist/components/generated/pb/decentraland/sdk/components/pointer_lock.gen.d.ts +5 -0
  30. package/dist/components/generated/pb/decentraland/sdk/components/raycast.gen.d.ts +41 -3
  31. package/dist/components/generated/pb/decentraland/sdk/components/raycast.gen.js +56 -7
  32. package/dist/components/generated/pb/decentraland/sdk/components/raycast_result.gen.d.ts +14 -15
  33. package/dist/components/generated/pb/decentraland/sdk/components/raycast_result.gen.js +8 -111
  34. package/dist/components/generated/pb/decentraland/sdk/components/text_shape.gen.d.ts +29 -11
  35. package/dist/components/generated/pb/decentraland/sdk/components/ui_text.gen.d.ts +5 -4
  36. package/dist/components/generated/types.gen.d.ts +1 -0
  37. package/dist/components/generated/types.gen.js +2 -0
  38. package/dist/engine/input.d.ts +1 -1
  39. package/package.json +20 -26
@@ -1,21 +1,35 @@
1
+ /**
2
+ * The Animator component is a container for multiple potential animations an Entity can display,
3
+ * separately or at the same time. It can be used to start, stop or blend animations; as well as
4
+ * to inspect their playback state.
5
+ *
6
+ * Animations have a `weight` property, which determines how pronounced the animation will be. This
7
+ * can be adjusted to blend animations together, or gracefully transition from one to the next.
8
+ */
1
9
  /**
2
10
  * @public
3
11
  */
4
12
  export interface PBAnimator {
13
+ /** a collection of animations and their current state */
5
14
  states: PBAnimationState[];
6
15
  }
16
+ /** AnimationState indicates the status and configuration of one available animation. */
7
17
  /**
8
18
  * @public
9
19
  */
10
20
  export interface PBAnimationState {
21
+ /** the identifier for this animation, to use in scene code */
11
22
  name: string;
23
+ /** the animation path in the `files` array of the scene manifest */
12
24
  clip: string;
25
+ /** whether this animation is currently playing */
13
26
  playing?: boolean | undefined;
14
- /** default=1.0s */
27
+ /** the "weight" of this animation (see below, default: 1.0) */
15
28
  weight?: number | undefined;
16
- /** default=1.0 */
29
+ /** the playback speed (default: 1.0) */
17
30
  speed?: number | undefined;
18
- /** default=true */
31
+ /** whether the animation repeats until stopped (default: true) */
19
32
  loop?: boolean | undefined;
33
+ /** whether the Entity is restored to its prior state when done */
20
34
  shouldReset?: boolean | undefined;
21
35
  }
@@ -1,12 +1,26 @@
1
+ /**
2
+ * The AudioSource component can play an audio clips bundled with the scene, controlling some
3
+ * of the behavior.
4
+ *
5
+ * In each AudioSource instance, the sound is spatially located at the associated entity’s position,
6
+ * given by its Transform.
7
+ *
8
+ * Note that the `audio_clip_url` is not actually a URL, but rather the path of a file bundled with
9
+ * the scene and declared in its manifest. The name was chosen because the URL use-case will
10
+ * eventually be supported.
11
+ */
1
12
  /**
2
13
  * @public
3
14
  */
4
15
  export interface PBAudioSource {
16
+ /** whether the clip is currently playing. */
5
17
  playing?: boolean | undefined;
6
- /** default=1.0f */
18
+ /** the audio volume (default: 1.0). */
7
19
  volume?: number | undefined;
20
+ /** whether the clip should restart when finished. */
8
21
  loop?: boolean | undefined;
9
- /** default=1.0f */
22
+ /** the audio pitch (default: 1.0). */
10
23
  pitch?: number | undefined;
24
+ /** the clip path as given in the `files` array of the scene's manifest. */
11
25
  audioClipUrl: string;
12
26
  }
@@ -1,9 +1,16 @@
1
+ /**
2
+ * The AudioStream component can play external audio clips given a URL, streaming it in real-time.
3
+ *
4
+ * Despite being attached to a particular entity, the sound is not affected by its position.
5
+ */
1
6
  /**
2
7
  * @public
3
8
  */
4
9
  export interface PBAudioStream {
10
+ /** whether the clip is currently playing */
5
11
  playing?: boolean | undefined;
6
- /** default=1.0f */
12
+ /** the audio volume (default: 1.0) */
7
13
  volume?: number | undefined;
14
+ /** the audio stream HTTP URL */
8
15
  url: string;
9
16
  }
@@ -1,3 +1,4 @@
1
+ /** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
1
2
  /**
2
3
  * @public
3
4
  */
@@ -7,11 +8,22 @@ export declare const enum AvatarAnchorPointType {
7
8
  AAPT_LEFT_HAND = 2,
8
9
  AAPT_RIGHT_HAND = 3
9
10
  }
11
+ /**
12
+ * The AvatarAttach component automatically repositions an Entity to maintain the same position and
13
+ * rotation relative to some part of an avatar, called the "anchor point". The Entity
14
+ * will follow this anchor as it moves.
15
+ *
16
+ * The Entity's own Transform is overridden by this component. To offset position and adjust scale,
17
+ * add a child to the anchored Entity and set a Transform on it instead.
18
+ *
19
+ * AvatarAnchorPointType indicates which part of the avatar the Entity must follow.
20
+ */
10
21
  /**
11
22
  * @public
12
23
  */
13
24
  export interface PBAvatarAttach {
14
- /** default's to current player avatar id if not provided */
25
+ /** the user ID of the avatar (default: local user) */
15
26
  avatarId?: string | undefined;
27
+ /** the anchor point. */
16
28
  anchorPointId: AvatarAnchorPointType;
17
29
  }
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import _m0 from "protobufjs/minimal";
3
3
  const protobufPackageSarasa = "decentraland.sdk.components";
4
+ /** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
4
5
  /**
5
6
  * @public
6
7
  */
@@ -1,16 +1,36 @@
1
1
  import { Vector3 } from "../../common/vectors.gen";
2
+ /** AvatarModifierType is an effect that should be applied to avatars inside the region. */
2
3
  /**
3
4
  * @public
4
5
  */
5
6
  export declare const enum AvatarModifierType {
7
+ /** AMT_HIDE_AVATARS - avatars are invisible */
6
8
  AMT_HIDE_AVATARS = 0,
9
+ /** AMT_DISABLE_PASSPORTS - selecting (e.g. clicking) an avatar will not bring up their profile. */
7
10
  AMT_DISABLE_PASSPORTS = 1
8
11
  }
12
+ /**
13
+ * The AvatarModifierArea component can be attached to an Entity to define a region of space where
14
+ * avatar behavior changes.
15
+ *
16
+ * The Entity's Transform position determines the center-point of the region, while its size is
17
+ * given as a vector in the `area` property below. The Transform rotation is applied, but the scale
18
+ * is ignored.
19
+ *
20
+ * The modifier effect is only applied to avatars inside the region. It does not affect how players
21
+ * standing inside it see avatars on the other side of the boundary.
22
+ *
23
+ * Note that, while commonly used to delineate a 2D area in a scene (hence the name), the region
24
+ * is actually a 3D volume.
25
+ */
9
26
  /**
10
27
  * @public
11
28
  */
12
29
  export interface PBAvatarModifierArea {
30
+ /** the 3D size of the region */
13
31
  area: Vector3 | undefined;
32
+ /** user IDs that can enter and remain unaffected */
14
33
  excludeIds: string[];
34
+ /** list of modifiers to apply */
15
35
  modifiers: AvatarModifierType[];
16
36
  }
@@ -2,12 +2,15 @@
2
2
  import _m0 from "protobufjs/minimal";
3
3
  import { Vector3 } from "../../common/vectors.gen";
4
4
  const protobufPackageSarasa = "decentraland.sdk.components";
5
+ /** AvatarModifierType is an effect that should be applied to avatars inside the region. */
5
6
  /**
6
7
  * @public
7
8
  */
8
9
  export var AvatarModifierType;
9
10
  (function (AvatarModifierType) {
11
+ /** AMT_HIDE_AVATARS - avatars are invisible */
10
12
  AvatarModifierType[AvatarModifierType["AMT_HIDE_AVATARS"] = 0] = "AMT_HIDE_AVATARS";
13
+ /** AMT_DISABLE_PASSPORTS - selecting (e.g. clicking) an avatar will not bring up their profile. */
11
14
  AvatarModifierType[AvatarModifierType["AMT_DISABLE_PASSPORTS"] = 1] = "AMT_DISABLE_PASSPORTS";
12
15
  })(AvatarModifierType || (AvatarModifierType = {}));
13
16
  function createBasePBAvatarModifierArea() {
@@ -1,33 +1,48 @@
1
1
  import { Color3 } from "../../common/colors.gen";
2
+ /**
3
+ * The AvatarShape component contains the information required to draw and animate avatar, acting as
4
+ * a simplified GLTF container for this specific case.
5
+ *
6
+ * All fields (except ID) are optional have reasonable default values. In the case of `wearables`,
7
+ * each slot on the Avatar's body that is not explicitly included in the list has its own default.
8
+ *
9
+ * Note that, while AvatarShape can be attached to any Entity, it's only actually used in the global
10
+ * Avatar Scene. Other requirements are usually better served by GLTFs.
11
+ */
2
12
  /**
3
13
  * @public
4
14
  */
5
15
  export interface PBAvatarShape {
16
+ /** the user ID */
6
17
  id: string;
7
- /** default = NPC */
18
+ /** visible name (default: "NPC") */
8
19
  name?: string | undefined;
9
- /** default = urn:decentraland:off-chain:base-avatars:BaseFemale */
20
+ /** shape URN (default "urn:decentraland:off-chain:base-avatars:BaseFemale") */
10
21
  bodyShape?: string | undefined;
11
- /** default = decentraland.common.Color3(R = 0.6f, G = 0.462f, B = 0.356f) */
22
+ /** RGB (default [0.6, 0.462, 0.356]) */
12
23
  skinColor?: Color3 | undefined;
13
- /** default = decentraland.common.Color3(R = 0.283f, G = 0.142f, B = 0f) */
24
+ /** RGB (default [0.283, 0.142, 0]) */
14
25
  hairColor?: Color3 | undefined;
15
- /** default = decentraland.common.Color3(R = 0.6f, G = 0.462f, B = 0.356f) */
26
+ /** RGB (default [0.6, 0.462, 0.356]) */
16
27
  eyeColor?: Color3 | undefined;
28
+ /** current emote animations */
17
29
  expressionTriggerId?: string | undefined;
18
- /** default = timestamp */
30
+ /** start of emote animations (in the same order) */
19
31
  expressionTriggerTimestamp?: number | undefined;
32
+ /** whether to display the floating voice chat icon */
20
33
  talking?: boolean | undefined;
21
34
  /**
22
- * default = ["urn:decentraland:off-chain:base-avatars:f_eyes_00",
23
- * "urn:decentraland:off-chain:base-avatars:f_eyebrows_00",
24
- * "urn:decentraland:off-chain:base-avatars:f_mouth_00"
25
- * "urn:decentraland:off-chain:base-avatars:standard_hair",
26
- * "urn:decentraland:off-chain:base-avatars:f_simple_yellow_tshirt",
27
- * "urn:decentraland:off-chain:base-avatars:f_brown_trousers",
28
- * "urn:decentraland:off-chain:base-avatars:bun_shoes"]
35
+ * Wearable URNs, one for each body slot.
36
+ * Default values for each unspecified slot:
37
+ * Eyes : "urn:decentraland:off-chain:base-avatars:f_eyes_00",
38
+ * Eyebrows: "urn:decentraland:off-chain:base-avatars:f_eyebrows_00",
39
+ * Mouth : "urn:decentraland:off-chain:base-avatars:f_mouth_00"
40
+ * Hair : "urn:decentraland:off-chain:base-avatars:standard_hair",
41
+ * Shirt : "urn:decentraland:off-chain:base-avatars:f_simple_yellow_tshirt",
42
+ * Trousers: "urn:decentraland:off-chain:base-avatars:f_brown_trousers",
43
+ * Shoes : "urn:decentraland:off-chain:base-avatars:bun_shoes"]
29
44
  */
30
45
  wearables: string[];
31
- /** default = [] */
46
+ /** available emotes (default empty) */
32
47
  emotes: string[];
33
48
  }
@@ -1,3 +1,4 @@
1
+ /** BillboardMode indicates one or more axis for automatic rotation, in OR-able bit flag form. */
1
2
  /**
2
3
  * @public
3
4
  */
@@ -6,12 +7,21 @@ export declare const enum BillboardMode {
6
7
  BM_X = 1,
7
8
  BM_Y = 2,
8
9
  BM_Z = 4,
10
+ /** BM_ALL - bitwise combination BM_X | BM_Y | BM_Z */
9
11
  BM_ALL = 7
10
12
  }
13
+ /**
14
+ * The Billboard component makes an Entity automatically reorient its rotation to face the camera.
15
+ * As the name indicates, it’s used to display in-game billboards and frequently combined with
16
+ * the TextShape component.
17
+ *
18
+ * Billboard only affects the Entity's rotation. Its scale and position are still determined by its
19
+ * Transform.
20
+ */
11
21
  /**
12
22
  * @public
13
23
  */
14
24
  export interface PBBillboard {
15
- /** default=BM_ALL */
25
+ /** the BillboardMode (default: BM_ALL) */
16
26
  billboardMode?: BillboardMode | undefined;
17
27
  }
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import _m0 from "protobufjs/minimal";
3
3
  const protobufPackageSarasa = "decentraland.sdk.components";
4
+ /** BillboardMode indicates one or more axis for automatic rotation, in OR-able bit flag form. */
4
5
  /**
5
6
  * @public
6
7
  */
@@ -10,6 +11,7 @@ export var BillboardMode;
10
11
  BillboardMode[BillboardMode["BM_X"] = 1] = "BM_X";
11
12
  BillboardMode[BillboardMode["BM_Y"] = 2] = "BM_Y";
12
13
  BillboardMode[BillboardMode["BM_Z"] = 4] = "BM_Z";
14
+ /** BM_ALL - bitwise combination BM_X | BM_Y | BM_Z */
13
15
  BillboardMode[BillboardMode["BM_ALL"] = 7] = "BM_ALL";
14
16
  })(BillboardMode || (BillboardMode = {}));
15
17
  function createBasePBBillboard() {
@@ -1,7 +1,12 @@
1
1
  import { CameraType } from "./common/camera_type.gen";
2
+ /**
3
+ * The CameraMode component can be used to determine whether the player is using a first-person o
4
+ * third-person view.
5
+ */
2
6
  /**
3
7
  * @public
4
8
  */
5
9
  export interface PBCameraMode {
10
+ /** the camera type (1st-person or 3rd-person) */
6
11
  mode: CameraType;
7
12
  }
@@ -1,9 +1,24 @@
1
1
  import { Vector3 } from "../../common/vectors.gen";
2
2
  import { CameraType } from "./common/camera_type.gen";
3
+ /**
4
+ * The CameraModeArea component can be attached to an Entity to define a region of space where
5
+ * the player's camera mode (1st-person or 3rd-person) is overridden.
6
+ *
7
+ * The Entity's Transform position determines the center-point of the region, while its size is
8
+ * given as a vector in the `area` property below. The Transform rotation is applied, but the scale
9
+ * is ignored.
10
+ *
11
+ * When players leave the region, their previous setting is restored.
12
+ *
13
+ * Note that, while commonly used to delineate a 2D area in a scene (hence the name), the region
14
+ * is actually a 3D volume.
15
+ */
3
16
  /**
4
17
  * @public
5
18
  */
6
19
  export interface PBCameraModeArea {
20
+ /** the 3D size of the region */
7
21
  area: Vector3 | undefined;
22
+ /** the camera mode to enforce */
8
23
  mode: CameraType;
9
24
  }
@@ -3,5 +3,7 @@
3
3
  */
4
4
  export declare const enum CameraType {
5
5
  CT_FIRST_PERSON = 0,
6
- CT_THIRD_PERSON = 1
6
+ CT_THIRD_PERSON = 1,
7
+ /** CT_CINEMATIC - controlled by the scene */
8
+ CT_CINEMATIC = 2
7
9
  }
@@ -7,4 +7,6 @@ export var CameraType;
7
7
  (function (CameraType) {
8
8
  CameraType[CameraType["CT_FIRST_PERSON"] = 0] = "CT_FIRST_PERSON";
9
9
  CameraType[CameraType["CT_THIRD_PERSON"] = 1] = "CT_THIRD_PERSON";
10
+ /** CT_CINEMATIC - controlled by the scene */
11
+ CameraType[CameraType["CT_CINEMATIC"] = 2] = "CT_CINEMATIC";
10
12
  })(CameraType || (CameraType = {}));
@@ -17,3 +17,13 @@ export declare const enum InputAction {
17
17
  IA_ACTION_5 = 12,
18
18
  IA_ACTION_6 = 13
19
19
  }
20
+ /** PointerEventType is a kind of interaction that can be detected. */
21
+ /**
22
+ * @public
23
+ */
24
+ export declare const enum PointerEventType {
25
+ PET_UP = 0,
26
+ PET_DOWN = 1,
27
+ PET_HOVER_ENTER = 2,
28
+ PET_HOVER_LEAVE = 3
29
+ }
@@ -20,3 +20,14 @@ export var InputAction;
20
20
  InputAction[InputAction["IA_ACTION_5"] = 12] = "IA_ACTION_5";
21
21
  InputAction[InputAction["IA_ACTION_6"] = 13] = "IA_ACTION_6";
22
22
  })(InputAction || (InputAction = {}));
23
+ /** PointerEventType is a kind of interaction that can be detected. */
24
+ /**
25
+ * @public
26
+ */
27
+ export var PointerEventType;
28
+ (function (PointerEventType) {
29
+ PointerEventType[PointerEventType["PET_UP"] = 0] = "PET_UP";
30
+ PointerEventType[PointerEventType["PET_DOWN"] = 1] = "PET_DOWN";
31
+ PointerEventType[PointerEventType["PET_HOVER_ENTER"] = 2] = "PET_HOVER_ENTER";
32
+ PointerEventType[PointerEventType["PET_HOVER_LEAVE"] = 3] = "PET_HOVER_LEAVE";
33
+ })(PointerEventType || (PointerEventType = {}));
@@ -0,0 +1,21 @@
1
+ import { Vector3 } from "../../../common/vectors.gen";
2
+ /** RaycastHit contains information about the intersection of a ray with a mesh. */
3
+ /**
4
+ * @public
5
+ */
6
+ export interface RaycastHit {
7
+ /** Position will be relative to the scene */
8
+ position: Vector3 | undefined;
9
+ /** the starting point of the ray in global coordinates */
10
+ globalOrigin: Vector3 | undefined;
11
+ /** the direction vector of the ray in global coordinates */
12
+ direction: Vector3 | undefined;
13
+ /** normal of the hit surface in global coordinates */
14
+ normalHit: Vector3 | undefined;
15
+ /** the distance between the ray origin and the hit position */
16
+ length: number;
17
+ /** mesh name, if collision happened inside a GltfContainer */
18
+ meshName?: string | undefined;
19
+ /** the ID of the Entity that has the impacted mesh attached */
20
+ entityId?: number | undefined;
21
+ }
@@ -0,0 +1,82 @@
1
+ /* eslint-disable */
2
+ import _m0 from "protobufjs/minimal";
3
+ import { Vector3 } from "../../../common/vectors.gen";
4
+ const protobufPackageSarasa = "decentraland.sdk.components.common";
5
+ function createBaseRaycastHit() {
6
+ return {
7
+ position: undefined,
8
+ globalOrigin: undefined,
9
+ direction: undefined,
10
+ normalHit: undefined,
11
+ length: 0,
12
+ meshName: undefined,
13
+ entityId: undefined,
14
+ };
15
+ }
16
+ /**
17
+ * @public
18
+ */
19
+ /**
20
+ * @internal
21
+ */
22
+ export const RaycastHit = {
23
+ encode(message, writer = _m0.Writer.create()) {
24
+ if (message.position !== undefined) {
25
+ Vector3.encode(message.position, writer.uint32(10).fork()).ldelim();
26
+ }
27
+ if (message.globalOrigin !== undefined) {
28
+ Vector3.encode(message.globalOrigin, writer.uint32(18).fork()).ldelim();
29
+ }
30
+ if (message.direction !== undefined) {
31
+ Vector3.encode(message.direction, writer.uint32(26).fork()).ldelim();
32
+ }
33
+ if (message.normalHit !== undefined) {
34
+ Vector3.encode(message.normalHit, writer.uint32(34).fork()).ldelim();
35
+ }
36
+ if (message.length !== 0) {
37
+ writer.uint32(45).float(message.length);
38
+ }
39
+ if (message.meshName !== undefined) {
40
+ writer.uint32(50).string(message.meshName);
41
+ }
42
+ if (message.entityId !== undefined) {
43
+ writer.uint32(56).uint32(message.entityId);
44
+ }
45
+ return writer;
46
+ },
47
+ decode(input, length) {
48
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
49
+ let end = length === undefined ? reader.len : reader.pos + length;
50
+ const message = createBaseRaycastHit();
51
+ while (reader.pos < end) {
52
+ const tag = reader.uint32();
53
+ switch (tag >>> 3) {
54
+ case 1:
55
+ message.position = Vector3.decode(reader, reader.uint32());
56
+ break;
57
+ case 2:
58
+ message.globalOrigin = Vector3.decode(reader, reader.uint32());
59
+ break;
60
+ case 3:
61
+ message.direction = Vector3.decode(reader, reader.uint32());
62
+ break;
63
+ case 4:
64
+ message.normalHit = Vector3.decode(reader, reader.uint32());
65
+ break;
66
+ case 5:
67
+ message.length = reader.float();
68
+ break;
69
+ case 6:
70
+ message.meshName = reader.string();
71
+ break;
72
+ case 7:
73
+ message.entityId = reader.uint32();
74
+ break;
75
+ default:
76
+ reader.skipType(tag & 7);
77
+ break;
78
+ }
79
+ }
80
+ return message;
81
+ },
82
+ };
@@ -1,7 +1,13 @@
1
+ /**
2
+ * GltfContainer loads a GLTF file (and any additional files packaged inside) attached to an Entity.
3
+ *
4
+ * This allows the use of custom models, materials, collision boundaries and shapes that can't be
5
+ * achieved using MeshRenderer, MeshCollider and other standard components.
6
+ */
1
7
  /**
2
8
  * @public
3
9
  */
4
10
  export interface PBGltfContainer {
5
- /** which file to load */
11
+ /** the GLTF file path as listed in the scene's manifest. */
6
12
  src: string;
7
13
  }
@@ -1,16 +1,45 @@
1
+ /** ColliderLayer determines the kind of collision to detect, in OR-able bit flag form. */
1
2
  /**
2
3
  * @public
3
4
  */
4
5
  export declare const enum ColliderLayer {
6
+ /** CL_NONE - no collisions */
5
7
  CL_NONE = 0,
8
+ /** CL_POINTER - collisions with the player's pointer ray (e.g. mouse cursor hovering) */
6
9
  CL_POINTER = 1,
7
- CL_PHYSICS = 2
10
+ /** CL_PHYSICS - collision affecting your player's physics i.e. walls, floor, moving platfroms */
11
+ CL_PHYSICS = 2,
12
+ /** CL_VISIBLE_MESHES - all visible meshes, use with extreme care since the performance penalty is high */
13
+ CL_VISIBLE_MESHES = 4,
14
+ CL_RESERVED2 = 8,
15
+ CL_RESERVED3 = 16,
16
+ CL_RESERVED4 = 32,
17
+ CL_RESERVED5 = 64,
18
+ CL_RESERVED6 = 128,
19
+ CL_CUSTOM1 = 256,
20
+ CL_CUSTOM2 = 512,
21
+ CL_CUSTOM3 = 1024,
22
+ CL_CUSTOM4 = 2048,
23
+ CL_CUSTOM5 = 4096,
24
+ CL_CUSTOM6 = 8192,
25
+ CL_CUSTOM7 = 16384,
26
+ CL_CUSTOM8 = 32768
8
27
  }
28
+ /**
29
+ * The MeshCollider component provides basic collision detection between Entities and Avatars. It
30
+ * can behave like a cube, a plane, a sphere or a cylinder.
31
+ *
32
+ * The Entity's Transform affects the MeshCollider, scaling it and rotating it appropriately. If
33
+ * the Transform for the collision mesh must be different than the Transform for rendering the Entity,
34
+ * two different Entities must be used.
35
+ *
36
+ * More complex shapes require the use of a `GltfContainer` component.
37
+ */
9
38
  /**
10
39
  * @public
11
40
  */
12
41
  export interface PBMeshCollider {
13
- /** default = ColliderLayer.Physics | ColliderLayer.Pointer */
42
+ /** enabled ColliderLayers (default CL_POINTER | CL_PHYSICS) */
14
43
  collisionMask?: number | undefined;
15
44
  mesh?: {
16
45
  $case: "box";
@@ -26,25 +55,29 @@ export interface PBMeshCollider {
26
55
  plane: PBMeshCollider_PlaneMesh;
27
56
  };
28
57
  }
58
+ /** BoxMesh is a prism shape that contains the Entity. */
29
59
  /**
30
60
  * @public
31
61
  */
32
62
  export interface PBMeshCollider_BoxMesh {
33
63
  }
64
+ /** CylinderMesh is a truncated cone shape that contains the Entity. */
34
65
  /**
35
66
  * @public
36
67
  */
37
68
  export interface PBMeshCollider_CylinderMesh {
38
- /** default=1.0 */
69
+ /** (default 1.0) */
39
70
  radiusTop?: number | undefined;
40
- /** default=1.0 */
71
+ /** (default 1.0) */
41
72
  radiusBottom?: number | undefined;
42
73
  }
74
+ /** PlaneMesh is a 2D rectangle described by the Entity's Transform. */
43
75
  /**
44
76
  * @public
45
77
  */
46
78
  export interface PBMeshCollider_PlaneMesh {
47
79
  }
80
+ /** SphereMesh is a sphere shape that contains the Entity. */
48
81
  /**
49
82
  * @public
50
83
  */
@@ -1,14 +1,33 @@
1
1
  /* eslint-disable */
2
2
  import _m0 from "protobufjs/minimal";
3
3
  const protobufPackageSarasa = "decentraland.sdk.components";
4
+ /** ColliderLayer determines the kind of collision to detect, in OR-able bit flag form. */
4
5
  /**
5
6
  * @public
6
7
  */
7
8
  export var ColliderLayer;
8
9
  (function (ColliderLayer) {
10
+ /** CL_NONE - no collisions */
9
11
  ColliderLayer[ColliderLayer["CL_NONE"] = 0] = "CL_NONE";
12
+ /** CL_POINTER - collisions with the player's pointer ray (e.g. mouse cursor hovering) */
10
13
  ColliderLayer[ColliderLayer["CL_POINTER"] = 1] = "CL_POINTER";
14
+ /** CL_PHYSICS - collision affecting your player's physics i.e. walls, floor, moving platfroms */
11
15
  ColliderLayer[ColliderLayer["CL_PHYSICS"] = 2] = "CL_PHYSICS";
16
+ /** CL_VISIBLE_MESHES - all visible meshes, use with extreme care since the performance penalty is high */
17
+ ColliderLayer[ColliderLayer["CL_VISIBLE_MESHES"] = 4] = "CL_VISIBLE_MESHES";
18
+ ColliderLayer[ColliderLayer["CL_RESERVED2"] = 8] = "CL_RESERVED2";
19
+ ColliderLayer[ColliderLayer["CL_RESERVED3"] = 16] = "CL_RESERVED3";
20
+ ColliderLayer[ColliderLayer["CL_RESERVED4"] = 32] = "CL_RESERVED4";
21
+ ColliderLayer[ColliderLayer["CL_RESERVED5"] = 64] = "CL_RESERVED5";
22
+ ColliderLayer[ColliderLayer["CL_RESERVED6"] = 128] = "CL_RESERVED6";
23
+ ColliderLayer[ColliderLayer["CL_CUSTOM1"] = 256] = "CL_CUSTOM1";
24
+ ColliderLayer[ColliderLayer["CL_CUSTOM2"] = 512] = "CL_CUSTOM2";
25
+ ColliderLayer[ColliderLayer["CL_CUSTOM3"] = 1024] = "CL_CUSTOM3";
26
+ ColliderLayer[ColliderLayer["CL_CUSTOM4"] = 2048] = "CL_CUSTOM4";
27
+ ColliderLayer[ColliderLayer["CL_CUSTOM5"] = 4096] = "CL_CUSTOM5";
28
+ ColliderLayer[ColliderLayer["CL_CUSTOM6"] = 8192] = "CL_CUSTOM6";
29
+ ColliderLayer[ColliderLayer["CL_CUSTOM7"] = 16384] = "CL_CUSTOM7";
30
+ ColliderLayer[ColliderLayer["CL_CUSTOM8"] = 32768] = "CL_CUSTOM8";
12
31
  })(ColliderLayer || (ColliderLayer = {}));
13
32
  function createBasePBMeshCollider() {
14
33
  return { collisionMask: undefined, mesh: undefined };
@@ -1,3 +1,13 @@
1
+ /**
2
+ * The MeshRenderer component renders a basic geometric shape for an Entity. It can be a cube, a
3
+ * plane, a sphere or a cylinder.
4
+ *
5
+ * The cube and plane variants can include a UV texture mapping, so specific areas of a material
6
+ * texture are rendered on different faces of the shape. They are serialized as a sequence of 2D
7
+ * `float` coordinates, one for each corner of each side of each face.
8
+ *
9
+ * More complex shapes require the use of a `GltfContainer` component.
10
+ */
1
11
  /**
2
12
  * @public
3
13
  */
@@ -16,27 +26,33 @@ export interface PBMeshRenderer {
16
26
  plane: PBMeshRenderer_PlaneMesh;
17
27
  };
18
28
  }
29
+ /** BoxMesh renders a prism shape. */
19
30
  /**
20
31
  * @public
21
32
  */
22
33
  export interface PBMeshRenderer_BoxMesh {
34
+ /** 96-value texture map (2D * 6 faces * 2 sides * 4 vertices) */
23
35
  uvs: number[];
24
36
  }
37
+ /** CylinderMesh renders a truncated cone shape. */
25
38
  /**
26
39
  * @public
27
40
  */
28
41
  export interface PBMeshRenderer_CylinderMesh {
29
- /** default=1.0 */
42
+ /** (default 1.0) */
30
43
  radiusTop?: number | undefined;
31
- /** default=1.0 */
44
+ /** (default 1.0) */
32
45
  radiusBottom?: number | undefined;
33
46
  }
47
+ /** PlaneMesh renders a 2D rectangular shape. */
34
48
  /**
35
49
  * @public
36
50
  */
37
51
  export interface PBMeshRenderer_PlaneMesh {
52
+ /** 16-value texture map (2D * 1 face * 2 sides * 4 vertices) */
38
53
  uvs: number[];
39
54
  }
55
+ /** SphereMesh renders a spherical shape. */
40
56
  /**
41
57
  * @public
42
58
  */