Vladimír Vondruš
f20c5beb76
python: move away from concrete pybind exceptions.
...
Use only py::error_already_set as that's the least heavy of them. Also
changed all occurences of "throw" to "raise" so next time I'm doing a
prune of all C++ exceptions for good, those are easy to find.
7 years ago
Vladimír Vondruš
14f7810870
python: finish the magic and docs for Matrix[34].scaling() and friends.
...
This is so ugly it's beautiful. The translation needed a metaclass to
work properly, but the undoubtedly worst/best is making those exposed
nicely in the docs.
7 years ago
Vladimír Vondruš
ff9003d10c
python: silence annoying GCC 4.8 warnings.
7 years ago
Vladimír Vondruš
7e057863c8
python: fix Clang's -Wself-assign-overloaded warnings.
...
It's unfortunate that the pybind11 operator helpers need this, but well.
7 years ago
Vladimír Vondruš
d36c847362
python: add an underscore to Matrix4.shearing_ab() parameter name.
...
Better readability.
7 years ago
Vladimír Vondruš
d157b55637
magnum: again (and hopefully for the last time) reorder constructors.
...
The order should be (and now is):
1. magnum's own conversion constructors (double from integer and such)
2. stuff like implicit color3 -> color4, if applicable
3. buffer protocol constructors
4. general "init from a tuple" constructors last, because they're the
slowest
7 years ago
Vladimír Vondruš
22a17cb5b8
python: slightly improve perf of __getitem__ on matrices/vectors.
...
Also test them properly. The full optimization is waiting for a pybind
PR to get merged.
7 years ago
Vladimír Vondruš
d4dff647f7
python: these are done.
7 years ago
Vladimír Vondruš
0170dea8f4
python: consolidate buffer-related headers.
7 years ago
Vladimír Vondruš
d1d6cb9ec0
python/magum/math: switch to our own buffer protocol implementation.
...
Also don't needlessly define buffer protocol again for subclasses (such
as Matrix3 or Color4) as the base can handle that just fine.
7 years ago
Vladimír Vondruš
700fd7c510
python: doc++
7 years ago
Vladimír Vondruš
b3a06f62e6
python: expose the new Matrix4::perspectiveProjection() overload.
7 years ago
Vladimír Vondruš
d5b5b55d2f
python: make sure all Matrix static constructors return proper type.
...
And test for those.
7 years ago
Vladimír Vondruš
52a0650cd2
python: expose at least underscored Matrix[34]._translation property.
...
Still need to figure out a way to expose the property with the same name
as a static function, but this has to suffice for now.
7 years ago
Vladimír Vondruš
82862b8bcd
python: numpy compatibility for matrices and vectors.
7 years ago
Vladimír Vondruš
452d9478ab
python: make it possible to create matrices from nested tuples.
...
Ugh, I need to drop this std::tuple. It makes code complicated for no
reason.
7 years ago
Vladimír Vondruš
464154adca
python: implement conversions between different underlying types.
...
Such a tiny feature and such a pain when it's not there.
7 years ago
Vladimír Vondruš
2c82dc8b3d
python: make Matrix4 operations return Matrix4, not Matrix4x4.
...
Similarly for Matrix3. Also make it implicitly convertible from the base
type.
7 years ago
Vladimír Vondruš
bd49350994
python: expose Matrix3 and Matrix4.
...
The clash of static constructors and members / properties is ...
unfortunate. This is resolved using a minor hack, but I think that's
warranted if it preserves C++/Python API compatibility. The
translation() static constructor and property is not done yet, tho.
7 years ago
Vladimír Vondruš
44503539e7
python: expose matrix types.
...
Not the Matrix4 / Matrix3 transformation types yet, though.
7 years ago