expose Roation.slerp to Python

This commit is contained in:
wmayer
2019-10-11 01:14:35 +02:00
parent 1d83fa7d92
commit fd352c14f1
2 changed files with 20 additions and 0 deletions

View File

@@ -256,6 +256,18 @@ PyObject* RotationPy::multVec(PyObject * args)
return new VectorPy(new Vector3d(vec));
}
PyObject* RotationPy::slerp(PyObject * args)
{
PyObject *rot;
double t;
if (!PyArg_ParseTuple(args, "O!d", &(RotationPy::Type), &rot, &t))
return 0;
Rotation *rot0 = this->getRotationPtr();
Rotation *rot1 = static_cast<RotationPy*>(rot)->getRotationPtr();
Rotation sl = Rotation::slerp(*rot0, *rot1, t);
return new RotationPy(new Rotation(sl));
}
PyObject* RotationPy::toEuler(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))