3#include "SeaCurrentsComponent.h"
5#include "Resources/Resources.h"
6#include "Resources/MeshStreamsLayout.h"
7#include "Systems/ComponentSystem.h"
8#include "Scene/GetBounds.h"
10#include "Rendering/VertexFormat.h"
11#include "Foundation/Geometry/Glm.hpp"
16 class SeaCurrentsRenderer;
17 class SeaCurrentsSystem;
29 virtual void getBounds(
Context* context, Cogs::Geometry::BoundingBox& bounds)
override;
38 std::vector<InstanceData> mData;
40 size_t mBufferSize = 0;
41 Cogs::Geometry::BoundingBox mBounds;
42 Cogs::Geometry::BoundingBox mTransformedBounds;
43 glm::mat4 mWorldMatrix;
54 float minScale = 0.2f;
55 float maxScale = 1.0f;
56 float lowestSpeed = 0.01f;
57 float highestSpeed = 13.0f;
66 const MeshHandle& getArrowMesh()
const {
return mArrowMesh; }
67 const VertexFormat& getVertexFormat()
const {
return mVertexFormat; }
68 const VertexFormatHandle& getVertexFormatHandle()
const {
return mVertexFormatHandle; }
70 const MeshStreamsLayout& getArrowInstancesStreamsLayout()
const {
return arrowInstancesStreamsLayout; }
82 std::unique_ptr<SeaCurrentsBounds> bounds;
Container for components, providing composition of dynamic entities.
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
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.
Needs custom bounds calculation.
virtual void getBounds(Context *context, Cogs::Geometry::BoundingBox &bounds) override
Expand bounds including bounds of all entities in this system in world coordinates.
The sea currents system manages and displays sea currents per the S-111 specification.
virtual void destroyComponent(ComponentHandle component) override
Cogs::Geometry::BoundingBox getWorldBounds(const SeaCurrentsComponent &seaCurrentsComponent, bool ignoreVisibility) const
Used by SeaCurrentsBounds::getBounds.
virtual void initialize(Context *context) override
Initialize the system.
virtual void cleanup(Context *context) override
Provided for custom cleanup logic in derived systems.
virtual ComponentHandle createComponent() override
Base allocator implementation.
Contains all Cogs related functionality.
ComponentIndex SizeType
Type used to track the size of pools.
Handle to a Component instance.
Component for displaying surface currents based on the IHO S111 standard.