Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-21 21:32:56 +0000
committerStijn Buys <ingar@osirion.org>2012-11-21 21:32:56 +0000
commit43b435c8488501d62fb15940eb551db30db3b898 (patch)
tree36ea1906a3648e35a4522af7becb0a6c8e935daa
parent5e4ef80dc29a69e1f5f185d1efab323af4a77292 (diff)
Accomodate bullet 2.81 API change.
-rw-r--r--src/core/physics.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/physics.cc b/src/core/physics.cc
index 2c7dd96..b1c8e0f 100644
--- a/src/core/physics.cc
+++ b/src/core/physics.cc
@@ -21,11 +21,20 @@ namespace core {
* see http://bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Callbacks_and_Triggers
*/
+#if (BT_BULLET_VERSION < 281)
+// bullet 2.80 or older
bool bullet_contact_added_callback(btManifoldPoint &cp, const btCollisionObject *body0, int partId0, int index0, const btCollisionObject *body1, int partId1, int index1)
{
Entity *entity0 = static_cast<Entity *>(body0->getUserPointer());
Entity *entity1 = static_cast<Entity *>(body1->getUserPointer());
-
+
+#else
+// bullet 2.81 or newer
+bool bullet_contact_added_callback(btManifoldPoint &cp, const btCollisionObjectWrapper *body0, int partId0, int index0, const btCollisionObjectWrapper *body1, int partId1, int index1)
+{
+ Entity *entity0 = static_cast<Entity *>(body0->getCollisionObject()->getUserPointer());
+ Entity *entity1 = static_cast<Entity *>(body1->getCollisionObject()->getUserPointer());
+#endif
assert(entity0 && entity1);
// FIXME there should probably be an entity flag indiciating wether or not it has a collision callback
@@ -37,7 +46,6 @@ bool bullet_contact_added_callback(btManifoldPoint &cp, const btCollisionObject
if ((entity1->type() == Entity::Dynamic) || (entity1->type() == Entity::Controlable)) {
static_cast<EntityDynamic *>(entity1)->collision(entity0);
}
- //con_debug << "collision " << entity0->label() << " - " << entity1->label() << std::endl;
// the return value should be ignored by bullet.
return true;