diff --git a/doc/python/pages/changelog.rst b/doc/python/pages/changelog.rst index 802d6b1..74882fe 100644 --- a/doc/python/pages/changelog.rst +++ b/doc/python/pages/changelog.rst @@ -41,6 +41,9 @@ Changelog / :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 these APIs +- Exposed newly added off-center variants of + :ref:`Matrix4.orthographhic_projection()` and + :ref:`Matrix3.projection()` - Exposed :ref:`gl.Renderer.set_blend_function()`, :ref:`gl.Renderer.set_blend_equation()` and related enums (see :gh:`mosra/magnum-bindings#9`) - Exposed :ref:`gl.Renderer.Feature.CLIP_DISTANCEn ` diff --git a/src/python/magnum/math.matrix.h b/src/python/magnum/math.matrix.h index 1dc1537..1b7e883 100644 --- a/src/python/magnum/math.matrix.h +++ b/src/python/magnum/math.matrix.h @@ -558,8 +558,10 @@ template void matrices( "2D shearing matrix along the X axis", py::arg("amount")) .def_static("shearing_y", &Math::Matrix3::shearingY, "2D shearning matrix along the Y axis", py::arg("amount")) - .def_static("projection", &Math::Matrix3::projection, + .def_static("projection", static_cast(*)(const Math::Vector2&)>(&Math::Matrix3::projection), "2D projection matrix", py::arg("size")) + .def_static("projection", static_cast(*)(const Math::Vector2&, const Math::Vector2&)>(&Math::Matrix3::projection), + "2D off-center projection matrix", py::arg("bottom_left"), py::arg("top_right")) .def_static("from_", static_cast(*)(const Math::Matrix2x2&, const Math::Vector2&)>(&Math::Matrix3::from), "Create a matrix from a rotation/scaling part and a translation part", py::arg("rotation_scaling"), py::arg("translation")) @@ -747,8 +749,10 @@ Overloaded function. "3D shearning matrix along the XZ plane", py::arg("amount_x"), py::arg("amount_z")) .def_static("shearing_yz", &Math::Matrix4::shearingYZ, "3D shearing matrix along the YZ plane", py::arg("amount_y"), py::arg("amount_z")) - .def_static("orthographic_projection", &Math::Matrix4::orthographicProjection, + .def_static("orthographic_projection", static_cast(*)(const Math::Vector2&, T, T)>(&Math::Matrix4::orthographicProjection), "3D orthographic projection matrix", py::arg("size"), py::arg("near"), py::arg("far")) + .def_static("orthographic_projection", static_cast(*)(const Math::Vector2&, const Math::Vector2&, T, T)>(&Math::Matrix4::orthographicProjection), + "3D off-center orthographic projection matrix", py::arg("bottom_left"), py::arg("top_right"), py::arg("near"), py::arg("far")) .def_static("perspective_projection", static_cast(*)(const Math::Vector2&, T, T)>(&Math::Matrix4::perspectiveProjection), "3D perspective projection matrix", py::arg("size"), py::arg("near"), py::arg("far"))