14 auto locked = system->lock();
17 for (
const auto entity : view) {
21 auto [beginEvents, endEvents, beginCount, endCount] = locked->GetWorld().GetSensorEvents();
23 for (int32_t i = 0; i < beginCount; ++i) {
24 const b2SensorBeginTouchEvent* beginTouch = beginEvents + i;
35 for (int32_t i = 0; i < endCount; ++i) {
36 const b2SensorEndTouchEvent* endTouch = endEvents + i;
55 void Trigger::OnBodyUserDataCreate(entt::registry& registry, entt::entity entity) {
56 Entity e = entt::handle{ registry, entity };
61 void Trigger::OnTriggerCreate(entt::registry& registry, entt::entity entity) {
62 Entity e = entt::handle{ registry, entity };
64 auto& ud = e.GetOrAddComponent<Physics::BodyUserData>();
66 auto& rb = e.GetComponents<Components::Entity::RigidBody>();
#define CORI_PROFILE_FUNCTION()
A GameTimer is responsible for managing everything that is connected with time, ticks,...
float GetTimestep() const
Returns the current timeStep, scale is in seconds.
A Trigger components is used in combination with RigidBody component used to respond to an entity get...
Entities are the essential part of WorldSystem.
bool IsActiveGlobally() const
Checks if the entity is active locally (doesn't have InactiveGloballyFlag), just a convenience functi...
decltype(auto) GetComponents()
Retries the references to the requested components of the entity.
A wrapper for an EnTT compile-time view that provides an iterator to access Entity instances directly...
decltype(auto) Get(Entity entity)
Retries the components from an entity, both the components and the entity should be in a view,...
System responsible for physics.
void OnTickUpdate(Core::GameTimer &gameTimer) override
Anything connected to WorldSystem (ECS) is in this namespace.
Cori::World::Entity m_Entity
Helper to exclude certain components from a static view.