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) {}