Skip to Content
Bear documentation

spatial

Import from bear/spatial.

Classes

SpatialIndex

Defined in: bear/spatial.ts:132

Constructors

Constructor
new SpatialIndex(): SpatialIndex;
Returns

SpatialIndex

Methods

get()
get(nodeId): ShapeProxy[] | undefined;

Defined in: bear/spatial.ts:148

Parameters
ParameterType
nodeIdstring
Returns

ShapeProxy[] | undefined

raycast()
raycast(
   originInput, 
   directionInput, 
   options?
): SpatialHit[];

Defined in: bear/spatial.ts:153

Parameters
ParameterType
originInputVector3
directionInputVector3
options?SpatialRaycastOptions
Returns

SpatialHit[]

remove()
remove(nodeId): void;

Defined in: bear/spatial.ts:144

Parameters
ParameterType
nodeIdstring
Returns

void

update()
update(nodeId, proxies): void;

Defined in: bear/spatial.ts:135

Parameters
ParameterType
nodeIdstring
proxiesShapeProxy | ShapeProxy[]
Returns

void

within()
within(bounds, options?): ShapeProxy[];

Defined in: bear/spatial.ts:219

Parameters
ParameterType
boundsAabb
options?{ excludeIds?: Iterable<string, any, any>; kinds?: Iterable<string, any, any>; }
options.excludeIds?Iterable<string, any, any>
options.kinds?Iterable<string, any, any>
Returns

ShapeProxy[]

Interfaces

AabbProxy

Defined in: bear/spatial.ts:33

Extends

  • BaseProxy

Properties

PropertyTypeOverridesInherited from
aabbAabb--
aggregate?boolean-BaseProxy.aggregate
nodeIdstring-BaseProxy.nodeId
nodeKindstring-BaseProxy.nodeKind
roles?Role[]-BaseProxy.roles
tags?string[]-BaseProxy.tags
type"aabb"BaseProxy.type-

PlaneProxy

Defined in: bear/spatial.ts:27

Extends

  • BaseProxy

Properties

PropertyTypeOverridesInherited from
aggregate?boolean-BaseProxy.aggregate
bounds?Aabb--
nodeIdstring-BaseProxy.nodeId
nodeKindstring-BaseProxy.nodeKind
planePlane--
roles?Role[]-BaseProxy.roles
tags?string[]-BaseProxy.tags
type"plane"BaseProxy.type-

SpatialRaycastOptions

Defined in: bear/spatial.ts:40

Properties

PropertyType
allowAggregates?boolean
bias?number
excludeIds?Iterable<string, any, any>
kinds?Iterable<string, any, any>
maxDistance?number
roles?Iterable<Role, any, any>

Type Aliases

Aabb

type Aabb = object;

Defined in: bear/spatial.ts:3

Properties

PropertyType
maxVector3
minVector3

ProxyKind

type ProxyKind = "plane" | "aabb";

Defined in: bear/spatial.ts:14


Role

type Role = 
  | "structural"
  | "connecting"
  | "enclosure"
  | "environmental"
  | "finish"
  | "service";

Defined in: bear/spatial.ts:6


ShapeProxy

type ShapeProxy = PlaneProxy | AabbProxy;

Defined in: bear/spatial.ts:38


SpatialHit

type SpatialHit = object;

Defined in: bear/spatial.ts:49

Properties

PropertyType
distancenumber
nodeIdstring
nodeKindstring
pointVector3
proxyShapeProxy

On this page