|
|
| BVHUnion ()=delete |
| | Disallowed, use the full constructor.
|
| |
| | BVHUnion (Pool &a_pool, const std::vector< P > &a_primitives, const std::vector< BV > &a_boundingVolumes, BVH::Construction a_construction=BVH::Construction::SAH) |
| | Build the union.
|
| |
| | BVHUnion (Pool &a_pool, const std::vector< P > &a_primitives, const std::vector< BV > &a_boundingVolumes, BVH::Construction a_construction, const BVH::ConstructionOptions &a_options) |
| | Build the union with leaf-size settings.
|
| |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| | Evaluate the union at a point.
|
| |
| BV | computeBoundingVolume () const noexcept |
| | The axis-aligned bounding box enclosing all primitives.
|
| |
| Root | getBVH () const noexcept |
| | Get the packed BVH over the primitives whose bounding box is bounded.
|
| |
| PODSpan< const CSGDetail::Stored< P > > | getUnboundedPrimitives () const noexcept |
| | Get the primitives whose bounding box is unbounded, which every query evaluates.
|
| |
| BVHUnion | rebasedView (const Pool &a_pool) const noexcept |
| | Produce a copy of this union that resolves against a_pool.
|
| |
| BVHUnion | deepCopy (Pool &a_dstPool) const |
| | Duplicate this union's storage, and that of any pool-resident primitive, into a_dstPool.
|
| |
| | BVHUnion (const Layout &a_layout, const PoolLocation &a_location) noexcept |
| | Rebuild a handle from a stored layout and the location of the pool that holds it.
|
| |
| Layout | layout () const noexcept |
| | The union's arrays without its location, for storing it inside an outer union.
|
| |
Public Member Functions inherited from EBGeometry::PoolHandle |
| PoolLocation | location () const noexcept |
| | Where this handle's arrays live.
|
| |
| bool | isAttachedTo (const Pool &a_pool) const noexcept |
| | Check whether this handle's arrays were reserved from a_pool.
|
| |
|
Protected Member Functions inherited from EBGeometry::PoolHandle |
|
| PoolHandle () noexcept=default |
| | An unset location; the first reservation attaches it.
|
| |
| | PoolHandle (const PoolLocation &a_location) noexcept |
| | Adopt a location, as a handle rebuilt from a stored layout does.
|
| |
| | PoolHandle (const PoolHandle &) noexcept=default |
| | Copy a handle, as a derived handle's copy does.
|
| |
|
| PoolHandle (PoolHandle &&) noexcept=default |
| | Move a handle; the same as a copy.
|
| |
| PoolHandle & | operator= (const PoolHandle &) noexcept=default |
| | Copy-assign a handle, as a derived handle's assignment does.
|
| |
| PoolHandle & | operator= (PoolHandle &&) noexcept=default |
| | Move-assign a handle; the same as a copy.
|
| |
|
| ~PoolHandle () noexcept=default |
| | Destructor; protected, since a PoolHandle exists only as the base of a handle.
|
| |
| void * | base () noexcept |
| | The base address this handle's offsets resolve against; see PoolLocation::base().
|
| |
| const void * | base () const noexcept |
| | The base address this handle's offsets resolve against, for read-only access.
|
| |
| void | attach (const Pool &a_pool, const char *a_who) noexcept |
| | Follow a_pool, as the first reservation does; see PoolLocation::attach().
|
| |
| PoolLocation | rebasedLocation (const Pool &a_pool, uint64_t a_endByte, const char *a_who) const noexcept |
| | The location of this handle's arrays in another pool of its mirror chain; see PoolLocation::rebasedOnto().
|
| |
| void | setLocation (const PoolLocation &a_location) noexcept |
| | Replace the location, for a view or a copy made by a derived handle.
|
| |
template<class T, class P, size_t K>
class EBGeometry::BVHUnion< T, P, K >
BVH-accelerated union of many primitives of one type.
A PackedBVH over the primitives, stored by value in a Pool. At query time the BVH culls primitives whose bounding volume lies further than the current best distance, giving sub-linear cost on large scenes. The value is the minimum over all primitives, negative inside the union.
This is a plain, trivially copyable value type with no virtual functions. signedDistance() is callable on the host and on a device: mirror the pool, call rebasedView(), and pass the result to a kernel. Because every primitive has the same type P, no runtime dispatch is needed. For primitives of different types, compose them with Union() and compile the result into a Tape, which evaluates a union of many operands with a BVH too.
P can be any trivially copyable type with an EBGEOMETRY_HOST_DEVICE signedDistance(const Vec3T<T>&): an analytic shape, a mesh distance function, or another BVH union. Pruning needs only that each bounding volume encloses its primitive's object (where the primitive's value is not positive): a primitive skipped because its box is further away than the best value so far is positive at the query point, so skipping it never changes the union's sign. Its value is a distance bound if the primitives' values are, and only a sign if they are DistanceQuality::NotADistance (see distanceQuality).
A primitive whose bounding box is unbounded in some direction (it reaches plus or minus Math::Limits<T>::max(), as an InfiniteCylinderSDF's does along its axis) is kept out of the BVH: such boxes would make every ancestor's box unbounded and the build heuristics meaningless. Those primitives are evaluated at every query instead, before the traversal, so their values can prune it. A union of many bounded primitives and a few unbounded ones costs the BVH query plus one evaluation per unbounded primitive.
A pool-resident primitive (a mesh distance function or a union; see PoolHandle) must have been built in the same Pool as this union. The union stores its layout, and rebuilds it with the union's own location as it evaluates it. The constructor checks the pool, and that there is one bounding volume per primitive, in every build, and aborts with a message if either fails.
- Template Parameters
-
| T | Floating-point precision. |
| P | Primitive type. |
| K | BVH branching factor. |