aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Force.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-23 21:54:28 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-23 21:54:28 +0200
commit9b7be419c9dcc6ebd1e504713c7b2676ca3d2fdf (patch)
tree97a2fc5ce1ec1345bd6f44889682ea9a2ffafd76 /src/crepe/api/Force.cpp
parent080ad535e6fc6666b919b1a21b6986aaf9b678eb (diff)
`clang-format`
Diffstat (limited to 'src/crepe/api/Force.cpp')
-rw-r--r--src/crepe/api/Force.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/crepe/api/Force.cpp b/src/crepe/api/Force.cpp
index 1b4c81a..ff82afa 100644
--- a/src/crepe/api/Force.cpp
+++ b/src/crepe/api/Force.cpp
@@ -3,12 +3,14 @@
namespace crepe::api {
-Force::Force(uint32_t gameObjectId, uint32_t forceMagnitude, uint32_t direction): Component(gameObjectId)
-{
+Force::Force(uint32_t gameObjectId, uint32_t forceMagnitude, uint32_t direction)
+ : Component(gameObjectId) {
// Convert direction from degrees to radians
- float radian_direction = static_cast<float>(direction) * (M_PI / 180.0f);
- force_x = static_cast<int32_t>(std::round(forceMagnitude * std::cos(radian_direction)));
- force_y = static_cast<int32_t>(std::round(forceMagnitude * std::sin(radian_direction)));
+ float radian_direction = static_cast<float>(direction) * (M_PI / 180.0f);
+ force_x = static_cast<int32_t>(
+ std::round(forceMagnitude * std::cos(radian_direction)));
+ force_y = static_cast<int32_t>(
+ std::round(forceMagnitude * std::sin(radian_direction)));
}
} // namespace crepe::api