Revert "Gui: Refactor navigation animations"

This commit is contained in:
Yorik van Havre
2023-09-26 19:44:16 +02:00
committed by GitHub
parent 097b60a612
commit f1fb45960d
15 changed files with 352 additions and 674 deletions

View File

@@ -777,8 +777,10 @@ Py::Object View3DInventorPy::getCameraOrientation()
Py::Object View3DInventorPy::viewPosition(const Py::Tuple& args)
{
PyObject* p = nullptr;
if (!PyArg_ParseTuple(args.ptr(), "|O!", &Base::PlacementPy::Type, &p))
PyObject* p=nullptr;
int steps = 20;
int ms = 30;
if (!PyArg_ParseTuple(args.ptr(), "|O!ii",&Base::PlacementPy::Type,&p,&steps,&ms))
throw Py::Exception();
if (p) {
@@ -789,7 +791,7 @@ Py::Object View3DInventorPy::viewPosition(const Py::Tuple& args)
rot.getValue(q0,q1,q2,q3);
getView3DIventorPtr()->getViewer()->moveCameraTo(
SbRotation((float)q0, (float)q1, (float)q2, (float)q3),
SbVec3f((float)pos.x, (float)pos.y, (float)pos.z));
SbVec3f((float)pos.x, (float)pos.y, (float)pos.z), steps, ms);
}
SoCamera* cam = getView3DIventorPtr()->getViewer()->getSoRenderManager()->getCamera();
@@ -808,11 +810,11 @@ Py::Object View3DInventorPy::viewPosition(const Py::Tuple& args)
Py::Object View3DInventorPy::startAnimating(const Py::Tuple& args)
{
float x, y, z;
float x,y,z;
float velocity;
if (!PyArg_ParseTuple(args.ptr(), "ffff", &x, &y, &z, &velocity))
if (!PyArg_ParseTuple(args.ptr(), "ffff", &x,&y,&z,&velocity))
throw Py::Exception();
getView3DIventorPtr()->getViewer()->startSpinningAnimation(SbVec3f(x, y, z), velocity);
getView3DIventorPtr()->getViewer()->startAnimating(SbVec3f(x,y,z),velocity);
return Py::None();
}