@dcl/playground-assets 7.21.1-22918726402.commit-ee210ee → 7.21.1-23252789519.commit-9f806e1
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 +115 -101
- package/dist/beta.d.ts +115 -101
- package/dist/index.bundled.d.ts +115 -101
- package/dist/index.js +7 -7
- package/dist/index.js.map +4 -4
- package/dist/playground/sdk/dcl-sdk.package.json +2 -2
- package/dist/playground-assets.d.ts +115 -101
- package/etc/playground-assets.api.json +1139 -1209
- package/etc/playground-assets.api.md +33 -79
- package/package.json +5 -6
package/dist/alpha.d.ts
CHANGED
|
@@ -163,42 +163,6 @@ export declare interface AudioStreamComponentDefinitionExtended extends LastWrit
|
|
|
163
163
|
getAudioState(entity: Entity): PBAudioEvent | undefined;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
/**
|
|
167
|
-
* @public
|
|
168
|
-
*/
|
|
169
|
-
export declare type AuthoritativePutComponentMessage = CrdtMessageHeader & AuthoritativePutComponentMessageBody;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Server authoritative message - identical to PutComponentMessageBody but with forced processing
|
|
173
|
-
* Min. length = header (8 bytes) + 16 bytes = 24 bytes
|
|
174
|
-
*
|
|
175
|
-
* @param entity - Uint32 number of the entity
|
|
176
|
-
* @param componentId - Uint32 number of id
|
|
177
|
-
* @param timestamp - Uint32 Lamport timestamp (server's authoritative timestamp)
|
|
178
|
-
* @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
|
|
179
|
-
* @public
|
|
180
|
-
*/
|
|
181
|
-
export declare type AuthoritativePutComponentMessageBody = {
|
|
182
|
-
type: CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT;
|
|
183
|
-
entityId: Entity;
|
|
184
|
-
componentId: number;
|
|
185
|
-
timestamp: number;
|
|
186
|
-
data: Uint8Array;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* @public
|
|
191
|
-
*/
|
|
192
|
-
export declare namespace AuthoritativePutComponentOperation {
|
|
193
|
-
const MESSAGE_HEADER_LENGTH = 16;
|
|
194
|
-
/**
|
|
195
|
-
* Call this function for an optimal writing data passing the ByteBuffer
|
|
196
|
-
* already allocated
|
|
197
|
-
*/
|
|
198
|
-
export function write(entity: Entity, timestamp: number, componentId: number, data: Uint8Array, buf: ByteBuffer): void;
|
|
199
|
-
export function read(buf: ByteBuffer): AuthoritativePutComponentMessage | null;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
166
|
/** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
|
|
203
167
|
/**
|
|
204
168
|
* @public
|
|
@@ -358,22 +322,6 @@ export declare interface BaseComponent<T> {
|
|
|
358
322
|
* If the value is undefined, the component was deleted.
|
|
359
323
|
*/
|
|
360
324
|
onChange(entity: Entity, cb: (value: T | undefined) => void): void;
|
|
361
|
-
/**
|
|
362
|
-
* @public
|
|
363
|
-
*
|
|
364
|
-
*/
|
|
365
|
-
validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
|
|
366
|
-
validateBeforeChange(cb: ValidateCallback<T>): void;
|
|
367
|
-
/**
|
|
368
|
-
* Get the CRDT state for an entity (serialized data and timestamp)
|
|
369
|
-
* @param entity - Entity to get the CRDT state for
|
|
370
|
-
* @returns Object with serialized data and timestamp, or null if entity doesn't have the component
|
|
371
|
-
* @public
|
|
372
|
-
*/
|
|
373
|
-
getCrdtState(entity: Entity): {
|
|
374
|
-
data: Uint8Array;
|
|
375
|
-
timestamp: number;
|
|
376
|
-
} | null;
|
|
377
325
|
}
|
|
378
326
|
|
|
379
327
|
/** @public */
|
|
@@ -1584,12 +1532,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1584
1532
|
/**
|
|
1585
1533
|
* @public
|
|
1586
1534
|
*/
|
|
1587
|
-
export declare type CrdtMessage = PutComponentMessage |
|
|
1535
|
+
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1588
1536
|
|
|
1589
1537
|
/**
|
|
1590
1538
|
* @public
|
|
1591
1539
|
*/
|
|
1592
|
-
export declare type CrdtMessageBody = PutComponentMessageBody |
|
|
1540
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1593
1541
|
|
|
1594
1542
|
/**
|
|
1595
1543
|
* Min length = 8 bytes
|
|
@@ -1644,8 +1592,7 @@ export declare enum CrdtMessageType {
|
|
|
1644
1592
|
PUT_COMPONENT_NETWORK = 5,
|
|
1645
1593
|
DELETE_COMPONENT_NETWORK = 6,
|
|
1646
1594
|
DELETE_ENTITY_NETWORK = 7,
|
|
1647
|
-
|
|
1648
|
-
MAX_MESSAGE_TYPE = 9
|
|
1595
|
+
MAX_MESSAGE_TYPE = 8
|
|
1649
1596
|
}
|
|
1650
1597
|
|
|
1651
1598
|
/**
|
|
@@ -1653,8 +1600,6 @@ export declare enum CrdtMessageType {
|
|
|
1653
1600
|
*/
|
|
1654
1601
|
export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
|
|
1655
1602
|
|
|
1656
|
-
export declare const CreatedBy: ICreatedBy;
|
|
1657
|
-
|
|
1658
1603
|
/**
|
|
1659
1604
|
* @public
|
|
1660
1605
|
*/
|
|
@@ -2356,12 +2301,6 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
|
|
|
2356
2301
|
|
|
2357
2302
|
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
2358
2303
|
|
|
2359
|
-
export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
2360
|
-
|
|
2361
|
-
export declare interface ICreatedByType {
|
|
2362
|
-
address: string;
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
2304
|
/**
|
|
2366
2305
|
* @public
|
|
2367
2306
|
*/
|
|
@@ -2805,35 +2744,6 @@ export declare type InstanceCompositeOptions = {
|
|
|
2805
2744
|
alreadyRequestedSrc?: Set<string>;
|
|
2806
2745
|
};
|
|
2807
2746
|
|
|
2808
|
-
/**
|
|
2809
|
-
* Internal component interface that exposes all internal methods for SDK use
|
|
2810
|
-
* This is not exposed to users, only for internal SDK operations
|
|
2811
|
-
*/
|
|
2812
|
-
export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
2813
|
-
/**
|
|
2814
|
-
* @public
|
|
2815
|
-
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
2816
|
-
*/
|
|
2817
|
-
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
2818
|
-
/**
|
|
2819
|
-
* @public
|
|
2820
|
-
* Get the iterator to every entity has the component
|
|
2821
|
-
*/
|
|
2822
|
-
iterator(): Iterable<[Entity, any]>;
|
|
2823
|
-
/**
|
|
2824
|
-
* @public
|
|
2825
|
-
*/
|
|
2826
|
-
dirtyIterator(): Iterable<Entity>;
|
|
2827
|
-
/**
|
|
2828
|
-
* @public
|
|
2829
|
-
*/
|
|
2830
|
-
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
2831
|
-
/**
|
|
2832
|
-
* @public
|
|
2833
|
-
*/
|
|
2834
|
-
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
2747
|
/**
|
|
2838
2748
|
* @public
|
|
2839
2749
|
*/
|
|
@@ -2912,6 +2822,19 @@ export declare type JustifyType = 'flex-start' | 'center' | 'flex-end' | 'space-
|
|
|
2912
2822
|
*/
|
|
2913
2823
|
export declare type Key = number | string;
|
|
2914
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
|
+
|
|
2915
2838
|
/**
|
|
2916
2839
|
*
|
|
2917
2840
|
* @public
|
|
@@ -6572,12 +6495,92 @@ export declare namespace PBVisibilityComponent {
|
|
|
6572
6495
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBVisibilityComponent;
|
|
6573
6496
|
}
|
|
6574
6497
|
|
|
6498
|
+
/**
|
|
6499
|
+
* @public
|
|
6500
|
+
* Physics helpers for applying impulses and forces to the player.
|
|
6501
|
+
*/
|
|
6502
|
+
export declare const Physics: PhysicsSystem;
|
|
6503
|
+
|
|
6575
6504
|
/** @public */
|
|
6576
6505
|
export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
|
|
6577
6506
|
|
|
6578
6507
|
/** @public */
|
|
6579
6508
|
export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
|
|
6580
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
|
+
|
|
6581
6584
|
/**
|
|
6582
6585
|
* Represens a plane by the equation ax + by + cz + d = 0
|
|
6583
6586
|
* @public
|
|
@@ -7698,6 +7701,13 @@ export declare namespace RotateContinuous {
|
|
|
7698
7701
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): RotateContinuous;
|
|
7699
7702
|
}
|
|
7700
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
|
+
|
|
7701
7711
|
export declare type RPCSendableMessage = {
|
|
7702
7712
|
jsonrpc: '2.0';
|
|
7703
7713
|
id: number;
|
|
@@ -8394,6 +8404,18 @@ export declare type TransformComponent = LastWriteWinElementSetComponentDefiniti
|
|
|
8394
8404
|
export declare interface TransformComponentExtended extends TransformComponent {
|
|
8395
8405
|
create(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
|
|
8396
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;
|
|
8397
8419
|
}
|
|
8398
8420
|
|
|
8399
8421
|
/**
|
|
@@ -8944,14 +8966,6 @@ export declare interface UiTransformProps {
|
|
|
8944
8966
|
*/
|
|
8945
8967
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
8946
8968
|
|
|
8947
|
-
export declare type ValidateCallback<T> = (value: {
|
|
8948
|
-
entity: Entity;
|
|
8949
|
-
currentValue: T | undefined;
|
|
8950
|
-
newValue: T | undefined;
|
|
8951
|
-
senderAddress: string;
|
|
8952
|
-
createdBy: string;
|
|
8953
|
-
}) => boolean;
|
|
8954
|
-
|
|
8955
8969
|
/**
|
|
8956
8970
|
* @public
|
|
8957
8971
|
*/
|
package/dist/beta.d.ts
CHANGED
|
@@ -163,42 +163,6 @@ export declare interface AudioStreamComponentDefinitionExtended extends LastWrit
|
|
|
163
163
|
getAudioState(entity: Entity): PBAudioEvent | undefined;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
/**
|
|
167
|
-
* @public
|
|
168
|
-
*/
|
|
169
|
-
export declare type AuthoritativePutComponentMessage = CrdtMessageHeader & AuthoritativePutComponentMessageBody;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Server authoritative message - identical to PutComponentMessageBody but with forced processing
|
|
173
|
-
* Min. length = header (8 bytes) + 16 bytes = 24 bytes
|
|
174
|
-
*
|
|
175
|
-
* @param entity - Uint32 number of the entity
|
|
176
|
-
* @param componentId - Uint32 number of id
|
|
177
|
-
* @param timestamp - Uint32 Lamport timestamp (server's authoritative timestamp)
|
|
178
|
-
* @param data - Uint8[] data of component => length(4 bytes) + block of bytes[0..length-1]
|
|
179
|
-
* @public
|
|
180
|
-
*/
|
|
181
|
-
export declare type AuthoritativePutComponentMessageBody = {
|
|
182
|
-
type: CrdtMessageType.AUTHORITATIVE_PUT_COMPONENT;
|
|
183
|
-
entityId: Entity;
|
|
184
|
-
componentId: number;
|
|
185
|
-
timestamp: number;
|
|
186
|
-
data: Uint8Array;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* @public
|
|
191
|
-
*/
|
|
192
|
-
export declare namespace AuthoritativePutComponentOperation {
|
|
193
|
-
const MESSAGE_HEADER_LENGTH = 16;
|
|
194
|
-
/**
|
|
195
|
-
* Call this function for an optimal writing data passing the ByteBuffer
|
|
196
|
-
* already allocated
|
|
197
|
-
*/
|
|
198
|
-
export function write(entity: Entity, timestamp: number, componentId: number, data: Uint8Array, buf: ByteBuffer): void;
|
|
199
|
-
export function read(buf: ByteBuffer): AuthoritativePutComponentMessage | null;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
166
|
/** AvatarAnchorPointType determines the part of the avatar's body that anchors the Entity. */
|
|
203
167
|
/**
|
|
204
168
|
* @public
|
|
@@ -358,22 +322,6 @@ export declare interface BaseComponent<T> {
|
|
|
358
322
|
* If the value is undefined, the component was deleted.
|
|
359
323
|
*/
|
|
360
324
|
onChange(entity: Entity, cb: (value: T | undefined) => void): void;
|
|
361
|
-
/**
|
|
362
|
-
* @public
|
|
363
|
-
*
|
|
364
|
-
*/
|
|
365
|
-
validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
|
|
366
|
-
validateBeforeChange(cb: ValidateCallback<T>): void;
|
|
367
|
-
/**
|
|
368
|
-
* Get the CRDT state for an entity (serialized data and timestamp)
|
|
369
|
-
* @param entity - Entity to get the CRDT state for
|
|
370
|
-
* @returns Object with serialized data and timestamp, or null if entity doesn't have the component
|
|
371
|
-
* @public
|
|
372
|
-
*/
|
|
373
|
-
getCrdtState(entity: Entity): {
|
|
374
|
-
data: Uint8Array;
|
|
375
|
-
timestamp: number;
|
|
376
|
-
} | null;
|
|
377
325
|
}
|
|
378
326
|
|
|
379
327
|
/** @public */
|
|
@@ -1584,12 +1532,12 @@ export declare const CRDT_MESSAGE_HEADER_LENGTH = 8;
|
|
|
1584
1532
|
/**
|
|
1585
1533
|
* @public
|
|
1586
1534
|
*/
|
|
1587
|
-
export declare type CrdtMessage = PutComponentMessage |
|
|
1535
|
+
export declare type CrdtMessage = PutComponentMessage | DeleteComponentMessage | AppendValueMessage | DeleteEntityMessage | PutNetworkComponentMessage | DeleteComponentNetworkMessage | DeleteEntityNetworkMessage;
|
|
1588
1536
|
|
|
1589
1537
|
/**
|
|
1590
1538
|
* @public
|
|
1591
1539
|
*/
|
|
1592
|
-
export declare type CrdtMessageBody = PutComponentMessageBody |
|
|
1540
|
+
export declare type CrdtMessageBody = PutComponentMessageBody | DeleteComponentMessageBody | DeleteEntityMessageBody | AppendValueMessageBody | CrdtNetworkMessageBody;
|
|
1593
1541
|
|
|
1594
1542
|
/**
|
|
1595
1543
|
* Min length = 8 bytes
|
|
@@ -1644,8 +1592,7 @@ export declare enum CrdtMessageType {
|
|
|
1644
1592
|
PUT_COMPONENT_NETWORK = 5,
|
|
1645
1593
|
DELETE_COMPONENT_NETWORK = 6,
|
|
1646
1594
|
DELETE_ENTITY_NETWORK = 7,
|
|
1647
|
-
|
|
1648
|
-
MAX_MESSAGE_TYPE = 9
|
|
1595
|
+
MAX_MESSAGE_TYPE = 8
|
|
1649
1596
|
}
|
|
1650
1597
|
|
|
1651
1598
|
/**
|
|
@@ -1653,8 +1600,6 @@ export declare enum CrdtMessageType {
|
|
|
1653
1600
|
*/
|
|
1654
1601
|
export declare type CrdtNetworkMessageBody = PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody | DeleteEntityNetworkMessageBody;
|
|
1655
1602
|
|
|
1656
|
-
export declare const CreatedBy: ICreatedBy;
|
|
1657
|
-
|
|
1658
1603
|
/**
|
|
1659
1604
|
* @public
|
|
1660
1605
|
*/
|
|
@@ -2356,12 +2301,6 @@ export declare interface GrowOnlyValueSetComponentDefinition<T> extends BaseComp
|
|
|
2356
2301
|
|
|
2357
2302
|
export declare type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineValueSetComponentFromSchema'>) => T;
|
|
2358
2303
|
|
|
2359
|
-
export declare type ICreatedBy = LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
2360
|
-
|
|
2361
|
-
export declare interface ICreatedByType {
|
|
2362
|
-
address: string;
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
2304
|
/**
|
|
2366
2305
|
* @public
|
|
2367
2306
|
*/
|
|
@@ -2796,35 +2735,6 @@ export declare type InstanceCompositeOptions = {
|
|
|
2796
2735
|
alreadyRequestedSrc?: Set<string>;
|
|
2797
2736
|
};
|
|
2798
2737
|
|
|
2799
|
-
/**
|
|
2800
|
-
* Internal component interface that exposes all internal methods for SDK use
|
|
2801
|
-
* This is not exposed to users, only for internal SDK operations
|
|
2802
|
-
*/
|
|
2803
|
-
export declare interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
2804
|
-
/**
|
|
2805
|
-
* @public
|
|
2806
|
-
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
2807
|
-
*/
|
|
2808
|
-
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
2809
|
-
/**
|
|
2810
|
-
* @public
|
|
2811
|
-
* Get the iterator to every entity has the component
|
|
2812
|
-
*/
|
|
2813
|
-
iterator(): Iterable<[Entity, any]>;
|
|
2814
|
-
/**
|
|
2815
|
-
* @public
|
|
2816
|
-
*/
|
|
2817
|
-
dirtyIterator(): Iterable<Entity>;
|
|
2818
|
-
/**
|
|
2819
|
-
* @public
|
|
2820
|
-
*/
|
|
2821
|
-
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
2822
|
-
/**
|
|
2823
|
-
* @public
|
|
2824
|
-
*/
|
|
2825
|
-
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
2738
|
/**
|
|
2829
2739
|
* @public
|
|
2830
2740
|
*/
|
|
@@ -2903,6 +2813,19 @@ export declare type JustifyType = 'flex-start' | 'center' | 'flex-end' | 'space-
|
|
|
2903
2813
|
*/
|
|
2904
2814
|
export declare type Key = number | string;
|
|
2905
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
|
+
|
|
2906
2829
|
/**
|
|
2907
2830
|
*
|
|
2908
2831
|
* @public
|
|
@@ -6544,12 +6467,92 @@ export declare namespace PBVisibilityComponent {
|
|
|
6544
6467
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBVisibilityComponent;
|
|
6545
6468
|
}
|
|
6546
6469
|
|
|
6470
|
+
/**
|
|
6471
|
+
* @public
|
|
6472
|
+
* Physics helpers for applying impulses and forces to the player.
|
|
6473
|
+
*/
|
|
6474
|
+
export declare const Physics: PhysicsSystem;
|
|
6475
|
+
|
|
6547
6476
|
/** @public */
|
|
6548
6477
|
export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
|
|
6549
6478
|
|
|
6550
6479
|
/** @public */
|
|
6551
6480
|
export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
|
|
6552
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
|
+
|
|
6553
6556
|
/**
|
|
6554
6557
|
* Represens a plane by the equation ax + by + cz + d = 0
|
|
6555
6558
|
* @public
|
|
@@ -7670,6 +7673,13 @@ export declare namespace RotateContinuous {
|
|
|
7670
7673
|
export function decode(input: _m0.Reader | Uint8Array, length?: number): RotateContinuous;
|
|
7671
7674
|
}
|
|
7672
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
|
+
|
|
7673
7683
|
export declare type RPCSendableMessage = {
|
|
7674
7684
|
jsonrpc: '2.0';
|
|
7675
7685
|
id: number;
|
|
@@ -8361,6 +8371,18 @@ export declare type TransformComponent = LastWriteWinElementSetComponentDefiniti
|
|
|
8361
8371
|
export declare interface TransformComponentExtended extends TransformComponent {
|
|
8362
8372
|
create(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
|
|
8363
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;
|
|
8364
8386
|
}
|
|
8365
8387
|
|
|
8366
8388
|
/**
|
|
@@ -8911,14 +8933,6 @@ export declare interface UiTransformProps {
|
|
|
8911
8933
|
*/
|
|
8912
8934
|
export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
|
|
8913
8935
|
|
|
8914
|
-
export declare type ValidateCallback<T> = (value: {
|
|
8915
|
-
entity: Entity;
|
|
8916
|
-
currentValue: T | undefined;
|
|
8917
|
-
newValue: T | undefined;
|
|
8918
|
-
senderAddress: string;
|
|
8919
|
-
createdBy: string;
|
|
8920
|
-
}) => boolean;
|
|
8921
|
-
|
|
8922
8936
|
/**
|
|
8923
8937
|
* @public
|
|
8924
8938
|
*/
|