@dcl/ecs 7.20.4 → 7.20.5-22631826546.commit-7c189f5

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 (87) hide show
  1. package/dist/components/extended/AudioAnalysis.d.ts +55 -0
  2. package/dist/components/extended/AudioAnalysis.js +66 -0
  3. package/dist/components/extended/Tween.d.ts +90 -0
  4. package/dist/components/extended/Tween.js +152 -0
  5. package/dist/components/generated/AudioAnalysis.gen.d.ts +1 -0
  6. package/dist/components/generated/AudioAnalysis.gen.js +25 -0
  7. package/dist/components/generated/AvatarLocomotionSettings.gen.d.ts +1 -0
  8. package/dist/components/generated/AvatarLocomotionSettings.gen.js +25 -0
  9. package/dist/components/generated/PhysicsCombinedForce.gen.d.ts +1 -0
  10. package/dist/components/generated/PhysicsCombinedForce.gen.js +25 -0
  11. package/dist/components/generated/PhysicsCombinedImpulse.gen.d.ts +1 -0
  12. package/dist/components/generated/PhysicsCombinedImpulse.gen.js +25 -0
  13. package/dist/components/generated/component-names.gen.js +4 -0
  14. package/dist/components/generated/global.gen.d.ts +8 -0
  15. package/dist/components/generated/global.gen.js +4 -0
  16. package/dist/components/generated/index.gen.d.ts +16 -0
  17. package/dist/components/generated/index.gen.js +20 -0
  18. package/dist/components/generated/pb/decentraland/sdk/components/audio_analysis.gen.d.ts +37 -0
  19. package/dist/components/generated/pb/decentraland/sdk/components/audio_analysis.gen.js +161 -0
  20. package/dist/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.d.ts +35 -0
  21. package/dist/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.js +123 -0
  22. package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.d.ts +12 -2
  23. package/dist/components/generated/pb/decentraland/sdk/components/common/input_action.gen.js +11 -0
  24. package/dist/components/generated/pb/decentraland/sdk/components/input_modifier.gen.d.ts +2 -0
  25. package/dist/components/generated/pb/decentraland/sdk/components/input_modifier.gen.js +20 -0
  26. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.d.ts +25 -0
  27. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.js +42 -0
  28. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.d.ts +28 -0
  29. package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.js +51 -0
  30. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.d.ts +5 -1
  31. package/dist/components/generated/pb/decentraland/sdk/components/pointer_events.gen.js +20 -1
  32. package/dist/components/generated/pb/decentraland/sdk/components/tween.gen.d.ts +40 -0
  33. package/dist/components/generated/pb/decentraland/sdk/components/tween.gen.js +176 -0
  34. package/dist/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.d.ts +3 -0
  35. package/dist/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.js +10 -1
  36. package/dist/components/index.d.ts +4 -0
  37. package/dist/components/index.js +3 -0
  38. package/dist/components/types.d.ts +2 -1
  39. package/dist/engine/entity.js +2 -4
  40. package/dist/index.d.ts +2 -1
  41. package/dist/index.js +1 -0
  42. package/dist/systems/events.d.ts +65 -0
  43. package/dist/systems/events.js +70 -8
  44. package/dist-cjs/components/extended/AudioAnalysis.d.ts +55 -0
  45. package/dist-cjs/components/extended/AudioAnalysis.js +70 -0
  46. package/dist-cjs/components/extended/Tween.d.ts +90 -0
  47. package/dist-cjs/components/extended/Tween.js +152 -0
  48. package/dist-cjs/components/generated/AudioAnalysis.gen.d.ts +1 -0
  49. package/dist-cjs/components/generated/AudioAnalysis.gen.js +28 -0
  50. package/dist-cjs/components/generated/AvatarLocomotionSettings.gen.d.ts +1 -0
  51. package/dist-cjs/components/generated/AvatarLocomotionSettings.gen.js +28 -0
  52. package/dist-cjs/components/generated/PhysicsCombinedForce.gen.d.ts +1 -0
  53. package/dist-cjs/components/generated/PhysicsCombinedForce.gen.js +28 -0
  54. package/dist-cjs/components/generated/PhysicsCombinedImpulse.gen.d.ts +1 -0
  55. package/dist-cjs/components/generated/PhysicsCombinedImpulse.gen.js +28 -0
  56. package/dist-cjs/components/generated/component-names.gen.js +4 -0
  57. package/dist-cjs/components/generated/global.gen.d.ts +8 -0
  58. package/dist-cjs/components/generated/global.gen.js +6 -1
  59. package/dist-cjs/components/generated/index.gen.d.ts +16 -0
  60. package/dist-cjs/components/generated/index.gen.js +26 -2
  61. package/dist-cjs/components/generated/pb/decentraland/sdk/components/audio_analysis.gen.d.ts +37 -0
  62. package/dist-cjs/components/generated/pb/decentraland/sdk/components/audio_analysis.gen.js +167 -0
  63. package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.d.ts +35 -0
  64. package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_locomotion_settings.gen.js +129 -0
  65. package/dist-cjs/components/generated/pb/decentraland/sdk/components/common/input_action.gen.d.ts +12 -2
  66. package/dist-cjs/components/generated/pb/decentraland/sdk/components/common/input_action.gen.js +12 -1
  67. package/dist-cjs/components/generated/pb/decentraland/sdk/components/input_modifier.gen.d.ts +2 -0
  68. package/dist-cjs/components/generated/pb/decentraland/sdk/components/input_modifier.gen.js +20 -0
  69. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.d.ts +25 -0
  70. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.js +48 -0
  71. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.d.ts +28 -0
  72. package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.js +57 -0
  73. package/dist-cjs/components/generated/pb/decentraland/sdk/components/pointer_events.gen.d.ts +5 -1
  74. package/dist-cjs/components/generated/pb/decentraland/sdk/components/pointer_events.gen.js +20 -1
  75. package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween.gen.d.ts +40 -0
  76. package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween.gen.js +177 -1
  77. package/dist-cjs/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.d.ts +3 -0
  78. package/dist-cjs/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.js +10 -1
  79. package/dist-cjs/components/index.d.ts +4 -0
  80. package/dist-cjs/components/index.js +5 -1
  81. package/dist-cjs/components/types.d.ts +2 -1
  82. package/dist-cjs/engine/entity.js +2 -4
  83. package/dist-cjs/index.d.ts +2 -1
  84. package/dist-cjs/index.js +2 -1
  85. package/dist-cjs/systems/events.d.ts +65 -0
  86. package/dist-cjs/systems/events.js +70 -8
  87. package/package.json +2 -2
