@thatopen/components 3.2.4 → 3.2.5

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/index.cjs CHANGED
@@ -4655,24 +4655,19 @@ class SimpleRaycaster {
4655
4655
  }
4656
4656
  return fragResult;
4657
4657
  }
4658
- // /**
4659
- // * Casts a ray from a given origin in a given direction and returns the first item found.
4660
- // * This method also takes into account the clipping planes used by the renderer.
4661
- // *
4662
- // * @param origin - The origin of the ray.
4663
- // * @param direction - The direction of the ray.
4664
- // * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
4665
- // * @returns The first intersection found or `null` if no intersection was found.
4666
- // */
4667
- // castRayFromVector(
4668
- // origin: THREE.Vector3,
4669
- // direction: THREE.Vector3,
4670
- // items = Array.from(this.world.meshes),
4671
- // ) {
4672
- // // TODO: Implement for fragmentsmodel
4673
- // this.three.set(origin, direction);
4674
- // return this.intersect(items);
4675
- // }
4658
+ /**
4659
+ * Casts a ray from a given origin in a given direction and returns the first item found.
4660
+ * This method also takes into account the clipping planes used by the renderer.
4661
+ *
4662
+ * @param origin - The origin of the ray.
4663
+ * @param direction - The direction of the ray.
4664
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
4665
+ * @returns The first intersection found or `null` if no intersection was found.
4666
+ */
4667
+ castRayFromVector(origin, direction, items = Array.from(this.world.meshes)) {
4668
+ this.three.set(origin, direction);
4669
+ return this.intersect(items);
4670
+ }
4676
4671
  intersect(items = Array.from(this.world.meshes)) {
4677
4672
  const result = this.three.intersectObjects(items);
4678
4673
  const filtered = this.filterClippingPlanes(result);
package/dist/index.d.ts CHANGED
@@ -3350,6 +3350,16 @@ export declare class SimpleRaycaster implements Disposable_2 {
3350
3350
  items?: THREE.Object3D[];
3351
3351
  position?: THREE.Vector2;
3352
3352
  }): Promise<THREE.Intersection | null>;
3353
+ /**
3354
+ * Casts a ray from a given origin in a given direction and returns the first item found.
3355
+ * This method also takes into account the clipping planes used by the renderer.
3356
+ *
3357
+ * @param origin - The origin of the ray.
3358
+ * @param direction - The direction of the ray.
3359
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
3360
+ * @returns The first intersection found or `null` if no intersection was found.
3361
+ */
3362
+ castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
3353
3363
  private intersect;
3354
3364
  private filterClippingPlanes;
3355
3365
  }