Browse Source

python: adapt to Magnum changes in a less lazy way.

pull/16/head
Vladimír Vondruš 4 years ago
parent
commit
04c1f712ed
  1. 14
      src/python/magnum/math.cpp

14
src/python/magnum/math.cpp

@ -174,7 +174,7 @@ template<class T> void angle(py::module_& m, py::class_<T>& c) {
.def("select", static_cast<T(*)(const T&, const T&, Double)>(Math::select), "Constant interpolation of two values", py::arg("a"), py::arg("b"), py::arg("t")); .def("select", static_cast<T(*)(const T&, const T&, Double)>(Math::select), "Constant interpolation of two values", py::arg("a"), py::arg("b"), py::arg("t"));
} }
template<class T> void boolVector(py::module_& m, py::class_<T>& c) { template<class T> void bitVector(py::module_& m, py::class_<T>& c) {
c c
/* Constructors */ /* Constructors */
.def_static("zero_init", []() { .def_static("zero_init", []() {
@ -448,12 +448,12 @@ void math(py::module_& root, py::module_& m) {
py::implicitly_convertible<Degd, Radd>(); py::implicitly_convertible<Degd, Radd>();
/* BitVector */ /* BitVector */
py::class_<Math::BitVector<2>> boolVector2{root, "BitVector2", "Two-component bool vector"}; py::class_<Math::BitVector<2>> boolVector2{root, "BitVector2", "Two-component vector of bits"};
py::class_<Math::BitVector<3>> boolVector3{root, "BitVector3", "Three-component bool vector"}; py::class_<Math::BitVector<3>> boolVector3{root, "BitVector3", "Three-component vector of bits"};
py::class_<Math::BitVector<4>> boolVector4{root, "BitVector4", "Four-component bool vector"}; py::class_<Math::BitVector<4>> boolVector4{root, "BitVector4", "Four-component vector of bits"};
boolVector(m, boolVector2); bitVector(m, boolVector2);
boolVector(m, boolVector3); bitVector(m, boolVector3);
boolVector(m, boolVector4); bitVector(m, boolVector4);
/* Constants. Putting them into math like Python does and as doubles, since /* Constants. Putting them into math like Python does and as doubles, since
Python doesn't really differentiate between 32bit and 64bit floats */ Python doesn't really differentiate between 32bit and 64bit floats */

Loading…
Cancel
Save