@dcl/sdk 7.0.0-2957285950.commit-2a77ef6 → 7.0.0-2979266925.commit-497e30d

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.
@@ -6,15 +6,22 @@ import "common/Color3.proto";
6
6
 
7
7
  message PBAvatarShape {
8
8
  string id = 1;
9
- optional string name = 2;
10
- optional string body_shape = 3;
11
- optional Color3 skin_color = 4;
12
- optional Color3 hair_color = 5;
13
- optional Color3 eye_color = 6;
14
- repeated string wearables = 7;
15
- optional string expression_trigger_id = 8;
16
- optional int64 expression_trigger_timestamp = 9;
17
- optional string sticker_trigger_id = 10;
18
- optional int64 sticker_trigger_timestamp = 11;
19
- optional bool talking = 12;
9
+ optional string name = 2; // default = NPC
10
+ optional string body_shape = 3; // default = urn:decentraland:off-chain:base-avatars:BaseFemale
11
+ optional Color3 skin_color = 4; // default = Color3(R = 0.6f, G = 0.462f, B = 0.356f)
12
+ optional Color3 hair_color = 5; // default = Color3(R = 0.283f, G = 0.142f, B = 0f)
13
+ optional Color3 eye_color = 6; // default = Color3(R = 0.6f, G = 0.462f, B = 0.356f)
14
+ optional string expression_trigger_id = 7;
15
+ optional int64 expression_trigger_timestamp = 8; // default = timestamp
16
+ optional bool talking = 9;
17
+ /**
18
+ * default = ["urn:decentraland:off-chain:base-avatars:f_eyes_00",
19
+ * "urn:decentraland:off-chain:base-avatars:f_eyebrows_00",
20
+ * "urn:decentraland:off-chain:base-avatars:f_mouth_00"
21
+ * "urn:decentraland:off-chain:base-avatars:standard_hair",
22
+ * "urn:decentraland:off-chain:base-avatars:f_simple_yellow_tshirt",
23
+ * "urn:decentraland:off-chain:base-avatars:f_brown_trousers",
24
+ * "urn:decentraland:off-chain:base-avatars:bun_shoes"]
25
+ */
26
+ repeated string wearables = 10;
20
27
  }
@@ -0,0 +1,35 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1019;
5
+
6
+ enum ColliderLayer {
7
+ None = 0;
8
+ Pointer = 1;
9
+ Physics = 2;
10
+ }
11
+
12
+ message PBMeshCollider {
13
+ message BoxMesh {
14
+ }
15
+
16
+ message CylinderMesh {
17
+ optional float radius_top = 1; // default=1.0
18
+ optional float radius_bottom = 2; // default=1.0
19
+ }
20
+
21
+ message PlaneMesh {
22
+ }
23
+
24
+ message SphereMesh {
25
+ }
26
+
27
+ optional int32 collision_mask = 1; // default = ColliderLayer.Physics | ColliderLayer.Pointer
28
+
29
+ oneof mesh {
30
+ BoxMesh box = 2;
31
+ SphereMesh sphere = 3;
32
+ CylinderMesh cylinder = 4;
33
+ PlaneMesh plane = 5;
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/sdk",
3
- "version": "7.0.0-2957285950.commit-2a77ef6",
3
+ "version": "7.0.0-2979266925.commit-497e30d",
4
4
  "description": "",
5
5
  "main": "dist/src/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -27,8 +27,8 @@
27
27
  "src/cli/**/*.js"
28
28
  ],
29
29
  "dependencies": {
30
- "@dcl/amd": "6.11.5-2957285950.commit-2a77ef6",
31
- "@dcl/build-ecs": "6.11.5-2957285950.commit-2a77ef6",
30
+ "@dcl/amd": "6.11.7-2979266925.commit-497e30d",
31
+ "@dcl/build-ecs": "6.11.7-2979266925.commit-497e30d",
32
32
  "@dcl/kernel": "1.0.0-2638443584.commit-696a74b",
33
33
  "@dcl/posix": "^1.0.4",
34
34
  "@dcl/schemas": "4.8.0",
@@ -38,5 +38,5 @@
38
38
  "ignore": "^5.1.8"
39
39
  },
40
40
  "minCliVersion": "3.10.2",
41
- "commit": "2a77ef6f1a5048b8d1b138ce6de416489221e9e2"
41
+ "commit": "497e30ddbfeed9474b3f924d811fada9acade2d6"
42
42
  }