@@ -0,0 +1,55 @@
1
+ import { Entity, IEngine } from '../../engine';
2
+ import { LastWriteWinElementSetComponentDefinition } from '../../engine/component';
3
+ import { PBAudioAnalysis, PBAudioAnalysisMode } from '../generated/pb/decentraland/sdk/components/audio_analysis.gen';
4
+ export interface AudioAnalysisComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBAudioAnalysis> {
5
+ /**
6
+ * Reads the component data of `entity` into the provided `out` view.
7
+ *
8
+ * @throws Error if the entity does not have an AudioAnalysis component.
9
+ * @param entity - The entity whose AudioAnalysis data will be read.
10
+ * @param out - An existing AudioAnalysisView to populate with the latest values.
11
+ */
12
+ readIntoView(entity: Entity, out: AudioAnalysisView): void;
13
+ /**
14
+ * Attempts to read the component data of `entity` into the provided `out` view.
15
+ *
16
+ * @returns `true` if the component exists and data was written into `out`,
17
+ * `false` if the entity does not have an AudioAnalysis component.
18
+ * @param entity - The entity whose AudioAnalysis data will be read.
19
+ * @param out - An existing AudioAnalysisView to populate.
20
+ */
21
+ tryReadIntoView(entity: Entity, out: AudioAnalysisView): boolean;
22
+ /**
23
+ * Creates an AudioAnalysis component for the given `entity`.
24
+ *
25
+ * If a component already exists on the entity, this call fails (does not replace).
26
+ *
27
+ * @param entity - The entity to attach the component to.
28
+ * @param mode - Analysis mode. Defaults to `PBAudioAnalysisMode.MODE_LOGARITHMIC`.
29
+ * @param amplitudeGain - Optional amplitude gain multiplier.
30
+ * @param bandsGain - Optional gain multiplier applied to all frequency bands.
31
+ */
32
+ createAudioAnalysis(entity: Entity, mode?: PBAudioAnalysisMode, // default is PBAudioAnalysisMode.MODE_LOGARITHMIC
33
+ amplitudeGain?: number, bandsGain?: number): void;
34
+ /**
35
+ * Creates the AudioAnalysis component if missing, or replaces the existing one.
36
+ *
37
+ * @param entity - The target entity.
38
+ * @param mode - Analysis mode. Defaults to `PBAudioAnalysisMode.MODE_LOGARITHMIC`.
39
+ * @param amplitudeGain - Optional amplitude gain multiplier.
40
+ * @param bandsGain - Optional gain multiplier applied to the frequency bands.
41
+ */
42
+ createOrReplaceAudioAnalysis(entity: Entity, mode?: PBAudioAnalysisMode, // default is PBAudioAnalysisMode.MODE_LOGARITHMIC
43
+ amplitudeGain?: number, bandsGain?: number): void;
44
+ }
45
+ /**
46
+ * A read-only JavaScript-friendly view of AudioAnalysis ECS data.
47
+ *
48
+ * `amplitude` represents the aggregated signal strength.
49
+ * `bands` represents the processed frequency bands.
50
+ */
51
+ export type AudioAnalysisView = {
52
+ amplitude: number;
53
+ bands: number[];
54
+ };
55
+ export declare function defineAudioAnalysisComponent(engine: Pick<IEngine, 'defineComponentFromSchema'>): AudioAnalysisComponentDefinitionExtended;
@@ -0,0 +1,66 @@
1
+ import { AudioAnalysis } from '../generated/index.gen';
2
+ export function defineAudioAnalysisComponent(engine) {
3
+ const theComponent = AudioAnalysis(engine);
4
+ return {
5
+ ...theComponent,
6
+ readIntoView(entity, out) {
7
+ const audioAnalysis = theComponent.get(entity);
8
+ out.amplitude = audioAnalysis.amplitude;
9
+ out.bands[0] = audioAnalysis.band0;
10
+ out.bands[1] = audioAnalysis.band1;
11
+ out.bands[2] = audioAnalysis.band2;
12
+ out.bands[3] = audioAnalysis.band3;
13
+ out.bands[4] = audioAnalysis.band4;
14
+ out.bands[5] = audioAnalysis.band5;
15
+ out.bands[6] = audioAnalysis.band6;
16
+ out.bands[7] = audioAnalysis.band7;
17
+ },
18
+ tryReadIntoView(entity, out) {
19
+ const audioAnalysis = theComponent.getOrNull(entity);
20
+ if (!audioAnalysis)
21
+ return false;
22
+ out.amplitude = audioAnalysis.amplitude;
23
+ out.bands[0] = audioAnalysis.band0;
24
+ out.bands[1] = audioAnalysis.band1;
25
+ out.bands[2] = audioAnalysis.band2;
26
+ out.bands[3] = audioAnalysis.band3;
27
+ out.bands[4] = audioAnalysis.band4;
28
+ out.bands[5] = audioAnalysis.band5;
29
+ out.bands[6] = audioAnalysis.band6;
30
+ out.bands[7] = audioAnalysis.band7;
31
+ return true;
32
+ },
33
+ createAudioAnalysis(entity, mode, amplitudeGain, bandsGain) {
34
+ theComponent.create(entity, {
35
+ mode: mode || 1 /* PBAudioAnalysisMode.MODE_LOGARITHMIC */,
36
+ amplitudeGain: amplitudeGain ?? undefined,
37
+ bandsGain: bandsGain ?? undefined,
38
+ amplitude: 0,
39
+ band0: 0,
40
+ band1: 0,
41
+ band2: 0,
42
+ band3: 0,
43
+ band4: 0,
44
+ band5: 0,
45
+ band6: 0,
46
+ band7: 0
47
+ });
48
+ },
49
+ createOrReplaceAudioAnalysis(entity, mode, amplitudeGain, bandsGain) {
50
+ theComponent.createOrReplace(entity, {
51
+ mode: mode || 1 /* PBAudioAnalysisMode.MODE_LOGARITHMIC */,
52
+ amplitudeGain: amplitudeGain ?? undefined,
53
+ bandsGain: bandsGain ?? undefined,
54
+ amplitude: 0,
55
+ band0: 0,
56
+ band1: 0,
57
+ band2: 0,
58
+ band3: 0,
59
+ band4: 0,
60
+ band5: 0,
61
+ band6: 0,
62
+ band7: 0
63
+ });
64
+ }
65
+ };
66
+ }
@@ -1,6 +1,66 @@
1
1
  import { Entity, IEngine, LastWriteWinElementSetComponentDefinition } from '../../engine';
