Skip to content

Commit 6ee9880

Browse files
committed
feat(core): restore raycast from vector
1 parent 670cb7c commit 6ee9880

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatopen/components",
33
"description": "Collection of core functionalities to author BIM apps.",
4-
"version": "3.2.4",
4+
"version": "3.2.5",
55
"author": "That Open Company",
66
"contributors": [
77
"Antonio Gonzalez Viegas (https://github.com/agviegas)",

packages/core/src/core/Raycasters/src/simple-raycaster.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,24 +128,24 @@ export class SimpleRaycaster implements Disposable {
128128
return fragResult;
129129
}
130130

131-
// /**
132-
// * Casts a ray from a given origin in a given direction and returns the first item found.
133-
// * This method also takes into account the clipping planes used by the renderer.
134-
// *
135-
// * @param origin - The origin of the ray.
136-
// * @param direction - The direction of the ray.
137-
// * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
138-
// * @returns The first intersection found or `null` if no intersection was found.
139-
// */
140-
// castRayFromVector(
141-
// origin: THREE.Vector3,
142-
// direction: THREE.Vector3,
143-
// items = Array.from(this.world.meshes),
144-
// ) {
145-
// // TODO: Implement for fragmentsmodel
146-
// this.three.set(origin, direction);
147-
// return this.intersect(items);
148-
// }
131+
/**
132+
* Casts a ray from a given origin in a given direction and returns the first item found.
133+
* This method also takes into account the clipping planes used by the renderer.
134+
*
135+
* @param origin - The origin of the ray.
136+
* @param direction - The direction of the ray.
137+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
138+
* @returns The first intersection found or `null` if no intersection was found.
139+
*/
140+
castRayFromVector(
141+
origin: THREE.Vector3,
142+
direction: THREE.Vector3,
143+
items = Array.from(this.world.meshes),
144+
) {
145+
// TODO: Implement for fragmentsmodel
146+
this.three.set(origin, direction);
147+
return this.intersect(items);
148+
}
149149

150150
private intersect(items: THREE.Object3D[] = Array.from(this.world.meshes)) {
151151
const result = this.three.intersectObjects(items);

0 commit comments

Comments
 (0)