@dcl/playground-assets 7.21.1-23203004012.commit-7c64ac2 → 7.21.1-23305235032.commit-03201a6

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/alpha.d.ts CHANGED
@@ -2822,6 +2822,19 @@ export declare type JustifyType = 'flex-start' | 'center' | 'flex-end' | 'space-
2822
2822
  */
2823
2823
  export declare type Key = number | string;
2824
2824
 
2825
+ /**
2826
+ * @public
2827
+ * Falloff mode for knockback force over distance.
2828
+ */
2829
+ export declare enum KnockbackFalloff {
2830
+ /** Same force at any distance within radius */
2831
+ CONSTANT = 0,
2832
+ /** Smooth linear decrease to 0 at radius edge: F = magnitude * (1 - distance / radius) */
2833
+ LINEAR = 1,
2834
+ /** Sharp drop-off, physically realistic: F = magnitude / (distance^2 + 1) */
2835
+ INVERSE_SQUARE = 2
2836
+ }
2837
+
2825
2838
  /**
2826
2839
  *
2827
2840
  * @public
@@ -6482,12 +6495,92 @@ export declare namespace PBVisibilityComponent {
6482
6495
  export function decode(input: _m0.Reader | Uint8Array, length?: number): PBVisibilityComponent;
6483
6496
  }
6484
6497
 
6498
+ /**
6499
+ * @public
6500
+ * Physics helpers for applying impulses and forces to the player.
6501
+ */
6502
+ export declare const Physics: PhysicsSystem;
6503
+
6485
6504
  /** @public */
6486
6505
  export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
6487
6506
 
6488
6507
  /** @public */
6489
6508
  export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
6490
6509
 
