PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
pbat::gpu::geometry::SweepAndPrune Class Reference

GPU Sweep and Prune public API. More...

#include <SweepAndPrune.h>

Public Types

using Impl = impl::geometry::SweepAndPrune
 Implementation type.
 

Public Member Functions

PBAT_API SweepAndPrune (std::size_t nPrimitives, std::size_t nOverlaps)
 Construct a new Sweep And Prune object with space allocated for nPrimitives and at most nOverlaps.
 
 SweepAndPrune (SweepAndPrune const &)=delete
 
SweepAndPruneoperator= (SweepAndPrune const &)=delete
 
PBAT_API SweepAndPrune (SweepAndPrune &&) noexcept
 Move constructor.
 
PBAT_API SweepAndPruneoperator= (SweepAndPrune &&) noexcept
 Move assignment.
 
PBAT_API GpuIndexMatrixX SortAndSweep (Aabb &aabbs)
 Detect overlaps between the AABBs.
 
PBAT_API GpuIndexMatrixX SortAndSweep (common::Buffer const &set, Aabb &aabbs)
 Detect overlaps between the AABBs of different sets.
 

Detailed Description

GPU Sweep and Prune public API.

Constructor & Destructor Documentation

◆ SweepAndPrune() [1/2]

pbat::gpu::geometry::SweepAndPrune::SweepAndPrune ( std::size_t nPrimitives,
std::size_t nOverlaps )

Construct a new Sweep And Prune object with space allocated for nPrimitives and at most nOverlaps.

Parameters
nPrimitivesNumber of primitives
nOverlapsMaximum number of overlaps

◆ SweepAndPrune() [2/2]

pbat::gpu::geometry::SweepAndPrune::SweepAndPrune ( SweepAndPrune && other)
noexcept

Move constructor.

Parameters
otherSweepAndPrune to move from

Member Function Documentation

◆ operator=()

SweepAndPrune & pbat::gpu::geometry::SweepAndPrune::operator= ( SweepAndPrune && other)
noexcept

Move assignment.

Parameters
otherSweepAndPrune to move from
Returns
Reference to this

◆ SortAndSweep() [1/2]

GpuIndexMatrixX pbat::gpu::geometry::SweepAndPrune::SortAndSweep ( Aabb & aabbs)

Detect overlaps between the AABBs.

Parameters
aabbsHandle to the AABBs
Returns
2 x |# overlaps| matrix of overlap pairs in aabbs

◆ SortAndSweep() [2/2]

PBAT_API GpuIndexMatrixX pbat::gpu::geometry::SweepAndPrune::SortAndSweep ( common::Buffer const & set,
Aabb & aabbs )

Detect overlaps between the AABBs of different sets.

Parameters
set|# aabbs| map of indices of aabbs to their corresponding set, i.e. set[i] = j means that aabb i belongs to set j. Must be a 1D Buffer of type GpuIndex of the same size as aabbs.
aabbsThe AABBs over objects
Returns
2x|# overlaps| matrix of overlap pairs between boxes of different sets

The documentation for this class was generated from the following files: