aboutsummaryrefslogtreecommitdiff
path: root/src/crepe
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-16 21:26:11 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-16 21:26:11 +0100
commit6e92c59b3364b00eb15c310120b93acc83ca504e (patch)
treecf24c206bf444bf8c3e1e51b6ac73be56e69c98c /src/crepe
parent5bece30f9ad495a0e82097b2c5668e979856fb69 (diff)
parent4cddaf8e8b809a69a8e03e79c4f7902920745a9a (diff)
pulled api change
Diffstat (limited to 'src/crepe')
-rw-r--r--src/crepe/api/BoxCollider.cpp4
-rw-r--r--src/crepe/api/BoxCollider.h3
-rw-r--r--src/crepe/api/CircleCollider.cpp4
-rw-r--r--src/crepe/api/CircleCollider.h3
-rw-r--r--src/crepe/api/Rigidbody.h2
5 files changed, 9 insertions, 7 deletions
diff --git a/src/crepe/api/BoxCollider.cpp b/src/crepe/api/BoxCollider.cpp
index c097a24..a893d41 100644
--- a/src/crepe/api/BoxCollider.cpp
+++ b/src/crepe/api/BoxCollider.cpp
@@ -4,7 +4,7 @@
using namespace crepe;
-BoxCollider::BoxCollider(game_object_id_t game_object_id, const vec2 & offset,
- const vec2 & dimensions)
+BoxCollider::BoxCollider(game_object_id_t game_object_id, const vec2 & dimensions,
+ const vec2 & offset)
: Collider(game_object_id, offset),
dimensions(dimensions) {}
diff --git a/src/crepe/api/BoxCollider.h b/src/crepe/api/BoxCollider.h
index 1ac4d46..d643e7f 100644
--- a/src/crepe/api/BoxCollider.h
+++ b/src/crepe/api/BoxCollider.h
@@ -13,7 +13,8 @@ namespace crepe {
*/
class BoxCollider : public Collider {
public:
- BoxCollider(game_object_id_t game_object_id, const vec2 & offset, const vec2 & dimensions);
+ BoxCollider(game_object_id_t game_object_id, const vec2 & dimensions,
+ const vec2 & offset = {0, 0});
//! Width and height of the box collider
vec2 dimensions;
diff --git a/src/crepe/api/CircleCollider.cpp b/src/crepe/api/CircleCollider.cpp
index a4271e9..90ab5e7 100644
--- a/src/crepe/api/CircleCollider.cpp
+++ b/src/crepe/api/CircleCollider.cpp
@@ -2,7 +2,7 @@
using namespace crepe;
-CircleCollider::CircleCollider(game_object_id_t game_object_id, const vec2 & offset,
- float radius)
+CircleCollider::CircleCollider(game_object_id_t game_object_id, float radius,
+ const vec2 & offset)
: Collider(game_object_id, offset),
radius(radius) {}
diff --git a/src/crepe/api/CircleCollider.h b/src/crepe/api/CircleCollider.h
index c7bf66e..22da836 100644
--- a/src/crepe/api/CircleCollider.h
+++ b/src/crepe/api/CircleCollider.h
@@ -13,7 +13,8 @@ namespace crepe {
*/
class CircleCollider : public Collider {
public:
- CircleCollider(game_object_id_t game_object_id, const vec2 & offset, float radius);
+ CircleCollider(game_object_id_t game_object_id, float radius,
+ const vec2 & offset = {0, 0});
//! Radius of the circle collider.
float radius;
diff --git a/src/crepe/api/Rigidbody.h b/src/crepe/api/Rigidbody.h
index 8566d00..0f6be21 100644
--- a/src/crepe/api/Rigidbody.h
+++ b/src/crepe/api/Rigidbody.h
@@ -132,7 +132,7 @@ public:
* Each element represents a layer ID, and the GameObject will only detect
* collisions with other GameObjects that belong to these layers.
*/
- std::set<int> collision_layers;
+ std::set<int> collision_layers = {0};
};
public: