Saga
Saga Game Engine
Loading...
Searching...
No Matches
collisionSystem.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <glm/vec3.hpp>
5#include <optional>
6#include "Engine/saga.h"
7
8namespace Saga {
9 class GameWorld;
10}
11
12namespace Saga::Systems {
13
17 struct Collision {
18 float t;
19 glm::vec3 pos;
20 glm::vec3 normal;
21
22 Entity entity0;
23 Entity entity1;
24 };
25
34 void collisionSystem(std::shared_ptr<GameWorld> world, float deltaTime, float time);
35
36
44 void collisionSystem_startup(std::shared_ptr<GameWorld> world);
45
53 void registerCollisionSystem(std::shared_ptr<GameWorld> world);
54}
void collisionSystem(std::shared_ptr< GameWorld > world, float deltaTime, float time)
First handle cylinder-cylinder collision. Then handle all triangle-ellipsoid collisions.
Definition: collisionSystem.cpp:187
Definition: audioSystem.cpp:8
void collisionSystem_startup(std::shared_ptr< GameWorld > world)
Builds the bounding volume hierarchy of the scene's static triangles. Used for ellipsoid-triangle col...
Definition: collisionSystem.cpp:204
void registerCollisionSystem(std::shared_ptr< GameWorld > world)
Register all Group for this System, as well as register collisionSystem and collisionSystem as Update...
Definition: collisionSystem.cpp:209
Definition: app.cpp:8
Collision struct that details a collision.
Definition: collisionSystem.h:17
float t
time at which the collision happens.
Definition: collisionSystem.h:18
glm::vec3 normal
normal direction of the collision.
Definition: collisionSystem.h:20
Entity entity0
first Entity in the collision.
Definition: collisionSystem.h:22
Entity entity1
second Entity in the collision. The normal direction is away from this Entity.
Definition: collisionSystem.h:23
glm::vec3 pos
position of the collision.
Definition: collisionSystem.h:19