From c0aa6a3ba5020b6684b9552f4067b6c144168625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 11 Oct 2012 20:19:05 +0200 Subject: [PATCH] Don't forget to set ShapedObject as dirty after setting shape. Also inlined the function and allowed method chaining. --- src/Physics/ShapedObject.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Physics/ShapedObject.h b/src/Physics/ShapedObject.h index fceee5c3b..e7e2aac9e 100644 --- a/src/Physics/ShapedObject.h +++ b/src/Physics/ShapedObject.h @@ -56,8 +56,15 @@ template class PHYSICS_EXPORT ShapedObject: public Scen inline AbstractShape* shape() { return _shape; } inline const AbstractShape* shape() const { return _shape; } /**< @overload */ - /** @brief Set object shape */ - void setShape(AbstractShape* shape) { _shape = shape; } + /** + * @brief Set object shape + * @return Pointer to self (for method chaining) + */ + inline ShapedObject* setShape(AbstractShape* shape) { + _shape = shape; + setDirty(); + return this; + } /** * @copybrief SceneGraph::AbstractObject::setDirty()