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
| Type | Name | Description |
|---|---|---|
static constexpr size_t | kParallelThreshold | Below this many rays the batch runs inline — the dispatch costs more than the work it hands out. Default 64. |
Public functions
| Returns | Name | Description |
|---|---|---|
void | Reserve | |
void | Clear | Keeps the capacity — the point of holding the batch across frames. |
void | Add | |
size_t | Num | |
void | Execute | Runs every queued ray against the world. |
bool | HasHit | |
const FQueryHit& | GetHit | |
const std::vector<FQueryHit>& | GetHits | |
uint32_t | GetHitCount |
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() constExecute
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) constGetHit
C++
const FQueryHit& GetHit(size_t index) constGetHits
C++
const std::vector<FQueryHit>& GetHits() constGetHitCount
C++
uint32_t GetHitCount() constGenerated from Physics/PhysicsQuery.h via physics.json · Nov 4, 2026Version 1.0.0