class

FTraceBatch

Many rays, one filter, one setup. A scanner fan pays for filter construction, the narrow-phase lookup and the job dispatch ONCE for the whole sweep instead of once per ray, and the rays fan out across the worker pool. Fill, Execute, read; the storage is reused across frames, so a per-frame scanner allocates nothing after its first sweep.

Module
Physics
Header
#include "Physics/PhysicsQuery.h"
Namespace
Mowo

Properties

TypeNameDescription
static constexpr size_tkParallelThresholdBelow this many rays the batch runs inline — the dispatch costs more than the work it hands out. Default 64.

Public functions

ReturnsNameDescription
voidReserve
voidClearKeeps the capacity — the point of holding the batch across frames.
voidAdd
size_tNum
voidExecuteRuns every queued ray against the world.
boolHasHit
const FQueryHit&GetHit
const std::vector<FQueryHit>&GetHits
uint32_tGetHitCount

Function details

Reserve

C++
void Reserve(size_t count)

Clear

C++
void Clear()

Keeps the capacity — the point of holding the batch across frames.

Add

C++
void Add(const Vec3& origin, const Vec3& direction, float maxDistance)

Num

C++
size_t Num() const

Execute

C++
void Execute(const PhysicsWorld& world, const FQueryFilter& filter)

Runs every queued ray against the world. Game-thread only: it reads the narrow phase, which must not be mid-step. Results line up index for index with the Add calls.

HasHit

C++
bool HasHit(size_t index) const

GetHit

C++
const FQueryHit& GetHit(size_t index) const

GetHits

C++
const std::vector<FQueryHit>& GetHits() const

GetHitCount

C++
uint32_t GetHitCount() const
Generated from Physics/PhysicsQuery.h via physics.json · Nov 4, 2026Version 1.0.0