[1966] | 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 | #include "SpuContactManifoldCollisionAlgorithm.h" |
---|
| 17 | #include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" |
---|
| 18 | #include "BulletCollision/CollisionDispatch/btCollisionObject.h" |
---|
| 19 | #include "BulletCollision/CollisionShapes/btCollisionShape.h" |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | SpuContactManifoldCollisionAlgorithm::SpuContactManifoldCollisionAlgorithm() |
---|
| 23 | :m_manifoldPtr(0) |
---|
| 24 | { |
---|
| 25 | |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | void SpuContactManifoldCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) |
---|
| 30 | { |
---|
| 31 | btAssert(0); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | btScalar SpuContactManifoldCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) |
---|
| 35 | { |
---|
| 36 | btAssert(0); |
---|
| 37 | return 1.f; |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | #ifndef __SPU__ |
---|
| 41 | SpuContactManifoldCollisionAlgorithm::SpuContactManifoldCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1) |
---|
| 42 | :btCollisionAlgorithm(ci) |
---|
| 43 | { |
---|
| 44 | m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1); |
---|
| 45 | m_shapeType0 = body0->getCollisionShape()->getShapeType(); |
---|
| 46 | m_shapeType1 = body1->getCollisionShape()->getShapeType(); |
---|
| 47 | m_collisionMargin0 = body0->getCollisionShape()->getMargin(); |
---|
| 48 | m_collisionMargin1 = body1->getCollisionShape()->getMargin(); |
---|
| 49 | |
---|
| 50 | } |
---|
| 51 | #endif //__SPU__ |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | SpuContactManifoldCollisionAlgorithm::~SpuContactManifoldCollisionAlgorithm() |
---|
| 55 | { |
---|
| 56 | if (m_manifoldPtr) |
---|
| 57 | m_dispatcher->releaseManifold(m_manifoldPtr); |
---|
| 58 | } |
---|