From 0a23895f95382a8c6d5c36bc8b36802c4474eb2e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Aug 2009 22:51:18 +0000 Subject: remove all python api functions deprecated in 2.49 --- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 327 ------------------------- 1 file changed, 327 deletions(-) (limited to 'source/gameengine/Ketsji/KX_ObjectActuator.cpp') diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 2ee30ee0bfa..99179c5ed96 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -347,32 +347,6 @@ PyTypeObject KX_ObjectActuator::Type = { }; PyMethodDef KX_ObjectActuator::Methods[] = { - // Deprecated -----> - {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS}, - {"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS}, - {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS}, - {"setTorque", (PyCFunction) KX_ObjectActuator::sPySetTorque, METH_VARARGS}, - {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_NOARGS}, - {"setDLoc", (PyCFunction) KX_ObjectActuator::sPySetDLoc, METH_VARARGS}, - {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_NOARGS}, - {"setDRot", (PyCFunction) KX_ObjectActuator::sPySetDRot, METH_VARARGS}, - {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_NOARGS}, - {"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS}, - {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_NOARGS}, - {"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS}, - {"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS}, - {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_NOARGS}, - {"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS}, - {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_NOARGS}, - {"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS}, - {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_NOARGS}, - {"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS}, - {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_NOARGS}, - {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS}, - {"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS}, - - // <----- Deprecated - {NULL,NULL} //Sentinel }; @@ -667,305 +641,4 @@ int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIB return PY_SET_ATTR_SUCCESS; } - -/* 1. set ------------------------------------------------------------------ */ -/* Removed! */ - -/* 2. getForce */ -PyObject* KX_ObjectActuator::PyGetForce() -{ - ShowDeprecationWarning("getForce()", "the force and the useLocalForce properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_force[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_force[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_force[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Force)); - - return retVal; -} -/* 3. setForce */ -PyObject* KX_ObjectActuator::PySetForce(PyObject* args) -{ - ShowDeprecationWarning("setForce()", "the force and the useLocalForce properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setForce", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_force.setValue(vecArg); - m_bitLocalFlag.Force = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 4. getTorque */ -PyObject* KX_ObjectActuator::PyGetTorque() -{ - ShowDeprecationWarning("getTorque()", "the torque and the useLocalTorque properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Torque)); - - return retVal; -} -/* 5. setTorque */ -PyObject* KX_ObjectActuator::PySetTorque(PyObject* args) -{ - ShowDeprecationWarning("setTorque()", "the torque and the useLocalTorque properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setTorque", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_torque.setValue(vecArg); - m_bitLocalFlag.Torque = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 6. getDLoc */ -PyObject* KX_ObjectActuator::PyGetDLoc() -{ - ShowDeprecationWarning("getDLoc()", "the dLoc and the useLocalDLoc properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_dloc[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_dloc[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DLoc)); - - return retVal; -} -/* 7. setDLoc */ -PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args) -{ - ShowDeprecationWarning("setDLoc()", "the dLoc and the useLocalDLoc properties"); - float vecArg[3]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "fffi:setDLoc", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_dloc.setValue(vecArg); - m_bitLocalFlag.DLoc = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 8. getDRot */ -PyObject* KX_ObjectActuator::PyGetDRot() -{ - ShowDeprecationWarning("getDRot()", "the dRot and the useLocalDRot properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_drot[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_drot[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DRot)); - - return retVal; -} -/* 9. setDRot */ -PyObject* KX_ObjectActuator::PySetDRot(PyObject* args) -{ - ShowDeprecationWarning("setDRot()", "the dRot and the useLocalDRot properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setDRot", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_drot.setValue(vecArg); - m_bitLocalFlag.DRot = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 10. getLinearVelocity */ -PyObject* KX_ObjectActuator::PyGetLinearVelocity() { - ShowDeprecationWarning("getLinearVelocity()", "the linV and the useLocalLinV properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity)); - - return retVal; -} - -/* 11. setLinearVelocity */ -PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) { - ShowDeprecationWarning("setLinearVelocity()", "the linV and the useLocalLinV properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_linear_velocity.setValue(vecArg); - m_bitLocalFlag.LinearVelocity = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - - -/* 12. getAngularVelocity */ -PyObject* KX_ObjectActuator::PyGetAngularVelocity() { - ShowDeprecationWarning("getAngularVelocity()", "the angV and the useLocalAngV properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity)); - - return retVal; -} -/* 13. setAngularVelocity */ -PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) { - ShowDeprecationWarning("setAngularVelocity()", "the angV and the useLocalAngV properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_angular_velocity.setValue(vecArg); - m_bitLocalFlag.AngularVelocity = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 13. setDamping */ -PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) { - ShowDeprecationWarning("setDamping()", "the damping property"); - int damping = 0; - if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) { - return NULL; - } - m_damping = damping; - Py_RETURN_NONE; -} - -/* 13. getVelocityDamping */ -PyObject* KX_ObjectActuator::PyGetDamping() { - ShowDeprecationWarning("getDamping()", "the damping property"); - return Py_BuildValue("i",m_damping); -} -/* 6. getForceLimitX */ -PyObject* KX_ObjectActuator::PyGetForceLimitX() -{ - ShowDeprecationWarning("getForceLimitX()", "the forceLimitX property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[0])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque)); - - return retVal; -} -/* 7. setForceLimitX */ -PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitX()", "the forceLimitX property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitX", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[0] = vecArg[0]; - m_dloc[0] = vecArg[1]; - m_bitLocalFlag.Torque = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 6. getForceLimitY */ -PyObject* KX_ObjectActuator::PyGetForceLimitY() -{ - ShowDeprecationWarning("getForceLimitY()", "the forceLimitY property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[1])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc)); - - return retVal; -} -/* 7. setForceLimitY */ -PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitY()", "the forceLimitY property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitY", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[1] = vecArg[0]; - m_dloc[1] = vecArg[1]; - m_bitLocalFlag.DLoc = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 6. getForceLimitZ */ -PyObject* KX_ObjectActuator::PyGetForceLimitZ() -{ - ShowDeprecationWarning("getForceLimitZ()", "the forceLimitZ property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[2])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[2])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot)); - - return retVal; -} -/* 7. setForceLimitZ */ -PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitZ()", "the forceLimitZ property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitZ", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[2] = vecArg[0]; - m_dloc[2] = vecArg[1]; - m_bitLocalFlag.DRot = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 4. getPID */ -PyObject* KX_ObjectActuator::PyGetPID() -{ - ShowDeprecationWarning("getPID()", "the pid property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_pid[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_pid[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_pid[2])); - - return retVal; -} -/* 5. setPID */ -PyObject* KX_ObjectActuator::PySetPID(PyObject* args) -{ - ShowDeprecationWarning("setPID()", "the pid property"); - float vecArg[3]; - if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) { - return NULL; - } - m_pid.setValue(vecArg); - Py_RETURN_NONE; -} - - - - - /* eof */ -- cgit v1.2.3