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
SweepAndPrune.h
Go to the documentation of this file.
1
10
11#ifndef PBAT_GPU_GEOMETRY_SWEEPANDPRUNE_H
12#define PBAT_GPU_GEOMETRY_SWEEPANDPRUNE_H
13
14#include "Aabb.h"
15#include "PhysicsBasedAnimationToolkitExport.h"
16#include "pbat/gpu/Aliases.h"
18
19#include <cstddef>
20
21namespace pbat::gpu::impl::geometry {
22class SweepAndPrune;
23} // namespace pbat::gpu::impl::geometry
24
25namespace pbat {
26namespace gpu {
27namespace geometry {
28
33{
34 public:
36
43 PBAT_API SweepAndPrune(std::size_t nPrimitives, std::size_t nOverlaps);
44
45 SweepAndPrune(SweepAndPrune const&) = delete;
46 SweepAndPrune& operator=(SweepAndPrune const&) = delete;
51 PBAT_API SweepAndPrune(SweepAndPrune&&) noexcept;
57 PBAT_API SweepAndPrune& operator=(SweepAndPrune&&) noexcept;
63 PBAT_API GpuIndexMatrixX SortAndSweep(Aabb& aabbs);
72 PBAT_API GpuIndexMatrixX SortAndSweep(common::Buffer const& set, Aabb& aabbs);
73
74 PBAT_API ~SweepAndPrune();
75
76 private:
77 void Deallocate();
78
79 Impl* mImpl;
80 void* mOverlaps;
81};
82
83} // namespace geometry
84} // namespace gpu
85} // namespace pbat
86
87#endif // PBAT_GPU_GEOMETRY_SWEEPANDPRUNE_H
Axis-aligned bounding box (AABB) buffer on the GPU.
This file contains the Buffer class for 1- or 2-dimensional GPU buffers of numeric types.
GPU axis-aligned bounding box (AABB) buffer public API.
Definition Aabb.h:25
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.
Definition SweepAndPrune.cu:16
impl::geometry::SweepAndPrune Impl
Implementation type.
Definition SweepAndPrune.h:35
PBAT_API GpuIndexMatrixX SortAndSweep(Aabb &aabbs)
Detect overlaps between the AABBs.
Definition SweepAndPrune.cu:46
Single-axis parallel sweep and prune algorithm for detecting overlapping bounding boxes.
Definition SweepAndPrune.cuh:29
Type aliases for GPU code.
Public API to core GPU utilities.
Definition Buffer.cu:17
Public geometry API for GPU.
Definition Aabb.cu:16
GPU related public functionality.
Definition Buffer.cu:16
The main namespace of the library.
Definition Aliases.h:15
Eigen::Matrix< GpuIndex, Eigen::Dynamic, Eigen::Dynamic > GpuIndexMatrixX
Index matrix type for GPU code.
Definition Aliases.h:24