Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2005-08-02 18:59:49 +0400
committerErwin Coumans <blender@erwincoumans.com>2005-08-02 18:59:49 +0400
commit558b8daf67bc986210d2ca9f778872ec6a4fab3b (patch)
treeda8cd2b52806c83deb0cb6acb7c54a3938e5f965 /source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
parent292c03ab8e9979a3792f8f96e4bad1a9d5b82275 (diff)
added python binding for debugdraw,
tweaked friction, some more preparations but no real functionality added yet
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyConstraintBinding.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PyConstraintBinding.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index 0111fd36cb2..1f732098718 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -48,9 +48,11 @@ static char PhysicsConstraints_module_documentation[] =
static char gPySetGravity__doc__[] = "setGravity(float x,float y,float z)";
+static char gPySetDebugMode__doc__[] = "setDebugMode(int mode)";
static char gPyCreateConstraint__doc__[] = "createConstraint(ob1,ob2,float restLength,float restitution,float damping)";
static char gPyRemoveConstraint__doc__[] = "removeConstraint(constraint id)";
+
static PyObject* gPySetGravity(PyObject* self,
PyObject* args,
PyObject* kwds)
@@ -65,6 +67,26 @@ static PyObject* gPySetGravity(PyObject* self,
Py_INCREF(Py_None); return Py_None;
}
+static PyObject* gPySetDebugMode(PyObject* self,
+ PyObject* args,
+ PyObject* kwds)
+{
+ int mode;
+ if (PyArg_ParseTuple(args,"i",&mode))
+ {
+ if (PHY_GetActiveEnvironment())
+ {
+ PHY_GetActiveEnvironment()->setDebugMode(mode);
+
+ }
+
+ }
+ printf("hi\n");
+
+ Py_INCREF(Py_None); return Py_None;
+}
+
+
@@ -142,7 +164,10 @@ static PyObject* gPyRemoveConstraint(PyObject* self,
static struct PyMethodDef physicsconstraints_methods[] = {
{"setGravity",(PyCFunction) gPySetGravity,
METH_VARARGS, gPySetGravity__doc__},
-
+ {"setDebugMode",(PyCFunction) gPySetDebugMode,
+ METH_VARARGS, gPySetDebugMode__doc__},
+
+
{"createConstraint",(PyCFunction) gPyCreateConstraint,
METH_VARARGS, gPyCreateConstraint__doc__},
{"removeConstraint",(PyCFunction) gPyRemoveConstraint,
@@ -161,6 +186,7 @@ PyObject* initPythonConstraintBinding()
PyObject* m;
PyObject* d;
+
m = Py_InitModule4("PhysicsConstraints", physicsconstraints_methods,
PhysicsConstraints_module_documentation,
(PyObject*)NULL,PYTHON_API_VERSION);