@@ -229,6 +229,8 @@ declare namespace Components {
229
229
  /** @public */
230
230
  const Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
231
231
  /** @public */
232
+ const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider>;
233
+ /** @public */
232
234
  const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
233
235
  /** @public */
234
236
  const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
@@ -407,14 +409,36 @@ declare interface CreateByteBufferOptions {
407
409
  /** @public */
408
410
  declare const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
409
411
 
412
+ /**
413
+ * @public
414
+ */
415
+ declare type DeepReadonly<T> = T extends ReadonlyPrimitive ? T : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
416
+
410
417
  /**
411
418
  * Make each field readonly deeply
412
419
  * @public
413
420
  */
414
- declare type DeepReadonly<T> = {
415
- readonly [P in keyof T]: DeepReadonly<T[P]>;
421
+ declare type DeepReadonly_2<T> = {
422
+ readonly [P in keyof T]: DeepReadonly_2<T[P]>;
423
+ };
424
+
425
+ /**
426
+ * @public
427
+ */
428
+ declare type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
429
+
430
+ /**
431
+ * @public
432
+ */
433
+ declare type DeepReadonlyObject<T> = {
434
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
416
435
  };
417
436
 
437
+ /**
438
+ * @public
439
+ */
440
+ declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
441
+
418
442
  declare function defineSdkComponents(engine: PreEngine): {
419
443
  Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
420
444
  MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
@@ -430,6 +454,7 @@ declare function defineSdkComponents(engine: PreEngine): {
430
454
  CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
431
455
  GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>, PBGLTFShape>;
432
456
  Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
457
+ MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider>;
433
458
  NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
434
459
  OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
435
460
  OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
@@ -566,7 +591,7 @@ declare type IEngine = {
566
591
  *
567
592
  * ```
568
593
  */
569
- defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: Spec, componentId: number, constructorDefault?: Partial<Result<T>>): ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
594
+ defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: Partial<Result<T>>): ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
570
595
  /**
571
596
  * Define a component and add it to the engine.
572
597
  * @param spec An object with schema fields
@@ -601,7 +626,7 @@ declare type IEngine = {
601
626
  * }
602
627
  * ```
603
628
  */
604
- getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...DeepReadonly<ComponentSchema<T>>]>;
629
+ getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ReadonlyComponentSchema<T>]>;
605
630
  baseComponents: SdkComponents;
606
631
  };
607
632
 
@@ -697,7 +722,7 @@ declare namespace Matrix {
697
722
  _isIdentity3x2Dirty: boolean;
698
723
  _m: Matrix4x4;
699
724
  };
700
- type ReadonlyMatrix = DeepReadonly<MutableMatrix>;
725
+ type ReadonlyMatrix = DeepReadonly_2<MutableMatrix>;
701
726
  /**
702
727
  * Gets the internal data of the matrix
703
728
  */
@@ -1380,6 +1405,9 @@ declare namespace Matrix {
1380
1405
  function toggleProjectionMatrixHandInPlace(self: MutableMatrix): void;
1381
1406
  }
1382
1407
 
1408
+ /** @public */
1409
+ declare const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider>;
1410
+
1383
1411
  /** @public */
1384
1412
  declare const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
1385
1413
 
@@ -1462,17 +1490,30 @@ declare interface PBAvatarModifierArea {
1462
1490
 
1463
1491
  declare interface PBAvatarShape {
1464
1492
  id: string;
1493
+ /** default = NPC */
1465
1494
  name?: string | undefined;
1495
+ /** default = urn:decentraland:off-chain:base-avatars:BaseFemale */
1466
1496
  bodyShape?: string | undefined;
1497
+ /** default = Color3(R = 0.6f, G = 0.462f, B = 0.356f) */
1467
1498
  skinColor?: Color3 | undefined;
1499
+ /** default = Color3(R = 0.283f, G = 0.142f, B = 0f) */
1468
1500
  hairColor?: Color3 | undefined;
1501
+ /** default = Color3(R = 0.6f, G = 0.462f, B = 0.356f) */
1469
1502
  eyeColor?: Color3 | undefined;
1470
- wearables: string[];
1471
1503
  expressionTriggerId?: string | undefined;
1504
+ /** default = timestamp */
1472
1505
  expressionTriggerTimestamp?: number | undefined;
1473
- stickerTriggerId?: string | undefined;
1474
- stickerTriggerTimestamp?: number | undefined;
1475
1506
  talking?: boolean | undefined;
1507
+ /**
1508
+ * default = ["urn:decentraland:off-chain:base-avatars:f_eyes_00",
1509
+ * "urn:decentraland:off-chain:base-avatars:f_eyebrows_00",
1510
+ * "urn:decentraland:off-chain:base-avatars:f_mouth_00"
1511
+ * "urn:decentraland:off-chain:base-avatars:standard_hair",
1512
+ * "urn:decentraland:off-chain:base-avatars:f_simple_yellow_tshirt",
1513
+ * "urn:decentraland:off-chain:base-avatars:f_brown_trousers",
1514
+ * "urn:decentraland:off-chain:base-avatars:bun_shoes"]
1515
+ */
1516
+ wearables: string[];
1476
1517
  }
1477
1518
 
1478
1519
  declare interface PBBillboard {
@@ -1569,6 +1610,31 @@ declare interface PBMaterial_Texture {
1569
1610
  filterMode?: FilterMode | undefined;
1570
1611
  }
1571
1612
 
1613
+ declare interface PBMeshCollider {
1614
+ /** default = ColliderLayer.Physics | ColliderLayer.Pointer */
1615
+ collisionMask?: number | undefined;
1616
+ box: PBMeshCollider_BoxMesh | undefined;
1617
+ sphere: PBMeshCollider_SphereMesh | undefined;
1618
+ cylinder: PBMeshCollider_CylinderMesh | undefined;
1619
+ plane: PBMeshCollider_PlaneMesh | undefined;
1620
+ }
1621
+
1622
+ declare interface PBMeshCollider_BoxMesh {
1623
+ }
1624
+
1625
+ declare interface PBMeshCollider_CylinderMesh {
1626
+ /** default=1.0 */
1627
+ radiusTop?: number | undefined;
1628
+ /** default=1.0 */
1629
+ radiusBottom?: number | undefined;
1630
+ }
1631
+
1632
+ declare interface PBMeshCollider_PlaneMesh {
1633
+ }
1634
+
1635
+ declare interface PBMeshCollider_SphereMesh {
1636
+ }
1637
+
1572
1638
  declare interface PBMeshRenderer {
1573
1639
  box: PBMeshRenderer_BoxMesh | undefined;
1574
1640
  sphere: PBMeshRenderer_SphereMesh | undefined;
@@ -1736,7 +1802,7 @@ declare namespace Plane {
1736
1802
  */
1737
1803
  d: number;
1738
1804
  };
1739
- type ReadonlyPlane = DeepReadonly<MutablePlane>;
1805
+ type ReadonlyPlane = DeepReadonly_2<MutablePlane>;
1740
1806
  /**
1741
1807
  * Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0
1742
1808
  * @param a - a component of the plane
@@ -1856,7 +1922,7 @@ declare function preEngine(): {
1856
1922
  removeSystem: (selector: string | Update) => boolean;
1857
1923
  defineComponent: <T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType | undefined) => ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
1858
1924
  defineComponentFromSchema: <T_1 extends ISchema<any>, ConstructorType_1 = EcsResult<T_1>>(spec: T_1, componentId: number, constructorDefault?: ConstructorType_1 | undefined) => ComponentDefinition<T_1, ConstructorType_1>;
1859
- getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...DeepReadonly<ComponentSchema<T_2>>]>;
1925
+ getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...ReadonlyComponentSchema<T_2>]>;
1860
1926
  getComponent: <T_3 extends ISchema<any>>(componentId: number) => ComponentDefinition<T_3, EcsResult<T_3>>;
1861
1927
  removeComponentDefinition: (componentId: number) => void;
1862
1928
  };
@@ -1877,7 +1943,7 @@ declare namespace Quaternion {
1877
1943
  /**
1878
1944
  * @public
1879
1945
  */
1880
- export type ReadonlyQuaternion = DeepReadonly<MutableQuaternion>;
1946
+ export type ReadonlyQuaternion = DeepReadonly_2<MutableQuaternion>;
1881
1947
  /**
1882
1948
  * Creates a new Quaternion from the given floats
1883
1949
  * @param x - defines the first component (0 by default)
@@ -2031,6 +2097,18 @@ declare namespace Quaternion {
2031
2097
  */
2032
2098
  declare const RAD2DEG: number;
2033
2099
 
2100
+ /**
2101
+ * @public
2102
+ */
2103
+ declare type ReadonlyComponentSchema<T extends [ComponentDefinition, ...ComponentDefinition[]]> = {
2104
+ [K in keyof T]: T[K] extends ComponentDefinition ? ReturnType<T[K]['get']> : never;
2105
+ };
2106
+
2107
+ /**
2108
+ * @public
2109
+ */
2110
+ declare type ReadonlyPrimitive = number | string | number[] | string[] | boolean | boolean[];
2111
+
2034
2112
  declare type ReceiveMessage = {
2035
2113
  type: WireMessage.Enum;
2036
2114
  entity: Entity;
@@ -2195,7 +2273,7 @@ declare namespace Vector3 {
2195
2273
  /**
2196
2274
  * @public
2197
2275
  */
2198
- export type ReadonlyVector3 = DeepReadonly<MutableVector3>;
2276
+ export type ReadonlyVector3 = DeepReadonly_2<MutableVector3>;
2199
2277
  /**
2200
2278
  * Creates a new Vector3 object from the given x, y, z (floats) coordinates.
2201
2279
  * @param x - defines the first coordinates (on X axis)