40 #ifndef _ghostproxy_cpp
41 #define _ghostproxy_cpp
43 #include "Physics/ghostproxy.h"
44 #include "Physics/physicsmanager.h"
47 #include "stringtool.h"
49 #include <btBulletDynamicsCommon.h>
50 #include <BulletSoftBody/btSoftRigidDynamicsWorld.h>
51 #include <BulletCollision/CollisionDispatch/btGhostObject.h>
59 PhysicsGhostBody(NULL)
66 PhysicsGhostBody(NULL)
92 return Mezzanine::PT_Physics_GhostProxy;
114 btCollisionObject* OverlappingObject = this->
PhysicsGhostBody->getOverlappingObject( static_cast<int>( Index ) );
115 return static_cast<CollidableProxy*
>( OverlappingObject->getUserPointer() );
127 btBroadphasePairArray& PairArray = this->
PhysicsGhostBody->getOverlappingPairCache()->getOverlappingPairArray();
128 const btBroadphasePair& CachePair = PairArray[Index];
129 btBroadphasePair* WorldPair = PhysWorld->getPairCache()->findPair(CachePair.m_pProxy0,CachePair.m_pProxy1);
131 if( WorldPair != NULL )
133 btManifoldArray ManifoldArray;
134 ManifoldArray.clear();
136 if( WorldPair->m_algorithm )
137 WorldPair->m_algorithm->getAllContactManifolds(ManifoldArray);
139 for(
int ManifoldIndex = 0 ; ManifoldIndex < ManifoldArray.size() ; ++ManifoldIndex )
141 btPersistentManifold* Manifold = ManifoldArray[ManifoldIndex];
142 for(
int ContactIndex = 0 ; ContactIndex < Manifold->getNumContacts() ; ++ContactIndex )
148 btCollisionObject* ColObj = ( Manifold->getBody0() != this->
PhysicsGhostBody ? (btCollisionObject*)(Manifold->getBody0()) : (btCollisionObject*)(Manifold->getBody1()) );
158 btBroadphasePairArray& PairArray = this->
PhysicsGhostBody->getOverlappingPairCache()->getOverlappingPairArray();
159 return static_cast<UInt32>( PairArray.size() );
175 {
return "GhostProxy"; }