diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-03-24 22:37:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-03-24 22:37:17 +0300 |
commit | c78b460fce4b1da228bd60809e281eea358cf2c9 (patch) | |
tree | f8139efb8191b197b8711fa5a1209f293daf77ab /source/gameengine/Ketsji/KX_GameObject.h | |
parent | 5d48e0430763e1d6cb790606e1c06d7a2190ca88 (diff) |
Use Benoits attributes in KX_GameObject.
Deprecated..
getPosition, setPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass
* swapped set/get to get/set in KX_PYATTRIBUTE_RW_FUNCTION macro to match pythons getsetattrs.
* deprecation warnings in the api and notes in epydocs.
* added 'state' attribute
* gameob.mass = 10 # now works because its not checking only for float values.
* dir(gameob) # includes attributes now
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 211c9b7ca7d..326b3700ad7 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -802,7 +802,27 @@ public: KX_PYMETHOD_DOC(KX_GameObject,rayCast); KX_PYMETHOD_DOC_O(KX_GameObject,getDistanceTo); KX_PYMETHOD_DOC_O(KX_GameObject,getVectTo); + + /* attributes */ + static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + + static PyObject* pyattr_get_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_orientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_orientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_scaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_scaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + private : /** |