3#include "EntityDefinition.h"
4#include "Scene/GetBounds.h"
5#include "Systems/ComponentSystem.h"
7#include "../Components/OctProviderComponent.h"
8#include "../Systems/DataSetSystem.h"
10#include "Rendering/Common.h"
12#include "Foundation/Memory/MemoryBuffer.h"
14#include <unordered_map>
30 inline uint64_t encodeKey2(
const uint32_t source,
const uint32_t slice)
32 return (uint64_t(source) << 32u) | uint64_t(slice);
36 inline void decodeKey2(uint32_t& source, uint32_t& slice,
const uint64_t regionKey)
38 source = uint32_t(regionKey >> 32u);
39 slice = uint32_t(regionKey);
45 int64_t timestamp = 0;
47 uint32_t beamCount = 0;
48 uint32_t sampleCount = 0;
49 float depthOffset = 0;
51 glm::vec3 transducerAlpha;
52 glm::vec3 transducerOffset;
55 bool linearized =
false;
65 uint32_t majorCount = 0;
66 uint32_t minorCount = 0;
67 std::vector<float> directionX;
68 std::vector<float> directionY;
69 float minDirectionX = 0.0f;
70 float maxDirectionX = 0.0f;
71 float minDirectionY = 0.0f;
72 float maxDirectionY = 0.0f;
73 float maxBeamWidthX = 0.0f;
74 float maxBeamWidthY = 0.0f;
94 std::unordered_map<uint64_t, std::unique_ptr<CachedPing>>
pingCache;
95 std::vector<std::unique_ptr<CachedPing>> pingCacheUnused;
111 uint32_t dataGen = 0;
112 uint32_t sliceBegin = 0;
113 uint32_t sliceCount = 0;
120 uint64_t mostRecentTimestamp = 0;
122 unsigned history = 1;
123 std::shared_ptr<OctProviderPersistent> persistent;
125 std::vector<OctProviderSource> sources;
126 unsigned callbackCount = 0;
138 static float alphaCallback(
void* data, uint64_t clientData);
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
void preUpdate()
Run the pre-update method of the system.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Base allocator implementation.
std::shared_ptr< ComponentModel::Entity > EntityPtr
Smart pointer for Entity access.
Contains all Cogs related functionality.
ComponentIndex SizeType
Type used to track the size of pools.
std::vector< unsigned > taskCount
Number of tasks to split each request into.
std::vector< CachedBeamGroup > groupCache
Beam group data cached while tile builder task is running.
std::unordered_map< uint64_t, std::unique_ptr< CachedPing > > pingCache
Cache of beam data for both while tile builder is running, and between runs to avoid re-copying and r...
bool tainted
True if the groups or data have changed to an extent that responses in flight and all cached data mus...
std::vector< CachedPing * > needsLinearization
List of new pings that must be linearized next time tile builder runs.
bool tasksRunning
True if the tile builder is running.
std::vector< Volumetric::TileResponse * > responses
List of responses to be processed by tile builder.