Files
test/source/gameengine/Ketsji/KX_CharacterWrapper.h
Mitchell Stokes f840bd4a9f BGE: This patch adds a character wrapper (similar to the already implemented vehicle wrapper) to control character physics options. Currently supported options are:
* jump() -- causes the character to jump
  * onGround -- specifies whether or not the character is on the ground
  * gravity -- controls the "gravity" that the character physics uses for the character

More options could be added (such as jump speed, step height, make fall speed, max slope, etc).
2012-11-04 20:56:02 +00:00

36 lines
846 B
C++

/** \file KX_CharacterWrapper.h
* \ingroup ketsji
*/
#ifndef __KX_CHARACTERWRAPPER_H__
#define __KX_CHARACTERWRAPPER_H__
#include "Value.h"
#include "PHY_DynamicTypes.h"
class PHY_ICharacter;
///Python interface to character physics
class KX_CharacterWrapper : public PyObjectPlus
{
Py_Header
public:
KX_CharacterWrapper(PHY_ICharacter* character);
virtual ~KX_CharacterWrapper();
#ifdef WITH_PYTHON
KX_PYMETHOD_DOC_NOARGS(KX_CharacterWrapper, jump);
static PyObject* pyattr_get_onground(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_gravity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_gravity(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
#endif // WITH_PYTHON
private:
PHY_ICharacter* m_character;
};
#endif //__KX_CHARACTERWRAPPER_H__