#include "components/PhysicsComponent.hpp" #include "Entity.hpp" #include "components/TransformComponent.hpp" #include void PhysicsComponent::Setup() {} void PhysicsComponent::Update(float dt) { auto transform = entity->GetComponent(); if (!transform) { return; } const float speed = std::sqrt(vx * vx + vy * vy); if (speed > speedCap && speed > 0.0f) { const float scale = speedCap / speed; vx *= scale; vy *= scale; } transform->get().x += vx * dt; transform->get().y += vy * dt; } void PhysicsComponent::Cleanup() {}