6510
+ /**
6511
+ * @public
6512
+ */
6513
+ export declare interface PhysicsSystem {
6514
+ /**
6515
+ * Apply a one-shot impulse to the player entity.
6516
+ * Multiple calls within the same frame are accumulated (summed).
6517
+ *
6518
+ * @param vector - a single `vector` whose length encodes the strength.
6519
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6520
+ */
6521
+ applyImpulseToPlayer(vector: Vector3Type): void;
6522
+ applyImpulseToPlayer(direction: Vector3Type, magnitude: number): void;
6523
+ /**
6524
+ * Apply a continuous force to the player from a given source entity.
6525
+ * Multiple sources are accumulated: the registry sums all active forces
6526
+ * and writes a single PBPhysicsCombinedForce component.
6527
+ * Calling again with the same source replaces its previous force.
6528
+ *
6529
+ * @param source - Entity key identifying this force source
6530
+ * @param vector - single `vector` whose length encodes the strength
6531
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6532
+ */
6533
+ applyForceToPlayer(source: Entity, vector: Vector3Type): void;
6534
+ applyForceToPlayer(source: Entity, direction: Vector3Type, magnitude: number): void;
6535
+ /**
6536
+ * Remove a continuous force from the player. Remaining sources are
6537
+ * re-summed; if none remain the force is cleared. No-op if the source
6538
+ * is not registered.
6539
+ *
6540
+ * @param source - Entity key identifying the force source to remove
6541
+ */
6542
+ removeForceFromPlayer(source: Entity): void;
6543
+ /**
6544
+ * Push the player away from a point. Computes direction from
6545
+ * `fromPosition` to the player, applies falloff, and delegates
6546
+ * to applyImpulseToPlayer.
6547
+ *
6548
+ * If the player is exactly at `fromPosition`, pushes upward.
6549
+ *
6550
+ * @param fromPosition - world-space origin of the knockback (explosion center, enemy position, etc.)
6551
+ * @param magnitude - base impulse strength
6552
+ * @param radius - max distance of effect (default: Infinity)
6553
+ * @param falloff - how force decreases with distance (default: CONSTANT)
6554
+ */
6555
+ applyKnockbackToPlayer(fromPosition: Vector3Type, magnitude: number, radius?: number, falloff?: KnockbackFalloff): void;
6556
+ /**
6557
+ * Apply a continuous force to the player for a limited duration.
6558
+ * After `duration` seconds the force is automatically removed.
6559
+ * Calling again with the same source resets the timer.
6560
+ *
6561
+ * @param source - Entity key identifying this force source
6562
+ * @param duration - how long the force lasts, in seconds
6563
+ * @param vector - single `vector` whose length encodes the strength
6564
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6565
+ */
6566
+ applyForceToPlayerForDuration(source: Entity, duration: number, vector: Vector3Type): void;
6567
+ applyForceToPlayerForDuration(source: Entity, duration: number, direction: Vector3Type, magnitude: number): void;
6568
+ /**
6569
+ * Apply a continuous repulsion force that pushes the player away from a point,
6570
+ * recalculating direction every tick as the player moves.
6571
+ * Remove with `removeForceFromPlayer(source)`.
6572
+ *
6573
+ * Negative magnitude = attraction (pulls toward the source).
6574
+ *
6575
+ * @param source - Entity key identifying this force source
6576
+ * @param fromPosition - world-space origin of repulsion
6577
+ * @param magnitude - base force strength
6578
+ * @param radius - max distance of effect (default: Infinity)
6579
+ * @param falloff - how force decreases with distance (default: CONSTANT)
6580
+ */
6581
+ applyRepulsionForceToPlayer(source: Entity, fromPosition: Vector3Type, magnitude: number, radius?: number, falloff?: KnockbackFalloff): void;
6582
+ }
6583
+
6491
6584
  /**
6492
6585
  * Represens a plane by the equation ax + by + cz + d = 0
6493
6586
  * @public
@@ -7608,6 +7701,13 @@ export declare namespace RotateContinuous {
7608
7701
  export function decode(input: _m0.Reader | Uint8Array, length?: number): RotateContinuous;
7609
7702
  }
7610
7703
 
7704
+ /**
7705
+ * @public
7706
+ * Rotate a vector by a quaternion
7707
+ * Uses the formula: v' = q * v * q^(-1), optimized version
7708
+ */
7709
+ export declare function rotateVectorByQuaternion(v: Vector3Type, q: QuaternionType): Vector3Type;
7710
+
7611
7711
  export declare type RPCSendableMessage = {
7612
7712
  jsonrpc: '2.0';
7613
7713
  id: number;
@@ -8304,6 +8404,18 @@ export declare type TransformComponent = LastWriteWinElementSetComponentDefiniti
8304
8404
  export declare interface TransformComponentExtended extends TransformComponent {
8305
8405
  create(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
8306
8406
  createOrReplace(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
8407
+ /**
8408
+ * Transforms a direction vector from an entity's local coordinate space
8409
+ * to world space, accounting for the full parent hierarchy.
8410
+ *
8411
+ * This applies only rotation (not translation or scale) — suitable for
8412
+ * direction vectors like force/impulse directions.
8413
+ *
8414
+ * @param entity - The source entity whose local space defines the direction
8415
+ * @param localDirection - Direction vector in the entity's local coordinates
8416
+ * @returns The direction vector in world coordinates
8417
+ */
8418
+ localToWorldDirection(entity: Entity, localDirection: Vector3Type): Vector3Type;
8307
8419
  }
8308
8420
 
8309
8421
  /**
package/dist/beta.d.ts CHANGED
@@ -2813,6 +2813,19 @@ export declare type JustifyType = 'flex-start' | 'center' | 'flex-end' | 'space-
2813
2813
  */
2814
2814
  export declare type Key = number | string;
2815
2815
 
2816
+ /**
2817
+ * @public
2818
+ * Falloff mode for knockback force over distance.
2819
+ */
2820
+ export declare enum KnockbackFalloff {
2821
+ /** Same force at any distance within radius */
2822
+ CONSTANT = 0,
2823
+ /** Smooth linear decrease to 0 at radius edge: F = magnitude * (1 - distance / radius) */
2824
+ LINEAR = 1,
2825
+ /** Sharp drop-off, physically realistic: F = magnitude / (distance^2 + 1) */
2826
+ INVERSE_SQUARE = 2
2827
+ }
2828
+
2816
2829
  /**
2817
2830
  *
2818
2831
  * @public
@@ -6454,12 +6467,92 @@ export declare namespace PBVisibilityComponent {
6454
6467
  export function decode(input: _m0.Reader | Uint8Array, length?: number): PBVisibilityComponent;
6455
6468
  }
6456
6469
 
6470
+ /**
6471
+ * @public
6472
+ * Physics helpers for applying impulses and forces to the player.
6473
+ */
6474
+ export declare const Physics: PhysicsSystem;
6475
+
6457
6476
  /** @public */
6458
6477
  export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
6459
6478
 
6460
6479
  /** @public */
6461
6480
  export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
6462
6481
 
6482
+ /**
6483
+ * @public
6484
+ */
6485
+ export declare interface PhysicsSystem {
6486
+ /**
6487
+ * Apply a one-shot impulse to the player entity.
6488
+ * Multiple calls within the same frame are accumulated (summed).
6489
+ *
6490
+ * @param vector - a single `vector` whose length encodes the strength.
6491
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6492
+ */
6493
+ applyImpulseToPlayer(vector: Vector3Type): void;
6494
+ applyImpulseToPlayer(direction: Vector3Type, magnitude: number): void;
6495
+ /**
6496
+ * Apply a continuous force to the player from a given source entity.
6497
+ * Multiple sources are accumulated: the registry sums all active forces
6498
+ * and writes a single PBPhysicsCombinedForce component.
6499
+ * Calling again with the same source replaces its previous force.
6500
+ *
6501
+ * @param source - Entity key identifying this force source
6502
+ * @param vector - single `vector` whose length encodes the strength
6503
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6504
+ */
6505
+ applyForceToPlayer(source: Entity, vector: Vector3Type): void;
6506
+ applyForceToPlayer(source: Entity, direction: Vector3Type, magnitude: number): void;
6507
+ /**
6508
+ * Remove a continuous force from the player. Remaining sources are
6509
+ * re-summed; if none remain the force is cleared. No-op if the source
6510
+ * is not registered.
6511
+ *
6512
+ * @param source - Entity key identifying the force source to remove
6513
+ */
6514
+ removeForceFromPlayer(source: Entity): void;
6515
+ /**
6516
+ * Push the player away from a point. Computes direction from
6517
+ * `fromPosition` to the player, applies falloff, and delegates
6518
+ * to applyImpulseToPlayer.
6519
+ *
6520
+ * If the player is exactly at `fromPosition`, pushes upward.
6521
+ *
6522
+ * @param fromPosition - world-space origin of the knockback (explosion center, enemy position, etc.)
6523
+ * @param magnitude - base impulse strength
6524
+ * @param radius - max distance of effect (default: Infinity)
6525
+ * @param falloff - how force decreases with distance (default: CONSTANT)
6526
+ */
6527
+ applyKnockbackToPlayer(fromPosition: Vector3Type, magnitude: number, radius?: number, falloff?: KnockbackFalloff): void;
6528
+ /**
6529
+ * Apply a continuous force to the player for a limited duration.
6530
+ * After `duration` seconds the force is automatically removed.
6531
+ * Calling again with the same source resets the timer.
6532
+ *
6533
+ * @param source - Entity key identifying this force source
6534
+ * @param duration - how long the force lasts, in seconds
6535
+ * @param vector - single `vector` whose length encodes the strength
6536
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6537
+ */
6538
+ applyForceToPlayerForDuration(source: Entity, duration: number, vector: Vector3Type): void;
6539
+ applyForceToPlayerForDuration(source: Entity, duration: number, direction: Vector3Type, magnitude: number): void;
6540
+ /**
6541
+ * Apply a continuous repulsion force that pushes the player away from a point,
6542
+ * recalculating direction every tick as the player moves.
6543
+ * Remove with `removeForceFromPlayer(source)`.
6544
+ *
6545
+ * Negative magnitude = attraction (pulls toward the source).
6546
+ *
6547
+ * @param source - Entity key identifying this force source
6548
+ * @param fromPosition - world-space origin of repulsion
6549
+ * @param magnitude - base force strength
6550
+ * @param radius - max distance of effect (default: Infinity)
6551
+ * @param falloff - how force decreases with distance (default: CONSTANT)
6552
+ */
6553
+ applyRepulsionForceToPlayer(source: Entity, fromPosition: Vector3Type, magnitude: number, radius?: number, falloff?: KnockbackFalloff): void;
6554
+ }
6555
+
6463
6556
  /**
6464
6557
  * Represens a plane by the equation ax + by + cz + d = 0
6465
6558
  * @public
@@ -7580,6 +7673,13 @@ export declare namespace RotateContinuous {
7580
7673
  export function decode(input: _m0.Reader | Uint8Array, length?: number): RotateContinuous;
7581
7674
  }
7582
7675
 
7676
+ /**
7677
+ * @public
7678
+ * Rotate a vector by a quaternion
7679
+ * Uses the formula: v' = q * v * q^(-1), optimized version
7680
+ */
7681
+ export declare function rotateVectorByQuaternion(v: Vector3Type, q: QuaternionType): Vector3Type;
7682
+
7583
7683
  export declare type RPCSendableMessage = {
7584
7684
  jsonrpc: '2.0';
7585
7685
  id: number;
@@ -8271,6 +8371,18 @@ export declare type TransformComponent = LastWriteWinElementSetComponentDefiniti
8271
8371
  export declare interface TransformComponentExtended extends TransformComponent {
8272
8372
  create(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
8273
8373
  createOrReplace(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
8374
+ /**
8375
+ * Transforms a direction vector from an entity's local coordinate space
8376
+ * to world space, accounting for the full parent hierarchy.
8377
+ *
8378
+ * This applies only rotation (not translation or scale) — suitable for
8379
+ * direction vectors like force/impulse directions.
8380
+ *
8381
+ * @param entity - The source entity whose local space defines the direction
8382
+ * @param localDirection - Direction vector in the entity's local coordinates
8383
+ * @returns The direction vector in world coordinates
8384
+ */
8385
+ localToWorldDirection(entity: Entity, localDirection: Vector3Type): Vector3Type;
8274
8386
  }
8275
8387
 
8276
8388
  /**
@@ -2813,6 +2813,19 @@ export declare type JustifyType = 'flex-start' | 'center' | 'flex-end' | 'space-
2813
2813
  */
2814
2814
  export declare type Key = number | string;
2815
2815
 
2816
+ /**
2817
+ * @public
2818
+ * Falloff mode for knockback force over distance.
2819
+ */
2820
+ export declare enum KnockbackFalloff {
2821
+ /** Same force at any distance within radius */
2822
+ CONSTANT = 0,
2823
+ /** Smooth linear decrease to 0 at radius edge: F = magnitude * (1 - distance / radius) */
2824
+ LINEAR = 1,
2825
+ /** Sharp drop-off, physically realistic: F = magnitude / (distance^2 + 1) */
2826
+ INVERSE_SQUARE = 2
2827
+ }
2828
+
2816
2829
  /**
2817
2830
  *
2818
2831
  * @public
@@ -6454,12 +6467,92 @@ export declare namespace PBVisibilityComponent {
6454
6467
  export function decode(input: _m0.Reader | Uint8Array, length?: number): PBVisibilityComponent;
6455
6468
  }
6456
6469
 
6470
+ /**
6471
+ * @public
6472
+ * Physics helpers for applying impulses and forces to the player.
6473
+ */
6474
+ export declare const Physics: PhysicsSystem;
6475
+
6457
6476
  /** @public */
6458
6477
  export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
6459
6478
 
6460
6479
  /** @public */
6461
6480
  export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
6462
6481
 
6482
+ /**
6483
+ * @public
6484
+ */
6485
+ export declare interface PhysicsSystem {
6486
+ /**
6487
+ * Apply a one-shot impulse to the player entity.
6488
+ * Multiple calls within the same frame are accumulated (summed).
6489
+ *
6490
+ * @param vector - a single `vector` whose length encodes the strength.
6491
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6492
+ */
6493
+ applyImpulseToPlayer(vector: Vector3Type): void;
6494
+ applyImpulseToPlayer(direction: Vector3Type, magnitude: number): void;
6495
+ /**
6496
+ * Apply a continuous force to the player from a given source entity.
6497
+ * Multiple sources are accumulated: the registry sums all active forces
6498
+ * and writes a single PBPhysicsCombinedForce component.
6499
+ * Calling again with the same source replaces its previous force.
6500
+ *
6501
+ * @param source - Entity key identifying this force source
6502
+ * @param vector - single `vector` whose length encodes the strength
6503
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6504
+ */
6505
+ applyForceToPlayer(source: Entity, vector: Vector3Type): void;
6506
+ applyForceToPlayer(source: Entity, direction: Vector3Type, magnitude: number): void;
6507
+ /**
6508
+ * Remove a continuous force from the player. Remaining sources are
6509
+ * re-summed; if none remain the force is cleared. No-op if the source
6510
+ * is not registered.
6511
+ *
6512
+ * @param source - Entity key identifying the force source to remove
6513
+ */
6514
+ removeForceFromPlayer(source: Entity): void;
6515
+ /**
6516
+ * Push the player away from a point. Computes direction from
6517
+ * `fromPosition` to the player, applies falloff, and delegates
6518
+ * to applyImpulseToPlayer.
6519
+ *
6520
+ * If the player is exactly at `fromPosition`, pushes upward.
6521
+ *
6522
+ * @param fromPosition - world-space origin of the knockback (explosion center, enemy position, etc.)
6523
+ * @param magnitude - base impulse strength
6524
+ * @param radius - max distance of effect (default: Infinity)
6525
+ * @param falloff - how force decreases with distance (default: CONSTANT)
6526
+ */
6527
+ applyKnockbackToPlayer(fromPosition: Vector3Type, magnitude: number, radius?: number, falloff?: KnockbackFalloff): void;
6528
+ /**
6529
+ * Apply a continuous force to the player for a limited duration.
6530
+ * After `duration` seconds the force is automatically removed.
6531
+ * Calling again with the same source resets the timer.
6532
+ *
6533
+ * @param source - Entity key identifying this force source
6534
+ * @param duration - how long the force lasts, in seconds
6535
+ * @param vector - single `vector` whose length encodes the strength
6536
+ * or use overload for `direction` with a separate `magnitude` — the direction will be normalized before scaling.
6537
+ */
6538
+ applyForceToPlayerForDuration(source: Entity, duration: number, vector: Vector3Type): void;
6539
+ applyForceToPlayerForDuration(source: Entity, duration: number, direction: Vector3Type, magnitude: number): void;
6540
+ /**
6541
+ * Apply a continuous repulsion force that pushes the player away from a point,
6542
+ * recalculating direction every tick as the player moves.
6543
+ * Remove with `removeForceFromPlayer(source)`.
6544
+ *
6545
+ * Negative magnitude = attraction (pulls toward the source).
6546
+ *
6547
+ * @param source - Entity key identifying this force source
6548
+ * @param fromPosition - world-space origin of repulsion
6549
+ * @param magnitude - base force strength
6550
+ * @param radius - max distance of effect (default: Infinity)
6551
+ * @param falloff - how force decreases with distance (default: CONSTANT)
6552
+ */
6553
+ applyRepulsionForceToPlayer(source: Entity, fromPosition: Vector3Type, magnitude: number, radius?: number, falloff?: KnockbackFalloff): void;
6554
+ }
6555
+
6463
6556
  /**
6464
6557
  * Represens a plane by the equation ax + by + cz + d = 0
6465
6558
  * @public
@@ -7580,6 +7673,13 @@ export declare namespace RotateContinuous {
7580
7673
  export function decode(input: _m0.Reader | Uint8Array, length?: number): RotateContinuous;
7581
7674
  }
7582
7675
 
7676
+ /**
7677
+ * @public
7678
+ * Rotate a vector by a quaternion
7679
+ * Uses the formula: v' = q * v * q^(-1), optimized version
7680
+ */
7681
+ export declare function rotateVectorByQuaternion(v: Vector3Type, q: QuaternionType): Vector3Type;
7682
+
7583
7683
  export declare type RPCSendableMessage = {
7584
7684
  jsonrpc: '2.0';
7585
7685
  id: number;
@@ -8271,6 +8371,18 @@ export declare type TransformComponent = LastWriteWinElementSetComponentDefiniti
8271
8371
  export declare interface TransformComponentExtended extends TransformComponent {
8272
8372
  create(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
8273
8373
  createOrReplace(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
8374
+ /**
8375
+ * Transforms a direction vector from an entity's local coordinate space
8376
+ * to world space, accounting for the full parent hierarchy.
8377
+ *
8378
+ * This applies only rotation (not translation or scale) — suitable for
8379
+ * direction vectors like force/impulse directions.
8380
+ *
8381
+ * @param entity - The source entity whose local space defines the direction
8382
+ * @param localDirection - Direction vector in the entity's local coordinates
8383
+ * @returns The direction vector in world coordinates
8384
+ */
8385
+ localToWorldDirection(entity: Entity, localDirection: Vector3Type): Vector3Type;
8274
8386
  }
8275
8387
 
8276
8388
  /**