add method RotationPy.toMatrix()

This commit is contained in:
wmayer
2019-10-07 19:27:54 +02:00
parent edcb33f120
commit 6222cb310b
2 changed files with 18 additions and 1 deletions

View File

@@ -73,7 +73,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="toEuler" Const="true">
<Methode Name="toEuler" Const="true">
<Documentation>
<UserDocu>
toEuler(Vector) -> list
@@ -82,6 +82,14 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="toMatrix" Const="true">
<Documentation>
<UserDocu>
toMatrix()
convert the rotation to a matrix representation
</UserDocu>
</Documentation>
</Methode>
<Methode Name="isNull" Const="true">
<Documentation>
<UserDocu>

View File

@@ -270,6 +270,15 @@ PyObject* RotationPy::toEuler(PyObject * args)
return Py::new_reference_to(tuple);
}
PyObject* RotationPy::toMatrix(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
Base::Matrix4D mat;
getRotationPtr()->getValue(mat);
return new MatrixPy(new Matrix4D(mat));
}
PyObject* RotationPy::isSame(PyObject *args)
{
PyObject *rot;