Bullet Collision Detection & Physics Library
SpuContactManifoldCollisionAlgorithm.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2007 Erwin Coumans http://bulletphysics.com
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 
16 #ifndef BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
17 #define BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
18 
25 
27 
28 //#define USE_SEPDISTANCE_UTIL 1
29 
32 {
40 
43 
44 
45 
46 
47 public:
48 
49  virtual void processCollision (const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
50 
51  virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
52 
53 
55 #ifdef USE_SEPDISTANCE_UTIL
56  btConvexSeparatingDistanceUtil m_sepDistance;
57 #endif //USE_SEPDISTANCE_UTIL
58 
60 
61  virtual void getAllContactManifolds(btManifoldArray& manifoldArray)
62  {
63  if (m_manifoldPtr)
64  manifoldArray.push_back(m_manifoldPtr);
65  }
66 
68  {
69  return m_manifoldPtr;
70  }
71 
73  {
74  return m_collisionObject0;
75  }
76 
78  {
79  return m_collisionObject1;
80  }
81 
82  int getShapeType0() const
83  {
84  return m_shapeType0;
85  }
86 
87  int getShapeType1() const
88  {
89  return m_shapeType1;
90  }
91  float getCollisionMargin0() const
92  {
93  return m_collisionMargin0;
94  }
95  float getCollisionMargin1() const
96  {
97  return m_collisionMargin1;
98  }
99 
101  {
102  return m_shapeDimensions0;
103  }
104 
106  {
107  return m_shapeDimensions1;
108  }
109 
111  {
112  virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap)
113  {
115  return new(mem) SpuContactManifoldCollisionAlgorithm(ci,body0Wrap->getCollisionObject(),body1Wrap->getCollisionObject());
116  }
117  };
118 
119 };
120 
121 #endif //BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
void push_back(const T &_Val)
virtual void getAllContactManifolds(btManifoldArray &manifoldArray)
btManifoldResult is a helper class to manage contact results.
virtual void * allocateCollisionAlgorithm(int size)=0
Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm.
The btConvexSeparatingDistanceUtil can help speed up convex collision detection by conservatively upd...
btCollisionObject can be used to manage collision detection objects.
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:59
virtual btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
SpuContactManifoldCollisionAlgorithm provides contact manifold and should be processed on SPU...
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:266
const btCollisionObject * getCollisionObject() const