diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-20 11:10:06 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-20 11:10:06 +0100 |
commit | 5b1a26a13d8a2f44a7ef1fa8c0fc609c37adc28b (patch) | |
tree | 801ff9f3bbd82efacb5d4fdb1cbe4c09cfedf7c5 /src/crepe/api/Rigidbody.h | |
parent | 88d84763147fbd6bcc087f15a7460566a009cdb2 (diff) | |
parent | 69ca2bafcd617ac8af1b8f715f0c802205a60ab1 (diff) |
merge masterloek/replay
Diffstat (limited to 'src/crepe/api/Rigidbody.h')
-rw-r--r-- | src/crepe/api/Rigidbody.h | 44 |
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: |