Skip to content
Snippets Groups Projects
Commit 40cd6367 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Make errors more usefull

parent f44636f1
No related branches found
No related tags found
No related merge requests found
......@@ -496,10 +496,11 @@ namespace VirtualRobot
bool CollisionChecker::checkCollision(CollisionModelPtr model1, CollisionModelPtr model2)
{
VR_ASSERT(model1 && model2);
THROW_VR_EXCEPTION_IF(!model1, "model1 is null");
THROW_VR_EXCEPTION_IF(!model2, "model2 is null");
VR_ASSERT_MESSAGE(model1->getCollisionChecker() == model2->getCollisionChecker(), "Collision models are linked to different Collision Checker instances");
VR_ASSERT_MESSAGE(model1->getCollisionChecker() == shared_from_this(), "Collision models are linked to different Collision Checker instances");
VR_ASSERT(isInitialized());
THROW_VR_EXCEPTION_IF(!isInitialized(), "checker not initialized");
return collisionCheckerImplementation->checkCollision(model1, model2);//, storeContact);
}
......
......@@ -103,16 +103,16 @@ namespace VirtualRobot
bool CollisionCheckerPQP::checkCollision(const CollisionModelPtr& model1, const CollisionModelPtr& model2) //, Eigen::Vector3f *storeContact)
{
BOOST_ASSERT(model1);
BOOST_ASSERT(model2);
THROW_VR_EXCEPTION_IF(!model1, "model1 is null");
THROW_VR_EXCEPTION_IF(!model2, "model2 is null");
const auto& Impl1 = model1->getCollisionModelImplementation();
const auto& Impl2 = model2->getCollisionModelImplementation();
BOOST_ASSERT(Impl1);
BOOST_ASSERT(Impl2);
THROW_VR_EXCEPTION_IF(!Impl1, "Impl1 of model1 is null");
THROW_VR_EXCEPTION_IF(!Impl2, "Impl2 of model2 is null");
const boost::shared_ptr<PQP::PQP_Model>& m1 = Impl1->getPQPModel();
const boost::shared_ptr<PQP::PQP_Model>& m2 = Impl2->getPQPModel();
BOOST_ASSERT_MSG(m1, "NULL data in ColChecker in m1!");
BOOST_ASSERT_MSG(m2, "NULL data in ColChecker in m2!");
THROW_VR_EXCEPTION_IF(!m1, "NULL data in ColChecker in m1!");
THROW_VR_EXCEPTION_IF(!m2, "NULL data in ColChecker in m2!");
PQP::PQP_CollideResult result;
PQP::PQP_REAL R1[3][3];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment