@dcl/playground-assets 7.1.8-4754660154.commit-c71195f → 7.1.8-4757726595.commit-28cb54f

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
@@ -1667,10 +1667,22 @@ export declare type GizmoSelectedEvent = {
1667
1667
  entities: string[];
1668
1668
  };
1669
1669
 
1670
+ export declare type GlobalDirectionRaycastOptions = RaycastSystemOptions & GlobalDirectionRaycastSystemOptions;
1671
+
1672
+ export declare type GlobalDirectionRaycastSystemOptions = {
1673
+ direction?: PBVector3;
1674
+ };
1675
+
1670
1676
  export declare type GlobalInputEventResult = InputEventResult & {
1671
1677
  type: 0 | 1;
1672
1678
  };
1673
1679
 
1680
+ export declare type GlobalTargetRaycastOptions = RaycastSystemOptions & GlobalTargetRaycastSystemOptions;
1681
+
1682
+ export declare type GlobalTargetRaycastSystemOptions = {
1683
+ target?: PBVector3;
1684
+ };
1685
+
1674
1686
  /** @public */
1675
1687
  export declare const GltfContainer: LastWriteWinElementSetComponentDefinition<PBGltfContainer>;
1676
1688
 
@@ -2279,6 +2291,12 @@ export declare type Listeners = {
2279
2291
  onMouseUp?: Callback;
2280
2292
  };
2281
2293
 
2294
+ export declare type LocalDirectionRaycastOptions = RaycastSystemOptions & LocalDirectionRaycastSystemOptions;
2295
+
2296
+ export declare type LocalDirectionRaycastSystemOptions = {
2297
+ direction?: PBVector3;
2298
+ };
2299
+
2282
2300
  export declare type LwwComponentGetter<T extends LastWriteWinElementSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
2283
2301
 
2284
2302
  /**
@@ -4390,7 +4408,7 @@ export declare interface PointerEventsSystem {
4390
4408
 
4391
4409
  /**
4392
4410
  * @public
4393
- * Register callback functions to a particular entity.
4411
+ * Register callback functions to a particular entity on input events.
4394
4412
  */
4395
4413
  export declare const pointerEventsSystem: PointerEventsSystem;
4396
4414
 
@@ -4834,6 +4852,76 @@ export declare type RaycastResponsePayload<T> = {
4834
4852
  /** @public */
4835
4853
  export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
4836
4854
 
4855
+ /**
4856
+ * @public
4857
+ */
4858
+ export declare interface RaycastSystem {
4859
+ /**
4860
+ * @public
4861
+ * Remove the callback for raycast event
4862
+ * @param entity - Entity where the callback was attached
4863
+ */
4864
+ removeRaycasterEntity(entity: Entity): void;
4865
+ /**
4866
+ * @public
4867
+ * Execute callback when the entity receives a RaycastResult component update.
4868
+ * Uses a Vector3 entity-local direction value to calculate the ray direction
4869
+ * @param entity - Entity to attach the callback
4870
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4871
+ * @param options - Raycast configuration options
4872
+ */
4873
+ registerLocalDirectionRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<LocalDirectionRaycastOptions>): void;
4874
+ /**
4875
+ * @public
4876
+ * Execute callback when the entity receives a RaycastResult component update.
4877
+ * Uses a Vector3 global direction value to calculate the ray direction
4878
+ * @param entity - Entity to attach the callback
4879
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4880
+ * @param options - Raycast configuration options
4881
+ */
4882
+ registerGlobalDirectionRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<GlobalDirectionRaycastOptions>): void;
4883
+ /**
4884
+ * @public
4885
+ * Execute callback when the entity receives a RaycastResult component update.
4886
+ * Uses a Vector3 global target position to calculate the ray direction
4887
+ * @param entity - Entity to attach the callback
4888
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4889
+ * @param options - Raycast configuration options
4890
+ */
4891
+ registerGlobalTargetRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<GlobalTargetRaycastOptions>): void;
4892
+ /**
4893
+ * @public
4894
+ * Execute callback when the entity receives a RaycastResult component update.
4895
+ * Uses an target Entity value to calculate the ray direction
4896
+ * @param entity - Entity to attach the callback
4897
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4898
+ * @param options - Raycast configuration options
4899
+ */
4900
+ registerTargetEntityRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<TargetEntityRaycastOptions>): void;
4901
+ }
4902
+
4903
+ /**
4904
+ * @public
4905
+ * Register callback functions to a particular entity on raycast results.
4906
+ */
4907
+ export declare const raycastSystem: RaycastSystem;
4908
+
4909
+ /**
4910
+ * @public
4911
+ */
4912
+ export declare type RaycastSystemCallback = (event: DeepReadonlyObject<PBRaycastResult>) => void;
4913
+
4914
+ /**
4915
+ * @public
4916
+ */
4917
+ export declare type RaycastSystemOptions = {
4918
+ originOffset?: PBVector3 | undefined;
4919
+ maxDistance: number;
4920
+ queryType: RaycastQueryType;
4921
+ continuous?: boolean | undefined;
4922
+ collisionMask?: number | undefined;
4923
+ };
4924
+
4837
4925
  /**
4838
4926
  * @public
4839
4927
  */
@@ -5197,6 +5285,12 @@ export declare type SystemItem = {
5197
5285
  name?: string;
5198
5286
  };
5199
5287
 
5288
+ export declare type TargetEntityRaycastOptions = RaycastSystemOptions & TargetEntityRaycastSystemOptions;
5289
+
5290
+ export declare type TargetEntityRaycastSystemOptions = {
5291
+ targetEntity?: number;
5292
+ };
5293
+
5200
5294
  export declare type Task<T = unknown> = () => Promise<T>;
5201
5295
 
5202
5296
  /**
package/dist/beta.d.ts CHANGED
@@ -1667,10 +1667,22 @@ export declare type GizmoSelectedEvent = {
1667
1667
  entities: string[];
1668
1668
  };
1669
1669
 
1670
+ export declare type GlobalDirectionRaycastOptions = RaycastSystemOptions & GlobalDirectionRaycastSystemOptions;
1671
+
1672
+ export declare type GlobalDirectionRaycastSystemOptions = {
1673
+ direction?: PBVector3;
1674
+ };
1675
+
1670
1676
  export declare type GlobalInputEventResult = InputEventResult & {
1671
1677
  type: 0 | 1;
1672
1678
  };
1673
1679
 
1680
+ export declare type GlobalTargetRaycastOptions = RaycastSystemOptions & GlobalTargetRaycastSystemOptions;
1681
+
1682
+ export declare type GlobalTargetRaycastSystemOptions = {
1683
+ target?: PBVector3;
1684
+ };
1685
+
1674
1686
  /** @public */
1675
1687
  export declare const GltfContainer: LastWriteWinElementSetComponentDefinition<PBGltfContainer>;
1676
1688
 
@@ -2275,6 +2287,12 @@ export declare type Listeners = {
2275
2287
  onMouseUp?: Callback;
2276
2288
  };
2277
2289
 
2290
+ export declare type LocalDirectionRaycastOptions = RaycastSystemOptions & LocalDirectionRaycastSystemOptions;
2291
+
2292
+ export declare type LocalDirectionRaycastSystemOptions = {
2293
+ direction?: PBVector3;
2294
+ };
2295
+
2278
2296
  export declare type LwwComponentGetter<T extends LastWriteWinElementSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
2279
2297
 
2280
2298
  /**
@@ -4386,7 +4404,7 @@ export declare interface PointerEventsSystem {
4386
4404
 
4387
4405
  /**
4388
4406
  * @public
4389
- * Register callback functions to a particular entity.
4407
+ * Register callback functions to a particular entity on input events.
4390
4408
  */
4391
4409
  export declare const pointerEventsSystem: PointerEventsSystem;
4392
4410
 
