From 706db2b5600246d597ad59e7632926e2c3aefcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Oct 2012 22:06:36 +0200 Subject: [PATCH] Physics: Accessors to ShapeGroup members. --- src/Physics/ShapeGroup.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Physics/ShapeGroup.h b/src/Physics/ShapeGroup.h index 768731bd6..505cb3309 100644 --- a/src/Physics/ShapeGroup.h +++ b/src/Physics/ShapeGroup.h @@ -107,6 +107,20 @@ template class PHYSICS_EXPORT ShapeGroup: public Abstra bool collides(const AbstractShape* other) const; + /** + * @brief First object in the group + * + * If there is no such object, returns `nullptr`. + */ + inline AbstractShape* first() { return a; } + + /** + * @brief Second object in the group + * + * If there is no such object, returns `nullptr`. + */ + inline AbstractShape* second() { return b; } + private: inline ShapeGroup(int operation, AbstractShape* a, AbstractShape* b): operation(operation), a(a), b(b) {}