{"action":"created","issue":{"url":"https://api.github.com/repos/flexible-collision-library/fcl/issues/78","repository_url":"https://api.github.com/repos/flexible-collision-library/fcl","labels_url":"https://api.github.com/repos/flexible-collision-library/fcl/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/flexible-collision-library/fcl/issues/78/comments","events_url":"https://api.github.com/repos/flexible-collision-library/fcl/issues/78/events","html_url":"https://github.com/flexible-collision-library/fcl/issues/78","id":105581392,"number":78,"title":"Question: mesh and box collision check?","user":{"login":"Randa-Almadhoun","id":7913167,"avatar_url":"https://avatars.githubusercontent.com/u/7913167?v=3","gravatar_id":"","url":"https://api.github.com/users/Randa-Almadhoun","html_url":"https://github.com/Randa-Almadhoun","followers_url":"https://api.github.com/users/Randa-Almadhoun/followers","following_url":"https://api.github.com/users/Randa-Almadhoun/following{/other_user}","gists_url":"https://api.github.com/users/Randa-Almadhoun/gists{/gist_id}","starred_url":"https://api.github.com/users/Randa-Almadhoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Randa-Almadhoun/subscriptions","organizations_url":"https://api.github.com/users/Randa-Almadhoun/orgs","repos_url":"https://api.github.com/users/Randa-Almadhoun/repos","events_url":"https://api.github.com/users/Randa-Almadhoun/events{/privacy}","received_events_url":"https://api.github.com/users/Randa-Almadhoun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-09T11:53:40Z","updated_at":"2016-03-17T16:59:27Z","closed_at":null,"body":"Hi, \r\nI'm trying to check if there is a collision between a mesh model and a Box of volume 1 located at specific point,  \r\nThe problem I'm facing is that when the Box is located inside the mesh, the collision function returns false (no collision). \r\nHow can I use fcl to check if there is a collision inside the mesh??\r\n\r\nHere is the code used for the collision check:\r\n//loading the mesh.obj\r\nstd::vector<Vec3f> p1;\r\nstd::vector<Triangle> t1;\r\nloadOBJFile(\"mesh.obj\", p1, t1);\r\nBVHModel<OBBRSS>* m1 = new BVHModel<OBBRSS>();\r\n\r\nm1->beginModel();\r\nm1->addSubModel(p1, t1);\r\nm1->endModel();\r\n\r\nTransform3f tf1;\r\ntf1.setIdentity();\r\ntf1.setTranslation(Vec3f(0,0,0));\r\nCollisionObject* obj = new CollisionObject(boost::shared_ptr<CollisionGeometry>(m1), tf1); \r\n\r\n//creating the Box centered at specific point\r\nboost::shared_ptr<Box> Sample(new Box(1));\r\ntf0.setIdentity();\r\ntf0.setTranslation(Vec3f(0 , 0 , -5));\r\nCollisionObject co0(Sample, tf0);\r\nstatic const int num_max_contacts = std::numeric_limits<int>::max();\r\nstatic const bool enable_contact = true ;\r\nfcl::CollisionResult result;\r\nfcl::CollisionRequest request(num_max_contacts, enable_contact);\r\nfcl::collide(&co0, obj, request, result);\r\nAABB a    = co0.getAABB() ;\r\nVec3f vec2 =  a.center() ;\r\nif (result.isCollision() == true )\r\n{     marker = drawCUBE(vec2,1,2,1) ;//red\r\n      std::cout<<\"Collision\"<<std::endl;\r\n} else  {\r\n       marker = drawCUBE(vec2, 1, 1,1) ;//blue\r\n       std::cout<<\"No Collision\"<<std::endl;\r\n}\r\n\r\n\r\nThe model used is as shown below\r\n![1](https://cloud.githubusercontent.com/assets/7913167/9760847/b8ba4730-5709-11e5-9ff0-03995ba716cb.JPG)\r\n\r\nThe following is a snap shot of Box and mesh collision ( the mesh is represented as points just for visualization but the model used is as shown in the previous snap shot)\r\n![2](https://cloud.githubusercontent.com/assets/7913167/9760893/11b5226a-570a-11e5-9687-7c19ea03d6bc.JPG)\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/flexible-collision-library/fcl/issues/comments/197973813","html_url":"https://github.com/flexible-collision-library/fcl/issues/78#issuecomment-197973813","issue_url":"https://api.github.com/repos/flexible-collision-library/fcl/issues/78","id":197973813,"user":{"login":"michaelaeriksen","id":8325683,"avatar_url":"https://avatars.githubusercontent.com/u/8325683?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelaeriksen","html_url":"https://github.com/michaelaeriksen","followers_url":"https://api.github.com/users/michaelaeriksen/followers","following_url":"https://api.github.com/users/michaelaeriksen/following{/other_user}","gists_url":"https://api.github.com/users/michaelaeriksen/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelaeriksen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelaeriksen/subscriptions","organizations_url":"https://api.github.com/users/michaelaeriksen/orgs","repos_url":"https://api.github.com/users/michaelaeriksen/repos","events_url":"https://api.github.com/users/michaelaeriksen/events{/privacy}","received_events_url":"https://api.github.com/users/michaelaeriksen/received_events","type":"User","site_admin":false},"created_at":"2016-03-17T16:59:27Z","updated_at":"2016-03-17T16:59:27Z","body":"I have the same problem, did you find a solution?"}}