Merge remote branch 'scrawl/bulletsvn'

This commit is contained in:
Marc Zinnschlag 2012-06-20 18:33:05 +02:00
commit 7dad67e423
2 changed files with 9 additions and 9 deletions

View file

@ -488,7 +488,7 @@ namespace Physic
dynamicsWorld->rayTest(from, to, resultCallback1); dynamicsWorld->rayTest(from, to, resultCallback1);
if (resultCallback1.hasHit()) if (resultCallback1.hasHit())
{ {
name = static_cast<RigidBody&>(*resultCallback1.m_collisionObject).mName; name = static_cast<const RigidBody&>(*resultCallback1.m_collisionObject).mName;
d1 = resultCallback1.m_closestHitFraction; d1 = resultCallback1.m_closestHitFraction;
d = d1; d = d1;
} }
@ -502,7 +502,7 @@ namespace Physic
d2 = resultCallback1.m_closestHitFraction; d2 = resultCallback1.m_closestHitFraction;
if(d2<=d1) if(d2<=d1)
{ {
name = static_cast<PairCachingGhostObject&>(*resultCallback2.m_collisionObject).mName; name = static_cast<const PairCachingGhostObject&>(*resultCallback2.m_collisionObject).mName;
d = d2; d = d2;
} }
} }
@ -515,25 +515,25 @@ namespace Physic
MyRayResultCallback resultCallback1; MyRayResultCallback resultCallback1;
resultCallback1.m_collisionFilterMask = COL_WORLD|COL_RAYCASTING; resultCallback1.m_collisionFilterMask = COL_WORLD|COL_RAYCASTING;
dynamicsWorld->rayTest(from, to, resultCallback1); dynamicsWorld->rayTest(from, to, resultCallback1);
std::vector< std::pair<float, btCollisionObject*> > results = resultCallback1.results; std::vector< std::pair<float, const btCollisionObject*> > results = resultCallback1.results;
MyRayResultCallback resultCallback2; MyRayResultCallback resultCallback2;
resultCallback2.m_collisionFilterMask = COL_ACTOR_INTERNAL|COL_ACTOR_EXTERNAL; resultCallback2.m_collisionFilterMask = COL_ACTOR_INTERNAL|COL_ACTOR_EXTERNAL;
dynamicsWorld->rayTest(from, to, resultCallback2); dynamicsWorld->rayTest(from, to, resultCallback2);
std::vector< std::pair<float, btCollisionObject*> > actorResults = resultCallback2.results; std::vector< std::pair<float, const btCollisionObject*> > actorResults = resultCallback2.results;
std::vector< std::pair<float, std::string> > results2; std::vector< std::pair<float, std::string> > results2;
for (std::vector< std::pair<float, btCollisionObject*> >::iterator it=results.begin(); for (std::vector< std::pair<float, const btCollisionObject*> >::iterator it=results.begin();
it != results.end(); ++it) it != results.end(); ++it)
{ {
results2.push_back( std::make_pair( (*it).first, static_cast<RigidBody&>(*(*it).second).mName ) ); results2.push_back( std::make_pair( (*it).first, static_cast<const RigidBody&>(*(*it).second).mName ) );
} }
for (std::vector< std::pair<float, btCollisionObject*> >::iterator it=actorResults.begin(); for (std::vector< std::pair<float, const btCollisionObject*> >::iterator it=actorResults.begin();
it != actorResults.end(); ++it) it != actorResults.end(); ++it)
{ {
results2.push_back( std::make_pair( (*it).first, static_cast<PairCachingGhostObject&>(*(*it).second).mName ) ); results2.push_back( std::make_pair( (*it).first, static_cast<const PairCachingGhostObject&>(*(*it).second).mName ) );
} }
std::sort(results2.begin(), results2.end(), MyRayResultCallback::cmp); std::sort(results2.begin(), results2.end(), MyRayResultCallback::cmp);

View file

@ -278,7 +278,7 @@ namespace Physic
return false; return false;
} }
std::vector < std::pair<float, btCollisionObject*> > results; std::vector < std::pair<float, const btCollisionObject*> > results;
}; };
}} }}