{"action":"created","issue":{"url":"https://api.github.com/repos/irlanrobson/bounce/issues/15","repository_url":"https://api.github.com/repos/irlanrobson/bounce","labels_url":"https://api.github.com/repos/irlanrobson/bounce/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/irlanrobson/bounce/issues/15/comments","events_url":"https://api.github.com/repos/irlanrobson/bounce/issues/15/events","html_url":"https://github.com/irlanrobson/bounce/issues/15","id":220938314,"number":15,"title":"Possible problem with b3MeshShape::RayCast?","user":{"login":"Kazade","id":16649,"avatar_url":"https://avatars0.githubusercontent.com/u/16649?v=3","gravatar_id":"","url":"https://api.github.com/users/Kazade","html_url":"https://github.com/Kazade","followers_url":"https://api.github.com/users/Kazade/followers","following_url":"https://api.github.com/users/Kazade/following{/other_user}","gists_url":"https://api.github.com/users/Kazade/gists{/gist_id}","starred_url":"https://api.github.com/users/Kazade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kazade/subscriptions","organizations_url":"https://api.github.com/users/Kazade/orgs","repos_url":"https://api.github.com/users/Kazade/repos","events_url":"https://api.github.com/users/Kazade/events{/privacy}","received_events_url":"https://api.github.com/users/Kazade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-11T12:40:59Z","updated_at":"2017-04-11T13:02:58Z","closed_at":null,"body":"I've successfully implemented support for Box and Sphere collider shapes in my game engine using Bounce, and I am currently implementing support for mesh shapes. I've followed the same pattern as before but instead of `b3BoxHull` + `b3HullShape` I'm using `b3Mesh` and `b3MeshShape`. So I generate a b3Mesh once, call `BuildTree()` after specifying vertex and triangle data, then create a `b3MeshShape` and pass it to `CreateShape`.\r\n\r\nMy problem is that when I try to write a test case in my game engine (using `world->RayCast`) the RayCast doesn't return a hit and I can't figure out why.\r\n\r\nMy test involves creation a 1.0 diameter cube mesh shape around 0, 0, 0. Then performing a ray cast from (0, 2, 0) to (0, 0, 0) (e.g. downward) but the ray cast never returns a hit. I've stepped through the code, and the cast never enters this if statement: https://github.com/irlanrobson/bounce/blob/8defab994568f381e1d6efc036d1f63c42942aa4/src/bounce/dynamics/shapes/mesh_shape.cpp#L111\r\n\r\nI noticed that the variable `offset` in that function is never used, and I wondered if that's a mistake?\r\n"},"comment":{"url":"https://api.github.com/repos/irlanrobson/bounce/issues/comments/293253755","html_url":"https://github.com/irlanrobson/bounce/issues/15#issuecomment-293253755","issue_url":"https://api.github.com/repos/irlanrobson/bounce/issues/15","id":293253755,"user":{"login":"irlanrobson","id":4203641,"avatar_url":"https://avatars0.githubusercontent.com/u/4203641?v=3","gravatar_id":"","url":"https://api.github.com/users/irlanrobson","html_url":"https://github.com/irlanrobson","followers_url":"https://api.github.com/users/irlanrobson/followers","following_url":"https://api.github.com/users/irlanrobson/following{/other_user}","gists_url":"https://api.github.com/users/irlanrobson/gists{/gist_id}","starred_url":"https://api.github.com/users/irlanrobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irlanrobson/subscriptions","organizations_url":"https://api.github.com/users/irlanrobson/orgs","repos_url":"https://api.github.com/users/irlanrobson/repos","events_url":"https://api.github.com/users/irlanrobson/events{/privacy}","received_events_url":"https://api.github.com/users/irlanrobson/received_events","type":"User","site_admin":false},"created_at":"2017-04-11T13:02:58Z","updated_at":"2017-04-11T13:02:58Z","body":"Anyhow... The offset variable stores the offset of the triangle face plane in mesh coordinates. I would have to investigate this to see if there is a problem."}}
{"actor":{"display_login":"irlanrobson"}}