Saga
Saga Game Engine
Loading...
Searching...
No Matches
collisionSystem.cpp File Reference
#include "collisionSystem.h"
#include "Engine/Components/collider.h"
#include "collisionSystemOptimizationStatic.h"
#include "collisionSystemOptimizationDynamic.h"
#include "collisionSystemHelper.h"
#include <glm/common.hpp>
#include "../Gameworld/gameworld.h"
#include "../Components/_import.h"
#include "../Utils/geometry/geometry.h"
#include "../_Core/asserts.h"
#include <glm/vec3.hpp>
#include "Engine/Components/collisionSystemData.h"
#include "events.h"
#include "Graphics/modeltransform.h"
#include "glm/gtx/string_cast.hpp"
#include <unordered_set>
#include <functional>
Include dependency graph for collisionSystem.cpp:

Namespaces

namespace  Saga
 
namespace  Saga::Systems
 
namespace  Saga::Systems::anonymous_namespace{collisionSystem.cpp}
 

Functions

glm::vec3 Saga::Systems::anonymous_namespace{collisionSystem.cpp}::detectCollision (CylinderCollider &a, Transform &aTransform, CylinderCollider &b, Transform &bTransform)
 Detect collision between two axis-aligned cylinder colliders, and return the mtv such that if the first cylinder is translated by the mtv, the two objects no longer collide.
 
std::pair< glm::vec3, std::vector< Collision > > Saga::Systems::anonymous_namespace{collisionSystem.cpp}::ellipsoidTriangleCollisions (std::shared_ptr< GameWorld > world, Entity entityEllipsoid, Transform &transform, EllipsoidCollider &ellipsoidCollider, RigidBody &rigidBody, glm::vec3 move)
 Handle collisions between a moving ellipsoid and triangles in the scene. By default, this does 100 translations before dropping further movement.
 
void Saga::Systems::anonymous_namespace{collisionSystem.cpp}::cylinderCylinderCollision (std::shared_ptr< GameWorld > world, float deltaTime, float time)
 Process all cylinder-cylinder collisions. If two cylinders penetrate, they move by half of the minimum translation vector away from each other if they are both dynamic. Otherwise, only the dynamic one move and moves by the full mtv, plus some epsilon. By default, this only resolve 100 collisions per call.
 
void Saga::Systems::collisionSystem (std::shared_ptr< GameWorld > world, float deltaTime, float time)
 First handle cylinder-cylinder collision. Then handle all triangle-ellipsoid collisions.
 
void Saga::Systems::collisionSystem_startup (std::shared_ptr< GameWorld > world)
 Builds the bounding volume hierarchy of the scene's static triangles. Used for ellipsoid-triangle collisions.
 
void Saga::Systems::registerCollisionSystem (std::shared_ptr< GameWorld > world)
 Register all Group for this System, as well as register collisionSystem and collisionSystem as Update and Awake staged systems respectively.