#include "Force.h" #include namespace crepe::api { Force::Force(uint32_t gameObjectId, uint32_t forceMagnitude, uint32_t direction): Component(gameObjectId) { // Convert direction from degrees to radians float radian_direction = static_cast(direction) * (M_PI / 180.0f); force_x = static_cast(std::round(forceMagnitude * std::cos(radian_direction))); force_y = static_cast(std::round(forceMagnitude * std::sin(radian_direction))); } } // namespace crepe::api