diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-05-23 01:03:43 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-05-23 01:03:43 +0400 |
commit | ab71e2a9b55e0982d1134792d10af55464c7ac9e (patch) | |
tree | 4a53791a67d3234360107a33c5365d4de4844bb7 /source/gameengine/Ketsji/KX_PyConstraintBinding.cpp | |
parent | 677cf7f1333c634a52227a15d6dcb3351b39febc (diff) |
-added basic support for GameActuator 'load game', relative paths were broken, just load file into memory and load blend from memory.
-near sensor support
- python binding for PhysicsConstraints.setNumTimeSubSteps (dividing the physics timestep to tradeoff quality for performance)
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyConstraintBinding.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PyConstraintBinding.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index e9c71fe02c9..28138195a5e 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -53,6 +53,9 @@ static char gPySetGravity__doc__[] = "setGravity(float x,float y,float z)"; static char gPySetDebugMode__doc__[] = "setDebugMode(int mode)"; static char gPySetNumIterations__doc__[] = "setNumIterations(int numiter) This sets the number of iterations for an iterative constraint solver"; +static char gPySetNumTimeSubSteps__doc__[] = "setNumTimeSubSteps(int numsubstep) This sets the number of substeps for each physics proceed. Tradeoff quality for performance."; + + static char gPySetDeactivationTime__doc__[] = "setDeactivationTime(float time) This sets the time after which a resting rigidbody gets deactived"; static char gPySetDeactivationLinearTreshold__doc__[] = "setDeactivationLinearTreshold(float linearTreshold)"; static char gPySetDeactivationAngularTreshold__doc__[] = "setDeactivationAngularTreshold(float angularTreshold)"; @@ -106,6 +109,24 @@ static PyObject* gPySetDebugMode(PyObject* self, Py_INCREF(Py_None); return Py_None; } + + +static PyObject* gPySetNumTimeSubSteps(PyObject* self, + PyObject* args, + PyObject* kwds) +{ + int substep; + if (PyArg_ParseTuple(args,"i",&substep)) + { + if (PHY_GetActiveEnvironment()) + { + PHY_GetActiveEnvironment()->setNumTimeSubSteps(substep); + } + } + Py_INCREF(Py_None); return Py_None; +} + + static PyObject* gPySetNumIterations(PyObject* self, PyObject* args, PyObject* kwds) @@ -411,6 +432,9 @@ static struct PyMethodDef physicsconstraints_methods[] = { {"setNumIterations",(PyCFunction) gPySetNumIterations, METH_VARARGS, gPySetNumIterations__doc__}, + {"setNumTimeSubSteps",(PyCFunction) gPySetNumTimeSubSteps, + METH_VARARGS, gPySetNumTimeSubSteps__doc__}, + {"setDeactivationTime",(PyCFunction) gPySetDeactivationTime, METH_VARARGS, gPySetDeactivationTime__doc__}, |