@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.
- package/dist/ecs7/index.d.ts +90 -12
- package/dist/ecs7/index.js +3062 -2867
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/dist/ecs7/proto-definitions/AvatarShape.proto +18 -11
- package/dist/ecs7/proto-definitions/MeshCollider.proto +35 -0
- package/package.json +4 -4
- package/types/ecs7/index.d.ts +90 -12
package/dist/ecs7/index.d.ts
CHANGED
@@ -229,6 +229,8 @@ export 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
|
export declare const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
|
409
411
|
|
412
|
+
/**
|
413
|
+
* @public
|
414
|
+
*/
|
415
|
+
export 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
|
-
|
415
|
-
readonly [P in keyof T]:
|
421
|
+
declare type DeepReadonly_2<T> = {
|
422
|
+
readonly [P in keyof T]: DeepReadonly_2<T[P]>;
|
423
|
+
};
|
424
|
+
|
425
|
+
/**
|
426
|
+
* @public
|
427
|
+
*/
|
428
|
+
export declare type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
|
429
|
+
|
430
|
+
/**
|
431
|
+
* @public
|
432
|
+
*/
|
433
|
+
export declare type DeepReadonlyObject<T> = {
|
434
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
416
435
|
};
|
417
436
|
|
437
|
+
/**
|
438
|
+
* @public
|
439
|
+
*/
|
440
|
+
export 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 @@ export declare type IEngine = {
|
|
566
591
|
*
|
567
592
|
* ```
|
568
593
|
*/
|
569
|
-
defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec:
|
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 @@ export declare type IEngine = {
|
|
601
626
|
* }
|
602
627
|
* ```
|
603
628
|
*/
|
604
|
-
getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...
|
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 =
|
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
|
+
export declare const MeshCollider: ComponentDefinition<ISchema<PBMeshCollider>, PBMeshCollider>;
|
1410
|
+
|
1383
1411
|
/** @public */
|
1384
1412
|
export 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 =
|
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, ...
|
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 @@ export declare namespace Quaternion {
|
|
1877
1943
|
/**
|
1878
1944
|
* @public
|
1879
1945
|
*/
|
1880
|
-
export type ReadonlyQuaternion =
|
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 @@ export declare namespace Quaternion {
|
|
2031
2097
|
*/
|
2032
2098
|
export declare const RAD2DEG: number;
|
2033
2099
|
|
2100
|
+
/**
|
2101
|
+
* @public
|
2102
|
+
*/
|
2103
|
+
export 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
|
+
export 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 @@ export declare namespace Vector3 {
|
|
2195
2273
|
/**
|
2196
2274
|
* @public
|
2197
2275
|
*/
|
2198
|
-
export type ReadonlyVector3 =
|
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)
|