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>2006-06-19 02:10:00 +0400
committerErwin Coumans <blender@erwincoumans.com>2006-06-19 02:10:00 +0400
commitec8448b88d9285624d61ce9196c7ad3643dc921e (patch)
treea8b88feac6e25d1c8aa0e45fb1a018e3b2b30e6c /source/gameengine/Ketsji/KX_GameObject.cpp
parentdcbcc125824c6debc082b7ba36082602bc63f9d3 (diff)
bugfix/workaround for problem with hard-coded collision margins being too large.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 3b1e4f7ce59..6e53cb4d25f 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -627,6 +627,7 @@ PyMethodDef KX_GameObject::Methods[] = {
{"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_VARARGS},
{"getReactionForce", (PyCFunction) KX_GameObject::sPyGetReactionForce, METH_VARARGS},
{"applyImpulse", (PyCFunction) KX_GameObject::sPyApplyImpulse, METH_VARARGS},
+ {"setCollisionMargin", (PyCFunction) KX_GameObject::sPySetCollisionMargin, METH_VARARGS},
{"suspendDynamics", (PyCFunction)KX_GameObject::sPySuspendDynamics,METH_VARARGS},
{"restoreDynamics", (PyCFunction)KX_GameObject::sPyRestoreDynamics,METH_VARARGS},
{"enableRigidBody", (PyCFunction)KX_GameObject::sPyEnableRigidBody,METH_VARARGS},
@@ -979,6 +980,29 @@ PyObject* KX_GameObject::PyGetMesh(PyObject* self,
}
+
+
+
+PyObject* KX_GameObject::PySetCollisionMargin(PyObject* self,
+ PyObject* args,
+ PyObject* kwds)
+{
+ float collisionMargin;
+ if (PyArg_ParseTuple(args, "f", &collisionMargin))
+ {
+ if (m_pPhysicsController1)
+ {
+ m_pPhysicsController1->SetMargin(collisionMargin);
+ Py_Return;
+ }
+
+ }
+
+ return NULL;
+}
+
+
+
PyObject* KX_GameObject::PyApplyImpulse(PyObject* self,
PyObject* args,
PyObject* kwds)