From 6814e334a252daeda4022dc5b614b9607d5dcbb7 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 1 Dec 2016 17:54:52 -0800 Subject: [PATCH] expose numSubSteps to pybullet --- examples/pybullet/pybullet.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index a3da3e942..5d8844c4b 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -425,15 +425,16 @@ static PyObject* pybullet_setPhysicsEngineParameter(PyObject* self, PyObject* ar int numSolverIterations = -1; int useSplitImpulse = -1; double splitImpulsePenetrationThreshold = -1; + int numSubSteps = -1; if (0 == sm) { PyErr_SetString(SpamError, "Not connected to physics server."); return NULL; } - static char *kwlist[] = { "fixedTimeStep", "numSolverIterations","useSplitImpulse","splitImpulsePenetrationThreshold", NULL }; + static char *kwlist[] = { "fixedTimeStep", "numSolverIterations","useSplitImpulse","splitImpulsePenetrationThreshold","numSubSteps", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "|diid", kwlist,&fixedTimeStep,&numSolverIterations,&useSplitImpulse,&splitImpulsePenetrationThreshold)) + if (!PyArg_ParseTupleAndKeywords(args, keywds, "|diidi", kwlist,&fixedTimeStep,&numSolverIterations,&useSplitImpulse,&splitImpulsePenetrationThreshold,&numSubSteps)) { return NULL; } @@ -457,6 +458,10 @@ static PyObject* pybullet_setPhysicsEngineParameter(PyObject* self, PyObject* ar { b3PhysicsParamSetSplitImpulsePenetrationThreshold(command, splitImpulsePenetrationThreshold); } + if (numSubSteps>=0) + { + b3PhysicsParamSetNumSubSteps(command,numSubSteps); + } //ret = b3PhysicsParamSetRealTimeSimulation(command, enableRealTimeSimulation);