diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-04-01 01:03:15 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-04-01 01:03:15 +0400 |
commit | f6f47a08eba8991419853f66ade3b1ad44f5b3e4 (patch) | |
tree | 3f2ad50e807de670fb7d6ec70c187c894f27e502 /source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | |
parent | 1f0e5f5807f796a6c90aadf9e86916bd69c89a23 (diff) |
BGE API cleanup: DynamicActuator, ReplaceMeshActuator, TrackToActuator.
Diffstat (limited to 'source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index 394bb667728..8df3af61721 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -36,6 +36,7 @@ // Please look here for revision history. #include "KX_SCA_DynamicActuator.h" +#include "blendef.h" #ifdef HAVE_CONFIG_H #include <config.h> @@ -80,21 +81,34 @@ PyParentObject KX_SCA_DynamicActuator::Parents[] = { PyMethodDef KX_SCA_DynamicActuator::Methods[] = { + // ---> deprecated KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation), KX_PYMETHODTABLE(KX_SCA_DynamicActuator, getOperation), {NULL,NULL} //Sentinel }; PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = { + KX_PYATTRIBUTE_SHORT_RW("operation",0,4,false,KX_SCA_DynamicActuator,m_dyn_operation), + KX_PYATTRIBUTE_FLOAT_RW("mass",0.0,MAXFLOAT,KX_SCA_DynamicActuator,m_setmass), { NULL } //Sentinel }; PyObject* KX_SCA_DynamicActuator::_getattr(const char *attr) { - _getattr_up(SCA_IActuator); + PyObject* object = _getattr_self(Attributes, this, attr); + if (object != NULL) + return object; + _getattr_up(SCA_IActuator); } +int KX_SCA_DynamicActuator::_setattr(const char *attr, PyObject* value) +{ + int ret = _setattr_self(Attributes, this, attr, value); + if (ret >= 0) + return ret; + return SCA_IActuator::_setattr(attr, value); +} /* 1. setOperation */ @@ -107,6 +121,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation, "\t 3 = disable rigid body\n" "Change the dynamic status of the parent object.\n") { + ShowDeprecationWarning("setOperation()", "the operation property"); int dyn_operation; if (!PyArg_ParseTuple(args, "i", &dyn_operation)) @@ -126,6 +141,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, "Returns the operation type of this actuator.\n" ) { + ShowDeprecationWarning("getOperation()", "the operation property"); return PyInt_FromLong((long)m_dyn_operation); } |