diff --git a/doc/python/pages/changelog.rst b/doc/python/pages/changelog.rst index 5e0de88..e31bb6c 100644 --- a/doc/python/pages/changelog.rst +++ b/doc/python/pages/changelog.rst @@ -35,6 +35,8 @@ Changelog `Changes since 2020.06`_ ======================== +- Exposed missing :ref:`Vector4` constructor from a :ref:`Vector3` and a + W component and :ref:`Vector3` from :ref:`Vector2` and a Z component - Renamed :py:`Matrix3.from()` / :py:`Matrix4.from()` to :ref:`Matrix3.from_()` / :ref:`Matrix4.from_()` because :py:`from` is a Python keyword and it would be silly to have to write :py:`getattr(Matrix4, 'from')` just to use diff --git a/src/python/magnum/math.vector.h b/src/python/magnum/math.vector.h index 14c60a8..a21b4d8 100644 --- a/src/python/magnum/math.vector.h +++ b/src/python/magnum/math.vector.h @@ -380,6 +380,7 @@ template void vector3(py::class_>& c) { c /* Constructors */ .def(py::init(), "Constructor") + .def(py::init, T>(), "Constructor") .def(py::init([](const std::tuple& value) { return Math::Vector3{std::get<0>(value), std::get<1>(value), std::get<2>(value)}; }), "Construct from a tuple") @@ -437,6 +438,7 @@ template void vector4(py::class_>& c) { c /* Constructors */ .def(py::init(), "Constructor") + .def(py::init, T>(), "Constructor") .def(py::init([](const std::tuple& value) { return Math::Vector4{std::get<0>(value), std::get<1>(value), std::get<2>(value), std::get<3>(value)}; }), "Construct from a tuple")