aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Rigidbody.h
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-12-20 12:01:36 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-12-20 12:01:36 +0100
commit79d3a9f4311e6684b6df83a15ca7844f58c1959c (patch)
treeb2883e83f61cee9edf290a6a7228c7f0b1fbae8a /src/crepe/api/Rigidbody.h
parent9140b73e4af7aa925b53e4fb4e6aa7f4ea2e3385 (diff)
parent03aea832aa0bc2edba2cc5ab4d9f8eba42d355be (diff)
Merge remote-tracking branch 'origin/master' into max/game
Diffstat (limited to 'src/crepe/api/Rigidbody.h')
-rw-r--r--src/crepe/api/Rigidbody.h44
1 files changed, 34 insertions, 10 deletions
diff --git a/src/crepe/api/Rigidbody.h b/src/crepe/api/Rigidbody.h
index 6900295..b63d941 100644
--- a/src/crepe/api/Rigidbody.h
+++ b/src/crepe/api/Rigidbody.h
@@ -2,6 +2,7 @@
#include <cmath>
#include <set>
+#include <string>
#include "../Component.h"
@@ -120,26 +121,49 @@ public:
* above 0.0.
*
*/
- float elastisity_coefficient = 0.0;
+ float elasticity_coefficient = 0.0;
/**
- * \brief Offset of all colliders relative to the object's transform position.
+ * \brief Enables collision handling for objects colliding with kinematic objects.
+ *
+ * Enables collision handling for objects colliding with kinematic objects in the collision system.
+ * If `kinematic_collision` is true, dynamic objects cannot pass through this kinematic object.
+ * This ensures that kinematic objects delegate collision handling to the collision system.
+ */
+ bool kinematic_collision = true;
+
+ /**
+ * \brief Defines the collision layers a GameObject interacts with.
*
- * The `offset` defines a positional shift applied to all colliders associated with the object, relative to the object's
- * transform position. This allows for the colliders to be placed at a different position than the object's actual
- * position, without modifying the object's transform itself.
+ * The `collision_layers` represent the set of layers the GameObject can detect collisions with.
+ * Each element in this set corresponds to a layer ID. The GameObject will only collide with other
+ * GameObjects that belong to one these layers.
+ */
+ std::set<int> collision_layers = {0};
+
+ /**
+ * \brief Specifies the collision layer of the GameObject.
*
+ * The `collision_layer` indicates the single layer that this GameObject belongs to.
+ * This determines which layers other objects must match to detect collisions with this object.
*/
- vec2 offset;
+ int collision_layer = 0;
/**
* \brief Defines the collision layers of a GameObject.
*
- * The `collision_layers` specifies the layers that the GameObject will collide with.
- * Each element represents a layer ID, and the GameObject will only detect
- * collisions with other GameObjects that belong to these layers.
+ * The `collision_names` specifies where the GameObject will collide with.
+ * Each element represents a name from the Metadata of the gameobject.
*/
- std::set<int> collision_layers = {0};
+ std::set<std::string> collision_names;
+
+ /**
+ * \brief Defines the collision layers of a GameObject.
+ *
+ * The `collision_tags` specifies where the GameObject will collide with.
+ * Each element represents a tag from the Metadata of the gameobject.
+ */
+ std::set<std::string> collision_tags;
};
public: