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:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-09-25 02:58:49 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-09-25 02:58:49 +0400
commit38a80ff9a5c6d7bebef42bc3b8320d781b4e4f1c (patch)
tree325f16aebffa126c36f2377cb32c5dc8fd3f533b /source/gameengine/Ketsji/KX_PythonInit.cpp
parent48bc5b2ac654229832752e7f8593f0dda2ccf80c (diff)
BGE patch: add advanced parameters for SoftBody. Add Rasterizer.drawLine() Python function.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 95693efe30e..3e271be7984 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -797,6 +797,36 @@ static PyObject* gPyGetMaterialType(PyObject*)
return PyInt_FromLong(flag);
}
+static PyObject* gPyDrawLine(PyObject*, PyObject* args)
+{
+ PyObject* ob_from;
+ PyObject* ob_to;
+ PyObject* ob_color;
+
+ if (!gp_Rasterizer) {
+ PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available");
+ return NULL;
+ }
+
+ if (!PyArg_ParseTuple(args,"OOO",&ob_from,&ob_to,&ob_color))
+ return NULL;
+
+ MT_Vector3 from(0., 0., 0.);
+ MT_Vector3 to(0., 0., 0.);
+ MT_Vector3 color(0., 0., 0.);
+ if (!PyVecTo(ob_from, from))
+ return NULL;
+ if (!PyVecTo(ob_to, to))
+ return NULL;
+ if (!PyVecTo(ob_color, color))
+ return NULL;
+
+ gp_Rasterizer->DrawDebugLine(from,to,color);
+
+ Py_RETURN_NONE;
+}
+
+
STR_String gPyGetWindowHeight__doc__="getWindowHeight doc";
STR_String gPyGetWindowWidth__doc__="getWindowWidth doc";
STR_String gPyEnableVisibility__doc__="enableVisibility doc";
@@ -838,6 +868,8 @@ static struct PyMethodDef rasterizer_methods[] = {
METH_VARARGS, "set the state of a GLSL material setting"},
{"getGLSLMaterialSetting",(PyCFunction) gPyGetGLSLMaterialSetting,
METH_VARARGS, "get the state of a GLSL material setting"},
+ {"drawLine", (PyCFunction) gPyDrawLine,
+ METH_VARARGS, "draw a line on the screen"},
{ NULL, (PyCFunction) NULL, 0, NULL }
};