@@ -4830,6 +4848,76 @@ export declare type RaycastResponsePayload<T> = {
4830
4848
  /** @public */
4831
4849
  export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
4832
4850
 
4851
+ /**
4852
+ * @public
4853
+ */
4854
+ export declare interface RaycastSystem {
4855
+ /**
4856
+ * @public
4857
+ * Remove the callback for raycast event
4858
+ * @param entity - Entity where the callback was attached
4859
+ */
4860
+ removeRaycasterEntity(entity: Entity): void;
4861
+ /**
4862
+ * @public
4863
+ * Execute callback when the entity receives a RaycastResult component update.
4864
+ * Uses a Vector3 entity-local direction value to calculate the ray direction
4865
+ * @param entity - Entity to attach the callback
4866
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4867
+ * @param options - Raycast configuration options
4868
+ */
4869
+ registerLocalDirectionRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<LocalDirectionRaycastOptions>): void;
4870
+ /**
4871
+ * @public
4872
+ * Execute callback when the entity receives a RaycastResult component update.
4873
+ * Uses a Vector3 global direction value to calculate the ray direction
4874
+ * @param entity - Entity to attach the callback
4875
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4876
+ * @param options - Raycast configuration options
4877
+ */
4878
+ registerGlobalDirectionRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<GlobalDirectionRaycastOptions>): void;
4879
+ /**
4880
+ * @public
4881
+ * Execute callback when the entity receives a RaycastResult component update.
4882
+ * Uses a Vector3 global target position to calculate the ray direction
4883
+ * @param entity - Entity to attach the callback
4884
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4885
+ * @param options - Raycast configuration options
4886
+ */
4887
+ registerGlobalTargetRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<GlobalTargetRaycastOptions>): void;
4888
+ /**
4889
+ * @public
4890
+ * Execute callback when the entity receives a RaycastResult component update.
4891
+ * Uses an target Entity value to calculate the ray direction
4892
+ * @param entity - Entity to attach the callback
4893
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4894
+ * @param options - Raycast configuration options
4895
+ */
4896
+ registerTargetEntityRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<TargetEntityRaycastOptions>): void;
4897
+ }
4898
+
4899
+ /**
4900
+ * @public
4901
+ * Register callback functions to a particular entity on raycast results.
4902
+ */
4903
+ export declare const raycastSystem: RaycastSystem;
4904
+
4905
+ /**
4906
+ * @public
4907
+ */
4908
+ export declare type RaycastSystemCallback = (event: DeepReadonlyObject<PBRaycastResult>) => void;
4909
+
4910
+ /**
4911
+ * @public
4912
+ */
4913
+ export declare type RaycastSystemOptions = {
4914
+ originOffset?: PBVector3 | undefined;
4915
+ maxDistance: number;
4916
+ queryType: RaycastQueryType;
4917
+ continuous?: boolean | undefined;
4918
+ collisionMask?: number | undefined;
4919
+ };
4920
+
4833
4921
  /**
4834
4922
  * @public
4835
4923
  */
@@ -5193,6 +5281,12 @@ export declare type SystemItem = {
5193
5281
  name?: string;
5194
5282
  };
5195
5283
 
5284
+ export declare type TargetEntityRaycastOptions = RaycastSystemOptions & TargetEntityRaycastSystemOptions;
5285
+
5286
+ export declare type TargetEntityRaycastSystemOptions = {
5287
+ targetEntity?: number;
5288
+ };
5289
+
5196
5290
  export declare type Task<T = unknown> = () => Promise<T>;
5197
5291
 
5198
5292
  /**
@@ -1667,10 +1667,22 @@ export declare type GizmoSelectedEvent = {
1667
1667
  entities: string[];
1668
1668
  };
1669
1669
 
1670
+ export declare type GlobalDirectionRaycastOptions = RaycastSystemOptions & GlobalDirectionRaycastSystemOptions;
1671
+
1672
+ export declare type GlobalDirectionRaycastSystemOptions = {
1673
+ direction?: PBVector3;
1674
+ };
1675
+
1670
1676
  export declare type GlobalInputEventResult = InputEventResult & {
1671
1677
  type: 0 | 1;
1672
1678
  };
1673
1679
 
1680
+ export declare type GlobalTargetRaycastOptions = RaycastSystemOptions & GlobalTargetRaycastSystemOptions;
1681
+
1682
+ export declare type GlobalTargetRaycastSystemOptions = {
1683
+ target?: PBVector3;
1684
+ };
1685
+
1674
1686
  /** @public */
1675
1687
  export declare const GltfContainer: LastWriteWinElementSetComponentDefinition<PBGltfContainer>;
1676
1688
 
@@ -2275,6 +2287,12 @@ export declare type Listeners = {
2275
2287
  onMouseUp?: Callback;
2276
2288
  };
2277
2289
 
2290
+ export declare type LocalDirectionRaycastOptions = RaycastSystemOptions & LocalDirectionRaycastSystemOptions;
2291
+
2292
+ export declare type LocalDirectionRaycastSystemOptions = {
2293
+ direction?: PBVector3;
2294
+ };
2295
+
2278
2296
  export declare type LwwComponentGetter<T extends LastWriteWinElementSetComponentDefinition<any>> = (engine: Pick<IEngine, 'defineComponentFromSchema'>) => T;
