aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Collider.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-03 19:32:15 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-03 19:32:15 +0100
commitff618da3f97237796042fa3664da59ed147bc1da (patch)
treecfc283425f145b16a2b2e3b1a0a5760e8015a2b1 /src/crepe/Collider.h
parentfb018cd8511e9cae408f8ea7d2b73e66a452625b (diff)
improved comments
Diffstat (limited to 'src/crepe/Collider.h')
-rw-r--r--src/crepe/Collider.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/crepe/Collider.h b/src/crepe/Collider.h
index 15d3a24..f5f53d2 100644
--- a/src/crepe/Collider.h
+++ b/src/crepe/Collider.h
@@ -10,7 +10,23 @@ public:
Collider(game_object_id_t id, const vec2& offset);
public:
- //! Offset of the collider relative to rigidbody position
+ /**
+ * \brief Offset of the collider relative to the rigidbody position.
+ *
+ * The `offset` defines the positional shift applied to the collider relative to the position of the rigidbody it is attached to.
+ * This allows the collider to be placed at a different position than the rigidbody, which can be useful for scenarios
+ * where the collider's position needs to differ from the rigidbody's center, such as in non-centered colliders.
+ *
+ * - The `offset` is typically used when the collider is not meant to be centered exactly on the rigidbody's position.
+ * - For example, the collider might need to be shifted to account for an object with an asymmetrical shape or for objects
+ * where the pivot point of the rigidbody is different from the collider's center.
+ *
+ * When multiple colliders are added to the same object (e.g., a character with separate body parts or a vehicle with multiple zones),
+ * the offset is important for properly positioning each collider relative to the rigidbody, allowing accurate collision detection.
+ *
+ * - Multiple colliders can be used on the same object, and each can have its own unique offset.
+ * - Overlap between colliders is allowed and does not impact performance.
+ */
vec2 offset;
};