Saga
Saga Game Engine
Loading...
Searching...
No Matches
collisionSystemOptimizationDynamic.h File Reference
#include "Engine/Components/collider.h"
#include "Engine/Components/collisionSystemData.h"
#include "Engine/Components/transform.h"
#include "Engine/Entity/entity.h"
#include "Engine/Systems/collisionSystem.h"
#include "glm/ext/vector_float3.hpp"
#include <functional>
#include "collisionSystemOptimizationDynamic.inl"
Include dependency graph for collisionSystemOptimizationDynamic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Saga
 
namespace  Saga::Systems
 

Functions

void Saga::Systems::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.
 
void Saga::Systems::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, and we add this entity to any grid cell that the cylinder specified by the collider and transform intersects.
 
void Saga::Systems::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 transform, and we add this entity to any grid cell that the cylinder specified by the collider and transform intersects.
 
void Saga::Systems::rebuildUniformGrid (std::shared_ptr< GameWorld > world)
 Build a world's uniform grid from all objects with cylinder colliders.
 
std::optional< Collision > Saga::Systems::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.
 

Variables

const glm::vec3 Saga::Systems::gridSize = glm::vec3(3,3,3)