diff --git a/src/Magnum/SceneGraph/Animable.h b/src/Magnum/SceneGraph/Animable.h index 3d0854538..0980af250 100644 --- a/src/Magnum/SceneGraph/Animable.h +++ b/src/Magnum/SceneGraph/Animable.h @@ -129,6 +129,12 @@ template class Animable: public AbstractGrouped */ explicit Animable(AbstractObject& object, AnimableGroup* group = nullptr); + #ifndef DOXYGEN_GENERATING_OUTPUT + /* This is here to avoid ambiguity with deleted copy constructor when + passing `*this` from class subclassing both Animable and AbstractObject */ + template, U>::value>::type> explicit Animable(U& object): Animable{static_cast&>(object)} {} + #endif + ~Animable(); /** @brief Animation duration */ diff --git a/src/Magnum/SceneGraph/Drawable.h b/src/Magnum/SceneGraph/Drawable.h index b6d64ea25..ff5075865 100644 --- a/src/Magnum/SceneGraph/Drawable.h +++ b/src/Magnum/SceneGraph/Drawable.h @@ -111,6 +111,12 @@ template class Drawable: public AbstractGrouped */ explicit Drawable(AbstractObject& object, DrawableGroup* drawables = nullptr); + #ifndef DOXYGEN_GENERATING_OUTPUT + /* This is here to avoid ambiguity with deleted copy constructor when + passing `*this` from class subclassing both Drawable and AbstractObject */ + template, U>::value>::type> explicit Drawable(U& object): Drawable{static_cast&>(object)} {} + #endif + /** * @brief Group containing this drawable *