diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-11-05 00:56:02 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-11-05 00:56:02 +0400 |
commit | f840bd4a9f89815ca213d8398c99865fc6d64e4c (patch) | |
tree | b2c27e3ec22ac337120ab6f8db47b5071b6c49cb /source/gameengine/Physics/common/PHY_ICharacter.h | |
parent | cc77001416b385b289e7824cd5d71cad2bddfefb (diff) |
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).
Diffstat (limited to 'source/gameengine/Physics/common/PHY_ICharacter.h')
-rw-r--r-- | source/gameengine/Physics/common/PHY_ICharacter.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/gameengine/Physics/common/PHY_ICharacter.h b/source/gameengine/Physics/common/PHY_ICharacter.h new file mode 100644 index 00000000000..e2fc5e45125 --- /dev/null +++ b/source/gameengine/Physics/common/PHY_ICharacter.h @@ -0,0 +1,30 @@ + +/** \file PHY_ICharacter.h + * \ingroup phys + */ + +#ifndef __PHY_ICHARACTER_H__ +#define __PHY_ICHARACTER_H__ + +//PHY_ICharacter provides a generic interface for "character" controllers + +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + +class PHY_ICharacter +{ +public: + + virtual void Jump()= 0; + virtual bool OnGround()= 0; + + virtual float GetGravity()= 0; + virtual void SetGravity(float gravity)= 0; + +#ifdef WITH_CXX_GUARDEDALLOC + MEM_CXX_CLASS_ALLOC_FUNCS("GE:PHY_ICharacter") +#endif +}; + +#endif //__PHY_ICHARACTER_H__ |