spatial
Import from bear/spatial.
Classes
SpatialIndex
Defined in: bear/spatial.ts:132
Constructors
Constructor
new SpatialIndex(): SpatialIndex;Returns
Methods
get()
get(nodeId): ShapeProxy[] | undefined;Defined in: bear/spatial.ts:148
Parameters
| Parameter | Type |
|---|---|
nodeId | string |
Returns
ShapeProxy[] | undefined
raycast()
raycast(
originInput,
directionInput,
options?
): SpatialHit[];Defined in: bear/spatial.ts:153
Parameters
| Parameter | Type |
|---|---|
originInput | Vector3 |
directionInput | Vector3 |
options? | SpatialRaycastOptions |
Returns
remove()
remove(nodeId): void;Defined in: bear/spatial.ts:144
Parameters
| Parameter | Type |
|---|---|
nodeId | string |
Returns
void
update()
update(nodeId, proxies): void;Defined in: bear/spatial.ts:135
Parameters
| Parameter | Type |
|---|---|
nodeId | string |
proxies | ShapeProxy | ShapeProxy[] |
Returns
void
within()
within(bounds, options?): ShapeProxy[];Defined in: bear/spatial.ts:219
Parameters
| Parameter | Type |
|---|---|
bounds | Aabb |
options? | { excludeIds?: Iterable<string, any, any>; kinds?: Iterable<string, any, any>; } |
options.excludeIds? | Iterable<string, any, any> |
options.kinds? | Iterable<string, any, any> |
Returns
Interfaces
AabbProxy
Defined in: bear/spatial.ts:33
Extends
BaseProxy
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
aabb | Aabb | - | - |
aggregate? | boolean | - | BaseProxy.aggregate |
nodeId | string | - | BaseProxy.nodeId |
nodeKind | string | - | BaseProxy.nodeKind |
roles? | Role[] | - | BaseProxy.roles |
tags? | string[] | - | BaseProxy.tags |
type | "aabb" | BaseProxy.type | - |
PlaneProxy
Defined in: bear/spatial.ts:27
Extends
BaseProxy
Properties
| Property | Type | Overrides | Inherited from |
|---|---|---|---|
aggregate? | boolean | - | BaseProxy.aggregate |
bounds? | Aabb | - | - |
nodeId | string | - | BaseProxy.nodeId |
nodeKind | string | - | BaseProxy.nodeKind |
plane | Plane | - | - |
roles? | Role[] | - | BaseProxy.roles |
tags? | string[] | - | BaseProxy.tags |
type | "plane" | BaseProxy.type | - |
SpatialRaycastOptions
Defined in: bear/spatial.ts:40
Properties
| Property | Type |
|---|---|
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
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
| Property | Type |
|---|---|
distance | number |
nodeId | string |
nodeKind | string |
point | Vector3 |
proxy | ShapeProxy |