3#include "Systems/ComponentSystem.h"
5#include "Components/Core/AssetComponent.h"
7#include "Resources/Asset.h"
8#include "Scene/GetBounds.h"
12#include "DynamicComponentSystem.h"
14#include "Foundation/Geometry/BoundingBox.hpp"
22 void getBounds(
Context* context, Cogs::Geometry::BoundingBox& bounds)
override;
37 return this->asset != asset || (asset && !isGeneration(
static_cast<uint8_t
>(asset->
getGeneration())));
43 setGeneration(asset ?
static_cast<uint8_t
>(asset->
getGeneration()) : 0);
46 void setGeneration(uint8_t generation) { this->generation = generation; }
47 bool isGeneration(uint8_t generation)
const {
return this->generation == generation; }
50 std::shared_ptr<struct AssetInstanceData> instanceData;
53 uint8_t generation = 0;
71 uint32_t modelFileIndex = 0;
75 bool canceled =
false;
85 void initialize(
Context * context)
override;
86 void update(
Context * context)
override;
87 void postUpdate(
Context * context)
override;
93 const Geometry::BoundingBox * getLocalBounds(
AssetComponent * assetComponent)
const;
94 Geometry::BoundingBox getWorldBounds(
AssetComponent* assetComponent,
bool ignoreVisibility)
const;
95 std::span<const AssetModelRequest* const> getPendingRequests()
const;
96 std::span<const AssetModelRequest* const> getInFlightRequests()
const;
99 std::unique_ptr<AssetBounds> bounds;
100 std::unique_ptr<struct AssetSystemData> systemData;
Container for components, providing composition of dynamic entities.
void getBounds(Context *context, Cogs::Geometry::BoundingBox &bounds) override
Expand bounds including bounds of all entities in this system in world coordinates.
Component system template with multiple parallel structures per component stored in separate pools si...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Base allocator implementation.
Provides a weakly referenced view over the contents of a string.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
ComponentIndex SizeType
Type used to track the size of pools.
Handle to a Component instance.
Instantiates an asset model into the scene.
uint32_t priority
Priority of request, largest number gets served first.
uint32_t getGeneration() const
Get the generation count.