From 4c7dcdc8aae7b4f65f0af3798f33b3da2d8b552f Mon Sep 17 00:00:00 2001 From: gus Date: Sat, 3 Aug 2013 11:33:34 +0200 Subject: [PATCH] check if there is an object in the way --- libs/openengine/bullet/physic.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index a9173e301..f2fa79735 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -584,9 +584,12 @@ namespace Physic broadphase->aabbTest(aabbMin,aabbMax,callback); for(int i=0;igetWorldTransform().getOrigin()-pos).length()getWorldTransform().getOrigin()-pos).length(); + if(dmName,callback.hits[i]->getWorldTransform().getOrigin()); + std::pair rayResult = this->rayTest(pos,callback.hits[i]->getWorldTransform().getOrigin()); + if(rayResult.second>d || rayResult.first == callback.hits[i]->mName) + return std::make_pair(callback.hits[i]->mName,callback.hits[i]->getWorldTransform().getOrigin()); } } //ContactTestResultCallback callback;