Saga
Saga Game Engine
Loading...
Searching...
No Matches
physics.h
Go to the documentation of this file.
1#pragma once
3#include <memory>
4#include <glm/vec3.hpp>
5#include <optional>
6
7namespace Saga {
8
9class GameWorld;
10
11namespace Physics {
12 struct RaycastHit {
14 float t;
15 glm::vec3 pos;
16 glm::vec3 normal;
17 };
18
29 bool overlapCylinder(std::shared_ptr<GameWorld> world, float height, float radius, glm::vec3 pos);
30
38 std::optional<RaycastHit> raycastAllTriangles(std::shared_ptr<GameWorld> world, glm::vec3 pos, glm::vec3 dir);
39
45 void registerPhysicsMetaSystem(std::shared_ptr<GameWorld> world);
46}
47
48}
void registerPhysicsMetaSystem(std::shared_ptr< GameWorld > world)
Register all Groups that the Physics meta system use.
Definition: physics.cpp:26
std::optional< RaycastHit > raycastAllTriangles(std::shared_ptr< GameWorld > world, glm::vec3 pos, glm::vec3 dir)
Cast a ray, hitting any mesh collider.
bool overlapCylinder(std::shared_ptr< GameWorld > world, float height, float radius, glm::vec3 pos)
Determine if a cylinder overlaps with another cylinder in the world.
Definition: physics.cpp:10
Definition: app.cpp:8
A boolean flag to tell if an Entity has a Collider.
Definition: collider.h:11
Definition: physics.h:12
Collider * collider
Definition: physics.h:13
glm::vec3 normal
Definition: physics.h:16
glm::vec3 pos
Definition: physics.h:15
float t
Definition: physics.h:14