Index: source/gameengine/GameLogic/SCA_ISensor.h =================================================================== --- source/gameengine/GameLogic/SCA_ISensor.h (r‚vision 13519) +++ source/gameengine/GameLogic/SCA_ISensor.h (copie de travail) @@ -122,6 +122,7 @@ KX_PYMETHOD_DOC(SCA_ISensor,SetUseNegPulseMode); KX_PYMETHOD_DOC(SCA_ISensor,GetInvert); KX_PYMETHOD_DOC(SCA_ISensor,SetInvert); + KX_PYMETHOD_DOC(SCA_ISensor,Evaluate); }; Index: source/gameengine/GameLogic/SCA_ISensor.cpp =================================================================== --- source/gameengine/GameLogic/SCA_ISensor.cpp (r‚vision 13519) +++ source/gameengine/GameLogic/SCA_ISensor.cpp (copie de travail) @@ -160,6 +160,8 @@ METH_VARARGS, GetInvert_doc}, {"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert, METH_VARARGS, SetInvert_doc}, + {"evaluate", (PyCFunction) SCA_ISensor::sPyEvaluate, + METH_VARARGS, Evaluate_doc}, {NULL,NULL} //Sentinel }; @@ -331,4 +333,15 @@ Py_Return; } +char SCA_ISensor::Evaluate_doc[] = +"evaluate()\n" +"\tRe-evaluate the sensor so that isPositive() and other methods are up to date\n" +"\twith current game conditions. BGE does it automatically on each frame so it's\n" +"\tnot usually needed.\n" +"\tReturns True or False if the sensor evaluates positively or negatively\n"; +PyObject* SCA_ISensor::PyEvaluate(PyObject* self, PyObject* args, PyObject* kwds) +{ + return BoolToPyArg(Evaluate(NULL)); +} + /* eof */