Physics2D: Fix the way newly physics entities are setup

This commit is contained in:
SirLynix
2023-03-25 14:47:35 +01:00
parent 3e99ce6be5
commit 883b54e6d3
4 changed files with 51 additions and 38 deletions

View File

@@ -98,6 +98,8 @@ namespace Nz
void SetVelocity(const Vector2f& velocity);
void SetVelocityFunction(VelocityFunc velocityFunc);
void TeleportTo(const Vector2f& position, const RadianAnglef& rotation);
void UpdateVelocity(const Vector2f& gravity, float damping, float deltaTime);
void Wakeup();

View File

@@ -38,9 +38,8 @@ namespace Nz
Physics2DSystem& operator=(Physics2DSystem&&) = delete;
private:
static void OnConstruct(entt::registry& registry, entt::entity entity);
entt::registry& m_registry;
entt::observer m_physicsConstructObserver;
entt::scoped_connection m_constructConnection;
PhysWorld2D m_physWorld;
};