2
2
  import { Quaternion, Vector2, Vector3 } from '../generated/pb/decentraland/common/vectors.gen';
3
3
  import { EasingFunction, Move, MoveContinuous, PBTween, Rotate, RotateContinuous, Scale, TextureMove, TextureMoveContinuous, TextureMovementType } from '../generated/index.gen';
4
+ /**
5
+ * @public
6
+ * Partial params for Tween.Mode.MoveRotateScale(). At least one of position, rotation, or scale must be provided.
7
+ * Use this when building a mode for Tween.createOrReplace() or TweenSequence (e.g. only positionStart/positionEnd).
8
+ */
9
+ export interface MoveRotateScaleModeParams {
10
+ /** Position tween (start → end). Optional. */
11
+ position?: {
12
+ start: Vector3;
13
+ end: Vector3;
14
+ };
15
+ /** Rotation tween (start → end). Optional. */
16
+ rotation?: {
17
+ start: Quaternion;
18
+ end: Quaternion;
19
+ };
20
+ /** Scale tween (start → end). Optional. */
21
+ scale?: {
22
+ start: Vector3;
23
+ end: Vector3;
24
+ };
25
+ }
26
+ /**
27
+ * @public
28
+ * Parameters for setMoveRotateScale. At least one of position, rotation, or scale must be provided.
29
+ */
30
+ export interface SetMoveRotateScaleParams extends MoveRotateScaleModeParams {
31
+ /** Duration of the tween in milliseconds. */
32
+ duration: number;
33
+ /** Easing function (defaults to EF_LINEAR). */
34
+ easingFunction?: EasingFunction;
35
+ }
36
+ /**
37
+ * @public
38
+ * Partial params for Tween.Mode.MoveRotateScaleContinuous(). At least one of position, rotation, or scale must be provided.
39
+ */
40
+ export interface MoveRotateScaleContinuousModeParams {
41
+ /** Position direction for continuous movement. Optional. */
42
+ position?: {
43
+ direction: Vector3;
44
+ };
45
+ /** Rotation direction for continuous rotation. Optional. */
46
+ rotation?: {
47
+ direction: Quaternion;
48
+ };
49
+ /** Scale direction for continuous scale change. Optional. */
50
+ scale?: {
51
+ direction: Vector3;
52
+ };
53
+ /** Speed of the animation per second. */
54
+ speed: number;
55
+ }
56
+ /**
57
+ * @public
58
+ * Parameters for setMoveRotateScaleContinuous. At least one of position, rotation, or scale must be provided.
59
+ */
60
+ export interface SetMoveRotateScaleContinuousParams extends MoveRotateScaleContinuousModeParams {
61
+ /** Duration in milliseconds (defaults to 0 for infinite). */
62
+ duration?: number;
63
+ }
4
64
  /**
5
65
  * @public
6
66
  */
