Logo Euclid.BVH

Bvh2d Type

Provides static functions to create Bvh2d trees without specifying the generic type argument.

Static members

Static member Description

Bvh2d.create (items, getRect, ?leafSize)

Full Usage: Bvh2d.create (items, getRect, ?leafSize)

Parameters:
    items : 'T seq - The items to build the tree from. They are enumerated and copied to an array at build time.
    getRect : 'T -> BRect - A function returning the axis aligned bounding rectangle of an item. It is called once per item at build time.
    ?leafSize : int - The maximum amount of items per leaf node. Optional, 4 by default.

Returns: Bvh2d<'T> A new immutable Bvh2d.
Type parameters: 'T

Builds a Bvh2d from the given sequence of items.

items : 'T seq

The items to build the tree from. They are enumerated and copied to an array at build time.

getRect : 'T -> BRect

A function returning the axis aligned bounding rectangle of an item. It is called once per item at build time.

?leafSize : int

The maximum amount of items per leaf node. Optional, 4 by default.

Returns: Bvh2d<'T>

A new immutable Bvh2d.

Bvh2d.create (items, getRect, ?leafSize)

Full Usage: Bvh2d.create (items, getRect, ?leafSize)

Parameters:
    items : ResizeArray<'T> - The items to build the tree from. They are copied to an array at build time.
    getRect : 'T -> BRect - A function returning the axis aligned bounding rectangle of an item. It is called once per item at build time.
    ?leafSize : int - The maximum amount of items per leaf node. Optional, 4 by default.

Returns: Bvh2d<'T> A new immutable Bvh2d.
Type parameters: 'T

Builds a Bvh2d from the given resizable array of items.

items : ResizeArray<'T>

The items to build the tree from. They are copied to an array at build time.

getRect : 'T -> BRect

A function returning the axis aligned bounding rectangle of an item. It is called once per item at build time.

?leafSize : int

The maximum amount of items per leaf node. Optional, 4 by default.

Returns: Bvh2d<'T>

A new immutable Bvh2d.

Bvh2d.create (items, getRect, ?leafSize)

Full Usage: Bvh2d.create (items, getRect, ?leafSize)

Parameters:
    items : 'T[] - The items to build the tree from. The array is referenced, not copied. Do not mutate it afterwards.
    getRect : 'T -> BRect - A function returning the axis aligned bounding rectangle of an item. It is called once per item at build time.
    ?leafSize : int - The maximum amount of items per leaf node. Optional, 4 by default.

Returns: Bvh2d<'T> A new immutable Bvh2d.
Type parameters: 'T

Builds a Bvh2d from the given items. The tree is built top-down by splitting at the median of the item-rectangle centers along the longer axis of the current bounding rectangle.

items : 'T[]

The items to build the tree from. The array is referenced, not copied. Do not mutate it afterwards.

getRect : 'T -> BRect

A function returning the axis aligned bounding rectangle of an item. It is called once per item at build time.

?leafSize : int

The maximum amount of items per leaf node. Optional, 4 by default.

Returns: Bvh2d<'T>

A new immutable Bvh2d.

Bvh2d.createFromRects (rects, ?leafSize)

Full Usage: Bvh2d.createFromRects (rects, ?leafSize)

Parameters:
    rects : BRect[] - The axis aligned bounding rectangles to build the tree from. The array is referenced, not copied. Do not mutate it afterwards.
    ?leafSize : int - The maximum amount of rectangles per leaf node. Optional, 4 by default.

Returns: Bvh2d<BRect> A new immutable Bvh2d of BRect.

Builds a Bvh2d directly from bounding rectangles. The rectangles themselves are the items.

rects : BRect[]

The axis aligned bounding rectangles to build the tree from. The array is referenced, not copied. Do not mutate it afterwards.

?leafSize : int

The maximum amount of rectangles per leaf node. Optional, 4 by default.

Returns: Bvh2d<BRect>

A new immutable Bvh2d of BRect.

Type something to start searching.