2279
2297
 
2280
2298
  /**
@@ -4386,7 +4404,7 @@ export declare interface PointerEventsSystem {
4386
4404
 
4387
4405
  /**
4388
4406
  * @public
4389
- * Register callback functions to a particular entity.
4407
+ * Register callback functions to a particular entity on input events.
4390
4408
  */
4391
4409
  export declare const pointerEventsSystem: PointerEventsSystem;
4392
4410
 
@@ -4830,6 +4848,76 @@ export declare type RaycastResponsePayload<T> = {
4830
4848
  /** @public */
4831
4849
  export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
4832
4850
 
4851
+ /**
4852
+ * @public
4853
+ */
4854
+ export declare interface RaycastSystem {
4855
+ /**
4856
+ * @public
4857
+ * Remove the callback for raycast event
4858
+ * @param entity - Entity where the callback was attached
4859
+ */
4860
+ removeRaycasterEntity(entity: Entity): void;
4861
+ /**
4862
+ * @public
4863
+ * Execute callback when the entity receives a RaycastResult component update.
4864
+ * Uses a Vector3 entity-local direction value to calculate the ray direction
4865
+ * @param entity - Entity to attach the callback
4866
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4867
+ * @param options - Raycast configuration options
4868
+ */
4869
+ registerLocalDirectionRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<LocalDirectionRaycastOptions>): void;
4870
+ /**
4871
+ * @public
4872
+ * Execute callback when the entity receives a RaycastResult component update.
4873
+ * Uses a Vector3 global direction value to calculate the ray direction
4874
+ * @param entity - Entity to attach the callback
4875
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4876
+ * @param options - Raycast configuration options
4877
+ */
4878
+ registerGlobalDirectionRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<GlobalDirectionRaycastOptions>): void;
4879
+ /**
4880
+ * @public
4881
+ * Execute callback when the entity receives a RaycastResult component update.
4882
+ * Uses a Vector3 global target position to calculate the ray direction
4883
+ * @param entity - Entity to attach the callback
4884
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4885
+ * @param options - Raycast configuration options
4886
+ */
4887
+ registerGlobalTargetRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<GlobalTargetRaycastOptions>): void;
4888
+ /**
4889
+ * @public
4890
+ * Execute callback when the entity receives a RaycastResult component update.
4891
+ * Uses an target Entity value to calculate the ray direction
4892
+ * @param entity - Entity to attach the callback
4893
+ * @param callback - Function to execute when the entity's RaycastResult component is updated
4894
+ * @param options - Raycast configuration options
4895
+ */
4896
+ registerTargetEntityRaycast(entity: Entity, callback: RaycastSystemCallback, options?: Partial<TargetEntityRaycastOptions>): void;
4897
+ }
4898
+
4899
+ /**
4900
+ * @public
4901
+ * Register callback functions to a particular entity on raycast results.
4902
+ */
4903
+ export declare const raycastSystem: RaycastSystem;
4904
+
4905
+ /**
4906
+ * @public
4907
+ */
4908
+ export declare type RaycastSystemCallback = (event: DeepReadonlyObject<PBRaycastResult>) => void;
4909
+
4910
+ /**
4911
+ * @public
4912
+ */
4913
+ export declare type RaycastSystemOptions = {
4914
+ originOffset?: PBVector3 | undefined;
4915
+ maxDistance: number;
4916
+ queryType: RaycastQueryType;
4917
+ continuous?: boolean | undefined;
4918
+ collisionMask?: number | undefined;
4919
+ };
4920
+
4833
4921
  /**
4834
4922
  * @public
4835
4923
  */
@@ -5193,6 +5281,12 @@ export declare type SystemItem = {
5193
5281
  name?: string;
5194
5282
  };
5195
5283
 
5284
+ export declare type TargetEntityRaycastOptions = RaycastSystemOptions & TargetEntityRaycastSystemOptions;
5285
+
5286
+ export declare type TargetEntityRaycastSystemOptions = {
5287
+ targetEntity?: number;
5288
+ };
5289
+
5196
5290
  export declare type Task<T = unknown> = () => Promise<T>;
5197
5291
 
5198
5292
  /**