8template <
typename ScalarType>
35template <
typename ResultConsumerType>
68 const FSpatialHash::FCellBlock& Block = GlobalSpatialHash.GetByElementId(BlockId).Value;
69 FVector3d BlockWorldPos = FVector3d(BlockLoc.Coord) * double(BlockSize);
74 FSphere3f BlockLocalSphere(FVector3f(Sphere.Center - BlockWorldPos), float(Sphere.W) + (LevelCellSize * 0.5f));
76 FFootprint8 LightFootprintInBlock = ToBlockLocal(LightFootprint, BlockLoc);
80 uint64 LightCellMask = FSpatialHash::FCellBlock::BuildFootPrintMask(LightFootprintInBlock);
82 if ((Block.CoarseCellMask & LightCellMask) != 0ULL)
84 LightFootprintInBlock.ForEach([&](const FLocation8& CellSubLoc)
86 if ((Block.CoarseCellMask & FSpatialHash::FCellBlock::CalcCellMask(CellSubLoc.Coord)) != 0ULL)
92 Box.Min = FVector3f(CellSubLoc.Coord) * LevelCellSize;
93 Box.Max = Box.Min + LevelCellSize;
95 bool bIntersects = true;
97 if (bTestCellVsQueryBounds)
99 if (!FMath::SphereAABBIntersection(BlockLocalSphere, Box))
106 uint32 CellId = Block.GetCellGridOffset(CellSubLoc.Coord);
107 ResultConsumer.OnCellOverlap(CellId);
130 const uint64& Bits =
reinterpret_cast<const uint64&
>(Packed);
#define check(expr)
Definition AssertionMacros.h:314
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::Math::TIntVector3< int64 > FInt64Vector3
Definition MathFwd.h:99
UE::Math::TIntVector3< int8 > FInt8Vector3
Definition SceneCulling.cpp:282
FSceneCulling::FFootprint8 ToBlockLocal(const FSceneCulling::FFootprint64 &ObjFootprint, const FSceneCulling::FLocation64 &BlockLoc)
Definition SceneCulling.inl:17
FCellHeader UnpackCellHeader(const FPackedCellHeader &Packed)
Definition SceneCulling.inl:128
UE::Math::TIntVector3< ScalarType > ClampDim(const UE::Math::TIntVector3< ScalarType > &Vec, ScalarType MinValueInc, ScalarType MaxValueInc)
Definition SceneCulling.inl:9
bool IsValidCell(const FCellHeader &CellHeader)
Definition SceneCulling.inl:117
Definition RobinHoodHashTable.h:72
bool IsValid() const
Definition RobinHoodHashTable.h:82
FSpatialHash::FFootprint8 FFootprint8
Definition SceneCulling.h:159
FSpatialHash::FFootprint64 FFootprint64
Definition SceneCulling.h:161
FBlockLocAligned FBlockLoc
Definition SceneCulling.h:140
void TestSphere(const FSphere &Sphere, ResultConsumerType &ResultConsumer) const
Definition SceneCulling.inl:36
Definition BitArray.h:1944
FFootprint64 CalcFootprintSphere(int32 Level, const FVector &Origin, double Radius) const
Definition HierarchicalSpatialHashGrid.h:321
static double GetCellSize(int32 Level)
Definition HierarchicalSpatialHashGrid.h:302
static constexpr int32 CellBlockDimLog2
Definition HierarchicalSpatialHashGrid.h:172
const FSpatialHashMap & GetHashMap() const
Definition HierarchicalSpatialHashGrid.h:468
static FFootprint64 CalcCellBlockFootprint(const FFootprint64 &Footprint)
Definition HierarchicalSpatialHashGrid.h:331
static constexpr int32 CellBlockDim
Definition HierarchicalSpatialHashGrid.h:175
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
Definition RenderingSpatialHash.h:17
Definition IntVector.h:22