@dcl/ecs 7.20.5-22639501193.commit-bf648a9 → 7.20.5-22670537517.commit-a403a9f

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 (77) hide show
  1. package/dist/components/generated/PhysicsCombinedForce.gen.d.ts +1 -0
  2. package/dist/components/generated/PhysicsCombinedForce.gen.js +25 -0
  3. package/dist/components/generated/PhysicsCombinedImpulse.gen.d.ts +1 -0
  4. package/dist/components/generated/PhysicsCombinedImpulse.gen.js +25 -0
  5. package/dist/components/generated/component-names.gen.js +2 -0
  6. package/dist/components/generated/global.gen.d.ts +4 -0
  7. package/dist/components/generated/global.gen.js +2 -0
  8. package/dist/components/generated/index.gen.d.ts +8 -0
  9. package/dist/components/generated/index.gen.js +10 -0
  10. package/dist/components/generated/pb/decentraland/sdk/components/input_modifier.gen.d.ts +2 -0
  11. package/dist/components/generated/pb/decentraland/sdk/components/input_modifier.gen.js +20 -0
  12. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.d.ts +25 -0
  13. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.js +42 -0
  14. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.d.ts +28 -0
  15. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.js +51 -0
  16. package/dist/components/index.d.ts +0 -5
  17. package/dist/components/index.js +2 -5
  18. package/dist/components/manual/Transform.d.ts +0 -9
  19. package/dist/components/manual/Transform.js +3 -3
  20. package/dist/components/types.d.ts +0 -1
  21. package/dist/engine/component.d.ts +1 -52
  22. package/dist/engine/grow-only-value-set-component-definition.js +2 -45
  23. package/dist/engine/lww-element-set-component-definition.d.ts +1 -3
  24. package/dist/engine/lww-element-set-component-definition.js +12 -65
  25. package/dist/index.d.ts +1 -2
  26. package/dist/index.js +0 -1
  27. package/dist/serialization/crdt/index.d.ts +0 -1
  28. package/dist/serialization/crdt/index.js +0 -1
  29. package/dist/serialization/crdt/network/utils.d.ts +9 -0
  30. package/dist/serialization/crdt/network/utils.js +60 -0
  31. package/dist/serialization/crdt/types.d.ts +3 -25
  32. package/dist/serialization/crdt/types.js +1 -3
  33. package/dist/systems/crdt/index.d.ts +1 -0
  34. package/dist/systems/crdt/index.js +146 -55
  35. package/dist-cjs/components/generated/PhysicsCombinedForce.gen.d.ts +1 -0
  36. package/dist-cjs/components/generated/PhysicsCombinedForce.gen.js +28 -0
  37. package/dist-cjs/components/generated/PhysicsCombinedImpulse.gen.d.ts +1 -0
  38. package/dist-cjs/components/generated/PhysicsCombinedImpulse.gen.js +28 -0
  39. package/dist-cjs/components/generated/component-names.gen.js +2 -0
  40. package/dist-cjs/components/generated/global.gen.d.ts +4 -0
  41. package/dist-cjs/components/generated/global.gen.js +3 -1
  42. package/dist-cjs/components/generated/index.gen.d.ts +8 -0
  43. package/dist-cjs/components/generated/index.gen.js +14 -2
  44. package/dist-cjs/components/generated/pb/decentraland/sdk/components/input_modifier.gen.d.ts +2 -0
  45. package/dist-cjs/components/generated/pb/decentraland/sdk/components/input_modifier.gen.js +20 -0
  46. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.d.ts +25 -0
  47. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.js +48 -0
  48. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.d.ts +28 -0
  49. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.js +57 -0
  50. package/dist-cjs/components/index.d.ts +0 -5
  51. package/dist-cjs/components/index.js +3 -7
  52. package/dist-cjs/components/manual/Transform.d.ts +0 -9
  53. package/dist-cjs/components/manual/Transform.js +3 -3
  54. package/dist-cjs/components/types.d.ts +0 -1
  55. package/dist-cjs/engine/component.d.ts +1 -52
  56. package/dist-cjs/engine/grow-only-value-set-component-definition.js +1 -44
  57. package/dist-cjs/engine/lww-element-set-component-definition.d.ts +1 -3
  58. package/dist-cjs/engine/lww-element-set-component-definition.js +13 -68
  59. package/dist-cjs/index.d.ts +1 -2
  60. package/dist-cjs/index.js +1 -2
  61. package/dist-cjs/serialization/crdt/index.d.ts +0 -1
  62. package/dist-cjs/serialization/crdt/index.js +0 -1
  63. package/dist-cjs/serialization/crdt/network/utils.d.ts +9 -0
  64. package/dist-cjs/serialization/crdt/network/utils.js +67 -0
  65. package/dist-cjs/serialization/crdt/types.d.ts +3 -25
  66. package/dist-cjs/serialization/crdt/types.js +1 -3
  67. package/dist-cjs/systems/crdt/index.d.ts +1 -0
  68. package/dist-cjs/systems/crdt/index.js +169 -55
  69. package/package.json +2 -2
  70. package/dist/components/manual/CreatedBy.d.ts +0 -9
  71. package/dist/components/manual/CreatedBy.js +0 -8
  72. package/dist/serialization/crdt/authoritativePutComponent.d.ts +0 -15
  73. package/dist/serialization/crdt/authoritativePutComponent.js +0 -47
  74. package/dist-cjs/components/manual/CreatedBy.d.ts +0 -9
  75. package/dist-cjs/components/manual/CreatedBy.js +0 -10
  76. package/dist-cjs/serialization/crdt/authoritativePutComponent.d.ts +0 -15
  77. package/dist-cjs/serialization/crdt/authoritativePutComponent.js +0 -50
