diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-11-06 07:58:10 +0300 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-11-06 07:58:10 +0300 |
commit | 38b993f787b1694957f7c9876189f8ef9e346515 (patch) | |
tree | cf51058e0dc02eba41d1dd06d7fe3411412a8004 /source/gameengine/Ketsji/KX_ClientObjectInfo.h | |
parent | b3395edd2a371de8ee56b3fbdfff4687750acccd (diff) |
Speed up the physics engine: hook the SOLID broad phase, so we can either reject the test or request the penetration depth test as necessary. Previously we were doing the penetration depth test, as well as SOLID's intersection test.
Diffstat (limited to 'source/gameengine/Ketsji/KX_ClientObjectInfo.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_ClientObjectInfo.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 0ef1a1b86fe..237ec137a1c 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -32,10 +32,16 @@ #ifndef __KX_CLIENTOBJECT_INFO_H #define __KX_CLIENTOBJECT_INFO_H +#include <SM_Object.h> + +#include <list> + +class SCA_ISensor; +class KX_GameObject; /** * Client Type and Additional Info. This structure can be use instead of a bare void* pointer, for safeness, and additional info for callbacks */ -struct KX_ClientObjectInfo +struct KX_ClientObjectInfo : public SM_ClientObject { enum clienttype { STATIC, @@ -44,15 +50,32 @@ struct KX_ClientObjectInfo RADAR, NEAR } m_type; - void* m_clientobject; + KX_GameObject* m_gameobject; void* m_auxilary_info; + std::list<SCA_ISensor*> m_sensors; public: - KX_ClientObjectInfo(void *clientobject, clienttype type = STATIC, void *auxilary_info = NULL) : + KX_ClientObjectInfo(KX_GameObject *gameobject, clienttype type = STATIC, void *auxilary_info = NULL) : + SM_ClientObject(), m_type(type), - m_clientobject(clientobject), + m_gameobject(gameobject), m_auxilary_info(auxilary_info) {} + KX_ClientObjectInfo(const KX_ClientObjectInfo ©) + : SM_ClientObject(copy), + m_type(copy.m_type), + m_gameobject(copy.m_gameobject), + m_auxilary_info(copy.m_auxilary_info) + { + } + + virtual ~KX_ClientObjectInfo() {} + + virtual bool hasCollisionCallback() + { + return m_sensors.size() != 0; + } + bool isActor() { return m_type <= ACTOR; } }; |