diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-07-04 04:05:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-07-04 04:05:50 +0400 |
commit | 5c93e756823cda49466ce7e546268d551fb7de2f (patch) | |
tree | 0ff40ffed5e599b61d1ce86e2283b794286b1141 /source/gameengine/GameLogic/SCA_PythonController.h | |
parent | 70c33ec526aad53df4f08329d7f514bbb7706724 (diff) |
non user visible changes and small optimizations to the game engine pyapi as well as fixing some bugs.
* 2 returning errors without exception set another return None instead of NULL.
* a missing check for parent relation
* BPY matrix length was incorrect in matrix.c, this change could break some scripts, however when a script expects a list of lists for a matrix, the len() function is incorrect and will give an error. This was the only thing stopping apricot game logic running in trunk.
Also added a function for GameObjects - getAxisVect(vec), multiplies the vector be the objects worldspace rotation matrix. Very useful if you want to know what the forward direction is for an object and dont want to use Blender.Mathutils which is tedious and not available in BlenderPlayer yet.
Diffstat (limited to 'source/gameengine/GameLogic/SCA_PythonController.h')
-rw-r--r-- | source/gameengine/GameLogic/SCA_PythonController.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index f3af54f402f..39b6c68c359 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -66,22 +66,19 @@ class SCA_PythonController : public SCA_IController void SetDictionary(PyObject* pythondictionary); static char* sPyGetCurrentController__doc__; - static PyObject* sPyGetCurrentController(PyObject* self, - PyObject* args, - PyObject* kwds); + static PyObject* sPyGetCurrentController(PyObject* self); static char* sPyAddActiveActuator__doc__; static PyObject* sPyAddActiveActuator(PyObject* self, - PyObject* args, - PyObject* kwds); + PyObject* args); virtual PyObject* _getattr(const STR_String& attr); - KX_PYMETHOD_DOC(SCA_PythonController,GetSensors); - KX_PYMETHOD_DOC(SCA_PythonController,GetSensor); - KX_PYMETHOD_DOC(SCA_PythonController,GetActuator); - KX_PYMETHOD_DOC(SCA_PythonController,GetActuators); - KX_PYMETHOD(SCA_PythonController,SetScript); - KX_PYMETHOD(SCA_PythonController,GetScript); - KX_PYMETHOD(SCA_PythonController,GetState); + KX_PYMETHOD_DOC_NOARGS(SCA_PythonController,GetSensors); + KX_PYMETHOD_DOC_NOARGS(SCA_PythonController,GetActuators); + KX_PYMETHOD_DOC_O(SCA_PythonController,GetSensor); + KX_PYMETHOD_DOC_O(SCA_PythonController,GetActuator); + KX_PYMETHOD_O(SCA_PythonController,SetScript); + KX_PYMETHOD_NOARGS(SCA_PythonController,GetScript); + KX_PYMETHOD_NOARGS(SCA_PythonController,GetState); }; |