@@ -33,6 +93,16 @@ export interface TweenHelper {
33
93
  * @returns a texture-move-continuous mode tween
34
94
  */
35
95
  TextureMoveContinuous: (textureMove: TextureMoveContinuous) => PBTween['mode'];
96
+ /**
97
+ * @returns a move-rotate-scale mode tween
98
+ * @param params - partial transform (at least one of position, rotation, scale); omit axes you don't need
99
+ */
100
+ MoveRotateScale: (params: MoveRotateScaleModeParams) => PBTween['mode'];
101
+ /**
102
+ * @returns a move-rotate-scale-continuous mode tween
103
+ * @param params - partial transform (at least one of position, rotation, scale) + speed; omit axes you don't need
104
+ */
105
+ MoveRotateScaleContinuous: (params: MoveRotateScaleContinuousModeParams) => PBTween['mode'];
36
106
  }
37
107
  /**
38
108
  * @public
@@ -118,5 +188,25 @@ export interface TweenComponentDefinitionExtended extends LastWriteWinElementSet
118
188
  * @param duration - duration of the tween in milliseconds (defaults to 0 for infinite)
119
189
  */
120
190
  setTextureMoveContinuous(entity: Entity, direction: Vector2, speed: number, movementType?: TextureMovementType, duration?: number): void;
191
+ /**
192
+ * @public
193
+ *
194
+ * Creates or replaces a move-rotate-scale tween component that simultaneously animates
195
+ * an entity's position, rotation, and/or scale from start to end. Provide only the
196
+ * properties you need (at least one of position, rotation, or scale).
197
+ * @param entity - entity to apply the tween to
198
+ * @param params - object with optional position, rotation, scale (each with start/end), duration, and optional easingFunction
199
+ */
200
+ setMoveRotateScale(entity: Entity, params: SetMoveRotateScaleParams): void;
201
+ /**
202
+ * @public
203
+ *
204
+ * Creates or replaces a continuous move-rotate-scale tween component that simultaneously
205
+ * moves, rotates, and/or scales an entity continuously. Provide only the properties
206
+ * you need (at least one of position, rotation, or scale).
207
+ * @param entity - entity to apply the tween to
208
+ * @param params - object with optional position, rotation, scale (each with direction), speed, and optional duration
209
+ */
210
+ setMoveRotateScaleContinuous(entity: Entity, params: SetMoveRotateScaleContinuousParams): void;
121
211
  }
122
212
  export declare function defineTweenComponent(engine: Pick<IEngine, 'defineComponentFromSchema'>): TweenComponentDefinitionExtended;
@@ -1,4 +1,75 @@
1
1
  import { Tween } from '../generated/index.gen';
