Skip to main content
Version: Next

Class: ClosestGeometryFinder<T>

Beta

A utility class to find and store the closest geometry to a given origin point.

Type Parameters

T

The type of the geometry.

Constructors

new ClosestGeometryFinder()

new ClosestGeometryFinder<T>(origin): ClosestGeometryFinder<T>

Beta

Parameters

origin: Vector3

The origin point from which distances are measured.

Returns

ClosestGeometryFinder<T>

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:22

Accessors

minDistance

Get Signature

get minDistance(): number

Beta

Gets the minimum distance to the closest geometry.

Returns

number

The minimum distance.

Set Signature

set minDistance(value): void

Beta

Sets the minimum distance to the closest geometry.

Parameters

value: number

The minimum distance.

Returns

void

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:41

Methods

add()

add(point, geometry): boolean

Beta

Parameters

point: Vector3

The point associated with the geometry.

geometry: T

The geometry to add.

Returns

boolean

True if the geometry was added, false otherwise.

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:93


addLazy()

addLazy(point, geometryCreator): boolean

Beta

Parameters

point: Vector3

The point associated with the geometry.

geometryCreator

A function that creates the geometry to add.

Returns

boolean

True if the geometry was added, false otherwise.

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:108


clear()

clear(): void

Beta

Returns

void

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:81


getClosestGeometry()

getClosestGeometry(): undefined | T

Beta

Returns

undefined | T

The closest geometry or undefined if no geometry has been added.

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:50


isClosest()

isClosest(point): boolean

Beta

Parameters

point: Vector3

The point to check.

Returns

boolean

True if the point is closer, false otherwise.

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:69


setClosestGeometry()

setClosestGeometry(geometry): void

Beta

Parameters

geometry: T

The geometry to set as the closest.

Returns

void

Defined in

packages/utilities/src/ClosestGeometryFinder.ts:59