Reference·JavaScript · @bimworks/viewer3dJavaScript

CurrentSpaceTracker

Interface in @bimworks/viewer3d.

API catalogue · @bimworks/viewer3d · Interface

TypeScript#
interface CurrentSpaceTracker

Locates the camera in the loaded models' spaces without server round trips (docs/current-space-design.md §8). Obtain it with Viewer3d.ensureCurrentSpaceTracker().

Members#

Member Kind Description
settings Property
configure Method Changes settings; a new getClause re-runs the feature prefetch.
dispose Method
getCurrent Method
getSpaces Method The spaces of the loaded index, no query: a point inside each footprint and the footprint's centre, both at the floor (render frame)
off Method
on Method
on Method
prefetch Method Re-runs the bulk BQL prefetch of every space's features.
spacesInZone Method The qids ("vid-oid") of every prefetched space that belongs to the zone: no query.

settings#

TypeScript#
readonly settings: CurrentSpaceTrackerSettings

configure#

TypeScript#
configure(settings: Partial<CurrentSpaceTrackerSettings>): Promise<void>

Changes settings; a new getClause re-runs the feature prefetch.

Parameters#

Name Type Description
settings Partial<CurrentSpaceTrackerSettings>

dispose#

TypeScript#
dispose(): void

getCurrent#

TypeScript#
getCurrent(): CurrentSpaceResult

getSpaces#

TypeScript#
getSpaces(): ({ centre: vec3; inside: vec3; qid: string })[]

The spaces of the loaded index, no query: a point inside each footprint and the footprint's centre, both at the floor (render frame)

off#

TypeScript#
off(event: "current_space_changed" | "current_zone_changed", fn: (payload: any) => void): this

Parameters#

Name Type Description
event "current_space_changed" | "current_zone_changed"
fn (payload: any) => void

on#

TypeScript#
on(event: "current_space_changed", fn: (current: CurrentSpaceResult) => void): this

Parameters#

Name Type Description
event "current_space_changed"
fn (current: CurrentSpaceResult) => void

on#

TypeScript#
on(event: "current_zone_changed", fn: (payload: { stale: boolean; zones: (CurrentZone)[] }) => void): this

Parameters#

Name Type Description
event "current_zone_changed"
fn (payload: { stale: boolean; zones: (CurrentZone)[] }) => void

prefetch#

TypeScript#
prefetch(): Promise<void>

Re-runs the bulk BQL prefetch of every space's features.

spacesInZone#

TypeScript#
spacesInZone(zoneQid: string): (string)[]

The qids ("vid-oid") of every prefetched space that belongs to the zone: no query.

Parameters#

Name Type Description
zoneQid string