@@ -0,0 +1,25 @@
1
+ import { PBPhysicsCombinedForce } from './pb/decentraland/sdk/components/physics_combined_force.gen';
2
+ /**
3
+ * @internal
4
+ */
5
+ export const PhysicsCombinedForceSchema = {
6
+ COMPONENT_ID: 1216,
7
+ serialize(value, builder) {
8
+ const writer = PBPhysicsCombinedForce.encode(value);
9
+ const buffer = new Uint8Array(writer.finish(), 0, writer.len);
10
+ builder.writeBuffer(buffer, false);
11
+ },
12
+ deserialize(reader) {
13
+ return PBPhysicsCombinedForce.decode(reader.buffer(), reader.remainingBytes());
14
+ },
15
+ create() {
16
+ // TODO: this is a hack.
17
+ return PBPhysicsCombinedForce.decode(new Uint8Array());
18
+ },
19
+ jsonSchema: {
20
+ type: "object",
21
+ properties: {},
22
+ serializationType: "protocol-buffer",
23
+ protocolBuffer: "PBPhysicsCombinedForce"
24
+ }
25
+ };
@@ -0,0 +1,25 @@
1
+ import { PBPhysicsCombinedImpulse } from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
2
+ /**
3
+ * @internal
4
+ */
5
+ export const PhysicsCombinedImpulseSchema = {
6
+ COMPONENT_ID: 1215,
7
+ serialize(value, builder) {
8
+ const writer = PBPhysicsCombinedImpulse.encode(value);
9
+ const buffer = new Uint8Array(writer.finish(), 0, writer.len);
10
+ builder.writeBuffer(buffer, false);
11
+ },
12
+ deserialize(reader) {
13
+ return PBPhysicsCombinedImpulse.decode(reader.buffer(), reader.remainingBytes());
14
+ },
15
+ create() {
16
+ // TODO: this is a hack.
17
+ return PBPhysicsCombinedImpulse.decode(new Uint8Array());
18
+ },
19
+ jsonSchema: {
20
+ type: "object",
21
+ properties: {},
22
+ serializationType: "protocol-buffer",
23
+ protocolBuffer: "PBPhysicsCombinedImpulse"
24
+ }
25
+ };
@@ -30,6 +30,8 @@ export const coreComponentMappings = {
30
30
  "core::MeshCollider": 1019,
31
31
  "core::MeshRenderer": 1018,
32
32
  "core::NftShape": 1040,
33
+ "core::PhysicsCombinedForce": 1216,
34
+ "core::PhysicsCombinedImpulse": 1215,
33
35
  "core::PlayerIdentityData": 1089,
34
36
  "core::PointerEvents": 1062,
35
37
  "core::PointerEventsResult": 1063,
@@ -22,6 +22,8 @@ import { PBInputModifier } from './pb/decentraland/sdk/components/input_modifier
22
22
  import { PBLightSource } from './pb/decentraland/sdk/components/light_source.gen';
23
23
  import { PBMainCamera } from './pb/decentraland/sdk/components/main_camera.gen';
24
24
  import { PBNftShape } from './pb/decentraland/sdk/components/nft_shape.gen';
25
+ import { PBPhysicsCombinedForce } from './pb/decentraland/sdk/components/physics_combined_force.gen';
26
+ import { PBPhysicsCombinedImpulse } from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
25
27
  import { PBPlayerIdentityData } from './pb/decentraland/sdk/components/player_identity_data.gen';
26
28
  import { PBPointerEvents } from './pb/decentraland/sdk/components/pointer_events.gen';
27
29
  import { PBPointerEventsResult } from './pb/decentraland/sdk/components/pointer_events_result.gen';
@@ -70,6 +72,8 @@ import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibili
70
72
  /** @public */ export declare const LightSource: LastWriteWinElementSetComponentDefinition<PBLightSource>;
71
73
  /** @public */ export declare const MainCamera: LastWriteWinElementSetComponentDefinition<PBMainCamera>;
72
74
  /** @public */ export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
75
+ /** @public */ export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
76
+ /** @public */ export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
73
77
  /** @public */ export declare const PlayerIdentityData: LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>;
74
78
  /** @public */ export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
75
79
  /** @public */ export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
@@ -23,6 +23,8 @@ export * from './index.gen';
23
23
  /** @public */ export const LightSource = /* @__PURE__ */ components.LightSource(engine);
24
24
  /** @public */ export const MainCamera = /* @__PURE__ */ components.MainCamera(engine);
25
25
  /** @public */ export const NftShape = /* @__PURE__ */ components.NftShape(engine);
26
+ /** @public */ export const PhysicsCombinedForce = /* @__PURE__ */ components.PhysicsCombinedForce(engine);
27
+ /** @public */ export const PhysicsCombinedImpulse = /* @__PURE__ */ components.PhysicsCombinedImpulse(engine);
26
28
  /** @public */ export const PlayerIdentityData = /* @__PURE__ */ components.PlayerIdentityData(engine);
27
29
  /** @public */ export const PointerEvents = /* @__PURE__ */ components.PointerEvents(engine);
28
30
  /** @public */ export const PointerEventsResult = /* @__PURE__ */ components.PointerEventsResult(engine);
@@ -26,6 +26,8 @@ import { PBMaterial } from './pb/decentraland/sdk/components/material.gen';
26
26
  import { PBMeshCollider } from './pb/decentraland/sdk/components/mesh_collider.gen';
27
27
  import { PBMeshRenderer } from './pb/decentraland/sdk/components/mesh_renderer.gen';
28
28
  import { PBNftShape } from './pb/decentraland/sdk/components/nft_shape.gen';
29
+ import { PBPhysicsCombinedForce } from './pb/decentraland/sdk/components/physics_combined_force.gen';
30
+ import { PBPhysicsCombinedImpulse } from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
29
31
  import { PBPlayerIdentityData } from './pb/decentraland/sdk/components/player_identity_data.gen';
30
32
  import { PBPointerEvents } from './pb/decentraland/sdk/components/pointer_events.gen';
31
33
  import { PBPointerEventsResult } from './pb/decentraland/sdk/components/pointer_events_result.gen';
@@ -79,6 +81,8 @@ export * from './pb/decentraland/sdk/components/material.gen';
79
81
  export * from './pb/decentraland/sdk/components/mesh_collider.gen';
80
82
  export * from './pb/decentraland/sdk/components/mesh_renderer.gen';
81
83
  export * from './pb/decentraland/sdk/components/nft_shape.gen';
84
+ export * from './pb/decentraland/sdk/components/physics_combined_force.gen';
85
+ export * from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
82
86
  export * from './pb/decentraland/sdk/components/player_identity_data.gen';
83
87
  export * from './pb/decentraland/sdk/components/pointer_events.gen';
84
88
  export * from './pb/decentraland/sdk/components/pointer_events_result.gen';
@@ -134,6 +138,8 @@ export type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<an
134
138
  /** @public */ export declare const MeshCollider: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshCollider>>;
135
139
  /** @public */ export declare const MeshRenderer: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshRenderer>>;
136
140
  /** @public */ export declare const NftShape: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBNftShape>>;
141
+ /** @public */ export declare const PhysicsCombinedForce: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>>;
142
+ /** @public */ export declare const PhysicsCombinedImpulse: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>>;
137
143
  /** @public */ export declare const PlayerIdentityData: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>>;
138
144
  /** @public */ export declare const PointerEvents: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerEvents>>;
139
145
  /** @public */ export declare const PointerEventsResult: GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>>;
@@ -189,6 +195,8 @@ export declare const componentDefinitionByName: {
189
195
  "core::MeshCollider": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshCollider>>;
190
196
  "core::MeshRenderer": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshRenderer>>;
191
197
  "core::NftShape": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBNftShape>>;
198
+ "core::PhysicsCombinedForce": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>>;
199
+ "core::PhysicsCombinedImpulse": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>>;
192
200
  "core::PlayerIdentityData": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>>;
193
201
  "core::PointerEvents": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerEvents>>;
194
202
  "core::PointerEventsResult": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>>;
@@ -24,6 +24,8 @@ import { MaterialSchema } from './Material.gen';
24
24
  import { MeshColliderSchema } from './MeshCollider.gen';
25
25
  import { MeshRendererSchema } from './MeshRenderer.gen';
26
26
  import { NftShapeSchema } from './NftShape.gen';
27
+ import { PhysicsCombinedForceSchema } from './PhysicsCombinedForce.gen';
28
+ import { PhysicsCombinedImpulseSchema } from './PhysicsCombinedImpulse.gen';
27
29
  import { PlayerIdentityDataSchema } from './PlayerIdentityData.gen';
28
30
  import { PointerEventsSchema } from './PointerEvents.gen';
29
31
  import { PointerEventsResultSchema } from './PointerEventsResult.gen';
@@ -77,6 +79,8 @@ export * from './pb/decentraland/sdk/components/material.gen';
77
79
  export * from './pb/decentraland/sdk/components/mesh_collider.gen';
78
80
  export * from './pb/decentraland/sdk/components/mesh_renderer.gen';
79
81
  export * from './pb/decentraland/sdk/components/nft_shape.gen';
82
+ export * from './pb/decentraland/sdk/components/physics_combined_force.gen';
83
+ export * from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
80
84
  export * from './pb/decentraland/sdk/components/player_identity_data.gen';
81
85
  export * from './pb/decentraland/sdk/components/pointer_events.gen';
82
86
  export * from './pb/decentraland/sdk/components/pointer_events_result.gen';
@@ -162,6 +166,10 @@ export * from './pb/decentraland/sdk/components/visibility_component.gen';
162
166
  /* @__PURE__ */ engine.defineComponentFromSchema("core::MeshRenderer", MeshRendererSchema);
163
167
  /** @public */ export const NftShape = engine =>
164
168
  /* @__PURE__ */ engine.defineComponentFromSchema("core::NftShape", NftShapeSchema);
169
+ /** @public */ export const PhysicsCombinedForce = engine =>
170
+ /* @__PURE__ */ engine.defineComponentFromSchema("core::PhysicsCombinedForce", PhysicsCombinedForceSchema);
171
+ /** @public */ export const PhysicsCombinedImpulse = engine =>
172
+ /* @__PURE__ */ engine.defineComponentFromSchema("core::PhysicsCombinedImpulse", PhysicsCombinedImpulseSchema);
165
173
  /** @public */ export const PlayerIdentityData = engine =>
166
174
  /* @__PURE__ */ engine.defineComponentFromSchema("core::PlayerIdentityData", PlayerIdentityDataSchema);
167
175
  /** @public */ export const PointerEvents = engine =>
@@ -250,6 +258,8 @@ export const componentDefinitionByName = /* @__PURE__ */ {
250
258
  "core::MeshCollider": MeshCollider,
251
259
  "core::MeshRenderer": MeshRenderer,
252
260
  "core::NftShape": NftShape,
261
+ "core::PhysicsCombinedForce": PhysicsCombinedForce,
262
+ "core::PhysicsCombinedImpulse": PhysicsCombinedImpulse,
253
263
  "core::PlayerIdentityData": PlayerIdentityData,
254
264
  "core::PointerEvents": PointerEvents,
255
265
  "core::PointerEventsResult": PointerEventsResult,
@@ -19,6 +19,8 @@ export interface PBInputModifier_StandardInput {
19
19
  disableRun?: boolean | undefined;
20
20
  disableJump?: boolean | undefined;
21
21
  disableEmote?: boolean | undefined;
22
+ disableDoubleJump?: boolean | undefined;
23
+ disableGliding?: boolean | undefined;
22
24
  }
23
25
  /**
24
26
  * @public
@@ -49,6 +49,8 @@ function createBasePBInputModifier_StandardInput() {
49
49
  disableRun: undefined,
50
50
  disableJump: undefined,
51
51
  disableEmote: undefined,
52
+ disableDoubleJump: undefined,
53
+ disableGliding: undefined,
52
54
  };
53
55
  }
54
56
  /**
@@ -75,6 +77,12 @@ export var PBInputModifier_StandardInput;
75
77
  if (message.disableEmote !== undefined) {
76
78
  writer.uint32(48).bool(message.disableEmote);
77
79
  }
80
+ if (message.disableDoubleJump !== undefined) {
81
+ writer.uint32(56).bool(message.disableDoubleJump);
82
+ }
83
+ if (message.disableGliding !== undefined) {
84
+ writer.uint32(64).bool(message.disableGliding);
85
+ }
78
86
  return writer;
79
87
  }
80
88
  PBInputModifier_StandardInput.encode = encode;
@@ -121,6 +129,18 @@ export var PBInputModifier_StandardInput;
121
129
  }
122
130
  message.disableEmote = reader.bool();
123
131
  continue;
132
+ case 7:
133
+ if (tag !== 56) {
134
+ break;
135
+ }
136
+ message.disableDoubleJump = reader.bool();
137
+ continue;
138
+ case 8:
139
+ if (tag !== 64) {
140
+ break;
141
+ }
142
+ message.disableGliding = reader.bool();
143
+ continue;
124
144
  }
125
145
  if ((tag & 7) === 4 || tag === 0) {
126
146
  break;
@@ -0,0 +1,25 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ import { Vector3 } from "../../common/vectors.gen";
3
+ /**
4
+ * This component applies a continuous physics force.
5
+ *
6
+ * @remarks Low-level component. Use Physics.applyForceToPlayer()/.removeForceToPlayer() instead.
7
+ * Direct manipulation will conflict with the force accumulation registry.
8
+ * Summary component: stores the accumulated result of all active forces registered by the scene in the current frame.
9
+ *
10
+ * State-like component: the force is applied every physics tick while the component is present on the entity.
11
+ */
12
+ /**
13
+ * @public
14
+ */
15
+ export interface PBPhysicsCombinedForce {
16
+ /** Includes force direction and magnitude */
17
+ vector: Vector3 | undefined;
18
+ }
19
+ /**
20
+ * @public
21
+ */
22
+ export declare namespace PBPhysicsCombinedForce {
23
+ function encode(message: PBPhysicsCombinedForce, writer?: _m0.Writer): _m0.Writer;
24
+ function decode(input: _m0.Reader | Uint8Array, length?: number): PBPhysicsCombinedForce;
25
+ }
@@ -0,0 +1,42 @@
1
+ /* eslint-disable */
2
+ import _m0 from "protobufjs/minimal";
3
+ import { Vector3 } from "../../common/vectors.gen";
4
+ const protobufPackageSarasa = "decentraland.sdk.components";
5
+ function createBasePBPhysicsCombinedForce() {
6
+ return { vector: undefined };
7
+ }
8
+ /**
9
+ * @public
10
+ */
11
+ export var PBPhysicsCombinedForce;
12
+ (function (PBPhysicsCombinedForce) {
13
+ function encode(message, writer = _m0.Writer.create()) {
14
+ if (message.vector !== undefined) {
15
+ Vector3.encode(message.vector, writer.uint32(10).fork()).ldelim();
16
+ }
17
+ return writer;
18
+ }
19
+ PBPhysicsCombinedForce.encode = encode;
20
+ function decode(input, length) {
21
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
22
+ let end = length === undefined ? reader.len : reader.pos + length;
23
+ const message = createBasePBPhysicsCombinedForce();
24
+ while (reader.pos < end) {
25
+ const tag = reader.uint32();
26
+ switch (tag >>> 3) {
27
+ case 1:
28
+ if (tag !== 10) {
29
+ break;
30
+ }
31
+ message.vector = Vector3.decode(reader, reader.uint32());
32
+ continue;
33
+ }
34
+ if ((tag & 7) === 4 || tag === 0) {
35
+ break;
36
+ }
37
+ reader.skipType(tag & 7);
38
+ }
39
+ return message;
40
+ }
41
+ PBPhysicsCombinedForce.decode = decode;
42
+ })(PBPhysicsCombinedForce || (PBPhysicsCombinedForce = {}));
@@ -0,0 +1,28 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ import { Vector3 } from "../../common/vectors.gen";
3
+ /**
4
+ * This component applies a one-shot physics summary impulse.
5
+ *
6
+ * @remarks Low-level component. Use Physics.applyImpulseToPlayer() instead.
7
+ * Direct manipulation will conflict with the force accumulation registry.
8
+ * Summary component: stores the accumulated result of all impulses registered by the scene in the current frame.
9
+ *
10
+ * Event-like component: each new impulse must increment the eventID to ensure delivery via CRDT, even if the direction is identical to the previous one.
11
+ * Renderer processes impulse with the unique ID only once. Increase eventID of the component to apply another impulse.
12
+ */
13
+ /**
14
+ * @public
15
+ */
16
+ export interface PBPhysicsCombinedImpulse {
17
+ /** Includes impulse direction and magnitude */
18
+ vector: Vector3 | undefined;
19
+ /** Monotonic counter to distinguish different impulses. */
20
+ eventId: number;
21
+ }
22
+ /**
23
+ * @public
24
+ */
25
+ export declare namespace PBPhysicsCombinedImpulse {
26
+ function encode(message: PBPhysicsCombinedImpulse, writer?: _m0.Writer): _m0.Writer;
27
+ function decode(input: _m0.Reader | Uint8Array, length?: number): PBPhysicsCombinedImpulse;
28
+ }
@@ -0,0 +1,51 @@
1
+ /* eslint-disable */
2
+ import _m0 from "protobufjs/minimal";
3
+ import { Vector3 } from "../../common/vectors.gen";
4
+ const protobufPackageSarasa = "decentraland.sdk.components";
5
+ function createBasePBPhysicsCombinedImpulse() {
6
+ return { vector: undefined, eventId: 0 };
7
+ }
8
+ /**
9
+ * @public
10
+ */
11
+ export var PBPhysicsCombinedImpulse;
12
+ (function (PBPhysicsCombinedImpulse) {
13
+ function encode(message, writer = _m0.Writer.create()) {
14
+ if (message.vector !== undefined) {
15
+ Vector3.encode(message.vector, writer.uint32(10).fork()).ldelim();
16
+ }
17
+ if (message.eventId !== 0) {
18
+ writer.uint32(16).uint32(message.eventId);
19
+ }
20
+ return writer;
21
+ }
22
+ PBPhysicsCombinedImpulse.encode = encode;
23
+ function decode(input, length) {
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 = createBasePBPhysicsCombinedImpulse();
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
+ message.vector = Vector3.decode(reader, reader.uint32());
35
+ continue;
36
+ case 2:
37
+ if (tag !== 16) {
38
+ break;
39
+ }
40
+ message.eventId = reader.uint32();
41
+ continue;
42
+ }
43
+ if ((tag & 7) === 4 || tag === 0) {
44
+ break;
45
+ }
46
+ reader.skipType(tag & 7);
47
+ }
48
+ return message;
49
+ }
50
+ PBPhysicsCombinedImpulse.decode = decode;
51
+ })(PBPhysicsCombinedImpulse || (PBPhysicsCombinedImpulse = {}));
@@ -19,7 +19,6 @@ import { InputModifierComponentDefinitionExtended } from './extended/InputModifi
19
19
  import { LightSourceComponentDefinitionExtended } from './extended/LightSource';
20
20
  import { TriggerAreaComponentDefinitionExtended } from './extended/TriggerArea';
21
21
  import { TagsComponentDefinitionExtended } from './manual/Tags';
22
- import { ICreatedByType } from './manual/CreatedBy';
23
22
  export * from './generated/index.gen';
24
23
  export type { GrowOnlyValueSetComponentDefinition, LastWriteWinElementSetComponentDefinition, LwwComponentGetter, GSetComponentGetter };
25
24
  export declare const Transform: LwwComponentGetter<TransformComponentExtended>;
@@ -51,8 +50,4 @@ export declare const NetworkEntity: (engine: Pick<IEngine, 'defineComponent'>) =
51
50
  * @alpha
52
51
  */
53
52
  export declare const NetworkParent: (engine: Pick<IEngine, 'defineComponent'>) => LastWriteWinElementSetComponentDefinition<INetowrkParentType>;
54
- /**
55
- * @public
56
- */
57
- export declare const CreatedBy: (engine: Pick<IEngine, 'defineComponent'>) => LastWriteWinElementSetComponentDefinition<ICreatedByType>;
58
53
  export { MediaState };
@@ -16,7 +16,6 @@ import { defineInputModifierComponent } from './extended/InputModifier';
16
16
  import { defineLightSourceComponent } from './extended/LightSource';
17
17
  import { defineTriggerAreaComponent } from './extended/TriggerArea';
18
18
  import defineTagsComponent from './manual/Tags';
19
- import defineCreatedBy from './manual/CreatedBy';
20
19
  export * from './generated/index.gen';
21
20
  /* @__PURE__ */
22
21
  export const Transform = (engine) => defineTransformComponent(engine);
@@ -57,13 +56,11 @@ export const SyncComponents = (engine) => defineSyncComponent(engine);
57
56
  /**
58
57
  * @alpha
59
58
  */
59
+ /* @__PURE__ */
60
60
  export const NetworkEntity = (engine) => defineNetworkEntity(engine);
61
61
  /**
62
62
  * @alpha
63
63
  */
64
+ /* @__PURE__ */
64
65
  export const NetworkParent = (engine) => defineNetworkParent(engine);
65
- /**
66
- * @public
67
- */
68
- export const CreatedBy = (engine) => defineCreatedBy(engine);
69
66
  export { MediaState };
@@ -1,6 +1,5 @@
1
1
  import { LastWriteWinElementSetComponentDefinition, IEngine } from '../../engine';
2
2
  import { Entity } from '../../engine/entity';
3
- import type { ISchema } from '../../schemas/ISchema';
4
3
  /**
5
4
  * @public
6
5
  */
@@ -12,10 +11,6 @@ export interface TransformComponentExtended extends TransformComponent {
12
11
  create(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
13
12
  createOrReplace(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
14
13
  }
15
- /**
16
- * @public
17
- */
18
- export declare const COMPONENT_ID = 1;
19
14
  /**
20
15
  * @public
21
16
  */
@@ -38,10 +33,6 @@ export type TransformType = {
38
33
  };
39
34
  parent?: Entity;
40
35
  };
41
- /** @public */
42
- export declare const TRANSFORM_LENGTH = 44;
43
- /** @public */
44
- export declare const TransformSchema: ISchema<TransformType>;
45
36
  /**
46
37
  * @public
47
38
  */
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @public
2
+ * @internal
3
3
  */
4
4
  export const COMPONENT_ID = 1;
5
- /** @public */
5
+ /** @internal */
6
6
  export const TRANSFORM_LENGTH = 44;
7
- /** @public */
7
+ /** @internal */
8
8
  export const TransformSchema = {
9
9
  serialize(value, builder) {
10
10
  const ptr = builder.incrementWriteOffset(TRANSFORM_LENGTH);
@@ -12,7 +12,6 @@ export type { TagsComponentDefinitionExtended, TagsType } from './manual/Tags';
12
12
  export type { ISyncComponents, ISyncComponentsType } from './manual/SyncComponents';
13
13
  export type { INetowrkEntity, INetowrkEntityType } from './manual/NetworkEntity';
14
14
  export type { INetowrkParent, INetowrkParentType } from './manual/NetworkParent';
15
- export type { ICreatedBy, ICreatedByType } from './manual/CreatedBy';
16
15
  export type { InputModifierHelper, InputModifierComponentDefinitionExtended } from './extended/InputModifier';
17
16
  export type { LightSourceHelper, LightSourceComponentDefinitionExtended } from './extended/LightSource';
18
17
  export type { TriggerAreaComponentDefinitionExtended } from './extended/TriggerArea';
@@ -1,6 +1,6 @@
1
1
  import { ISchema } from '../schemas';
2
2
  import { ByteBuffer } from '../serialization/ByteBuffer';
3
- import { CrdtMessageBody, DeleteComponentMessageBody, ProcessMessageResultType, PutComponentMessageBody } from '../serialization/crdt';
3
+ import { CrdtMessageBody, DeleteComponentMessageBody, PutComponentMessageBody } from '../serialization/crdt';
4
4
  import { Entity } from './entity';
5
5
  import { DeepReadonly, DeepReadonlySet } from './readonly';
6
6
  /**
@@ -70,58 +70,7 @@ export interface BaseComponent<T> {
70
70
  * If the value is undefined, the component was deleted.
71
71
  */
72
72
  onChange(entity: Entity, cb: (value: T | undefined) => void): void;
73
- /**
74
- * @public
75
- *
76
- */
77
- validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
78
- validateBeforeChange(cb: ValidateCallback<T>): void;
79
- /**
80
- * Get the CRDT state for an entity (serialized data and timestamp)
81
- * @param entity - Entity to get the CRDT state for
82
- * @returns Object with serialized data and timestamp, or null if entity doesn't have the component
83
- * @public
84
- */
85
- getCrdtState(entity: Entity): {
86
- data: Uint8Array;
87
- timestamp: number;
88
- } | null;
89
- }
90
- /**
91
- * Internal component interface that exposes all internal methods for SDK use
92
- * This is not exposed to users, only for internal SDK operations
93
- */
94
- export interface InternalBaseComponent<T> extends BaseComponent<T> {
95
- /**
96
- * @public
97
- * Dry run update to check if a CRDT message would be accepted without actually applying it
98
- */
99
- __dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
100
- /**
101
- * @public
102
- * Get the iterator to every entity has the component
103
- */
104
- iterator(): Iterable<[Entity, any]>;
105
- /**
106
- * @public
107
- */
108
- dirtyIterator(): Iterable<Entity>;
109
- /**
110
- * @public
111
- */
112
- __onChangeCallbacks(entity: Entity, value: T): void;
113
- /**
114
- * @public
115
- */
116
- __run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
117
73
  }
118
- export type ValidateCallback<T> = (value: {
119
- entity: Entity;
120
- currentValue: T | undefined;
121
- newValue: T | undefined;
122
- senderAddress: string;
123
- createdBy: string;
124
- }) => boolean;
125
74
  /**
126
75
  * @public
127
76
  */
@@ -1,8 +1,7 @@
1
1
  import { ReadWriteByteBuffer } from '../serialization/ByteBuffer';
2
- import { AppendValueOperation, CrdtMessageType, ProcessMessageResultType } from '../serialization/crdt';
2
+ import { AppendValueOperation, CrdtMessageType } from '../serialization/crdt';
3
3
  import { __DEV__ } from '../runtime/invariant';
4
4
  const emptyReadonlySet = freezeSet(new Set());
5
- const __GLOBAL_ENTITY = '__GLOBAL_ENTITY';
6
5
  function frozenError() {
7
6
  throw new Error('The set is frozen');
8
7
  }
@@ -23,7 +22,6 @@ export function createValueSetComponentDefinitionFromSchema(componentName, compo
23
22
  const dirtyIterator = new Set();
24
23
  const queuedCommands = [];
25
24
  const onChangeCallbacks = new Map();
26
- const validateCallbacks = new Map();
27
25
  // only sort the array if the latest (N) element has a timestamp <= N-1
28
26
  function shouldSort(row) {
29
27
  const len = row.raw.length;
@@ -82,11 +80,8 @@ export function createValueSetComponentDefinitionFromSchema(componentName, compo
82
80
  has(entity) {
83
81
  return data.has(entity);
84
82
  },
85
- entityDeleted(entity, markAsDirty) {
83
+ entityDeleted(entity) {
86
84
  data.delete(entity);
87
- if (markAsDirty) {
88
- // For grow-only sets, we don't need to mark as dirty since deletion doesn't generate CRDT messages
89
- }
90
85
  },
91
86
  get(entity) {
92
87
  const values = data.get(entity);
@@ -157,44 +152,6 @@ export function createValueSetComponentDefinitionFromSchema(componentName, compo
157
152
  for (const cb of cbs) {
158
153
  cb(value);
159
154
  }
160
- },
161
- __dry_run_updateFromCrdt(_body) {
162
- return ProcessMessageResultType.StateUpdatedData;
163
- },
164
- validateBeforeChange(entityOrCb, cb) {
165
- if (arguments.length === 1) {
166
- // Second overload: just callback (global validation)
167
- validateCallbacks.set(__GLOBAL_ENTITY, entityOrCb);
168
- }
169
- else {
170
- if (cb) {
171
- validateCallbacks.set(entityOrCb, cb);
172
- }
173
- }
174
- },
175
- __run_validateBeforeChange(entity, newValue, senderAddress, createdBy) {
176
- const cb = entity && validateCallbacks.get(entity);
177
- const globalCb = validateCallbacks.get(__GLOBAL_ENTITY);
178
- const currentValue = [...this.get(entity).values()];
179
- const value = { entity, currentValue: currentValue, newValue, senderAddress, createdBy };
180
- const globalResult = globalCb?.(value) ?? true;
181
- const entityResult = (globalResult && cb?.(value)) ?? true;
182
- return globalResult && entityResult;
183
- },
184
- getCrdtState(entity) {
185
- const row = data.get(entity);
186
- if (!row || row.raw.length === 0) {
187
- return null;
188
- }
189
- // For GrowOnlySet, we need to return the complete CRDT messages for all values
190
- // This is complex because GrowOnlySet uses APPEND messages, not a single PUT
191
- // For now, return null to indicate this component type doesn't support simple corrections
192
- return null;
193
- },
194
- __forceUpdateFromCrdt(_msg) {
195
- // GrowOnlySet doesn't support authoritative corrections in the same way as LWW
196
- // since it uses APPEND_VALUE messages instead of PUT_COMPONENT messages
197
- return [null, undefined];
198
155
  }
199
156
  };
200
157
  return ret;
@@ -1,10 +1,8 @@
1
1
  import { ISchema } from '../schemas';
2
2
  import { ByteBuffer } from '../serialization/ByteBuffer';
3
- import { PutComponentMessageBody, DeleteComponentMessageBody, ProcessMessageResultType, CrdtMessageBody, PutNetworkComponentMessageBody, DeleteComponentNetworkMessageBody, AuthoritativePutComponentMessageBody } from '../serialization/crdt';
3
+ import { PutComponentMessageBody, DeleteComponentMessageBody, CrdtMessageBody } from '../serialization/crdt';
4
4
  import { Entity } from './entity';
5
5
  export declare function incrementTimestamp(entity: Entity, timestamps: Map<Entity, number>): number;
6
6
  export declare function createDumpLwwFunctionFromCrdt(componentId: number, timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>): (buffer: ByteBuffer, filterEntity?: ((entity: Entity) => boolean) | undefined) => void;
7
- export declare function createCrdtRuleValidator(timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>): (message: PutComponentMessageBody | DeleteComponentMessageBody | PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody) => ProcessMessageResultType;
8
- export declare function createForceUpdateLwwFromCrdt(componentId: number, timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>): (msg: AuthoritativePutComponentMessageBody) => [null, any];
9
7
  export declare function createUpdateLwwFromCrdt(componentId: number, timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>): (msg: CrdtMessageBody) => [null | PutComponentMessageBody | DeleteComponentMessageBody, any];
10
8
  export declare function createGetCrdtMessagesForLww(componentId: number, timestamps: Map<Entity, number>, dirtyIterator: Set<Entity>, schema: Pick<ISchema<any>, 'serialize'>, data: Map<Entity, unknown>): () => Generator<PutComponentMessageBody | DeleteComponentMessageBody, void, unknown>;