2
+ function validateAtLeastOneMoveRotateScale(hasPosition, hasRotation, hasScale, apiName) {
3
+ if (!hasPosition && !hasRotation && !hasScale) {
4
+ throw new Error(`${apiName}: at least one of position, rotation, or scale must be provided`);
5
+ }
6
+ }
7
+ function validateDuration(duration, apiName) {
8
+ if (typeof duration !== 'number' || !Number.isFinite(duration) || duration < 0) {
9
+ throw new Error(`${apiName}: duration must be a non-negative finite number`);
10
+ }
11
+ }
12
+ function validateSpeed(speed, apiName) {
13
+ if (typeof speed !== 'number' || !Number.isFinite(speed)) {
14
+ throw new Error(`${apiName}: speed must be a finite number`);
15
+ }
16
+ }
17
+ /** Shared validation for params that have optional position/rotation/scale with start & end. */
18
+ function validateMoveRotateScaleAxesStartEnd(params, apiName) {
19
+ const hasPosition = params.position != null;
20
+ const hasRotation = params.rotation != null;
21
+ const hasScale = params.scale != null;
22
+ validateAtLeastOneMoveRotateScale(hasPosition, hasRotation, hasScale, apiName);
23
+ if (hasPosition) {
24
+ const pos = params.position;
25
+ if (pos.start == null || pos.end == null) {
26
+ throw new Error(`${apiName}: position must have both start and end`);
27
+ }
28
+ }
29
+ if (hasRotation) {
30
+ const rot = params.rotation;
31
+ if (rot.start == null || rot.end == null) {
32
+ throw new Error(`${apiName}: rotation must have both start and end`);
33
+ }
34
+ }
35
+ if (hasScale) {
36
+ const scl = params.scale;
37
+ if (scl.start == null || scl.end == null) {
38
+ throw new Error(`${apiName}: scale must have both start and end`);
39
+ }
40
+ }
41
+ }
42
+ /** Shared validation for params that have optional position/rotation/scale with direction + speed. */
43
+ function validateMoveRotateScaleAxesDirection(params, apiName) {
44
+ const hasPosition = params.position != null;
45
+ const hasRotation = params.rotation != null;
46
+ const hasScale = params.scale != null;
47
+ validateAtLeastOneMoveRotateScale(hasPosition, hasRotation, hasScale, apiName);
48
+ validateSpeed(params.speed, apiName);
49
+ if (hasPosition && params.position.direction == null) {
50
+ throw new Error(`${apiName}: position must have direction`);
51
+ }
52
+ if (hasRotation && params.rotation.direction == null) {
53
+ throw new Error(`${apiName}: rotation must have direction`);
54
+ }
55
+ if (hasScale && params.scale.direction == null) {
56
+ throw new Error(`${apiName}: scale must have direction`);
57
+ }
58
+ }
59
+ function validateSetMoveRotateScaleParams(params, apiName) {
60
+ validateMoveRotateScaleModeParams(params, apiName);
61
+ validateDuration(params.duration, apiName);
62
+ }
63
+ function validateSetMoveRotateScaleContinuousParams(params, apiName) {
64
+ validateMoveRotateScaleContinuousModeParams(params, apiName);
65
+ validateDuration(params.duration ?? 0, apiName);
66
+ }
67
+ function validateMoveRotateScaleModeParams(params, apiName) {
68
+ validateMoveRotateScaleAxesStartEnd(params, apiName);
69
+ }
70
+ function validateMoveRotateScaleContinuousModeParams(params, apiName) {
71
+ validateMoveRotateScaleAxesDirection(params, apiName);
72
+ }
2
73
  const TweenHelper = {
3
74
  Move(move) {
4
75
  return {
@@ -41,6 +112,40 @@ const TweenHelper = {
41
112
  $case: 'textureMoveContinuous',
42
113
  textureMoveContinuous
43
114
  };
115
+ },
116
+ MoveRotateScale(params) {
117
+ validateMoveRotateScaleModeParams(params, 'Tween.Mode.MoveRotateScale');
118
+ const hasPosition = params.position != null;
119
+ const hasRotation = params.rotation != null;
120
+ const hasScale = params.scale != null;
121
+ const moveRotateScale = {
122
+ positionStart: hasPosition ? params.position.start : undefined,
123
+ positionEnd: hasPosition ? params.position.end : undefined,
124
+ rotationStart: hasRotation ? params.rotation.start : undefined,
125
+ rotationEnd: hasRotation ? params.rotation.end : undefined,
126
+ scaleStart: hasScale ? params.scale.start : undefined,
127
+ scaleEnd: hasScale ? params.scale.end : undefined
128
+ };
129
+ return {
130
+ $case: 'moveRotateScale',
131
+ moveRotateScale
132
+ };
133
+ },
134
+ MoveRotateScaleContinuous(params) {
135
+ validateMoveRotateScaleContinuousModeParams(params, 'Tween.Mode.MoveRotateScaleContinuous');
136
+ const hasPosition = params.position != null;
137
+ const hasRotation = params.rotation != null;
138
+ const hasScale = params.scale != null;
139
+ const moveRotateScaleContinuous = {
140
+ positionDirection: hasPosition ? params.position.direction : undefined,
141
+ rotationDirection: hasRotation ? params.rotation.direction : undefined,
142
+ scaleDirection: hasScale ? params.scale.direction : undefined,
143
+ speed: params.speed
144
+ };
145
+ return {
146
+ $case: 'moveRotateScaleContinuous',
147
+ moveRotateScaleContinuous
148
+ };
44
149
  }
45
150
  };
46
151
  export function defineTweenComponent(engine) {
@@ -147,6 +252,53 @@ export function defineTweenComponent(engine) {
147
252
  easingFunction: 0 /* EasingFunction.EF_LINEAR */,
148
253
  playing: true
149
254
  });
255
+ },
256
+ setMoveRotateScale(entity, params) {
257
+ validateSetMoveRotateScaleParams(params, 'setMoveRotateScale');
258
+ const { position, rotation, scale, duration, easingFunction = 0 /* EasingFunction.EF_LINEAR */ } = params;
259
+ const hasPosition = position != null;
260
+ const hasRotation = rotation != null;
261
+ const hasScale = scale != null;
262
+ const moveRotateScale = {
263
+ positionStart: hasPosition ? position.start : undefined,
264
+ positionEnd: hasPosition ? position.end : undefined,
265
+ rotationStart: hasRotation ? rotation.start : undefined,
266
+ rotationEnd: hasRotation ? rotation.end : undefined,
267
+ scaleStart: hasScale ? scale.start : undefined,
268
+ scaleEnd: hasScale ? scale.end : undefined
269
+ };
270
+ theComponent.createOrReplace(entity, {
271
+ mode: {
272
+ $case: 'moveRotateScale',
273
+ moveRotateScale
274
+ },
275
+ duration,
276
+ easingFunction,
277
+ playing: true
278
+ });
279
+ },
280
+ setMoveRotateScaleContinuous(entity, params) {
281
+ const duration = params.duration ?? 0;
282
+ validateSetMoveRotateScaleContinuousParams(params, 'setMoveRotateScaleContinuous');
283
+ const { position, rotation, scale, speed } = params;
284
+ const hasPosition = position != null;
285
+ const hasRotation = rotation != null;
286
+ const hasScale = scale != null;
287
+ const moveRotateScaleContinuous = {
288
+ positionDirection: hasPosition ? position.direction : undefined,
289
+ rotationDirection: hasRotation ? rotation.direction : undefined,
290
+ scaleDirection: hasScale ? scale.direction : undefined,
291
+ speed
292
+ };
293
+ theComponent.createOrReplace(entity, {
294
+ mode: {
295
+ $case: 'moveRotateScaleContinuous',
296
+ moveRotateScaleContinuous
297
+ },
298
+ duration,
299
+ easingFunction: 0 /* EasingFunction.EF_LINEAR */,
300
+ playing: true
301
+ });
150
302
  }
