From 1e8553dbe9044147d55407b4429a6e0d8bc29cd7 Mon Sep 17 00:00:00 2001 From: fallenatlas Date: Thu, 1 Feb 2024 18:08:20 +0000 Subject: [PATCH] fix(physics): fix type error by adding gravity plugin after adding components --- engine/src/cubos/engine/physics/plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/cubos/engine/physics/plugin.cpp b/engine/src/cubos/engine/physics/plugin.cpp index 60113baf9..090f59bf6 100644 --- a/engine/src/cubos/engine/physics/plugin.cpp +++ b/engine/src/cubos/engine/physics/plugin.cpp @@ -56,8 +56,6 @@ static bool simulatePhysicsStep(PhysicsAccumulator& accumulator, const FixedDelt void cubos::engine::physicsPlugin(Cubos& cubos) { - cubos.addPlugin(gravityPlugin); - cubos.addResource(); cubos.addResource(); cubos.addResource(); @@ -70,6 +68,8 @@ void cubos::engine::physicsPlugin(Cubos& cubos) cubos.addComponent(); cubos.addComponent(); + cubos.addPlugin(gravityPlugin); + // executed every frame cubos.system("increase fixed-step accumulator") .tagged("cubos.physics.simulation.prepare")