@speckle/viewer
Version:
A 3d viewer for Speckle, based on threejs.
21 lines (20 loc) • 1.56 kB
TypeScript
import { Box3, Camera, Object3D, Plane, Ray, Scene, Vector2, Vector3 } from 'three';
import { ExtendedIntersection, ExtendedMeshIntersection, SpeckleRaycaster } from './objects/SpeckleRaycaster.js';
import { ObjectLayers } from '../IViewer.js';
import { OBB } from 'three/examples/jsm/math/OBB.js';
export declare class Intersections {
protected raycaster: SpeckleRaycaster;
private boxBuffer;
private vec0Buffer;
private vec1Buffer;
private boundsBuffer;
constructor();
protected onObjectIntersection(obj: Object3D): void;
intersect(scene: Scene, camera: Camera, point: Vector2, castLayers: ObjectLayers.STREAM_CONTENT_MESH, nearest?: boolean, bounds?: Box3 | OBB, firstOnly?: boolean, tasOnly?: boolean): Array<ExtendedMeshIntersection> | null;
intersect(scene: Scene, camera: Camera, point: Vector2, castLayers?: Array<ObjectLayers>, nearest?: boolean, bounds?: Box3 | OBB, firstOnly?: boolean, tasOnly?: boolean): Array<ExtendedIntersection> | null;
intersectRay(scene: Scene, camera: Camera, ray: Ray, castLayers: ObjectLayers.STREAM_CONTENT_MESH, nearest?: boolean, bounds?: Box3 | OBB, firstOnly?: boolean, tasOnly?: boolean): Array<ExtendedMeshIntersection> | null;
intersectRay(scene: Scene, camera: Camera, ray: Ray, castLayers?: Array<ObjectLayers>, nearest?: boolean, bounds?: Box3 | OBB, firstOnly?: boolean, tasOnly?: boolean): Array<ExtendedIntersection> | null;
private setRaycasterLayers;
private intersectInternal;
static aabbPlanePoints: (plane: Plane, aabb: Box3) => Vector3[];
}