FPointCloudEphemeral
Points that landed on something that can move. They are kept apart from the persistent cloud because they are wrong the moment the body moves — and because that wrongness is the game: scan, see a silhouette standing in the dark, scan again, and it is somewhere else.
- Module
- Game
- Header
#include "PointCloud/PointCloudEphemeral.h"- Namespace
Mowo
A ring buffer rather than a growing set. A monster walking through a beam produces points forever, so the only safe capacity policy is a fixed one where the oldest point is the one that dies.
Public functions
| Returns | Name | Description |
|---|---|---|
void | Configure | |
uint32_t | AddHits | |
void | Decay | Rebuilds the drawable set for tick, dropping the expired points and grouping the survivors by chunk: a record's position is relative to its chunk's corner, so each chunk the ring touches is one draw range with its own origin. |
const std::vector<PointCloudPoint>& | GetVisiblePoints | |
const std::vector<PointCloudDrawRange>& | GetVisibleRanges | Ranges into GetVisiblePoints(), firstPoint relative to its start. |
uint32_t | GetVisibleCount | |
uint32_t | GetCapacity | |
uint32_t | GetLifetimeTicks | |
uint32_t | GetLiveCount | Entries the ring currently holds, expired ones included — Decay has not necessarily run since the last AddHits. |
uint64_t | GetEvictedCount | Points a later point overwrote because the ring was full. |
float | LifeOf | The remaining life the shader computes for a visible record at tick: 1 at spawn, 0 at expiry, linear. |
Vec3 | VisibleWorldPosition | World position of the visible record at index. |
uint64_t | MeasureBytes | |
void | Clear |
Function details
Configure
void Configure(uint32_t capacity, uint32_t lifetimeTicks)AddHits
uint32_t AddHits(const FLidarHit* hits, uint32_t count, uint64_t tick)Decay
void Decay(uint64_t tick)Rebuilds the drawable set for tick, dropping the expired points and grouping the survivors by chunk: a record's position is relative to its chunk's corner, so each chunk the ring touches is one draw range with its own origin. Each record's birth stamp is its spawn tick; the life curve applied to it is the shader's, so it can be retuned without touching the CPU side or re-uploading anything.
GetVisiblePoints
const std::vector<PointCloudPoint>& GetVisiblePoints() constGetVisibleRanges
const std::vector<PointCloudDrawRange>& GetVisibleRanges() constRanges into GetVisiblePoints(), firstPoint relative to its start.
GetVisibleCount
uint32_t GetVisibleCount() constGetCapacity
uint32_t GetCapacity() constGetLifetimeTicks
uint32_t GetLifetimeTicks() constGetLiveCount
uint32_t GetLiveCount() constEntries the ring currently holds, expired ones included — Decay has not necessarily run since the last AddHits.
GetEvictedCount
uint64_t GetEvictedCount() constPoints a later point overwrote because the ring was full. Non-zero means the cap is doing work: the scanner is producing faster than the lifetime retires, and the oldest silhouette is being cut short rather than the newest being dropped.
LifeOf
float LifeOf(const PointCloudPoint& point, uint64_t tick) constThe remaining life the shader computes for a visible record at tick: 1 at spawn, 0 at expiry, linear.
VisibleWorldPosition
Vec3 VisibleWorldPosition(uint32_t index) constWorld position of the visible record at index.
MeasureBytes
uint64_t MeasureBytes() constClear
void Clear()