diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-10-24 15:03:18 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-10-24 15:03:18 +0400 |
commit | 657eff7ed7f23e9218a22ff6b3c96d331d69dd47 (patch) | |
tree | f9a7c7a0e95fd40c6c6f3300f6248f23b3e9041b /source/gameengine/Ketsji/KX_PythonInit.cpp | |
parent | 6424bf6eb02345cc4e8db0951edba97993dce301 (diff) |
Port stereo stuff from tuhopuu2: anaglyph, vinterlace
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index ba466f20f64..42b26185b4c 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -341,7 +341,51 @@ static PyObject* gPySetMousePosition(PyObject*, Py_Return; } +static PyObject* gPySetEyeSeparation(PyObject*, + PyObject* args, + PyObject*) +{ + float sep; + if (PyArg_ParseTuple(args, "f", &sep)) + { + if (gp_Rasterizer) + gp_Rasterizer->SetEyeSeparation(sep); + + Py_Return; + } + + return NULL; +} + +static PyObject* gPyGetEyeSeparation(PyObject*, PyObject*, PyObject*) +{ + if (gp_Rasterizer) + return PyFloat_FromDouble(gp_Rasterizer->GetEyeSeparation()); + + return NULL; +} +static PyObject* gPySetFocalLength(PyObject*, + PyObject* args, + PyObject*) +{ + float focus; + if (PyArg_ParseTuple(args, "f", &focus)) + { + if (gp_Rasterizer) + gp_Rasterizer->SetFocalLength(focus); + Py_Return; + } + + return NULL; +} + +static PyObject* gPyGetFocalLength(PyObject*, PyObject*, PyObject*) +{ + if (gp_Rasterizer) + return PyFloat_FromDouble(gp_Rasterizer->GetFocalLength()); + return NULL; +} static PyObject* gPySetBackgroundColor(PyObject*, PyObject* args, @@ -461,6 +505,10 @@ static struct PyMethodDef rasterizer_methods[] = { {"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"}, {"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"}, + {"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"}, + {"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_VARARGS, "get the eye separation for stereo mode"}, + {"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"}, + {"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"}, { NULL, (PyCFunction) NULL, 0, NULL } }; |