151
303
  };
152
304
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import { PBAudioAnalysis } from './pb/decentraland/sdk/components/audio_analysis.gen';
2
+ /**
3
+ * @internal
4
+ */
5
+ export const AudioAnalysisSchema = {
6
+ COMPONENT_ID: 1212,
7
+ serialize(value, builder) {
8
+ const writer = PBAudioAnalysis.encode(value);
9
+ const buffer = new Uint8Array(writer.finish(), 0, writer.len);
10
+ builder.writeBuffer(buffer, false);
11
+ },
12
+ deserialize(reader) {
13
+ return PBAudioAnalysis.decode(reader.buffer(), reader.remainingBytes());
14
+ },
15
+ create() {
16
+ // TODO: this is a hack.
17
+ return PBAudioAnalysis.decode(new Uint8Array());
18
+ },
19
+ jsonSchema: {
20
+ type: "object",
21
+ properties: {},
22
+ serializationType: "protocol-buffer",
23
+ protocolBuffer: "PBAudioAnalysis"
24
+ }
25
+ };
@@ -0,0 +1,25 @@
1
+ import { PBAvatarLocomotionSettings } from './pb/decentraland/sdk/components/avatar_locomotion_settings.gen';
2
+ /**
3
+ * @internal
4
+ */
5
+ export const AvatarLocomotionSettingsSchema = {
6
+ COMPONENT_ID: 1211,
7
+ serialize(value, builder) {
8
+ const writer = PBAvatarLocomotionSettings.encode(value);
9
+ const buffer = new Uint8Array(writer.finish(), 0, writer.len);
10
+ builder.writeBuffer(buffer, false);
11
+ },
12
+ deserialize(reader) {
13
+ return PBAvatarLocomotionSettings.decode(reader.buffer(), reader.remainingBytes());
14
+ },
15
+ create() {
16
+ // TODO: this is a hack.
17
+ return PBAvatarLocomotionSettings.decode(new Uint8Array());
18
+ },
19
+ jsonSchema: {
20
+ type: "object",
21
+ properties: {},
22
+ serializationType: "protocol-buffer",
23
+ protocolBuffer: "PBAvatarLocomotionSettings"
24
+ }
25
+ };
@@ -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
+ };
@@ -6,6 +6,7 @@ export const coreComponentMappings = {
6
6
  "core::Animator": 1042,
7
7
  "core::AssetLoad": 1213,
8
8
  "core::AssetLoadLoadingState": 1214,
9
+ "core::AudioAnalysis": 1212,
9
10
  "core::AudioEvent": 1105,
10
11
  "core::AudioSource": 1020,
11
12
  "core::AudioStream": 1021,
@@ -13,6 +14,7 @@ export const coreComponentMappings = {
13
14
  "core::AvatarBase": 1087,
14
15
  "core::AvatarEmoteCommand": 1088,
15
16
  "core::AvatarEquippedData": 1091,
17
+ "core::AvatarLocomotionSettings": 1211,
16
18
  "core::AvatarModifierArea": 1070,
17
19
  "core::AvatarShape": 1080,
18
20
  "core::Billboard": 1090,
@@ -30,6 +32,8 @@ export const coreComponentMappings = {
30
32
  "core::MeshCollider": 1019,
31
33
  "core::MeshRenderer": 1018,
32
34
  "core::NftShape": 1040,
35
+ "core::PhysicsCombinedForce": 1216,
36
+ "core::PhysicsCombinedImpulse": 1215,
33
37
  "core::PlayerIdentityData": 1089,
34
38
  "core::PointerEvents": 1062,
35
39
  "core::PointerEventsResult": 1063,
@@ -2,6 +2,7 @@ import { LastWriteWinElementSetComponentDefinition, GrowOnlyValueSetComponentDef
2
2
  export * from './index.gen';
3
3
  import { PBAssetLoad } from './pb/decentraland/sdk/components/asset_load.gen';
4
4
  import { PBAssetLoadLoadingState } from './pb/decentraland/sdk/components/asset_load_loading_state.gen';
5
+ import { PBAudioAnalysis } from './pb/decentraland/sdk/components/audio_analysis.gen';
5
6
  import { PBAudioEvent } from './pb/decentraland/sdk/components/audio_event.gen';
6
7
  import { PBAudioSource } from './pb/decentraland/sdk/components/audio_source.gen';
7
8
  import { PBAudioStream } from './pb/decentraland/sdk/components/audio_stream.gen';
@@ -9,6 +10,7 @@ import { PBAvatarAttach } from './pb/decentraland/sdk/components/avatar_attach.g
9
10
  import { PBAvatarBase } from './pb/decentraland/sdk/components/avatar_base.gen';
10
11
  import { PBAvatarEmoteCommand } from './pb/decentraland/sdk/components/avatar_emote_command.gen';
11
12
  import { PBAvatarEquippedData } from './pb/decentraland/sdk/components/avatar_equipped_data.gen';
13
+ import { PBAvatarLocomotionSettings } from './pb/decentraland/sdk/components/avatar_locomotion_settings.gen';
12
14
  import { PBAvatarModifierArea } from './pb/decentraland/sdk/components/avatar_modifier_area.gen';
13
15
  import { PBAvatarShape } from './pb/decentraland/sdk/components/avatar_shape.gen';
14
16
  import { PBBillboard } from './pb/decentraland/sdk/components/billboard.gen';
@@ -22,6 +24,8 @@ import { PBInputModifier } from './pb/decentraland/sdk/components/input_modifier
22
24
  import { PBLightSource } from './pb/decentraland/sdk/components/light_source.gen';
23
25
  import { PBMainCamera } from './pb/decentraland/sdk/components/main_camera.gen';
24
26
  import { PBNftShape } from './pb/decentraland/sdk/components/nft_shape.gen';
27
+ import { PBPhysicsCombinedForce } from './pb/decentraland/sdk/components/physics_combined_force.gen';
28
+ import { PBPhysicsCombinedImpulse } from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
25
29
  import { PBPlayerIdentityData } from './pb/decentraland/sdk/components/player_identity_data.gen';
26
30
  import { PBPointerEvents } from './pb/decentraland/sdk/components/pointer_events.gen';
27
31
  import { PBPointerEventsResult } from './pb/decentraland/sdk/components/pointer_events_result.gen';
@@ -50,6 +54,7 @@ import { PBVirtualCamera } from './pb/decentraland/sdk/components/virtual_camera
50
54
  import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibility_component.gen';
51
55
  /** @public */ export declare const AssetLoad: LastWriteWinElementSetComponentDefinition<PBAssetLoad>;
52
56
  /** @public */ export declare const AssetLoadLoadingState: GrowOnlyValueSetComponentDefinition<PBAssetLoadLoadingState>;
57
+ /** @public */ export declare const AudioAnalysis: LastWriteWinElementSetComponentDefinition<PBAudioAnalysis>;
53
58
  /** @public */ export declare const AudioEvent: GrowOnlyValueSetComponentDefinition<PBAudioEvent>;
54
59
  /** @public */ export declare const AudioSource: LastWriteWinElementSetComponentDefinition<PBAudioSource>;
55
60
  /** @public */ export declare const AudioStream: LastWriteWinElementSetComponentDefinition<PBAudioStream>;
@@ -57,6 +62,7 @@ import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibili
57
62
  /** @public */ export declare const AvatarBase: LastWriteWinElementSetComponentDefinition<PBAvatarBase>;
58
63
  /** @public */ export declare const AvatarEmoteCommand: GrowOnlyValueSetComponentDefinition<PBAvatarEmoteCommand>;
59
64
  /** @public */ export declare const AvatarEquippedData: LastWriteWinElementSetComponentDefinition<PBAvatarEquippedData>;
65
+ /** @public */ export declare const AvatarLocomotionSettings: LastWriteWinElementSetComponentDefinition<PBAvatarLocomotionSettings>;
60
66
  /** @public */ export declare const AvatarModifierArea: LastWriteWinElementSetComponentDefinition<PBAvatarModifierArea>;
61
67
  /** @public */ export declare const AvatarShape: LastWriteWinElementSetComponentDefinition<PBAvatarShape>;
62
68
  /** @public */ export declare const Billboard: LastWriteWinElementSetComponentDefinition<PBBillboard>;
@@ -70,6 +76,8 @@ import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibili
70
76
  /** @public */ export declare const LightSource: LastWriteWinElementSetComponentDefinition<PBLightSource>;
71
77
  /** @public */ export declare const MainCamera: LastWriteWinElementSetComponentDefinition<PBMainCamera>;
72
78
  /** @public */ export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
79
+ /** @public */ export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
80
+ /** @public */ export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
73
81
  /** @public */ export declare const PlayerIdentityData: LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>;
74
82
  /** @public */ export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
75
83
  /** @public */ export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
@@ -3,6 +3,7 @@ import * as components from './index.gen';
3
3
  export * from './index.gen';
4
4
  /** @public */ export const AssetLoad = /* @__PURE__ */ components.AssetLoad(engine);
5
5
  /** @public */ export const AssetLoadLoadingState = /* @__PURE__ */ components.AssetLoadLoadingState(engine);
6
+ /** @public */ export const AudioAnalysis = /* @__PURE__ */ components.AudioAnalysis(engine);
6
7
  /** @public */ export const AudioEvent = /* @__PURE__ */ components.AudioEvent(engine);
7
8
  /** @public */ export const AudioSource = /* @__PURE__ */ components.AudioSource(engine);
8
9
  /** @public */ export const AudioStream = /* @__PURE__ */ components.AudioStream(engine);
@@ -10,6 +11,7 @@ export * from './index.gen';
10
11
  /** @public */ export const AvatarBase = /* @__PURE__ */ components.AvatarBase(engine);
11
12
  /** @public */ export const AvatarEmoteCommand = /* @__PURE__ */ components.AvatarEmoteCommand(engine);
12
13
  /** @public */ export const AvatarEquippedData = /* @__PURE__ */ components.AvatarEquippedData(engine);
14
+ /** @public */ export const AvatarLocomotionSettings = /* @__PURE__ */ components.AvatarLocomotionSettings(engine);
13
15
  /** @public */ export const AvatarModifierArea = /* @__PURE__ */ components.AvatarModifierArea(engine);
14
16
  /** @public */ export const AvatarShape = /* @__PURE__ */ components.AvatarShape(engine);
15
17
  /** @public */ export const Billboard = /* @__PURE__ */ components.Billboard(engine);
@@ -23,6 +25,8 @@ export * from './index.gen';
23
25
  /** @public */ export const LightSource = /* @__PURE__ */ components.LightSource(engine);
24
26
  /** @public */ export const MainCamera = /* @__PURE__ */ components.MainCamera(engine);
25
27
  /** @public */ export const NftShape = /* @__PURE__ */ components.NftShape(engine);
28
+ /** @public */ export const PhysicsCombinedForce = /* @__PURE__ */ components.PhysicsCombinedForce(engine);
29
+ /** @public */ export const PhysicsCombinedImpulse = /* @__PURE__ */ components.PhysicsCombinedImpulse(engine);
26
30
  /** @public */ export const PlayerIdentityData = /* @__PURE__ */ components.PlayerIdentityData(engine);
27
31
  /** @public */ export const PointerEvents = /* @__PURE__ */ components.PointerEvents(engine);
28
32
  /** @public */ export const PointerEventsResult = /* @__PURE__ */ components.PointerEventsResult(engine);