3#include "Systems/ComponentSystem.h"
5#include "TerrainComponent.h"
6#include "Resources/Resources.h"
7#include "Resources/MeshStreamsLayout.h"
8#include "Scene/RayPick.h"
9#include "Scene/GetBounds.h"
11#include "RenderContext.h"
12#include "Rendering/VertexFormat.h"
16 struct TerrainContext;
30 const glm::vec2& normPosition,
36 std::vector<RayPicking::RayPickHit>& hits)
override;
46 void getBounds(
Context * context, Cogs::Geometry::BoundingBox & bounds,
float& nearPlaneLimit)
final;
48 void getBounds(
Context* context, Cogs::Geometry::BoundingBox& bounds)
final {
float ignored = 0.f;
getBounds(context, bounds, ignored); }
60 bool initialized =
false;
67 int maxTilesPerFrame = 16;
76 std::string customComputeColor;
78 std::unique_ptr<TerrainBounds> getBounds;
80 Geometry::BoundingBox bbox;
82 float nearPlaneLimit = 0.0f;
86 bool viewportFromTarget =
true;
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.
Interface for modules implementing custom picking.
void getBounds(Context *context, Cogs::Geometry::BoundingBox &bounds) final
Expand bounds including bounds of all entities in this system in world coordinates.
void getBounds(Context *context, Cogs::Geometry::BoundingBox &bounds, float &nearPlaneLimit) final
bool pickCamera(Context *context, const CameraComponent &camera, const glm::vec2 &normPosition, float, float, PickingFlags pickingFlags, PicksReturned returnFlag, const RayPicking::RayPickFilter &filter, std::vector< RayPicking::RayPickHit > &hits) override
Do a ray pick from a normalized screen space position in the camera direction and return all hits.
ComponentModel::ComponentHandle createComponent() override
void cleanup(Context *context) override
Provided for custom cleanup logic in derived systems.
void destroyComponent(ComponentHandle component) override
void initialize(Context *context) override
Initialize the system.
Base allocator implementation.
PicksReturned
* Options for returning picking hits.
PickingFlags
Options for COGS picking.
Contains all Cogs related functionality.
ComponentIndex SizeType
Type used to track the size of pools.
Handle to a Component instance.