TheAtlasEngine
 
Loading...
Searching...
No Matches
physics_engine.hpp
1#pragma once
2#include <core/core.hpp>
3#include <drivers/jolt-cpp/jolt_components.hpp>
4#include <physics/physics_context.hpp>
5#include <core/event/event_bus.hpp>
6
7namespace atlas::physics {
8
15 public:
16 // Required by maps but should not be used in anyother circumstance.
17 physics_engine() = default;
18 physics_engine(const jolt_settings& p_settings,
19 flecs::world& p_registry,
20 event::event_bus& p_bus);
21
28 void start();
29
35 void update(float p_delta_time);
36
42 void stop();
43
44 private:
45 flecs::world* m_registry;
46 ref<physics_context> m_physics_context;
47 flecs::query<physics_body> m_physics_bodies;
48 flecs::query<transform, physics_body, box_collider>
49 m_query_box_collider;
50 flecs::query<transform, physics_body, sphere_collider>
51 m_query_sphere_collider;
52 flecs::query<transform, physics_body, capsule_collider>
53 m_query_capsule_collider;
54 event::event_bus* m_bus;
55 };
56};
Event bus that holds the responsibility to reroute events to the subscribers of those particular even...
Definition event_bus.hpp:13
The manager class for all physics engines. Manages the physics contexts and the collision engines.
Definition physics_engine.hpp:14
void start()
The runtime is specifically the way to start the physics, utilizing defined data from level_scene and...
void update(float p_delta_time)
Runs a single frame of the simulation. Should at minimum be called 60 fps. If below,...
void stop()
Deletes all physics bodies and shapes. Preps itself for runtime to be called again.
Types are still be filled out. When this is completed to_jph() can be removed.
Definition jolt_broad_phase.hpp:5
Jolt-specific context configurations These are going to be internally integrated to jolt_context.
Definition jolt_components.hpp:53