Saga
Saga Game Engine
Loading...
Searching...
No Matches
collisionSystemOptimizationDynamic.h
Go to the documentation of this file.
1#pragma once
2
8#include "glm/ext/vector_float3.hpp"
9#include <functional>
10
11namespace Saga {
12 class GameWorld;
13}
14
15namespace Saga::Systems {
16 const glm::vec3 gridSize = glm::vec3(3,3,3);
17
26 inline void runOverGridCells(CollisionSystemData& collisionSystemData, glm::vec3 pos, glm::vec3 size, std::function<void(Entity)> callback);
27
38 inline void addToUniformGrid(CollisionSystemData& collisionSystemData, Entity entity, CylinderCollider& cylinderCollider, Transform& transform);
39
40
50 inline void removeFromUniformGrid(CollisionSystemData& collisionSystemData, Entity entity, CylinderCollider& cylinderCollider, Transform& transform);
51
57 void rebuildUniformGrid(std::shared_ptr<GameWorld> world);
58
59
73 std::optional<Collision> getClosestCollisionDynamic(std::shared_ptr<GameWorld> world, std::optional<CollisionSystemData*> systemData,
74 Entity entity, CylinderCollider& cylinderCollider, glm::vec3 pos, glm::vec3 dir);
75}
76
Definition: audioSystem.cpp:8
const glm::vec3 gridSize
Definition: collisionSystemOptimizationDynamic.h:16
void removeFromUniformGrid(CollisionSystemData &collisionSystemData, Entity entity, CylinderCollider &cylinderCollider, Transform &transform)
Remove an entity from the uniform grid. Here, the entity must contain a cylinder collider and transfo...
Definition: collisionSystemOptimizationDynamic.inl:29
void addToUniformGrid(CollisionSystemData &collisionSystemData, Entity entity, CylinderCollider &cylinderCollider, Transform &transform)
Add an entity to the uniform grid. Here, the entity must contain a cylinder collider and transform,...
Definition: collisionSystemOptimizationDynamic.inl:18
void runOverGridCells(CollisionSystemData &collisionSystemData, glm::vec3 pos, glm::vec3 size, std::function< void(Entity)> callback)
Calls a function over the grid cells of a uniform grid that includes a certain bounding box.
Definition: collisionSystemOptimizationDynamic.inl:6
std::optional< Collision > getClosestCollisionDynamic(std::shared_ptr< GameWorld > world, std::optional< CollisionSystemData * > systemData, Entity entity, CylinderCollider &cylinderCollider, glm::vec3 pos, glm::vec3 dir)
Retrieve the closest dynamic collision to a cylinder.
Definition: collisionSystemOptimizationDynamic.cpp:20
void rebuildUniformGrid(std::shared_ptr< GameWorld > world)
Build a world's uniform grid from all objects with cylinder colliders.
Definition: collisionSystemOptimizationDynamic.cpp:10
Definition: app.cpp:8
Manages data that the collision system uses. This lives in runtime on an empty entity.
Definition: collisionSystemData.h:14
Model an axis-aligned cylinder collider.
Definition: collider.h:17
A wrapper around a shared pointer to a ModelTransform. This tells object where to position themselves...
Definition: transform.h:12